diff --git a/app/other/MakeWebSite/.settings b/app/other/MakeWebSite/.settings index 76898e187..298fc4fe6 100644 --- a/app/other/MakeWebSite/.settings +++ b/app/other/MakeWebSite/.settings @@ -36,9 +36,9 @@ SearchComment=False SearchString=True [OpenFile] -Active=1 File[1]="gambas.sourceforge.net/home.html.template:39.0" -File[2]="gambas.sourceforge.net/menu.html:59.0" +Active=2 +File[2]="gambas.sourceforge.net/menu.html:26.53" Count=2 [Watches] diff --git a/app/other/MakeWebSite/.src/MTranslation.module b/app/other/MakeWebSite/.src/MTranslation.module index d5369e1e9..7dfa6e013 100644 --- a/app/other/MakeWebSite/.src/MTranslation.module +++ b/app/other/MakeWebSite/.src/MTranslation.module @@ -18,6 +18,7 @@ Public Sub Load() $cTr["Readme"] = ("Readme") $cTr["Reporting a problem"] = ("Reporting a problem") $cTr["Resources"] = ("Resources") + $cTr["Bug tracker"] = ("Bug tracker") $cTr["Distributions & O.S."] = ("Distributions & O.S.") $cTr["Links"] = ("Links") $cTr["Mailing lists/Forums"] = ("Mailing lists/Forums") diff --git a/app/other/MakeWebSite/gambas.sourceforge.net/menu.html b/app/other/MakeWebSite/gambas.sourceforge.net/menu.html index 0e3c8d7a1..bf756e93e 100644 --- a/app/other/MakeWebSite/gambas.sourceforge.net/menu.html +++ b/app/other/MakeWebSite/gambas.sourceforge.net/menu.html @@ -25,6 +25,7 @@   About me 
  Acknowledgements 
--> {Resources}
+   {Bug tracker} 
  {Distributions & O.S.} 
  {Links} 
  {Mailing lists/Forums} 
