Author Topic: Claro-AIR  (Read 25681 times)

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Claro-AIR
« on: October 04, 2013, 06:05:45 PM »
Good to hear from you again AIR. I think you answered Kent's questions with the knowledge he is crossing over (and back again) from Windows and went easy on him.  :D

BTW, did you have a chance to look at Nimrod? I'm curious what your take is on it running GUI apps under OSX.


Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: Claro-AIR
« Reply #1 on: October 04, 2013, 06:43:15 PM »
Hey, John.

There's no native GUI support under MacOS, unless you use the old Claro library.  Araq has it up on GitHub, and I've spent the last day or two modifying it to work under OSX Mavericks and Mountain Lion.  Claro, unfortunately, is VERY incomplete, but nimrod has an (equally!) incomplete binding for it, so I dusted off the old Tiny Times demo.



Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: Claro-AIR
« Reply #2 on: October 04, 2013, 06:50:29 PM »
Oh, here's the code.  Definitely not finished, and probably never will be, because Claro needs a major re-write.

Code: [Select]
import claro, strutils

type
  TButtonArray = array[0..9, ptr TButton]

var bTop:cint = 16
var buttons:TButtonArray
var lb: ptr TListBox

proc window_closed (obj: ptr TClaroObj, event: ptr TEvent) {.cdecl.} =
  claro_shutdown()

proc button_pressed (obj: ptr TClaroObj, event: ptr TEvent) {.cdecl.} =
  var seed:cint = 10
  var button = cast[ptr TButton](obj)
  var multiplyer = cast[int](button.naddress[0])
  for i in 1..10:
    discard listbox_append_row( lb, IntToStr(multiplyer) & " x " & IntToStr(i) & " = " & IntToStr( multiplyer*i ) )
     
     
var Form1 = newWindow( nil, new_bounds( 100, 100, 500, 330 ), 1 )
window_set_title( Form1, "Tiny Times Table" )
object_addhandler( Form1, "destroy", window_closed )

lb = newListBox(Form1, new_bounds(bTop,bTop, 300,300), 0)

for i in low(buttons)..high(buttons):
  var val = intToStr(i+1)
  buttons[i] = newButton( Form1, new_bounds( 410, bTop, 70, -1 ), 0, intToStr(i+1) )
  object_addHandler( buttons[i], "pushed", button_pressed)
  buttons[i].naddress[0] = cast[ptr int](i+1)
  bTop+=30


window_show(Form1)
window_focus(Form1)

claro_loop()

EDIT:  fixed typo
« Last Edit: October 04, 2013, 06:55:29 PM by AIR »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Claro-AIR
« Reply #3 on: October 04, 2013, 07:08:38 PM »
That is too cool !

It's good to hear the Nimrod author has taken some interest in the OSX platform. I will have to do a search for what Claro is all about.

Thanks for the example.

Quote
===========================================================
          Claro GUI library
===========================================================

This is a revival of the Claro GUI library from Gian Perrone and Theo Julienne.

Claro is a set of cross-platform libraries which assist programmers in writing applications which can run on almost any platform without modification.

This project aims to revive this abandoned project and to provide wrappers for
Nimrod.

To try it out, build it with::
 
  python koch.py claro


Enjoy!
Andreas Rumpf
« Last Edit: October 04, 2013, 07:16:05 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Claro-AIR
« Reply #4 on: October 04, 2013, 10:53:50 PM »
I built and installed the Claro library on Linux (Ubuntu 12.4 64 bit) and here are a few of the examples that are done in C.






Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Claro-AIR
« Reply #5 on: October 05, 2013, 01:07:37 AM »
jrs@laptop:~/nimrod/examples$ nimrod c air_tt.nim
config/nimrod.cfg(36, 11) Hint: added path: '/home/jrs/.babel/libs/' [Path]
Hint: used config file '/home/jrs/nimrod/config/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: air_tt [Processing]
Hint: claro [Processing]
Hint: cairo [Processing]
lib/wrappers/claro.nim(174, 31) Error: inheritance only works with non-final objects
jrs@laptop:~/nimrod/examples$

This is the error I'm getting trying to compile your Tiny Times Nimrod example under Ubuntu 64 bit.

Update

I thought I had it with this change to nimrod core translator. I recompiled with these changes but it didn't resolve the issue.  :-\

