diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot index 10e57144b..01264f4bc 100644 --- a/app/src/gambas3/.lang/.pot +++ b/app/src/gambas3/.lang/.pot @@ -436,7 +436,7 @@ msgstr "" #: FConnectionEditor.class:261 FCreateFile.class:885 FDebugInfo.class:490 #: FEditor.class:2132 FFindList.class:195 FFind.class:114 #: FFontChooser.class:86 FForm.class:2836 FGotoLine.class:63 -#: FHelpBrowser.class:285 FIconEditor.class:1393 FImportTable.class:38 +#: FHelpBrowser.class:270 FIconEditor.class:1393 FImportTable.class:38 #: FList.class:155 FMain.class:204 FMakeExecutable.class:144 #: FMakeInstall.class:309 FMenu.class:1128 FNewConnection.class:317 #: FNewTable.class:168 FNewTranslation.class:70 FOpenProject.class:146 @@ -638,7 +638,7 @@ msgstr "" msgid "Default value" msgstr "" -#: FConnectionEditor.class:58 FDebugExpr.class:425 FHelpBrowser.class:257 +#: FConnectionEditor.class:58 FDebugExpr.class:425 FHelpBrowser.class:242 msgid "Index" msgstr "" @@ -781,7 +781,7 @@ msgid "Connection editor" msgstr "" #: FConnectionEditor.class:1547 FEditor.class:2132 FForm.class:2836 -#: FHelpBrowser.class:292 FIconEditor.class:2032 FTextEditor.class:462 +#: FHelpBrowser.class:277 FIconEditor.class:2032 FTextEditor.class:462 #: FTranslate.class:700 msgid "Reload" msgstr "" @@ -1229,7 +1229,7 @@ msgstr "" msgid "Find definition" msgstr "" -#: FEditor.class:3148 FHelpBrowser.class:271 +#: FEditor.class:3148 FHelpBrowser.class:256 msgid "Go back" msgstr "" @@ -1608,31 +1608,31 @@ msgstr "" msgid "Go to line" msgstr "" -#: FHelpBrowser.class:245 +#: FHelpBrowser.class:230 msgid "Help browser" msgstr "" -#: FHelpBrowser.class:278 +#: FHelpBrowser.class:263 msgid "Go forward" msgstr "" -#: FHelpBrowser.class:311 FIconEditor.class:2225 +#: FHelpBrowser.class:296 FIconEditor.class:2225 msgid "Zoom in" msgstr "" -#: FHelpBrowser.class:318 FIconEditor.class:2234 +#: FHelpBrowser.class:303 FIconEditor.class:2234 msgid "Zoom out" msgstr "" -#: FHelpBrowser.class:325 +#: FHelpBrowser.class:310 msgid "No zoom" msgstr "" -#: FHelpBrowser.class:337 +#: FHelpBrowser.class:322 msgid "Modify documentation..." msgstr "" -#: FHelpBrowser.class:345 +#: FHelpBrowser.class:329 msgid "Print" msgstr "" diff --git a/app/src/gambas3/.src/Help/FHelpBrowser.class b/app/src/gambas3/.src/Help/FHelpBrowser.class index 4f5959cca..916b58073 100644 --- a/app/src/gambas3/.src/Help/FHelpBrowser.class +++ b/app/src/gambas3/.src/Help/FHelpBrowser.class @@ -191,22 +191,7 @@ Public Sub btnPrint_Click() Printer1.OutputFile = "~/print.pdf" $bPrint = False - Printer1.Run - If $bPrint Then webHelp.Current.Print(Printer1) - 'Printer1.Run + If Printer1.Configure() Then Return + webHelp.Current.Print(Printer1) End - -Public Sub Printer1_Begin() - - $bPrint = True - Printer1.Cancel - -End - - -Public Sub Printer1_Draw() - - Debug - -End diff --git a/app/src/gambas3/.src/Help/FHelpBrowser.form b/app/src/gambas3/.src/Help/FHelpBrowser.form index 44cf8d3b8..1e36f2a90 100644 --- a/app/src/gambas3/.src/Help/FHelpBrowser.form +++ b/app/src/gambas3/.src/Help/FHelpBrowser.form @@ -86,7 +86,6 @@ } { btnPrint ToolButton MoveScaled(71,0,15,4) - Visible = False AutoResize = True Text = ("Print") Picture = Picture["icon:/small/print"] diff --git a/app/src/gambas3/.src/Project.module b/app/src/gambas3/.src/Project.module index 2a7929b91..9982967dd 100644 --- a/app/src/gambas3/.src/Project.module +++ b/app/src/gambas3/.src/Project.module @@ -4492,7 +4492,7 @@ Public Sub MakeDirectoryIcon(Optional sDir As String) If sIcon Then Try hIcon = StretchIcon(sIcon, 16) - If hIcon Then hDirIcon.Draw(hIcon, 26, 47) + If hIcon Then hDirIcon.Draw(hIcon, 40, 34) Endif hDirIcon.Save(sDir &/ ".icon.png") diff --git a/app/src/gambas3/img/logo/gambas-folder-64.png b/app/src/gambas3/img/logo/gambas-folder-64.png index f66c374b9..aa6e597a2 100644 Binary files a/app/src/gambas3/img/logo/gambas-folder-64.png and b/app/src/gambas3/img/logo/gambas-folder-64.png differ diff --git a/examples/examples/Drawing/Painting/.icon.png b/examples/examples/Drawing/Painting/.icon.png index 57eb49daf..cda5345c3 100644 Binary files a/examples/examples/Drawing/Painting/.icon.png and b/examples/examples/Drawing/Painting/.icon.png differ diff --git a/examples/examples/Drawing/Painting/.src/FMain.class b/examples/examples/Drawing/Painting/.src/FMain.class index 933daf496..2c277a2ff 100644 --- a/examples/examples/Drawing/Painting/.src/FMain.class +++ b/examples/examples/Drawing/Painting/.src/FMain.class @@ -277,17 +277,28 @@ End Public Sub Example11() - Dim hImg As Image - hImg = Image.Load(IMAGE_NAME) + Dim X, Y, W, H As Float + Dim hBrush As PaintBrush + Dim hImage As Image + + hImage = Image.Load(IMAGE_NAME) - Paint.Translate(128, 128) - 'Paint.Rotate(Rad(45)) - Paint.Scale(256.0 / hImg.W, 256.0 / hImg.H) - Paint.Translate(-0.5 * hImg.W, -0.5 * hImg.H) - Paint.Brush = Paint.Image(hImg, 0, 0) - Paint.Rectangle(0, 0, 256, 256) + X = 16 + Y = 40 + W = 200 + H = 200 + + hBrush = Paint.Image(hImage) + hBrush.Translate(X, Y) + hBrush.Scale(W / hImage.W, H / hImage.H) + Paint.Brush = hBrush + Paint.Rectangle(X, Y, W, H) Paint.Fill + Paint.Brush = Paint.Color(Color.RGB(255, 127, 127, 153)) + Paint.Arc(X, Y, 10) + Paint.Fill + End Public Sub Example12() @@ -344,7 +355,7 @@ Public Sub Example14() 'Draw helping lines Paint.Brush = Paint.Color(Color.RGB(255, 31, 31)) - Paint.LineWidth = 2.56 + Paint.LineWidth = 6 Paint.MoveTo(64, 50) Paint.LineTo(64, 200) Paint.MoveTo(128, 50) @@ -352,6 +363,7 @@ Public Sub Example14() Paint.MoveTo(192, 50) Paint.LineTo(192, 200) Paint.Stroke + End Public Sub Example15() @@ -457,18 +469,20 @@ Public Sub Example20() End +Private $hSvgImage As SvgImage + Public Sub Example21() - Dim hSvgImage As SvgImage + If Not $hSvgImage Then + $hSvgImage = SvgImage.Load("gambas.svg") + Paint.Begin($hSvgImage) + Paint.Brush = Paint.RadialGradient(200, 140, 40, 215, 115, [Color.RGB(255, 0, 0, 64), Color.White], [1.0, 0.1]) + Paint.Arc(200, 140, 40) + Paint.Fill + Paint.End + Endif - hSvgImage = SvgImage.Load("gambas.svg") - Paint.Begin(hSvgImage) - Paint.Brush = Paint.RadialGradient(200, 140, 40, 215, 115, [Color.RGB(255, 0, 0, 64), Color.White], [1.0, 0.1]) - Paint.Arc(200, 140, 40) - Paint.Fill - Paint.End - - hSvgImage.Paint + $hSvgImage.Paint End diff --git a/examples/examples/Drawing/Painting/Example11 b/examples/examples/Drawing/Painting/Example11 index 807e44ef4..72eebf6eb 100644 --- a/examples/examples/Drawing/Painting/Example11 +++ b/examples/examples/Drawing/Painting/Example11 @@ -1,14 +1,25 @@ Public Sub Example11() - Dim hImg As Image - hImg = Image.Load(IMAGE_NAME) + Dim X, Y, W, H As Float + Dim hBrush As PaintBrush + Dim hImage As Image + + hImage = Image.Load(IMAGE_NAME) - Paint.Translate(128, 128) - Paint.Rotate(Rad(45)) - Paint.Scale(256.0 / hImg.W, 256.0 / hImg.H) - Paint.Translate(-0.5 * hImg.W, -0.5 * hImg.H) - Paint.Brush = Paint.Image(hImg, 0, 0) - Paint.Rectangle(0, 0, 256, 256) + X = 16 + Y = 40 + W = 200 + H = 200 + + hBrush = Paint.Image(hImage) + hBrush.Translate(X, Y) + hBrush.Scale(W / hImage.W, H / hImage.H) + Paint.Brush = hBrush + Paint.Rectangle(X, Y, W, H) Paint.Fill + Paint.Brush = Paint.Color(Color.RGB(255, 127, 127, 153)) + Paint.Arc(X, Y, 10) + Paint.Fill + End diff --git a/examples/examples/Drawing/Painting/Example12 b/examples/examples/Drawing/Painting/Example12 index 2e2b98d33..5dde3f3ef 100644 --- a/examples/examples/Drawing/Painting/Example12 +++ b/examples/examples/Drawing/Painting/Example12 @@ -6,7 +6,7 @@ Public Sub Example12() hImg = Image.Load(IMAGE_NAME) Paint.Translate(128, 128) - Paint.Rotate(Pi / 4) + 'Paint.Rotate(Pi / 4) Paint.Scale(1 / Sqr(2), 1 / Sqr(2)) Paint.Translate(-128, -128) hBrush = Paint.Image(himg, 0, 0) diff --git a/examples/examples/Drawing/Painting/Example14 b/examples/examples/Drawing/Painting/Example14 index f01cb9090..4dca4dd0e 100644 --- a/examples/examples/Drawing/Painting/Example14 +++ b/examples/examples/Drawing/Painting/Example14 @@ -16,7 +16,7 @@ Public Sub Example14() 'Draw helping lines Paint.Brush = Paint.Color(Color.RGB(255, 31, 31)) - Paint.LineWidth = 2.56 + Paint.LineWidth = 6 Paint.MoveTo(64, 50) Paint.LineTo(64, 200) Paint.MoveTo(128, 50) @@ -24,4 +24,5 @@ Public Sub Example14() Paint.MoveTo(192, 50) Paint.LineTo(192, 200) Paint.Stroke + End diff --git a/examples/examples/Drawing/Painting/Example17 b/examples/examples/Drawing/Painting/Example17 index 02f9a7107..ace7a76c1 100644 --- a/examples/examples/Drawing/Painting/Example17 +++ b/examples/examples/Drawing/Painting/Example17 @@ -21,12 +21,15 @@ Public Sub Example17() Paint.Fill Paint.Brush = Paint.Color(Color.RGB(255, 31, 31, 93)) - Paint.LineWidth = 6 + Paint.LineWidth = 1 Paint.Arc(X, Y, 10) Paint.Fill - Paint.MoveTo(X, Y) - Paint.RelLineTo(0, Paint.Font.Descent - hExt.Height) - Paint.RelLineTo(hExt.Width, 0) - Paint.Stroke + 'Paint.MoveTo(X, Y) + 'Paint.RelLineTo(0, Paint.Font.Descent - hExt.Height) + 'Paint.RelLineTo(hExt.Width, 0) + 'Paint.Stroke + Paint.Brush = Paint.Color(Color.RGB(255, 31, 31, 192)) + Paint.Rectangle(hExt.X, hExt.Y, hExt.Width, hExt.Height) + Paint.Fill End diff --git a/examples/examples/Drawing/Painting/Example21 b/examples/examples/Drawing/Painting/Example21 index b5152bc4f..429f40b08 100644 --- a/examples/examples/Drawing/Painting/Example21 +++ b/examples/examples/Drawing/Painting/Example21 @@ -1,14 +1,14 @@ Public Sub Example21() - Dim hSvgImage As SvgImage + If Not $hSvgImage Then + $hSvgImage = SvgImage.Load("gambas.svg") + Paint.Begin($hSvgImage) + Paint.Brush = Paint.RadialGradient(200, 140, 40, 215, 115, [Color.RGB(255, 0, 0, 64), Color.White], [1.0, 0.1]) + Paint.Arc(200, 140, 40) + Paint.Fill + Paint.End + Endif - hSvgImage = SvgImage.Load("gambas.svg") - Paint.Begin(hSvgImage) - Paint.Brush = Paint.RadialGradient(200, 140, 40, 215, 115, [Color.RGB(255, 0, 0, 64), Color.White], [1.0, 0.1]) - Paint.Arc(200, 140, 40) - Paint.Fill - Paint.End - - hSvgImage.Paint + $hSvgImage.Paint End diff --git a/gb.cairo/src/main.c b/gb.cairo/src/main.c index e76e7bf01..148ca444f 100644 --- a/gb.cairo/src/main.c +++ b/gb.cairo/src/main.c @@ -40,7 +40,7 @@ GB_DESC *GB_CLASSES[] EXPORT = int EXPORT GB_INIT(void) { GB.GetInterface("gb.image", IMAGE_INTERFACE_VERSION, &IMAGE); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.compress.bzlib2/src/main.c b/gb.compress.bzlib2/src/main.c index 399960155..d38d030bf 100644 --- a/gb.compress.bzlib2/src/main.c +++ b/gb.compress.bzlib2/src/main.c @@ -574,7 +574,7 @@ int EXPORT GB_INIT(void) GB.GetInterface("gb.compress", COMPRESS_INTERFACE_VERSION, &COMPRESSION); COMPRESSION.Register(&_driver); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.compress.zlib/src/main.c b/gb.compress.zlib/src/main.c index 20e426b2a..e4d64d2c9 100644 --- a/gb.compress.zlib/src/main.c +++ b/gb.compress.zlib/src/main.c @@ -489,7 +489,7 @@ int EXPORT GB_INIT(void) GB.GetInterface("gb.compress", COMPRESS_INTERFACE_VERSION, &COMPRESSION); COMPRESSION.Register(&_driver); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.corba/src/main.cpp b/gb.corba/src/main.cpp index f9b841ee4..0320fb077 100644 --- a/gb.corba/src/main.cpp +++ b/gb.corba/src/main.cpp @@ -84,7 +84,7 @@ extern "C" { - return true; + return -1; } void EXPORT GB_EXIT() diff --git a/gb.db.firebird/src/main.cpp b/gb.db.firebird/src/main.cpp index 4b3335e65..bbbcef5e8 100644 --- a/gb.db.firebird/src/main.cpp +++ b/gb.db.firebird/src/main.cpp @@ -2390,7 +2390,7 @@ extern "C" { GB.GetInterface("gb.db", DB_INTERFACE_VERSION, &DB); DB.Register(&_driver); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.db.mysql/src/main.c b/gb.db.mysql/src/main.c index faa30b509..2ef60312c 100644 --- a/gb.db.mysql/src/main.c +++ b/gb.db.mysql/src/main.c @@ -2504,7 +2504,7 @@ int EXPORT GB_INIT(void) GB.GetInterface("gb.db", DB_INTERFACE_VERSION, &DB); DB.Register(&_driver); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.db.postgresql/src/main.c b/gb.db.postgresql/src/main.c index 637746ddd..aef8de38d 100644 --- a/gb.db.postgresql/src/main.c +++ b/gb.db.postgresql/src/main.c @@ -2732,7 +2732,7 @@ int EXPORT GB_INIT(void) GB.GetInterface("gb.db", DB_INTERFACE_VERSION, &DB); DB.Register(&_driver); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.db.sqlite2/src/main.cpp b/gb.db.sqlite2/src/main.cpp index 24018db02..a3c2ad5bb 100644 --- a/gb.db.sqlite2/src/main.cpp +++ b/gb.db.sqlite2/src/main.cpp @@ -2478,7 +2478,7 @@ int EXPORT GB_INIT(void) GB.GetInterface("gb.db", DB_INTERFACE_VERSION, &DB); DB.Register(&_driver); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.db.sqlite3/src/main.cpp b/gb.db.sqlite3/src/main.cpp index bdac1fad7..2c082a826 100644 --- a/gb.db.sqlite3/src/main.cpp +++ b/gb.db.sqlite3/src/main.cpp @@ -2718,7 +2718,7 @@ extern "C" GB.GetInterface("gb.db", DB_INTERFACE_VERSION, &DB); DB.Register(&_driver); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.dbus/src/main.c b/gb.dbus/src/main.c index 90e0dcced..6c0dea896 100644 --- a/gb.dbus/src/main.c +++ b/gb.dbus/src/main.c @@ -43,7 +43,7 @@ GB_DESC *GB_CLASSES[] EXPORT = int EXPORT GB_INIT(void) { CLASS_DBusVariant = GB.FindClass("DBusVariant"); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.desktop/src/main.c b/gb.desktop/src/main.c index 3dc9689a2..518d39877 100644 --- a/gb.desktop/src/main.c +++ b/gb.desktop/src/main.c @@ -39,7 +39,8 @@ GB_DESC *GB_CLASSES[] EXPORT = int EXPORT GB_INIT(void) { GB.GetInterface("gb.image", IMAGE_INTERFACE_VERSION, &IMAGE); - return 0; + // Must be not be unloaded, because libxtst registers some exit procedure called at XCloseDisplay() + return -1; } void EXPORT GB_EXIT(void) diff --git a/gb.gtk/src/ext/main.cpp b/gb.gtk/src/ext/main.cpp index 558656c2e..3bd00d173 100644 --- a/gb.gtk/src/ext/main.cpp +++ b/gb.gtk/src/ext/main.cpp @@ -41,11 +41,11 @@ GB_INTERFACE GB EXPORT; GB_DESC *GB_CLASSES[] EXPORT = { - CGridViewColumnDesc, - CGridViewColumnsDesc, - CGridViewDesc, - CPaintDesc, - CDrawDesc, + CGridViewColumnDesc, + CGridViewColumnsDesc, + CGridViewDesc, + CPaintDesc, + CDrawDesc, NULL }; @@ -53,7 +53,7 @@ int EXPORT GB_INIT(void) { GB.GetInterface("gb.gtk", GTK_INTERFACE_VERSION, >K); GB.GetInterface("gb.draw", DRAW_INTERFACE_VERSION, &DRAW); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.gtk/src/gtabstrip.cpp b/gb.gtk/src/gtabstrip.cpp index 1a32f5421..6fb1c0053 100644 --- a/gb.gtk/src/gtabstrip.cpp +++ b/gb.gtk/src/gtabstrip.cpp @@ -255,8 +255,7 @@ void gTabStripPage::setVisible(bool v) gtk_widget_show_all(widget); gtk_widget_show_all(fix); //gtk_container_resize_children(GTK_CONTAINER(gtk_widget_get_parent(widget))); - if (parent->isVisible()) - gtk_container_resize_children(GTK_CONTAINER(gtk_widget_get_parent(gtk_widget_get_parent(widget)))); + //gtk_container_resize_children(GTK_CONTAINER(gtk_widget_get_parent(gtk_widget_get_parent(widget)))); } else { diff --git a/gb.gtk/src/main.cpp b/gb.gtk/src/main.cpp index 7687fddc3..e64129f0b 100644 --- a/gb.gtk/src/main.cpp +++ b/gb.gtk/src/main.cpp @@ -259,7 +259,7 @@ extern "C" CLASS_Image = GB.FindClass("Image"); CLASS_SvgImage = GB.FindClass("SvgImage"); - return TRUE; + return -1; } void EXPORT GB_EXIT() diff --git a/gb.gtk/src/opengl/main.cpp b/gb.gtk/src/opengl/main.cpp index 7f2c27bf3..1c3f2e6f2 100644 --- a/gb.gtk/src/opengl/main.cpp +++ b/gb.gtk/src/opengl/main.cpp @@ -47,7 +47,7 @@ int EXPORT GB_INIT(void) GB.GetInterface("gb.gtk", GTK_INTERFACE_VERSION, >K); GB.GetInterface("gb.opengl", GL_INTERFACE_VERSION, &GL); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.image.imlib/src/main.c b/gb.image.imlib/src/main.c index b1acbb715..dceef95ad 100644 --- a/gb.image.imlib/src/main.c +++ b/gb.image.imlib/src/main.c @@ -38,7 +38,7 @@ int EXPORT GB_INIT(void) { GB.GetInterface("gb.image", IMAGE_INTERFACE_VERSION, &IMAGE); imlib_set_cache_size(0); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.image.io/src/main.c b/gb.image.io/src/main.c index 4ef804c20..152c78c1b 100644 --- a/gb.image.io/src/main.c +++ b/gb.image.io/src/main.c @@ -41,7 +41,7 @@ int EXPORT GB_INIT(void) // Bug in the gdk-pixbuf documentation: the following is mandatory. g_type_init(); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.opengl/src/glsl/main.c b/gb.opengl/src/glsl/main.c index a7e66acfd..d54681afa 100644 --- a/gb.opengl/src/glsl/main.c +++ b/gb.opengl/src/glsl/main.c @@ -39,7 +39,7 @@ GB_DESC *GB_CLASSES[] EXPORT = int EXPORT GB_INIT(void) { - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.opengl/src/main.c b/gb.opengl/src/main.c index ebe344eef..1deafb24f 100644 --- a/gb.opengl/src/main.c +++ b/gb.opengl/src/main.c @@ -86,7 +86,7 @@ int EXPORT GB_INIT(void) { GB.GetInterface("gb.image", IMAGE_INTERFACE_VERSION, &IMAGE); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.qt.kde/src/html/main.cpp b/gb.qt.kde/src/html/main.cpp index 6f0703bdd..d5f4ddf67 100644 --- a/gb.qt.kde/src/html/main.cpp +++ b/gb.qt.kde/src/html/main.cpp @@ -41,7 +41,7 @@ int EXPORT GB_INIT(void) { GB.GetInterface("gb.qt", QT_INTERFACE_VERSION, &QT); - return TRUE; + return -1; } void EXPORT GB_EXIT() diff --git a/gb.qt.kde/src/main.cpp b/gb.qt.kde/src/main.cpp index afbf79355..556ca7d81 100644 --- a/gb.qt.kde/src/main.cpp +++ b/gb.qt.kde/src/main.cpp @@ -239,7 +239,7 @@ int EXPORT GB_INIT(void) GB.Hook(GB_HOOK_MAIN, (void *)hook_main); old_hook_lang = GB.Hook(GB_HOOK_LANG, (void *)hook_lang); - return TRUE; + return -1; } void EXPORT GB_EXIT() diff --git a/gb.qt/share/gb.form.arrangement.h b/gb.qt/share/gb.form.arrangement.h index 5fb1e47f5..8086e782a 100644 --- a/gb.qt/share/gb.form.arrangement.h +++ b/gb.qt/share/gb.form.arrangement.h @@ -217,7 +217,7 @@ void FUNCTION_NAME(void *_object) //(QFrame *cont) wc -= padding * 2; hc -= padding * 2; - //if (!strcmp(GET_OBJECT_NAME(_object), "HBox1")) + //if (!strcmp(GET_OBJECT_NAME(_object), "TabStrip1")) // fprintf(stderr, "#0: %d %d %d %d\n", xc, yc, wc, hc); if (indent) diff --git a/gb.qt/src/ext/main.cpp b/gb.qt/src/ext/main.cpp index 9976b0f0b..ff50f71a7 100644 --- a/gb.qt/src/ext/main.cpp +++ b/gb.qt/src/ext/main.cpp @@ -82,7 +82,7 @@ int EXPORT GB_INIT(void) GB.GetInterface("gb.qt", QT_INTERFACE_VERSION, &QT); DRAW_init(); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.qt/src/main.cpp b/gb.qt/src/main.cpp index 75a5e6dad..13295a37a 100644 --- a/gb.qt/src/main.cpp +++ b/gb.qt/src/main.cpp @@ -925,7 +925,7 @@ int EXPORT GB_INIT(void) QT_InitEventLoop(); - return TRUE; + return -1; } void EXPORT GB_EXIT() diff --git a/gb.qt/src/opengl/main.cpp b/gb.qt/src/opengl/main.cpp index d96fc52b7..de1a7e9c1 100644 --- a/gb.qt/src/opengl/main.cpp +++ b/gb.qt/src/opengl/main.cpp @@ -45,7 +45,7 @@ int EXPORT GB_INIT(void) GB.GetInterface("gb.qt", QT_INTERFACE_VERSION, &QT); GB.GetInterface("gb.opengl", GL_INTERFACE_VERSION, &GL); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.qt4/src/CContainer.cpp b/gb.qt4/src/CContainer.cpp index fc73d4df0..8d683570b 100755 --- a/gb.qt4/src/CContainer.cpp +++ b/gb.qt4/src/CContainer.cpp @@ -38,6 +38,7 @@ #include "CWindow.h" #include "CConst.h" #include "CScrollView.h" +#include "CTabStrip.h" #include "CColor.h" #include "CContainer.h" @@ -204,7 +205,22 @@ static void flush_cache() _cache.clear(); } +#else +#if 0 +static void get_widget_contents(QWidget *wid, int &x, int &y, int &w, int &h) +{ + QRect wc; + + wc = wid->contentsRect(); + + x = wc.x(); + y = wc.y(); + w = wc.width(); + h = wc.height(); + +} +#endif #endif static void resize_container(void *_object, QWidget *cont, int w, int h) @@ -249,6 +265,7 @@ static void resize_container(void *_object, QWidget *cont, int w, int h) #else +//#define GET_WIDGET_CONTENTS(_widget, _x, _y, _w, _h) get_widget_contents(_widget, _x, _y, _w, _h) #define GET_WIDGET_CONTENTS(_widget, _x, _y, _w, _h) \ _x = (_widget)->contentsRect().x(); \ _y = (_widget)->contentsRect().y(); \ @@ -276,6 +293,8 @@ static void resize_container(void *_object, QWidget *cont, int w, int h) #define GET_OBJECT_FROM_WIDGET(_widget) CWidget::getRealExisting(_widget) +#define GET_OBJECT_NAME(_object) (((CWIDGET *)_object)->name) + #define RAISE_ARRANGE_EVENT(_object) \ { \ GB.Raise(_object, EVENT_Arrange, 0); \ @@ -296,6 +315,8 @@ void CCONTAINER_arrange(void *_object) { if (GB.Is(THIS, CLASS_ScrollView)) CSCROLLVIEW_arrange(THIS); + else if (GB.Is(THIS, CLASS_TabStrip)) + CTABSTRIP_arrange(THIS); #if DEBUG_CONTAINER static int level = 0; @@ -452,9 +473,12 @@ void MyContainer::showEvent(QShowEvent *e) void *_object = CWidget::get(this); QWidget::showEvent(e); THIS->widget.flag.shown = TRUE; + // if (!qstrcmp(GB.GetClassName(THIS), "TabStrip")) + // { + // qDebug("MyContainer::showEvent: %s %p: SHOWN = 1 (%d %d)", THIS->widget.name, THIS, THIS->widget.widget->isVisible() , !THIS->widget.widget->isHidden()); + // BREAKPOINT(); + // } CCONTAINER_arrange(THIS); - //if (!qstrcmp(GB.GetClassName(THIS), "ListContainer")) - // qDebug("MyContainer::showEvent: %s %p: SHOWN = 1 (%d %d)", THIS->widget.name, THIS, THIS->widget.widget->isVisible() , !THIS->widget.widget->isHidden()); } void MyContainer::hideEvent(QHideEvent *e) diff --git a/gb.qt4/src/CTabStrip.cpp b/gb.qt4/src/CTabStrip.cpp index e003eaa57..058f2b363 100644 --- a/gb.qt4/src/CTabStrip.cpp +++ b/gb.qt4/src/CTabStrip.cpp @@ -42,6 +42,11 @@ DECLARE_METHOD(CCONTAINER_y); DECLARE_EVENT(EVENT_Click); +void CTABSTRIP_arrange(void *_object) +{ + WIDGET->forceLayout(); +} + /** CTab *****************************************************************/ class CTab @@ -335,7 +340,6 @@ BEGIN_METHOD(CTABSTRIP_new, GB_OBJECT parent) CWIDGET_new(wid, (void *)_object, true); set_tab_count(THIS, 1); - wid->show(); //wid->updateLayout(); @@ -726,15 +730,13 @@ void CTabStrip::currentChanged(int index) wid = WIDGET->currentWidget(); - //qDebug("CTabStrip::currentChanged: %d %p -> %p", index, THIS->container, wid); - if (wid != THIS->container) { + //qDebug("CTabStrip::currentChanged: %d %p -> %p", index, THIS->container, wid); if (THIS->container) THIS->container->hide(); THIS->container = wid; wid->show(); - WIDGET->forceLayout(); CCONTAINER_arrange(THIS); //if (wid->isVisible() && !THIS->lock) @@ -789,14 +791,12 @@ GB_DESC CTabStripDesc[] = GB_PROPERTY("Orientation", "i", CTABSTRIP_orientation), GB_PROPERTY("Enabled", "b", CTABSTRIP_enabled), - #ifdef GB_QT_COMPONENT GB_PROPERTY_READ("ClientX", "i", CTABSTRIP_client_x), GB_PROPERTY_READ("ClientY", "i", CTABSTRIP_client_y), GB_PROPERTY_READ("ClientW", "i", CTABSTRIP_client_width), GB_PROPERTY_READ("ClientWidth", "i", CTABSTRIP_client_width), GB_PROPERTY_READ("ClientH", "i", CTABSTRIP_client_height), GB_PROPERTY_READ("ClientHeight", "i", CTABSTRIP_client_height), - #endif GB_PROPERTY("Arrangement", "i", CCONTAINER_arrangement), GB_PROPERTY("AutoResize", "b", CCONTAINER_auto_resize), diff --git a/gb.qt4/src/CTabStrip.h b/gb.qt4/src/CTabStrip.h index b8d512a7f..88aee8a76 100644 --- a/gb.qt4/src/CTabStrip.h +++ b/gb.qt4/src/CTabStrip.h @@ -99,4 +99,6 @@ public slots: void currentChanged(int); }; +void CTABSTRIP_arrange(void *_object); + #endif diff --git a/gb.qt4/src/CWidget.cpp b/gb.qt4/src/CWidget.cpp index 0597e17df..470eadeba 100644 --- a/gb.qt4/src/CWidget.cpp +++ b/gb.qt4/src/CWidget.cpp @@ -263,7 +263,7 @@ void CWIDGET_new(QWidget *w, void *_object, bool no_show, bool no_filter, bool n if (!no_show) { - w->setGeometry(-16, -16, 16, 16); + w->setGeometry(-32, -32, 32, 32); CWIDGET_set_visible(THIS, true); w->raise(); } diff --git a/gb.qt4/src/cpaint_impl.cpp b/gb.qt4/src/cpaint_impl.cpp index da326f246..f752e8af1 100644 --- a/gb.qt4/src/cpaint_impl.cpp +++ b/gb.qt4/src/cpaint_impl.cpp @@ -318,23 +318,26 @@ static void Stroke(GB_PAINT *d, int preserve) { CHECK_PATH(d); - if (!CLIP(d)) - PAINTER(d)->strokePath(*PATH(d), PAINTER(d)->pen()); - else + if (PAINTER(d)->pen().widthF() > 0.0) { - QPainterPathStroker stroker; - QPen pen = PAINTER(d)->pen(); - - stroker.setCapStyle(pen.capStyle()); - stroker.setDashOffset(pen.dashOffset()); - stroker.setDashPattern(pen.dashPattern()); - stroker.setJoinStyle(pen.joinStyle()); - stroker.setMiterLimit(pen.miterLimit()); - stroker.setWidth(pen.widthF()); - - QPainterPath path = PAINTER(d)->worldTransform().inverted().map(*CLIP(d)); - path = path.intersected(stroker.createStroke(*PATH(d))); - PAINTER(d)->fillPath(path, PAINTER(d)->brush()); + if (!CLIP(d)) + PAINTER(d)->strokePath(*PATH(d), PAINTER(d)->pen()); + else + { + QPainterPathStroker stroker; + QPen pen = PAINTER(d)->pen(); + + stroker.setCapStyle(pen.capStyle()); + stroker.setDashOffset(pen.dashOffset()); + stroker.setDashPattern(pen.dashPattern()); + stroker.setJoinStyle(pen.joinStyle()); + stroker.setMiterLimit(pen.miterLimit()); + stroker.setWidth(pen.widthF()); + + QPainterPath path = PAINTER(d)->worldTransform().inverted().map(*CLIP(d)); + path = path.intersected(stroker.createStroke(*PATH(d))); + PAINTER(d)->fillPath(path, PAINTER(d)->brush()); + } } PRESERVE_PATH(d, preserve); diff --git a/gb.qt4/src/ext/main.cpp b/gb.qt4/src/ext/main.cpp index b7ca1fa18..83598fbd3 100644 --- a/gb.qt4/src/ext/main.cpp +++ b/gb.qt4/src/ext/main.cpp @@ -79,7 +79,7 @@ int EXPORT GB_INIT(void) GB.GetInterface("gb.qt4", QT_INTERFACE_VERSION, &QT); DRAW_init(); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.qt4/src/main.cpp b/gb.qt4/src/main.cpp index cd3774830..b37f4f4b9 100644 --- a/gb.qt4/src/main.cpp +++ b/gb.qt4/src/main.cpp @@ -129,6 +129,7 @@ GB_CLASS CLASS_Control; GB_CLASS CLASS_Container; GB_CLASS CLASS_UserControl; GB_CLASS CLASS_UserContainer; +GB_CLASS CLASS_TabStrip; GB_CLASS CLASS_Window; GB_CLASS CLASS_Menu; GB_CLASS CLASS_Picture; @@ -1025,6 +1026,7 @@ int EXPORT GB_INIT(void) CLASS_Container = GB.FindClass("Container"); CLASS_UserControl = GB.FindClass("UserControl"); CLASS_UserContainer = GB.FindClass("UserContainer"); + CLASS_TabStrip = GB.FindClass("TabStrip"); CLASS_Window = GB.FindClass("Window"); CLASS_Menu = GB.FindClass("Menu"); CLASS_Picture = GB.FindClass("Picture"); @@ -1037,7 +1039,7 @@ int EXPORT GB_INIT(void) QT_InitEventLoop(); - return TRUE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.qt4/src/main.h b/gb.qt4/src/main.h index 6d9bfff80..14da408bd 100644 --- a/gb.qt4/src/main.h +++ b/gb.qt4/src/main.h @@ -49,6 +49,7 @@ extern GB_CLASS CLASS_Control; extern GB_CLASS CLASS_Container; extern GB_CLASS CLASS_UserControl; extern GB_CLASS CLASS_UserContainer; +extern GB_CLASS CLASS_TabStrip; extern GB_CLASS CLASS_Window; extern GB_CLASS CLASS_Menu; extern GB_CLASS CLASS_Picture; diff --git a/gb.qt4/src/opengl/main.cpp b/gb.qt4/src/opengl/main.cpp index 05cdc5795..0ea0e4155 100644 --- a/gb.qt4/src/opengl/main.cpp +++ b/gb.qt4/src/opengl/main.cpp @@ -43,7 +43,7 @@ int EXPORT GB_INIT(void) GB.GetInterface("gb.qt4", QT_INTERFACE_VERSION, &QT); GB.GetInterface("gb.opengl", GL_INTERFACE_VERSION, &GL); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.qt4/src/webkit/cwebview.cpp b/gb.qt4/src/webkit/cwebview.cpp index 270025436..f832cf63e 100644 --- a/gb.qt4/src/webkit/cwebview.cpp +++ b/gb.qt4/src/webkit/cwebview.cpp @@ -362,6 +362,7 @@ GB_DESC CWebViewDesc[] = MyWebView::MyWebView(QWidget *parent) : QWebView(parent) { + //settings()->setFontFamily(QWebSettings::FixedFont, "monospace"); } QWebView *MyWebView::createWindow(QWebPage::WebWindowType type) diff --git a/gb.qt4/src/webkit/main.cpp b/gb.qt4/src/webkit/main.cpp index 122188abc..90d662504 100644 --- a/gb.qt4/src/webkit/main.cpp +++ b/gb.qt4/src/webkit/main.cpp @@ -54,7 +54,7 @@ GB_DESC *GB_CLASSES[] EXPORT = int EXPORT GB_INIT(void) { GB.GetInterface("gb.qt4", QT_INTERFACE_VERSION, &QT); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/gb.sdl.sound/src/main.c b/gb.sdl.sound/src/main.c index da7c31106..97edad224 100644 --- a/gb.sdl.sound/src/main.c +++ b/gb.sdl.sound/src/main.c @@ -74,7 +74,7 @@ int EXPORT GB_INIT(void) SOUND_init(); - return 1; + return -1; } diff --git a/gb.sdl/src/main.cpp b/gb.sdl/src/main.cpp index 1dab1aa88..aa4fb24a0 100644 --- a/gb.sdl/src/main.cpp +++ b/gb.sdl/src/main.cpp @@ -88,7 +88,7 @@ extern "C" CLASS_Image = GB.FindClass("Image"); CLASS_Font = GB.FindClass("Font"); - return true; + return -1; } void EXPORT GB_EXIT() diff --git a/gb.xml/src/main.c b/gb.xml/src/main.c index 6f656d1e4..4af341b53 100644 --- a/gb.xml/src/main.c +++ b/gb.xml/src/main.c @@ -58,7 +58,7 @@ GB_DESC *GB_CLASSES[] EXPORT = int EXPORT GB_INIT(void) { - return 1; + return -1; } void EXPORT GB_EXIT() diff --git a/gb.xml/src/xslt/main.c b/gb.xml/src/xslt/main.c index a5b62bc17..9559da0ae 100644 --- a/gb.xml/src/xslt/main.c +++ b/gb.xml/src/xslt/main.c @@ -32,16 +32,14 @@ GB_INTERFACE GB EXPORT; GB_DESC *GB_CLASSES[] EXPORT = { - CXsltDesc, - NULL }; int EXPORT GB_INIT(void) { - return 1; + return -1; } void EXPORT GB_EXIT() diff --git a/main/gbx/gbx_component.c b/main/gbx/gbx_component.c index e4f38c7a1..d29a26626 100644 --- a/main/gbx/gbx_component.c +++ b/main/gbx/gbx_component.c @@ -54,7 +54,7 @@ #include "gbx_component.h" -/*#define DEBUG*/ +//#define DEBUG_COMP /*#define DEBUG_PRELOAD*/ COMPONENT *COMPONENT_current = NULL; @@ -76,9 +76,29 @@ void COMPONENT_init(void) void COMPONENT_exit(void) { COMPONENT *comp; + int order; + int max_order = 0; LIST_for_each(comp, _component_list) - COMPONENT_unload(comp); + { + if (comp->order > max_order) + max_order = comp->order; + } + + for (order = 0; order <= max_order; order++) + { + LIST_for_each(comp, _component_list) + { + if (comp->order == order) + COMPONENT_unload(comp); + } + } + + LIST_for_each(comp, _component_list) + { + if (comp->loaded) + COMPONENT_unload(comp); + } while (_component_list) COMPONENT_delete(_component_list); @@ -245,7 +265,7 @@ void COMPONENT_load(COMPONENT *comp) COMPONENT_current = comp; if (comp->library) - LIBRARY_load(comp->library); + comp->order = LIBRARY_load(comp->library); if (comp->archive) ARCHIVE_load(comp->archive); @@ -256,12 +276,21 @@ void COMPONENT_load(COMPONENT *comp) void COMPONENT_unload(COMPONENT *comp) { + if (!comp->loaded) + return; + + #if DEBUG_COMP + fprintf(stderr, "Unloading component %s [%d]\n", comp->name, comp->order); + #endif + if (comp->library) LIBRARY_unload(comp->library); /* Do not exist yet */ //if (comp->archive) // ARCHIVE_unload(comp->archive); + + comp->loaded = FALSE; } diff --git a/main/gbx/gbx_component.h b/main/gbx/gbx_component.h index 3e78c20f2..aec5e8946 100644 --- a/main/gbx/gbx_component.h +++ b/main/gbx/gbx_component.h @@ -38,11 +38,12 @@ typedef char *name; LIBRARY *library; ARCHIVE *archive; + char order; unsigned preload : 1; unsigned loaded : 1; unsigned user : 1; unsigned warning : 1; // Set when the bytecode warning was displayed by the class loader for this component - unsigned _reserved : 28; + unsigned _reserved : 20; } PACKED COMPONENT; diff --git a/main/gbx/gbx_library.c b/main/gbx/gbx_library.c index d076d418b..281a976f7 100644 --- a/main/gbx/gbx_library.c +++ b/main/gbx/gbx_library.c @@ -438,15 +438,16 @@ void LIBRARY_delete(LIBRARY *lib) } -void LIBRARY_load(LIBRARY *lib) +int LIBRARY_load(LIBRARY *lib) { int (*func)(); void **iface; GB_DESC **desc; char *path; + int order = 0; if (lib->handle) - return; + return 0; #ifdef DEBUG clock_t t = clock(); @@ -489,8 +490,9 @@ void LIBRARY_load(LIBRARY *lib) lib->info = (int(*)())get_symbol(lib, LIB_INFO, FALSE); /* Initialisation */ - lib->persistent = (bool)(*func)(); - + order = (*func)(); + lib->persistent = order < 0; + /* Déclaration des classes */ desc = get_symbol(lib, LIB_CLASS, FALSE); if (desc) @@ -500,6 +502,8 @@ void LIBRARY_load(LIBRARY *lib) fprintf(stderr, "Library %s loaded ", lib->name); fprintf(stderr, "in %g s\n", ((double)(clock() - t) / CLOCKS_PER_SEC)); #endif + + return order; } diff --git a/main/gbx/gbx_library.h b/main/gbx/gbx_library.h index fa7f2ed89..b7c09cb25 100644 --- a/main/gbx/gbx_library.h +++ b/main/gbx/gbx_library.h @@ -64,7 +64,7 @@ void LIBRARY_exit(void); LIBRARY *LIBRARY_create(const char *path); void LIBRARY_delete(LIBRARY *lib); -void LIBRARY_load(LIBRARY *lib); +int LIBRARY_load(LIBRARY *lib); void LIBRARY_unload(LIBRARY *lib); void LIBRARY_declare(GB_DESC **desc); diff --git a/main/lib/debug/main.c b/main/lib/debug/main.c index 7f08cb449..903de0198 100644 --- a/main/lib/debug/main.c +++ b/main/lib/debug/main.c @@ -54,7 +54,7 @@ void *GB_DEBUG_1[] EXPORT = int EXPORT GB_INIT(void) { - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/main/lib/draw/cpaint.c b/main/lib/draw/cpaint.c index 6d19e8e7f..3e3cf1d25 100644 --- a/main/lib/draw/cpaint.c +++ b/main/lib/draw/cpaint.c @@ -694,7 +694,7 @@ BEGIN_METHOD(Paint_Image, GB_OBJECT image; GB_FLOAT x; GB_FLOAT y) { GB_TRANSFORM transform; PAINT->Transform.Create(&transform); - PAINT->Transform.Translate(transform, -VARGOPT(x, 0.0), -VARGOPT(y, 0.0)); + PAINT->Transform.Translate(transform, VARGOPT(x, 0.0), VARGOPT(y, 0.0)); PAINT->Brush.Matrix(brush, TRUE, transform); PAINT->Transform.Delete(&transform); } diff --git a/main/lib/eval/main.c b/main/lib/eval/main.c index 920f6000c..f11d5ea40 100644 --- a/main/lib/eval/main.c +++ b/main/lib/eval/main.c @@ -65,7 +65,7 @@ int EXPORT GB_INIT(void) { EVAL_init(); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/main/lib/gui/main.c b/main/lib/gui/main.c index 3e417b6c5..e620d14c3 100644 --- a/main/lib/gui/main.c +++ b/main/lib/gui/main.c @@ -64,7 +64,7 @@ int EXPORT GB_INIT(void) if (GB.LoadComponent(comp)) fprintf(stderr, "gb.gui: unable to load '%s' component\n", comp); - return FALSE; + return 0; } void EXPORT GB_EXIT() diff --git a/main/lib/image/main.c b/main/lib/image/main.c index 1f2724fc5..f6ccd1ab1 100644 --- a/main/lib/image/main.c +++ b/main/lib/image/main.c @@ -71,7 +71,7 @@ void *GB_IMAGE_1[] EXPORT = int EXPORT GB_INIT(void) { - return FALSE; + return 0; } void EXPORT GB_EXIT()