diff --git a/examples/examples/Drawing/Painting/.src/FMain.class b/examples/examples/Drawing/Painting/.src/FMain.class index caf905116..cb97974dc 100644 --- a/examples/examples/Drawing/Painting/.src/FMain.class +++ b/examples/examples/Drawing/Painting/.src/FMain.class @@ -294,6 +294,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/gb.db.odbc/src/main.c b/gb.db.odbc/src/main.c index a1fe4f4b5..d491f16ee 100644 --- a/gb.db.odbc/src/main.c +++ b/gb.db.odbc/src/main.c @@ -1843,7 +1843,12 @@ fflush(stderr); SQLLEN nIndicatorRemarks; int compare = -1; ODBC_CONN *han = (ODBC_CONN *)db->handle; + int len; + len = strlen(table); + if (len == 0) + return FALSE; + retcode = SQLAllocHandle(SQL_HANDLE_STMT, han->odbcHandle, &statHandle); if ((retcode != SQL_SUCCESS) && (retcode != SQL_SUCCESS_WITH_INFO)) @@ -1851,12 +1856,9 @@ fflush(stderr); return FALSE; //V_OD_erg; } - - // EXECUTE OUR SQL/CALL if (SQL_SUCCESS != (nReturn = SQLTables(statHandle, 0, 0, 0, 0, 0, 0, 0, 0))) { - return FALSE; //nReturn; } @@ -1871,9 +1873,8 @@ fflush(stderr); while ((nReturn == SQL_SUCCESS || nReturn == SQL_SUCCESS_WITH_INFO) && compare != 0) { - //printf("le tabelle in comparazione %s : %s\n",szTableName,table); - compare = strncmp((char *)szTableName, table, sizeof(table)); + compare = strncmp((char *)szTableName, table, len); szTableName[0] = '\0'; szTableType[0] = '\0'; szTableRemarks[0] = '\0'; diff --git a/gb.gtk/src/cpaint_impl.cpp b/gb.gtk/src/cpaint_impl.cpp index 1c0eef7ce..71bc3cc95 100644 --- a/gb.gtk/src/cpaint_impl.cpp +++ b/gb.gtk/src/cpaint_impl.cpp @@ -989,6 +989,7 @@ GB_PAINT_DESC PAINT_Interface = RichTextExtents, Matrix, SetBrush, + NULL, { BrushFree, BrushColor, diff --git a/gb.qt4/src/cpaint_impl.cpp b/gb.qt4/src/cpaint_impl.cpp index 819444827..f15bf6b62 100644 --- a/gb.qt4/src/cpaint_impl.cpp +++ b/gb.qt4/src/cpaint_impl.cpp @@ -86,6 +86,9 @@ static bool init_painting(GB_PAINT *d, QPaintDevice *device) EXTRA(d)->painter = new QPainter(device); } + MyPaintEngine *engine = (MyPaintEngine *)device->paintEngine(); + engine->patchFeatures(); + EXTRA(d)->path = 0; EXTRA(d)->clip = 0; PAINTER(d)->setRenderHints(QPainter::Antialiasing, true); @@ -739,6 +742,13 @@ static void SetBrush(GB_PAINT *d, GB_BRUSH brush) //PAINTER(d)->setBrushOrigin(QPointF((qreal)x, (qreal)y)); } +static void DrawImage(GB_PAINT *d, GB_IMAGE image, float x, float y, float w, float h) +{ + QImage *img = CIMAGE_get((CIMAGE *)image); + QRectF rect(x, y, w, h); + + PAINTER(d)->drawImage(rect, *img); +} static void BrushFree(GB_BRUSH brush) { @@ -925,6 +935,7 @@ GB_PAINT_DESC PAINT_Interface = { RichTextExtents, Matrix, SetBrush, + DrawImage, { BrushFree, BrushColor, @@ -989,6 +1000,21 @@ void PAINT_clip(int x, int y, int w, int h) MyPaintEngine::MyPaintEngine() : QPaintEngine(0) {} MyPaintEngine::~MyPaintEngine() {} +void MyPaintEngine::patchFeatures() +{ + if (!(gccaps & QPaintEngine::PerspectiveTransform)) + { + QPaintEngine::PaintEngineFeatures f = QPaintEngine::AllFeatures; + f &= (QPaintEngine::PorterDuff | QPaintEngine::PerspectiveTransform + | QPaintEngine::ObjectBoundingModeGradients + | QPaintEngine::LinearGradientFill + | QPaintEngine::RadialGradientFill + | QPaintEngine::ConicalGradientFill); + qWarning("warning: patching current paint engine"); + gccaps = f; //PerspectiveTransform; + } +} + bool MyPaintEngine::begin(QPaintDevice *pdev) { setActive(true); diff --git a/gb.qt4/src/cpaint_impl.h b/gb.qt4/src/cpaint_impl.h index b1897a219..44f0aba4b 100644 --- a/gb.qt4/src/cpaint_impl.h +++ b/gb.qt4/src/cpaint_impl.h @@ -69,6 +69,8 @@ public: //virtual QPoint coordinateOffset() const; virtual Type type() const; + + void patchFeatures(); }; class MyPaintDevice: public QPaintDevice diff --git a/gb.qt4/src/cprinter.cpp b/gb.qt4/src/cprinter.cpp index 9b2ba7807..c64b2c798 100644 --- a/gb.qt4/src/cprinter.cpp +++ b/gb.qt4/src/cprinter.cpp @@ -167,6 +167,7 @@ BEGIN_METHOD_VOID(Printer_new) THIS->printer = new QPrinter(QPrinter::HighResolution); THIS->num_copies = 1; + THIS->page_count = 1; END_METHOD diff --git a/main/lib/draw/cpaint.c b/main/lib/draw/cpaint.c index 3edd2ccda..f95a9400a 100644 --- a/main/lib/draw/cpaint.c +++ b/main/lib/draw/cpaint.c @@ -828,6 +828,72 @@ BEGIN_METHOD(Paint_Rotate, GB_FLOAT angle) END_METHOD +BEGIN_METHOD(Paint_DrawImage, GB_OBJECT image; GB_FLOAT x; GB_FLOAT y; GB_FLOAT width; GB_FLOAT height) + + PAINT_BRUSH *pb; + GB_BRUSH brush; + GB_IMG *image; + GB_TRANSFORM transform; + float x, y, w, h; + + CHECK_DEVICE(); + + if (GB.CheckObject(VARG(image))) + return; + + x = VARG(x); + y = VARG(y); + w = VARG(width); + h = VARG(height); + + if (GB.CheckObject(VARG(image))) + return; + + if (w <= 0.0 || h <= 0.0) + return; + + if (PAINT->DrawImage) + { + PAINT->DrawImage(THIS, VARG(image), x, y, w, h); + return; + } + + image = (GB_IMG *)VARG(image); + + if (image->width <= 0 || image->height <= 0) + return; + + PAINT->Brush.Image(&brush, (GB_IMAGE)image); + pb = make_brush(THIS, brush); + GB.Ref(pb); + +// hBrush = Paint.Image(hImage) +// hBrush.Translate(X, Y) +// hBrush.Scale(W / hImage.W, H / hImage.H) + + PAINT->Transform.Create(&transform); + PAINT->Transform.Translate(transform, x, y); + //PAINT->Transform.Scale(transform, w / image->width, h / image->height); + fprintf(stderr, "brush %g %g %g %g %d %d\n", x, y, w, h, image->width, image->height); + PAINT->Brush.Matrix(brush, TRUE, transform); + PAINT->Transform.Delete(&transform); + +// Paint.Brush = hBrush + + PAINT->SetBrush(THIS, brush); + +// Paint.Rectangle(X, Y, W, H) + PAINT->NewPath(THIS); + PAINT->Rectangle(THIS, x, y, w, h); + PAINT->Fill(THIS, FALSE); + + if (THIS->brush) + PAINT->SetBrush(THIS, THIS->brush->brush); + + GB.Unref(POINTER(&pb)); + +END_METHOD + GB_DESC PaintDesc[] = { GB_DECLARE("Paint", 0), GB_VIRTUAL_CLASS(), @@ -893,6 +959,7 @@ GB_DESC PaintDesc[] = GB_STATIC_METHOD("Stroke", NULL, Paint_Stroke, "[(Preserve)b]"), //GB_STATIC_PROPERTY_READ("StrokeExtents", "PaintExtents", Paint_StrokeExtents), //GB_STATIC_METHOD("InStroke", "b", Paint_InStroke, "(X)f(Y)f"), + GB_STATIC_METHOD("DrawImage", NULL, Paint_DrawImage, "(Image)Image;(X)f(Y)f(Width)f(Height)f"), GB_STATIC_PROPERTY_READ("PathExtents", "PaintExtents", Paint_PathExtents), GB_STATIC_METHOD("PathContains", "b", Paint_PathContains, "(X)f(Y)f"), diff --git a/main/lib/draw/gb.paint.h b/main/lib/draw/gb.paint.h index e0aa3f855..e7f0816af 100644 --- a/main/lib/draw/gb.paint.h +++ b/main/lib/draw/gb.paint.h @@ -171,6 +171,8 @@ typedef void (*SetBrush)(GB_PAINT *d, GB_BRUSH brush); + void (*DrawImage)(GB_PAINT *d, GB_IMAGE image, float x, float y, float w, float h); + struct { void (*Free)(GB_BRUSH brush); void (*Color)(GB_BRUSH *brush, GB_COLOR color); diff --git a/main/share/gb_common.h b/main/share/gb_common.h index 014be6d94..e8d6ab1fe 100644 --- a/main/share/gb_common.h +++ b/main/share/gb_common.h @@ -1,21 +1,21 @@ /*************************************************************************** - gb_common.h + gb_common.h - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ***************************************************************************/ @@ -63,8 +63,8 @@ typedef unsigned long ulong; #if defined(OS_FREEBSD) || defined(OS_OPENBSD) - /* sighandler_t is replaced by sig_t */ - #define sighandler_t sig_t + /* sighandler_t is replaced by sig_t */ + #define sighandler_t sig_t typedef unsigned long ulong; @@ -75,28 +75,28 @@ typedef unsigned long ulong; #endif #ifdef OS_FREEBSD - /* finite is replaced by isfinite */ - #define finite isfinite + /* finite is replaced by isfinite */ + #define finite isfinite #endif #ifdef OS_SOLARIS - /* PGS: The following #define prevents /usr/include/sys/mman.h on solaris - from #define'ing PRIVATE to 0x20, thus breaking Gambas. - Perhaps Gambas should use a different name? - BM: I don't use PRIVATE anymore! - */ - #ifdef _POSIX_C_SOURCE - /* PGS: Stop compiler warnings when gcc on solaris does remember to define - _POSIX_C_SOURCE, e.g. when compiling qt related files. */ - #undef _POSIX_C_SOURCE - #endif +/* PGS: The following #define prevents /usr/include/sys/mman.h on solaris + from #define'ing PRIVATE to 0x20, thus breaking Gambas. + Perhaps Gambas should use a different name? + BM: I don't use PRIVATE anymore! +*/ + #ifdef _POSIX_C_SOURCE + /* PGS: Stop compiler warnings when gcc on solaris does remember to define + _POSIX_C_SOURCE, e.g. when compiling qt related files. */ + #undef _POSIX_C_SOURCE + #endif - #define _POSIX_C_SOURCE 3 - /* Get prototype for alloca() */ - #include - /* Get definition for index() */ - #include + #define _POSIX_C_SOURCE 3 + /* Get prototype for alloca() */ + #include + /* Get definition for index() */ + #include #endif @@ -109,28 +109,28 @@ typedef unsigned long ulong; #if !defined(__cplusplus) - #ifndef FALSE - enum - { - FALSE = 0, - TRUE = 1 - }; - #endif + #ifndef FALSE + enum + { + FALSE = 0, + TRUE = 1 + }; + #endif - typedef - char boolean; + typedef + char boolean; - typedef - char bool; + typedef + char bool; #endif typedef - unsigned char uchar; - + unsigned char uchar; + typedef size_t offset_t; - + #define PUBLIC #define INLINE __inline__ #define EXTERN extern @@ -152,7 +152,7 @@ typedef #define NO_WARNING(var) var = var #ifndef offsetof - #define offsetof(_type, _arg) ((size_t)&(((_type *)0)->_arg)) + #define offsetof(_type, _arg) ((size_t)&(((_type *)0)->_arg)) #endif #define Max(a, b) ({ int _a = (a), _b = (b); _a > _b ? _a : _b; }) @@ -170,10 +170,10 @@ typedef #endif /* __i386__ */ #define COPYRIGHT "(c) 2000-2010 Benoit Minisini\n\n" \ - "This program is free software; you can redistribute it and/or \n" \ - "modify it under the terms of the GNU General Public License as \n" \ - "published by the Free Software Foundation; either version 2, or \n" \ - "(at your option) any later version.\n\n" + "This program is free software; you can redistribute it and/or \n" \ + "modify it under the terms of the GNU General Public License as \n" \ + "published by the Free Software Foundation; either version 2, or \n" \ + "(at your option) any later version.\n\n" #define LIKELY(_x) __builtin_expect((_x), 1) #define UNLIKELY(_x) __builtin_expect((_x), 0)