Code: [Select]
Error: inheritance only works with non-final objects
Quote from: Araq
Araq closed the issue in c592622 a month ago
« Last Edit: October 05, 2013, 02:31:56 AM by John »

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: Claro-AIR
« Reply #6 on: October 05, 2013, 07:49:58 AM »
The problem isn't in the compiler, but in the Claro.nim module.

In line 67, change this:
Code: [Select]
TClaroObj*{.pure.} = object
So that it looks like this:
Code: [Select]
TClaroObj*{.pure, inheritable.} = object
Without that change, you can't sub-class TClaroObj.

AIR.

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Claro-AIR
« Reply #7 on: October 05, 2013, 08:47:02 AM »
Thanks AIR for the fix but I can't seem to load libclaro.so with Nimrod. I didn't have any problems running the C examples that came with the Claro distribution. The C examples were compiled with Gtk+2.0 and I think Nimrod is using Gtk-3. I tried to compile the Claro hello.c example with Gtk-3 and it wouldn't compile.

Update The Nimrod Gtk example are compiled with Gtk 2 so that doesn't seem the be the issue.

Code: [Select]
jrs@laptop:~/nimrod/examples$ nimrod c -d:release air_tt.nim
config/nimrod.cfg(36, 11) Hint: added path: '/home/jrs/.babel/libs/' [Path]
Hint: used config file '/home/jrs/nimrod/config/nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: air_tt [Processing]
Hint: claro [Processing]
Hint: cairo [Processing]
lib/wrappers/claro.nim(466, 13) Hint: 'noBoundsVar' is declared but not used [XDeclaredButNotUsed]
Hint: strutils [Processing]
Hint: parseutils [Processing]
examples/air_tt.nim(14, 10) Hint: 'seed' is declared but not used [XDeclaredButNotUsed]
examples/air_tt.nim(28, 9) Hint: 'val' is declared but not used [XDeclaredButNotUsed]
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/air_tt.o examples/nimcache/air_tt.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/system.o examples/nimcache/system.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/claro.o examples/nimcache/claro.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/cairo.o examples/nimcache/cairo.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/strutils.o examples/nimcache/strutils.c
gcc -c -w -O3 -fno-strict-aliasing -I/home/jrs/nimrod/lib -o examples/nimcache/parseutils.o examples/nimcache/parseutils.c
gcc   -o /home/jrs/nimrod/examples/air_tt  examples/nimcache/parseutils.o examples/nimcache/strutils.o examples/nimcache/cairo.o examples/nimcache/claro.o examples/nimcache/system.o examples/nimcache/air_tt.o  -ldl
Hint: operation successful (12653 lines compiled; 1.793 sec total; 13.133MB) [SuccessX]
jrs@laptop:~/nimrod/examples$ ./air_tt
could not load: libclaro.so
jrs@laptop:~/nimrod/examples$ ls -l /usr/lib/libclaro.so
-rwxrwxr-x 1 root root 815879 Oct  4 20:58 /usr/lib/libclaro.so
jrs@laptop:~/nimrod/examples$
« Last Edit: October 05, 2013, 09:41:24 AM by John »

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: Claro-AIR
« Reply #8 on: October 05, 2013, 01:34:40 PM »
libclaro is built wrong by koch.py, so it doesn't dynamically link to gtk.

Since you already have the object files after building the library, recreate it like this (from the root of the Claro folder):

