Author Topic: WinXP+ gui theme for oxygen apps  (Read 8860 times)

0 Members and 1 Guest are viewing this topic.

efgee

  • Guest
Re: WinXP+ gui theme for oxygen apps
« Reply #15 on: January 09, 2012, 09:35:38 AM »
Oxygen is so bare metal on the inside that it should not need to rely on external tools for that.

It's a very long time when I had to handle this but IIRC the ico and bmp resources inside an exe are nothing else that headerless raw ico and bmp files.
This said, reading-in an ico/bmp file, stripping the header and placing the remaining binary data into the resource section should suffice.
The only thing to keep in mind is that not only the ICON resource but the ICON_GROUP needs to be populated... I think  :-\
(not sure if the ICON_GROUP just needs the entry but no binary data though - have to search for very old code and look into it...)
« Last Edit: January 09, 2012, 09:38:21 AM by efgee »

Charles Pegge

  • Guest
Re: WinXP+ gui theme for oxygen apps
« Reply #16 on: January 09, 2012, 10:34:44 AM »
This is my general understanding

The Icons are extracted individually from a ICO file. Each is then split into the icon header and its BMP image.

The Icon headers are Id-tagged and accumulated in the group-icon directory while the BMP images are individually referenced in the Icon directory. The Ids must correspond.

In each image The BMP header and the bit data are contiguous.

This scheme goes all the way back to 1995 :)

Charles

JRS

  • Guest
Re: WinXP+ gui theme for oxygen apps
« Reply #17 on: January 11, 2012, 06:30:31 PM »
I like the way the IUP library handles images and icons.

Code: [Select]
img = """
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,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5,6,6,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,6,6,6,6,6,6,5,5,6,6,6,6,6,6,5,5,6,6,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,6,6,6,6,6,6,5,5,5,6,6,6,6,5,5,5,6,6,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,4,2,
1,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,2,
1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
"""

' Creating dialog's icon
icon = Iup::Image(32, 32, Iup::CreateImg(img))
Iup::SetAttribute(icon, "1", "255 255 255")
Iup::SetAttribute(icon, "2", "000 000 000")
Iup::SetAttribute(icon, "3", "226 226 226")
Iup::SetAttribute(icon, "4", "128 128 128")
Iup::SetAttribute(icon, "5", "192 192 192")
Iup::SetAttribute(icon, "6", "000 000 255")
Iup::SetHandle("icon", icon)

FUNCTION CreateImg(text)
  LOCAL i, strip, array, binstr
  strip = " " & CHR(9) & CHR(10) & CHR(13)
  FOR i = 1 TO LEN(strip)
    text = REPLACE(text, MID(strip, i, 1), "")
  NEXT i
  SPLITA text BY "," TO array
  FOR i = 0 TO UBOUND(array)
    binstr &= CHR(array[i])
  NEXT i
  CreateImg = binstr
END FUNCTION

   

Here is the C version of this example.


« Last Edit: January 11, 2012, 06:44:49 PM by JRS »

Charles Pegge

  • Guest
Re: WinXP+ gui theme for oxygen apps
« Reply #18 on: January 12, 2012, 11:24:36 AM »

Yes, that looks quite good in procedural code, John. I'll give it a try first before devising a resources scripting language.

JRS

  • Guest
Re: WinXP+ gui theme for oxygen apps
« Reply #19 on: January 12, 2012, 09:27:51 PM »
I would love to see a IUP binding for OxygenBasic. It would fill a lot of holes.

Then you could spend your time on the Linux version of O2.


efgee

  • Guest
Re: WinXP+ gui theme for oxygen apps
« Reply #20 on: January 12, 2012, 10:51:29 PM »
Are you volunteering?

JRS

  • Guest
Re: WinXP+ gui theme for oxygen apps
« Reply #21 on: January 12, 2012, 11:52:08 PM »
Are you volunteering?

I'm only half way done with the binding for ScriptBasic. I will be happy to share with anyone else what I have learned along the way. Since O2 can read .h includes, this should be a walk in the park.



Charles Pegge

  • Guest
Re: WinXP+ gui theme for oxygen apps
« Reply #22 on: January 15, 2012, 08:06:34 PM »
Binding to IUP looks feasible. The question is what dependencies are also required to run IUP and whether any static libraries would have to be linked into Oxygen.

I'm pursuing a low-dependency strategy to use OpenGl for the cross-platform GUI. The most technically demanding aspect was to create an edit control in Opengl, and much of this has already been cracked.

I feel that the traditional pixel-based GUI has a limited life span and will eventually be displaced.

Charles

JRS

  • Guest
Re: WinXP+ gui theme for oxygen apps
« Reply #23 on: January 15, 2012, 08:36:55 PM »
Quote
Binding to IUP looks feasible. The question is what dependencies are also required to run IUP and whether any static libraries would have to be linked into Oxygen.

I'm linking IUP statically to the SB iup.so extension module. I see no reason why you can't link dynamically to IUP from O2.

Here is my current Makefile for the ScriptBasic IUP extension module (iup.so) for Linux 64.

Code: [Select]
all : iup.a iup.so

iup.a : ../../bin/mod/obj/iup/s_interface.o
ar -r ../../bin/mod/lib/iup.a ../../bin/mod/obj/iup/s_interface.o  /usr/lib/iup/libiup.a /usr/lib/iup/libiupcontrols.a /usr/lib/iup/libiupcd.a /usr/lib/cd/libcd.a

iup.so : ../../bin/mod/obj/iup/interface.o
ld -shared -fPIC -o ../../bin/mod/dll/iup.so ../../bin/mod/obj/iup/interface.o $(shell pkg-config --libs --cflags gtk+-2.0) -I/usr/include/iup -I/usr/include/cd /usr/lib/iup/libiup.a /usr/lib/iup/libiupcontrols.a /usr/lib/iup/libiupcd.a /usr/lib/cd/libcd.a

../../bin/mod/obj/iup/interface.o : interface.c
gcc -w -fPIC $(ARCH) -c -I/usr/include/iup -I/usr/include/cd -o ../../bin/mod/obj/iup/interface.o interface.c

../../bin/mod/obj/iup/s_interface.o : interface.c
-mkdir ../../bin/mod/obj/iup
gcc -w -fPIC -static $(ARCH) -c -I/usr/include/iup -I/usr/include/cd -o ../../bin/mod/obj/iup/s_interface.o interface.c

clean :
rm ../../bin/mod/dll/iup.so
rm -rf ../../bin/mod/obj/iup
« Last Edit: January 17, 2012, 09:56:13 AM by JRS »