diff --git a/app/src/gambas3/.lang/.pot b/app/src/gambas3/.lang/.pot index 578acf1d7..4eb3a0a8e 100644 --- a/app/src/gambas3/.lang/.pot +++ b/app/src/gambas3/.lang/.pot @@ -1015,7 +1015,7 @@ msgstr "" msgid "(No parent)" msgstr "" -#: FCreateFile.class:414 +#: FCreateFile.class:418 msgid "Cannot add file." msgstr "" @@ -3093,6 +3093,10 @@ msgstr "" msgid "Emerald" msgstr "" +#: FOption.class:4 +msgid "Gambas" +msgstr "" + #: FOption.class:4 msgid "Ruby" msgstr "" diff --git a/app/src/gambas3/.src/FOption.class b/app/src/gambas3/.src/FOption.class index 5886998dd..1518361e3 100644 --- a/app/src/gambas3/.src/FOption.class +++ b/app/src/gambas3/.src/FOption.class @@ -1,7 +1,7 @@ ' Gambas class file -Static Private $aTheme As String[] = ["amethyst", "amber", "emerald", "ruby", "sapphire", "visual", "obsidian", "quest", "quick"] -Static Private $aThemeName As String[] = [("Amethyst"), ("Amber"), ("Emerald"), ("Ruby"), ("Sapphire"), ("Visual"), ("Obsidian"), ("Quest"), ("Quick")] +Static Private $aTheme As String[] = ["amethyst", "amber", "emerald", "gambas", "ruby", "sapphire", "visual", "obsidian", "quest", "quick"] +Static Private $aThemeName As String[] = [("Amethyst"), ("Amber"), ("Emerald"), ("Gambas"), ("Ruby"), ("Sapphire"), ("Visual"), ("Obsidian"), ("Quest"), ("Quick")] Static Private $aBrowser As String[] = ["konqueror", "firefox", "epiphany", "seamonkey", "opera"] Static Private $aTerminal As String[] = ["konsole", "gnome-terminal", "Terminal", "lxterminal", "xterm"] Static Private $aImageEditor As String[] = ["gimp", "kolourpaint", "krita"] diff --git a/app/src/gambas3/.src/MTheme.module b/app/src/gambas3/.src/MTheme.module index 50e4f3949..c5c06fcec 100644 --- a/app/src/gambas3/.src/MTheme.module +++ b/app/src/gambas3/.src/MTheme.module @@ -1,6 +1,6 @@ ' Gambas module file -Public Const DEFAULT_THEME As String = "sapphire" +Public Const DEFAULT_THEME As String = "gambas" Public ColorKeys As String[] = ["Background", "Alternate", "Normal", "Keyword", "Datatype", "Function", "Operator", "Symbol", "Number", "String", "Comment", "Help", "Preprocessor", "Breakpoint", "Current", "Selection", "Highlight", "CurrentLine", "Error"] Public ColorNames As String[] = [("Background"), ("Alternate background"), ("Normal text"), ("Keywords"), ("Data types"), ("Subroutines"), ("Operators"), ("Symbols"), ("Numbers"), ("Strings"), ("Comments"), ("Help"), ("Preprocessor"), ("Breakpoints"), ("Current line"), ("Selection"), ("Highlighting"), ("Editing line"), ("Errors")] diff --git a/app/src/gambas3/.src/Project/FCreateFile.class b/app/src/gambas3/.src/Project/FCreateFile.class index f7572f1d0..31f4e91e0 100644 --- a/app/src/gambas3/.src/Project/FCreateFile.class +++ b/app/src/gambas3/.src/Project/FCreateFile.class @@ -289,7 +289,7 @@ Private Sub CreateFile() As Boolean End -Private Sub ImportDependencies(sName As String, sOrig As String, bLink As Boolean) +Private Sub ImportDependencies(sName As String, sExt As String, sOrig As String, bLink As Boolean) Dim hIn As File Dim hOut As File @@ -303,11 +303,13 @@ Private Sub ImportDependencies(sName As String, sOrig As String, bLink As Boolea Inc Application.Busy - sForm = Project.Dir &/ sName & ".form" + sForm = Project.Dir &/ File.SetExt(sName, sExt) sOrig = File.Dir(sOrig) hIn = Open sForm - hOut = Open Temp$("form") For Create + hOut = Open Temp$(sExt) For Create + + 'TODO: Import Image.Load(*) and SvgImage.Load(*) While Not Eof(hIn) @@ -346,7 +348,7 @@ NEXT_LINE: If bSave Then Kill sForm - Copy Temp$("form") To sForm + Copy Temp$(sExt) To sForm Project.RefreshKey(sForm) Endif @@ -362,12 +364,14 @@ Private Sub ImportFile() As Boolean Dim sName As String Dim sTemp As String Dim sType As String + Dim sExt As String sTemp = fchExisting.Value sDir = File.Dir(fchExisting.Value) sName = File.Name(fchExisting.Value) - Select Case File.Ext(sTemp) + sExt = File.Ext(sTemp) + Select Case sExt Case "module" sName = File.BaseName(Project.GetUniqueSourceName(sName)) @@ -377,17 +381,17 @@ Private Sub ImportFile() As Boolean sName = File.BaseName(Project.GetUniqueSourceName(sName)) Project.InsertSource(sName, "class", $sDir, sTemp,,, chkLink.Value) - Case "form" + Case "form", "report" sName = File.BaseName(Project.GetUniqueSourceName(sName)) Project.InsertSource(sName, "class", $sDir, File.SetExt(sTemp, "class"), True, True, chkLink.Value) - Project.InsertSource(sName, "form", $sDir, sTemp,, True, chkLink.Value) - ImportDependencies(sName, sTemp, chkLink.Value) + Project.InsertSource(sName, sExt, $sDir, sTemp, False, True, chkLink.Value) + ImportDependencies(sName, sExt, sTemp, chkLink.Value) Project.OpenForm(sName) Case "webpage" sName = File.BaseName(Project.GetUniqueSourceName(sName)) Project.InsertSource(sName, "class", $sDir, File.SetExt(sTemp, "class"), True, True, chkLink.Value) - Project.InsertSource(sName, "webpage", $sDir, sTemp,,, chkLink.Value) + Project.InsertSource(sName, "webpage", $sDir, sTemp, False, False, chkLink.Value) Default sName = Project.GetUniqueName($sDir, sName) diff --git a/app/src/gambas3/.src/Search/FSearch.class b/app/src/gambas3/.src/Search/FSearch.class index bd5c46f42..0d33adb6a 100644 --- a/app/src/gambas3/.src/Search/FSearch.class +++ b/app/src/gambas3/.src/Search/FSearch.class @@ -862,7 +862,11 @@ Public Sub WakeUp(bReplace As Boolean) cmbSearch.SetFocus Endif - If sFind Then cmbSearch.Text = sFind + If sFind Then + cmbSearch.Text = sFind + cmbSearch.SelectAll + Endif + ShowString End diff --git a/app/src/gambas3/theme/gambas b/app/src/gambas3/theme/gambas new file mode 100644 index 000000000..63521ce6f --- /dev/null +++ b/app/src/gambas3/theme/gambas @@ -0,0 +1,21 @@ +[Theme] +Background="#FFFFFF" +Alternate="#D0FFE0" +Normal="#000000" +Keyword="#000000,Bold" +Datatype="#DF6B00,Bold" +Function="#3398C3,Bold" +Operator="#000000,Bold" +Symbol="#000000" +Number="#FF0000,Bold" +String="#7F0000" +Comment="#888786,Italic" +Help="#888786,Bold,Italic" +Preprocessor="#006E28,Bold" +Breakpoint="#FF5F5F" +Current="#42C9FF" +Selection="#9BE2FF" +Highlight="#7FFF00" +CurrentLine="#E7F3FF" +Error="#BF0303,Underline" + diff --git a/comp/src/gb.report/.src/Tests/myReport5.report b/comp/src/gb.report/.src/Tests/myReport5.report index a8c065f4f..ca0421a08 100644 --- a/comp/src/gb.report/.src/Tests/myReport5.report +++ b/comp/src/gb.report/.src/Tests/myReport5.report @@ -52,7 +52,7 @@ Tag = "*" Background = ReportBrush["#FFFF00"] { ReportLabel1 ReportLabel - #MoveScaled(0,5,46,23) + #MoveScaled(3,5,43,23) Left = "25%" Top = "5cm" Width = "50%" @@ -65,6 +65,10 @@ Text = ("gambas") Alignment = Align.Center } + { ReportImage1 ReportImage + #MoveScaled(8,24,14,8) + Image = Image.Load("printer1.png") + } } { ReportLabel2 ReportLabel #MoveScaled(9,47,47,5) diff --git a/comp/src/gb.settings/.project b/comp/src/gb.settings/.project index f9df9b45a..81cdf4cd5 100644 --- a/comp/src/gb.settings/.project +++ b/comp/src/gb.settings/.project @@ -1,8 +1,8 @@ # Gambas Project File 3.0 -# Compiled with Gambas 2.99.4 +# Compiled with Gambas 2.99.6 Title=Gambas settings management Startup=Main -Version=2.99.4 +Version=2.99.6 VersionProgram=gbx3 -V Authors="BenoƮt Minisini" TabSize=2 diff --git a/comp/src/gb.settings/.src/Settings.class b/comp/src/gb.settings/.src/Settings.class index 75014ef50..7ec539b2b 100644 --- a/comp/src/gb.settings/.src/Settings.class +++ b/comp/src/gb.settings/.src/Settings.class @@ -137,7 +137,7 @@ Public Sub Save() Sleep 0.2 Next - hFile = Open $sPath For Create + hFile = Open $sPath & "#" For Create If $sTitle Then Print #hFile, "# "; $sTitle @@ -155,7 +155,11 @@ Public Sub Save() Next Close #hFile + Try Kill $sPath & "~" + Try Move $sPath To $sPath & "~" + Try Move $sPath & "#" To $sPath Try Kill $sPath & ".lock" + Try Kill $sPath & "~" Unlock #hLock 'CATCH diff --git a/comp/src/gb.web/.info b/comp/src/gb.web/.info index 95741652f..3fcd7673d 100644 --- a/comp/src/gb.web/.info +++ b/comp/src/gb.web/.info @@ -184,6 +184,10 @@ Unique P b +Modified +P +b + _init M @@ -204,10 +208,6 @@ _put M (Value)v(Key)s -Modify -M - - Save M diff --git a/comp/src/gb.web/.src/Response.module b/comp/src/gb.web/.src/Response.module index b01544193..d3dd3e6f7 100644 --- a/comp/src/gb.web/.src/Response.module +++ b/comp/src/gb.web/.src/Response.module @@ -91,9 +91,7 @@ End Private Sub ShouldCompress() As Boolean - If $sContentType = "image/jpeg" Then Return False - If $sContentType = "image/png" Then Return False - Return True + Return $sContentType Begins "text/" End diff --git a/comp/src/gb.web/.src/Session.module b/comp/src/gb.web/.src/Session.module index 5641d04c0..05b80c723 100644 --- a/comp/src/gb.web/.src/Session.module +++ b/comp/src/gb.web/.src/Session.module @@ -17,6 +17,7 @@ Property Id As String Property Timeout As Float Property Prefix As String Property Unique As Boolean +Property Modified As Boolean Private Sub LockSession() @@ -310,12 +311,6 @@ Public Sub _put(Value As Variant, Key As String) End -Public Sub Modify() - - $bModify = True - -End - Private Function Id_Read() As String @@ -381,3 +376,15 @@ Private Sub Unique_Write(Value As Boolean) CheckUnique End + +Private Function Modified_Read() As Boolean + + Return $bModify + +End + +Private Sub Modified_Write(Value As Boolean) + + $bModify = Value + +End diff --git a/examples/examples/Drawing/Painting/.project b/examples/examples/Drawing/Painting/.project index b32a79441..e7497e4fe 100644 --- a/examples/examples/Drawing/Painting/.project +++ b/examples/examples/Drawing/Painting/.project @@ -1,5 +1,5 @@ # Gambas Project File 3.0 -# Compiled with Gambas 2.99.1 +# Compiled with Gambas 2.99.6 Title=Anti-Aliased Drawing Startup=FMain Icon=icon.png diff --git a/examples/examples/Drawing/Painting/.src/FMain.class b/examples/examples/Drawing/Painting/.src/FMain.class index cb97974dc..1f985615f 100644 --- a/examples/examples/Drawing/Painting/.src/FMain.class +++ b/examples/examples/Drawing/Painting/.src/FMain.class @@ -446,6 +446,24 @@ Public Sub Example17() End +Public Sub Example18() + + Paint.Save + Paint.Rectangle(10, 10, 200, 100) + Paint.Clip(True) + Paint.Stroke + Paint.Font.Size = 18 + 'Paint.Brush = Paint.Color(Color.Blue) + Paint.Text("TO BE, OR NOT TO BE: THAT IS THE QUESTION:", 10, 10, 30, 30) + Paint.Fill + Paint.Restore + 'Paint.Brush = Paint.Color(Color.Blue) + Paint.Text("TO BE, OR NOT TO BE: THAT IS THE QUESTION:", 10, 40, 30, 30) + Paint.Fill + +End + + Public Sub Example20() Dim eWidth As Float diff --git a/examples/examples/Drawing/Painting/.src/FMain.form b/examples/examples/Drawing/Painting/.src/FMain.form index d94d94db7..a600bdd13 100644 --- a/examples/examples/Drawing/Painting/.src/FMain.form +++ b/examples/examples/Drawing/Painting/.src/FMain.form @@ -126,9 +126,15 @@ Tag = "16" Text = ("Text") } + { Exemple18 RadioButton optExample + Name = "Exemple18" + MoveScaled(0,54,31,3) + Tag = "18" + Text = ("Text clipping") + } { Exemple17 RadioButton optExample Name = "Exemple17" - MoveScaled(0,54,31,3) + MoveScaled(0,57,31,3) Tag = "17" Text = ("Text extents") } diff --git a/examples/examples/Drawing/Painting/Example11 b/examples/examples/Drawing/Painting/Example11 index 72eebf6eb..5f026c8ee 100644 --- a/examples/examples/Drawing/Painting/Example11 +++ b/examples/examples/Drawing/Painting/Example11 @@ -17,6 +17,7 @@ Public Sub Example11() Paint.Brush = hBrush Paint.Rectangle(X, Y, W, H) Paint.Fill + 'Paint.DrawImage(hImage, X, Y, W, H) Paint.Brush = Paint.Color(Color.RGB(255, 127, 127, 153)) Paint.Arc(X, Y, 10) diff --git a/examples/examples/Drawing/Painting/Example18 b/examples/examples/Drawing/Painting/Example18 new file mode 100644 index 000000000..e0ee5b960 --- /dev/null +++ b/examples/examples/Drawing/Painting/Example18 @@ -0,0 +1,16 @@ +Public Sub Example18() + + Paint.Save + Paint.Rectangle(10, 10, 200, 100) + Paint.Clip(True) + Paint.Stroke + Paint.Font.Size = 18 + 'Paint.Brush = Paint.Color(Color.Blue) + Paint.Text("TO BE, OR NOT TO BE: THAT IS THE QUESTION:", 10, 10, 30, 30) + Paint.Fill + Paint.Restore + 'Paint.Brush = Paint.Color(Color.Blue) + Paint.Text("TO BE, OR NOT TO BE: THAT IS THE QUESTION:", 10, 40, 30, 30) + Paint.Fill + +End diff --git a/examples/examples/Printing/ReportExample/.settings b/examples/examples/Printing/ReportExample/.settings index 5785a89d8..4888cac72 100644 --- a/examples/examples/Printing/ReportExample/.settings +++ b/examples/examples/Printing/ReportExample/.settings @@ -10,7 +10,8 @@ Active=2 File[2]=".src/Report1.report" File[3]=".src/FMain.class:5.0" File[4]=".src/Report1.class:12.16" -Count=4 +File[5]=".src/Report2.report" +Count=5 [Watches] Count=0 diff --git a/examples/examples/Printing/ReportExample/.src/Report2.class b/examples/examples/Printing/ReportExample/.src/Report2.class new file mode 100644 index 000000000..83a998af0 --- /dev/null +++ b/examples/examples/Printing/ReportExample/.src/Report2.class @@ -0,0 +1,19 @@ +' Gambas class file + +Public Sub _new() + + Dim Rlbl As ReportLabel + Dim i As Integer + 'Report.Debug = True + For i = 0 To 200 + + Rlbl = New ReportLabel(RVBCont) + Rlbl.Text = "Ligne " & i + Rlbl.Border.bottom.Width = "1px" + Rlbl.Padding.Top = "3 mm" + Rlbl.Padding.Bottom = "1mm" + Rlbl.Padding.Left = "2 mm" + + Next + +End \ No newline at end of file diff --git a/examples/examples/Printing/ReportExample/.src/Report2.report b/examples/examples/Printing/ReportExample/.src/Report2.report new file mode 100644 index 000000000..0aad391a7 --- /dev/null +++ b/examples/examples/Printing/ReportExample/.src/Report2.report @@ -0,0 +1,19 @@ +# Gambas Form File 3.0 + +{ Report Report + #MoveScaled(0,0,64,64) + Index = 0 + Text = ("") + { ReportHBox1 ReportHBox + #MoveScaled(1,1,61,8) + Height = "10cm" + Fixed = True + Expand = True + Background = ReportBrush["#007FFF"] + } + { RVBCont ReportVBox + #MoveScaled(2,11,56,26) + Expand = True + } + Index = 0 +} diff --git a/gb.desktop/src/desktop.c b/gb.desktop/src/desktop.c index 904fc46a3..0eb216737 100644 --- a/gb.desktop/src/desktop.c +++ b/gb.desktop/src/desktop.c @@ -502,8 +502,6 @@ BEGIN_METHOD(CDESKTOP_get_window_geometry, GB_INTEGER window) GB_ARRAY array; int *data; - Window root; - uint ignore; if (X11_init()) return; @@ -511,7 +509,8 @@ BEGIN_METHOD(CDESKTOP_get_window_geometry, GB_INTEGER window) GB.Array.New(&array, GB_T_INTEGER, 4); data = (int *)GB.Array.Get(array, 0); - XGetGeometry(X11_display, VARG(window), &root, &data[0], &data[1], (uint *)&data[2], (uint *)&data[3], &ignore, &ignore); + X11_get_window_geometry(VARG(window), &data[0], &data[1], &data[2], &data[3]); + //XGetGeometry(X11_display, VARG(window), &root, &data[0], &data[1], (uint *)&data[2], (uint *)&data[3], &ignore, &ignore); GB.ReturnObject(array); END_METHOD diff --git a/gb.desktop/src/gb.desktop/.settings b/gb.desktop/src/gb.desktop/.settings index 71e4e4075..254ada116 100644 --- a/gb.desktop/src/gb.desktop/.settings +++ b/gb.desktop/src/gb.desktop/.settings @@ -25,8 +25,10 @@ File[1]=".src/_Desktop_Passwords.class:0.0" File[2]=".src/DesktopWindow.class:120.0" File[3]=".src/Atom.class:8.14" Active=4 -File[4]=".src/Main.module:149.25" -Count=4 +File[4]=".src/Main.module:149.28" +File[5]=".src/_DesktopVirtual.class:0.0" +File[6]=".src/Desktop.class:369.2" +Count=6 [Watches] Count=0 diff --git a/gb.desktop/src/gb.desktop/.src/Main.module b/gb.desktop/src/gb.desktop/.src/Main.module index f779245c3..9757ae291 100644 --- a/gb.desktop/src/gb.desktop/.src/Main.module +++ b/gb.desktop/src/gb.desktop/.src/Main.module @@ -142,17 +142,12 @@ End Public Sub Main() - Dim dWindow As DesktopWindow + Dim hWindow As DesktopWindow - Print Desktop.Path + 'Print Desktop.Path - For Each dWindow In Desktop.Windows - Print Hex(dWindow.Id);; - If dWindow.SkipTaskbar = True Then - Print "skip" - Else - Print dWindow.Name - Endif + For Each hWindow In Desktop.Windows + Print Hex$(hWindow.Id, 8);; Quote(hWindow.Name); ": "; hWindow.X;; hWindow.Y;; hWindow.Height;; hWindow.Width Next End diff --git a/gb.desktop/src/x11.c b/gb.desktop/src/x11.c index bc6a1449e..e85b6b9d9 100644 --- a/gb.desktop/src/x11.c +++ b/gb.desktop/src/x11.c @@ -776,3 +776,23 @@ void X11_event_filter(XEvent *e) GB.Call(&_desktop_window_func, 5, FALSE); } } + +void X11_get_window_geometry(Window win, int *wx, int *wy, int *ww, int *wh) +{ + Window p; + int transx, transy; + XWindowAttributes wattr; + + *wx = *wy = *ww = *wh = 0; + + if (!XTranslateCoordinates(_display, win, _root, 0, 0, &transx, &transy, &p)) + return; + + if (!XGetWindowAttributes(_display, win, &wattr)) + return; + + *wx = transx - wattr.border_width; + *wy = transy - wattr.border_width; + *ww = wattr.width + wattr.border_width * 2; + *wh = wattr.height + wattr.border_width * 2; +} diff --git a/gb.desktop/src/x11.h b/gb.desktop/src/x11.h index 756c32e4c..f73815ed4 100644 --- a/gb.desktop/src/x11.h +++ b/gb.desktop/src/x11.h @@ -85,6 +85,7 @@ void X11_find_windows(Window **window_list, int *count); void X11_get_window_title(Window window, char **result, int *length); void X11_get_window_class(Window window, char **result, int *length); void X11_get_window_role(Window window, char **result, int *length); +void X11_get_window_geometry(Window win, int *wx, int *wy, int *ww, int *wh); /* Function to make a tool window */ void X11_set_window_tool(Window window, int tool, Window parent); int X11_get_window_tool(Window window); diff --git a/gb.gtk/src/cpaint_impl.cpp b/gb.gtk/src/cpaint_impl.cpp index 74ff3ec05..7e65e800a 100644 --- a/gb.gtk/src/cpaint_impl.cpp +++ b/gb.gtk/src/cpaint_impl.cpp @@ -623,7 +623,7 @@ static void draw_text(GB_PAINT *d, bool rich, const char *text, int len, float w CFONT *font; float tw, th, offx, offy; - layout = pango_cairo_create_layout(CONTEXT(d)); + layout = pango_cairo_create_layout(CONTEXT(d)); if (rich) { @@ -638,6 +638,9 @@ static void draw_text(GB_PAINT *d, bool rich, const char *text, int len, float w _Font(d, FALSE, (GB_FONT *)&font); gt_add_layout_from_font(layout, font->font, d->resolutionY); + if (align == GB_DRAW_ALIGN_DEFAULT) + align = ALIGN_TOP_NORMAL; + if (w > 0 && h > 0) { gt_layout_alignment(layout, w, h, &tw, &th, align, &offx, &offy); diff --git a/gb.net/src/CDnsClient.c b/gb.net/src/CDnsClient.c index 55fe78985..17a5fd307 100644 --- a/gb.net/src/CDnsClient.c +++ b/gb.net/src/CDnsClient.c @@ -100,7 +100,7 @@ void dns_callback(intptr_t lParam) mypoll.events=POLLIN; mypoll.revents=0; idata=poll(&mypoll,1,0); - if (!idata) break; + if (idata <= 0) break; read_dns_pipe(&v_obj,sizeof(void*)); read_dns_pipe(&test_id,sizeof(int)); read_dns_pipe(Action,sizeof(char)); diff --git a/gb.qt4/src/cpaint_impl.cpp b/gb.qt4/src/cpaint_impl.cpp index eb9c19447..39780494e 100644 --- a/gb.qt4/src/cpaint_impl.cpp +++ b/gb.qt4/src/cpaint_impl.cpp @@ -196,6 +196,7 @@ static int Begin(GB_PAINT *d) static void End(GB_PAINT *d) { void *device = d->device; + QT_PAINT_EXTRA *dx = EXTRA(d); if (GB.Is(device, CLASS_DrawingArea)) { @@ -216,19 +217,41 @@ static void End(GB_PAINT *d) PAINTER(d)->end(); // ?? } - delete EXTRA(d)->path; - delete EXTRA(d)->clip; - delete EXTRA(d)->painter; + if (dx->clipStack) + { + while (!dx->clipStack->isEmpty()) + delete dx->clipStack->takeLast(); + delete dx->clipStack; + } + + delete dx->path; + delete dx->clip; + delete dx->painter; } static void Save(GB_PAINT *d) { + QT_PAINT_EXTRA *dx = EXTRA(d); + PAINTER(d)->save(); + if (!dx->clipStack) + dx->clipStack = new QList; + dx->clipStack->append(new QPainterPath(*dx->clip)); } static void Restore(GB_PAINT *d) { + QT_PAINT_EXTRA *dx = EXTRA(d); + PAINTER(d)->restore(); + + if (dx->clipStack && !dx->clipStack->isEmpty()) + { + QPainterPath *path = dx->clipStack->takeLast(); + delete dx->clip; + dx->clip = new QPainterPath(*path); + delete path; + } } static void Antialias(GB_PAINT *d, int set, int *antialias) diff --git a/gb.qt4/src/gb.qt.h b/gb.qt4/src/gb.qt.h index 513cc3d90..b15abfe9b 100644 --- a/gb.qt4/src/gb.qt.h +++ b/gb.qt4/src/gb.qt.h @@ -108,6 +108,7 @@ typedef QPainterPath *path; QPainterPath *clip; int fillRule; + QList *clipStack; } QT_PAINT_EXTRA; diff --git a/main/gbc/gbc_read.c b/main/gbc/gbc_read.c index be74ad174..f2b2c5ef1 100644 --- a/main/gbc/gbc_read.c +++ b/main/gbc/gbc_read.c @@ -929,6 +929,8 @@ static void add_string() *p = '\r'; else if (car == 'b') *p = '\b'; + else if (car == 'v') + *p = '\v'; else if (car == 'f') *p = '\f'; else if (car == 'e') diff --git a/main/gbx/gbx_c_array.c b/main/gbx/gbx_c_array.c index bcc1990bf..ecb1bd0e2 100644 --- a/main/gbx/gbx_c_array.c +++ b/main/gbx/gbx_c_array.c @@ -1064,6 +1064,7 @@ END_METHOD BEGIN_METHOD(CARRAY_string_exist, GB_STRING value; GB_INTEGER mode) + //fprintf(stderr, "%s\n", DEBUG_get_current_position()); GB_ReturnBoolean(find_string(THIS, VARGOPT(mode, GB_COMP_BINARY), STRING(value), LENGTH(value), 0) >= 0); END_METHOD diff --git a/main/gbx/gbx_exec_loop.c b/main/gbx/gbx_exec_loop.c index f926957da..9f1680871 100644 --- a/main/gbx/gbx_exec_loop.c +++ b/main/gbx/gbx_exec_loop.c @@ -480,6 +480,7 @@ _MAIN: _SUBR_CODE: + //fprintf(stderr, "gbx3: %02X: %s\n", (code >> 8), DEBUG_get_current_position()); (*(EXEC_FUNC_CODE)SubrTable[(code >> 8) - 0x28])(code); //if (UNLIKELY(PCODE_is_void(code))) diff --git a/main/gbx/gbx_subr_string.c b/main/gbx/gbx_subr_string.c index 408de27c2..039d5d1c2 100644 --- a/main/gbx/gbx_subr_string.c +++ b/main/gbx/gbx_subr_string.c @@ -525,7 +525,7 @@ void SUBR_replace(ushort code) if (NPARAM == 4) nocase = SUBR_get_integer(&PARAM[3]) == GB_COMP_NOCASE; - if (lp == 0) + if (lp == 0 || ls == 0) { RELEASE(&PARAM[1]); RELEASE(&PARAM[2]); @@ -534,10 +534,26 @@ void SUBR_replace(ushort code) return; } - STRING_start_len(ls); - - if (ls > 0 && lp > 0) + if (lp == 1 && lr == 1) { + char cp = *pp; + char cr = *pr; + + ps = STRING_new_temp(ps, ls); + + for (pos = 0; pos < ls; pos++) + { + if (ps[pos] == cp) + ps[pos] = cr; + } + + RETURN->_string.addr = ps; + RETURN->_string.len = ls; + } + else + { + STRING_start_len(ls); + for(;;) { pos = STRING_search(ps, ls, pp, lp, 1, FALSE, nocase); @@ -561,12 +577,12 @@ void SUBR_replace(ushort code) } STRING_make(ps, ls); + RETURN->_string.addr = STRING_end_temp(); + RETURN->_string.len = STRING_length(RETURN->_string.addr); } RETURN->type = T_STRING; - RETURN->_string.addr = STRING_end_temp(); RETURN->_string.start = 0; - RETURN->_string.len = STRING_length(RETURN->_string.addr); SUBR_LEAVE(); } diff --git a/main/lib/eval/eval_read.c b/main/lib/eval/eval_read.c index 1a92093dd..aa8150818 100644 --- a/main/lib/eval/eval_read.c +++ b/main/lib/eval/eval_read.c @@ -957,6 +957,8 @@ static void add_string() *p = '\r'; else if (car == 'b') *p = '\b'; + else if (car == 'v') + *p = '\v'; else if (car == 'f') *p = '\f'; else if (car == 'e')