Code: [Select]
gcc  -shared -fPIC -o build/libclaro.so  src/block.o src/hashtable.o src/claro.o src/list.o src/log.o src/memory.o src/object.o src/oscompat.o src/store.o src/object_map.o src/widgets/window.o src/widgets/toolbar.o src/widgets/textbox.o src/widgets/button.o src/widgets/canvas.o src/widgets/splitter.o src/widgets/container.o src/widgets/checkbox.o src/widgets/dialog.o src/widgets/label.o src/widgets/progress.o src/widgets/radio.o src/widgets/statusbar.o src/widgets/textarea.o src/widgets/frame.o src/widgets/image.o src/widgets/list.o src/widgets/listbox.o src/widgets/listview.o src/widgets/combo.o src/widgets/menubar.o src/widgets/menu.o src/widgets/scrollbar.o src/widgets/workspace.o src/widgets/opengl.o src/widgets/treeview.o src/widgets/stock.o src/layout_parser.o src/layout.o src/layout_heap.o src/widget.o src/graphics.o src/image.o src/font.o src/system.o src/platform/gtk.o src/platform/gdkcairo.o src/platform/gtkcairo.o src/platform/gtk/window.o src/platform/gtk/toolbar.o src/platform/gtk/textbox.o src/platform/gtk/button.o src/platform/gtk/canvas.o src/platform/gtk/splitter.o src/platform/gtk/container.o src/platform/gtk/label.o src/platform/gtk/statusbar.o src/platform/gtk/progressbar.o src/platform/gtk/checkbox.o src/platform/gtk/radio.o src/platform/gtk/textarea.o src/platform/gtk/frame.o src/platform/gtk/image.o src/platform/gtk/listview.o src/platform/gtk/listbox.o src/platform/gtk/combo.o src/platform/gtk/menubar.o src/platform/gtk/menu.o src/platform/gtk/scrollbar.o src/platform/gtk/workspace.o src/platform/gtk/opengl.o src/platform/gtk/treeview.o src/platform/gtk/font.o src/platform/gtk/images.o src/platform/gtk/system.o -ldl $(pkg-config --libs gtk+-2.0)
EDIT:
Or use the attached koch.py file that I fixed.
« Last Edit: October 05, 2013, 01:56:30 PM by AIR »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Claro-AIR
« Reply #9 on: October 05, 2013, 02:29:31 PM »
It's nice to have a Nimrod pro as a member of the forum. Thanks AIR!



This is the C source Nimrod generated for AIR's Tiny Times example.

Code: [Select]
/* Generated by Nimrod Compiler v0.9.2 */
/*   (c) 2012 Andreas Rumpf */
/* The generated code is subject to the original license. */
/* Compiled for: Linux, amd64, gcc */
/* Command for C compiler:
   gcc -c  -w  -I/home/jrs/nimrod/lib -o examples/nimcache/air_tt.o examples/nimcache/air_tt.c */
#define NIM_INTBITS 64
#include "nimbase.h"
typedef struct tbutton69623 tbutton69623;
typedef struct tlistbox70325 tlistbox70325;
typedef struct tclaroobj69074 tclaroobj69074;
typedef struct tevent69076 tevent69076;
typedef struct twidget69240 twidget69240;
typedef struct tlist69005 tlist69005;
typedef struct tnode69003 tnode69003;
typedef struct tbounds69225 tbounds69225;
typedef struct tfont69236 tfont69236;
typedef struct tlistitem69881 tlistitem69881;
typedef struct NimStringDesc NimStringDesc;
typedef struct TGenericSeq TGenericSeq;
typedef struct twindow71186 twindow71186;
typedef struct tlistwidget69883 tlistwidget69883;
typedef struct tcolor69238 tcolor69238;
typedef struct timage69305 timage69305;
typedef tbutton69623* tbuttonarray79003[10];
typedef N_CDECL_PTR(void, TY69206) (void);
typedef NIM_CHAR TY69083[64];
struct tlist69005 {
tnode69003* Head;
tnode69003* Tail;
NI32 Count;
};
struct tclaroobj69074 {
TY69083 Typ;
int Destroypending;
tlist69005 Eventhandlers;
tlist69005 Children;
tclaroobj69074* Parent;
void* Appdata;
};
struct tbounds69225 {
int X;
int Y;
int W;
int H;
tclaroobj69074* Owner;
};
struct tfont69236 {
int Used;
NCSTRING Face;
int Size;
int Weight;
int Slant;
int Decoration;
void* Native;
};
typedef void* TY69266[4];
struct twidget69240 {
  tclaroobj69074 Sup;
tbounds69225* Sizereq;
tbounds69225 Size;
tbounds69225 Sizect;
int Supportsalpha;
int Sizeflags;
int Flags;
int Visible;
int Notifyflags;
tfont69236 Font;
void* Native;
void* Ndata;
void* Container;
TY69266 Naddress;
};
typedef NIM_CHAR TY69624[256];
struct tbutton69623 {
  twidget69240 Sup;
TY69624 Text;
};
typedef N_CDECL_PTR(tlistitem69881*, TY70350) (tlistbox70325* listbox, NCSTRING text);
struct TGenericSeq {
NI len;
NI reserved;
};
typedef NIM_CHAR TY611[100000001];
struct NimStringDesc {
  TGenericSeq Sup;
TY611 data;
};
typedef N_CDECL_PTR(twindow71186*, TY71208) (tclaroobj69074* parent, tbounds69225* bounds, int flags);
typedef N_CDECL_PTR(tbounds69225*, TY69490) (int x, int y, int w, int h);
typedef N_CDECL_PTR(void, TY71218) (twindow71186* w, NCSTRING title);
typedef N_CDECL_PTR(void, teventfunc69078) (tclaroobj69074* obj, tevent69076* event);
typedef N_CDECL_PTR(void, TY69170) (tclaroobj69074* obj, NCSTRING event, teventfunc69078 func);
typedef N_CDECL_PTR(tlistbox70325*, TY70331) (tclaroobj69074* parent, tbounds69225* bounds, int flags);
typedef N_CDECL_PTR(tbutton69623*, TY69644) (tclaroobj69074* parent, tbounds69225* bounds, int flags, NCSTRING label);
typedef N_CDECL_PTR(void, TY71225) (twindow71186* w);
typedef N_CDECL_PTR(void, TY71237) (twindow71186* w);
typedef N_CDECL_PTR(void, TY69200) (void);
struct tlistwidget69883 {
  twidget69240 Sup;
int Columns;
NI32* Coltypes;
tlist69005 Items;
};
struct tlistbox70325 {
  tlistwidget69883 Sup;
tlistitem69881* Selected;
};
typedef NIM_CHAR TY69099[16];
struct tevent69076 {
tclaroobj69074* Obj;
TY69083 Name;
int Handled;
int Argnum;
TY69099 Format;
void** Arglist;
};
struct tnode69003 {
tnode69003* Next;
tnode69003* Prev;
void* Data;
};
struct tcolor69238 {
int Used;
float R;
float G;
float B;
float A;
};
struct tlistitem69881 {
  tclaroobj69074 Sup;
int Row;
void* Native;
NI Nativeid;
tclaroobj69074* Menu;
int Enabled;
void** Data;
tlist69005 Listitemchildren;
tlist69005* Listitemparent;
tlistitem69881* Parentitem;
tcolor69238 Textcolor;
tcolor69238 Seltextcolor;
tcolor69238 Backcolor;
tcolor69238 Selbackcolor;
tfont69236 Font;
};
typedef NIM_CHAR TY71187[512];
struct twindow71186 {
  twidget69240 Sup;
TY71187 Title;
timage69305* Icon;
twidget69240* Menubar;
twidget69240* Workspace;
int Exsptools;
int Exspstatus;
int Exspinit;
};
struct timage69305 {
  tclaroobj69074 Sup;
int Width;
int Height;
void* Native;
void* Native2;
void* Native3;
void* Icon;
};
N_CDECL(void, windowclosed_79017)(tclaroobj69074* obj, tevent69076* event);
static N_INLINE(void, nimFrame)(TFrame* s);
static N_INLINE(void, popFrame)(void);
N_CDECL(void, buttonpressed_79025)(tclaroobj69074* obj, tevent69076* event);
N_NIMCALL(NimStringDesc*, nsuIntToStr)(NI x, NI minchars);
static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src);
N_NIMCALL(NI, mulInt)(NI a, NI b);
N_NIMCALL(NimStringDesc*, rawNewString)(NI space);
static N_INLINE(NI, addInt)(NI a, NI b);
N_NOINLINE(void, raiseOverflow)(void);
static N_INLINE(void, initStackBottom)(void);
N_NOINLINE(void, setStackBottom)(void* thestackbottom);
N_NOINLINE(void, systemInit)(void);
N_NOINLINE(void, systemDatInit)(void);
N_NOINLINE(void, cairoInit)(void);
N_NOINLINE(void, cairoDatInit)(void);
N_NOINLINE(void, claroInit)(void);
N_NOINLINE(void, claroDatInit)(void);
N_NOINLINE(void, parseutilsInit)(void);
N_NOINLINE(void, parseutilsDatInit)(void);
N_NOINLINE(void, strutilsInit)(void);
N_NOINLINE(void, strutilsDatInit)(void);
N_NOINLINE(void, air_ttInit)(void);
N_NOINLINE(void, air_ttDatInit)(void);
STRING_LITERAL(TMP144, " x ", 3);
STRING_LITERAL(TMP145, " = ", 3);
int btop_79007;
tbuttonarray79003 buttons_79010;
tlistbox70325* lb_79014;
extern TY69206 Dl_69205;
extern TFrame* frameptr_10225;
extern TY70350 Dl_70349;
twindow71186* form1_79060;
extern TY71208 Dl_71207;
extern TY69490 Dl_69489;
extern TY71218 Dl_71217;
extern TY69170 Dl_69169;
extern TY70331 Dl_70330;
NI i_79093;
extern TY69644 Dl_69643;
extern TY71225 Dl_71224;
extern TY71237 Dl_71236;
extern TY69200 Dl_69199;

static N_INLINE(void, nimFrame)(TFrame* s) {
(*s).prev = frameptr_10225;
frameptr_10225 = s;
}

static N_INLINE(void, popFrame)(void) {
frameptr_10225 = (*frameptr_10225).prev;
}

N_CDECL(void, windowclosed_79017)(tclaroobj69074* obj, tevent69076* event) {
nimfr("window_closed", "air_tt.nim")
nimln(11, "air_tt.nim");
Dl_69205();
popFrame();
}

static N_INLINE(void, appendString)(NimStringDesc* dest, NimStringDesc* src) {
memcpy(((NCSTRING) (&(*dest).data[((*dest).Sup.len)- 0])), ((NCSTRING) ((*src).data)), (NI64)((*src).Sup.len + 1));
(*dest).Sup.len += (*src).Sup.len;
}

static N_INLINE(NI, addInt)(NI a, NI b) {
NI result;
NIM_BOOL LOC2;
result = 0;
result = (NI)((NU64)(a) + (NU64)(b));
LOC2 = (0 <= (NI)(result ^ a));
if (LOC2) goto LA3;
LOC2 = (0 <= (NI)(result ^ b));
LA3: ;
if (!LOC2) goto LA4;
{
goto BeforeRet;
}
LA4: ;
raiseOverflow();
BeforeRet: ;
return result;
}

N_CDECL(void, buttonpressed_79025)(tclaroobj69074* obj, tevent69076* event) {
int seed;
tbutton69623* button;
NI multiplyer;
NI i_79042;
NI res_79047;
nimfr("button_pressed", "air_tt.nim")
nimln(14, "air_tt.nim");
seed = ((int) 10);
nimln(15, "air_tt.nim");
button = ((tbutton69623*) (obj));
nimln(16, "air_tt.nim");
multiplyer = ((NI) ((*button).Sup.Naddress[(0)- 0]));
i_79042 = 0;
nimln(1289, "system.nim");
res_79047 = 1;
nimln(1290, "system.nim");
while (1) {
NimStringDesc* LOC2;
NimStringDesc* LOC3;
NimStringDesc* LOC4;
NI TMP146;
NimStringDesc* LOC5;
tlistitem69881* LOC6;
nimln(1290, "system.nim");
if (!(res_79047 <= 10)) goto LA1;
nimln(1289, "system.nim");
i_79042 = res_79047;
nimln(18, "air_tt.nim");
nimln(18, "air_tt.nim");
nimln(18, "air_tt.nim");
LOC2 = 0;
nimln(18, "air_tt.nim");
LOC3 = 0;
LOC3 = nsuIntToStr(multiplyer, 1);
nimln(18, "air_tt.nim");
LOC4 = 0;
LOC4 = nsuIntToStr(i_79042, 1);
nimln(18, "air_tt.nim");
nimln(18, "air_tt.nim");
TMP146 = mulInt(multiplyer, i_79042);
LOC5 = 0;
LOC5 = nsuIntToStr((NI64)(TMP146), 1);
LOC2 = rawNewString(LOC3->Sup.len + LOC4->Sup.len + LOC5->Sup.len + 6);
appendString(LOC2, LOC3);
appendString(LOC2, ((NimStringDesc*) &TMP144));
appendString(LOC2, LOC4);
appendString(LOC2, ((NimStringDesc*) &TMP145));
appendString(LOC2, LOC5);
LOC6 = Dl_70349(lb_79014, LOC2->data);
nimln(1292, "system.nim");
res_79047 = addInt(res_79047, 1);
} LA1: ;
popFrame();
}

static N_INLINE(void, initStackBottom)(void) {
void* volatile locals;
locals = 0;
locals = ((void*) (&locals));
setStackBottom(locals);
}
int cmdCount;
char** cmdLine;
char** gEnv;
N_CDECL(void, NimMain)(void) {
systemDatInit();
cairoDatInit();
claroDatInit();
parseutilsDatInit();
strutilsDatInit();
air_ttDatInit();
initStackBottom();
systemInit();
cairoInit();
claroInit();
parseutilsInit();
strutilsInit();
air_ttInit();
}
int main(int argc, char** args, char** env) {
cmdLine = args;
cmdCount = argc;
gEnv = env;
NimMain();
return nim_program_result;
}
N_NOINLINE(void, air_ttInit)(void) {
tbounds69225* LOC1;
tbounds69225* LOC2;
NI res_79114;
nimfr("air_tt", "air_tt.nim")
nimln(6, "air_tt.nim");
btop_79007 = ((int) 16);
nimln(21, "air_tt.nim");
nimln(21, "air_tt.nim");
LOC1 = Dl_69489(((int) 100), ((int) 100), ((int) 500), ((int) 330));
form1_79060 = Dl_71207(NIM_NIL, LOC1, ((int) 1));
nimln(22, "air_tt.nim");
Dl_71217(form1_79060, "Tiny Times Table");
nimln(23, "air_tt.nim");
Dl_69169(&form1_79060->Sup.Sup, "destroy", windowclosed_79017);
nimln(25, "air_tt.nim");
nimln(25, "air_tt.nim");
LOC2 = Dl_69489(btop_79007, btop_79007, ((int) 300), ((int) 300));
lb_79014 = Dl_70330(&form1_79060->Sup.Sup, LOC2, ((int) 0));
nimln(1289, "system.nim");
res_79114 = 0;
nimln(1290, "system.nim");
while (1) {
NimStringDesc* val;
NI TMP147;
tbounds69225* LOC4;
NI TMP148;
NimStringDesc* LOC5;
NI TMP149;
nimln(1290, "system.nim");
if (!(((NI) (res_79114)) <= 9)) goto LA3;
nimln(1289, "system.nim");
i_79093 = res_79114;
nimln(28, "air_tt.nim");
nimln(28, "air_tt.nim");
TMP147 = addInt(((NI) (i_79093)), 1);
val = nsuIntToStr(((NI) ((NI64)(TMP147))), 1);
nimln(29, "air_tt.nim");
nimln(29, "air_tt.nim");
LOC4 = Dl_69489(((int) 410), btop_79007, ((int) 70), ((int) -1));
nimln(29, "air_tt.nim");
nimln(29, "air_tt.nim");
TMP148 = addInt(((NI) (i_79093)), 1);
LOC5 = 0;
LOC5 = nsuIntToStr(((NI) ((NI64)(TMP148))), 1);
buttons_79010[(i_79093)- 0] = Dl_69643(&form1_79060->Sup.Sup, LOC4, ((int) 0), LOC5->data);
nimln(30, "air_tt.nim");
Dl_69169(&buttons_79010[(i_79093)- 0]->Sup.Sup, "pushed", buttonpressed_79025);
nimln(31, "air_tt.nim");
nimln(31, "air_tt.nim");
TMP149 = addInt(((NI) (i_79093)), 1);
(*buttons_79010[(i_79093)- 0]).Sup.Naddress[(0)- 0] = ((void*) (((NI*) ((NI64)(TMP149)))));
nimln(32, "air_tt.nim");
btop_79007 = addInt(btop_79007, ((int) 30));
nimln(1292, "system.nim");
res_79114 = addInt(res_79114, 1);
} LA3: ;
nimln(35, "air_tt.nim");
Dl_71224(form1_79060);
nimln(36, "air_tt.nim");
Dl_71236(form1_79060);
nimln(38, "air_tt.nim");
Dl_69199();
popFrame();
}

N_NOINLINE(void, air_ttDatInit)(void) {
}

« Last Edit: October 05, 2013, 11:24:32 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Claro-AIR
« Reply #10 on: October 05, 2013, 03:21:30 PM »
I tried to bring this full circle and compile the Nimrod Claro Tiny Times example from AIR on Windows XP. I have posted Nimrod examples on this platform before so I know it works.

Code: [Select]
F:\Nimrod\Claro-master>python koch.py claro
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32.o src\platform\win32.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\window.o src\platform\win32\window.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\toolbar.o src\platform\win32\toolbar.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\textbox.o src\platform\win32\textbox.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\button.o src\platform\win32\button.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\canvas.o src\platform\win32\canvas.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\splitter.o src\platform\win32\splitter.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\container.o src\platform\win32\container.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\label.o src\platform\win32\label.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\statusbar.o src\platform\win32\statusbar.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\progressbar.o src\platform\win32\progressbar.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\checkbox.o src\platform\win32\checkbox.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\radio.o src\platform\win32\radio.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\textarea.o src\platform\win32\textarea.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\frame.o src\platform\win32\frame.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\image.o src\platform\win32\image.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\listbox.o src\platform\win32\listbox.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\listview.o src\platform\win32\listview.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\combo.o src\platform\win32\combo.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\menubar.o src\platform\win32\menubar.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\menu.o src\platform\win32\menu.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\scrollbar.o src\platform\win32\scrollbar.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\workspace.o src\platform\win32\workspace.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\opengl.o src\platform\win32\opengl.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\treeview.o src\platform\win32\treeview.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\pngdib.o src\platform\win32\pngdib.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\font.o src\platform\win32\font.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\images.o src\platform\win32\images.c
[Koch] gcc -c -g -Wall -Wno-unused-but-set-variable  -Werror -DIMAGES_USE_LIBPNG -DNO_CAIRO -Iinclude -Iinclude\platform  -o
src\platform\win32\system.o src\platform\win32\system.c
[Koch] gcc  src\block.o src\hashtable.o src\claro.o src\list.o src\log.o src\memory.o src\object.o src\oscompat.o src\store.o
 src\object_map.o src\widgets\window.o src\widgets\toolbar.o src\widgets\textbox.o src\widgets\button.o src\widgets\canvas.o
src\widgets\splitter.o src\widgets\container.o src\widgets\checkbox.o src\widgets\dialog.o src\widgets\label.o src\widgets\pr
ogress.o src\widgets\radio.o src\widgets\statusbar.o src\widgets\textarea.o src\widgets\frame.o src\widgets\image.o src\widge
ts\list.o src\widgets\listbox.o src\widgets\listview.o src\widgets\combo.o src\widgets\menubar.o src\widgets\menu.o src\widge
ts\scrollbar.o src\widgets\workspace.o src\widgets\opengl.o src\widgets\treeview.o src\widgets\stock.o src\layout_parser.o sr
c\layout.o src\layout_heap.o src\widget.o src\graphics.o src\image.o src\font.o src\system.o src\platform\win32.o src\platfor
m\win32\window.o src\platform\win32\toolbar.o src\platform\win32\textbox.o src\platform\win32\button.o src\platform\win32\can
vas.o src\platform\win32\splitter.o src\platform\win32\container.o src\platform\win32\label.o src\platform\win32\statusbar.o
src\platform\win32\progressbar.o src\platform\win32\checkbox.o src\platform\win32\radio.o src\platform\win32\textarea.o src\p
latform\win32\frame.o src\platform\win32\image.o src\platform\win32\listbox.o src\platform\win32\listview.o src\platform\win3
2\combo.o src\platform\win32\menubar.o src\platform\win32\menu.o src\platform\win32\scrollbar.o src\platform\win32\workspace.
o src\platform\win32\opengl.o src\platform\win32\treeview.o src\platform\win32\pngdib.o src\platform\win32\font.o src\platfor
m\win32\images.o src\platform\win32\system.o  -lgdi32 -lcomctl32 -lole32 -lmsvcp60 -lMsimg32 -lopengl32 -lglu32 -lpng -lz -sh
ared -o build\claro.dll
src\block.o: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status
[Koch] *** ERROR: execution of an external program failed

F:\Nimrod\Claro-master>
« Last Edit: October 05, 2013, 05:38:04 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Claro-AIR
« Reply #11 on: October 05, 2013, 04:06:47 PM »
With a bit of farting around, I was able to get AIR's Tiny Times example to compile on Windows.  (like walking through a mine field)

Code: [Select]
F:\Nimrod\examples>nimrod c air_tt.nim
f:\nimrod\config\nimrod.cfg(36, 11) Hint: added path: 'C:\Documents and Settings\John\.babel\libs\' [Path]
Hint: used config file 'F:\Nimrod\config\nimrod.cfg' [Conf]
Hint: system [Processing]
Hint: air_tt [Processing]
Hint: claro [Processing]
Hint: cairo [Processing]
f:\nimrod\lib\wrappers\claro.nim(466, 13) Hint: 'noBoundsVar' is declared but not used [XDeclaredButNotUsed]
Hint: strutils [Processing]
Hint: parseutils [Processing]
air_tt.nim(14, 10) Hint: 'seed' is declared but not used [XDeclaredButNotUsed]
air_tt.nim(28, 9) Hint: 'val' is declared but not used [XDeclaredButNotUsed]
gcc.exe   -o f:\nimrod\examples\air_tt.exe  f:\nimrod\examples\nimcache\parseutils.o f:\nimrod\examples\nimcache\strutils.o f
:\nimrod\examples\nimcache\cairo.o f:\nimrod\examples\nimcache\claro.o f:\nimrod\examples\nimcache\system.o f:\nimrod\example
s\nimcache\air_tt.o
Hint: operation successful (12803 lines compiled; 4.356 sec total; 11.117MB) [SuccessX]

F:\Nimrod\examples>air_tt
could not load: libcairo-2.dll

F:\Nimrod\examples>

« Last Edit: October 05, 2013, 05:35:05 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3597
    • ScriptBasic Open Source Project
Re: Claro-AIR
« Reply #12 on: October 05, 2013, 05:57:06 PM »
I can't post the screen shot because the window only stay on the screen for a fraction of a second. I was able to get by the previous FreeType6.dll issue by copying the one from the Gtk2 for Windows install. It now looks like its down to AIR's Nimrod program and nil.

Code: [Select]
F:\Nimrod\examples>air_tt
[2013-10-05 17:51:09 at unknown_application src\list.c:26 in list_init] allocating in list_init( );
[2013-10-05 17:51:09 at unknown_application src\block.c:142 in block_alloc] block_alloc( heap=003e63d8 ) -> 003e6448
[2013-10-05 17:51:09 at unknown_application src\block.c:142 in block_alloc] block_alloc( heap=003e6538 ) -> 003e65a8
Traceback (most recent call last)
air_tt.nim(38)           air_tt
SIGSEGV: Illegal storage access. (Attempt to read from nil?)

F:\Nimrod\examples>

air_tt.nim(38)

claro_loop()


« Last Edit: October 05, 2013, 06:02:53 PM by John »

kryton9

  • Guest
Re: Claro-AIR
« Reply #13 on: October 05, 2013, 06:18:37 PM »
Responses inline, I couldn't ignore this post... :-*
...

All in all, your ideas are interesting, but (just my opinion) they aren't practical.

AIR.

Thanks for taking the time to reply in depth AIR, I appreciate it a lot.

I tried to try debian, but it would not see my wireless network device and said I needed a proprietary driver. So I couldn't install it.
Will try it in virtualbox instead of stand alone next.

Thanks again for taking the time to reply and clarify.
« Last Edit: October 05, 2013, 07:12:52 PM by kryton9 »

Offline AIR

  • BASIC Developer
  • Posts: 932
  • Coder
Re: Claro-AIR
« Reply #14 on: October 05, 2013, 08:49:59 PM »


Thanks for taking the time to reply in depth AIR, I appreciate it a lot.

I tried to try debian, but it would not see my wireless network device and said I needed a proprietary driver. So I couldn't install it.
Will try it in virtualbox instead of stand alone next.

Thanks again for taking the time to reply and clarify.

If you're going the Virtual route (I run VMWare Fusion on my Macs and have my virtual machines on a portable drive) take a look a Linux Mint 15.  Really nice distro, I've switched all of my Linux stuff to it. Also, Distrowatch has release info for just about every Linux distro that matters.


AIR.