Author: manolo
Date: 2012-04-01 10:47:15 -0700 (Sun, 01 Apr 2012)
New Revision: 9314
Log:
Further extending FLTK1 compatibility: pixmap & pixmap_browser demos compile & 
run.

Modified:
   branches/branch-3.0/include/FL/Fl_Image.H
   branches/branch-3.0/include/FL/Fl_Widget.H
   branches/branch-3.0/include/fltk3/Wrapper.h

Modified: branches/branch-3.0/include/FL/Fl_Image.H
===================================================================
--- branches/branch-3.0/include/FL/Fl_Image.H   2012-03-30 17:38:19 UTC (rev 
9313)
+++ branches/branch-3.0/include/FL/Fl_Image.H   2012-04-01 17:47:15 UTC (rev 
9314)
@@ -93,6 +93,18 @@
 
 public:
 
+  virtual Fl_Image* copy(int w, int h) {
+    fltk3::Image* ret = 0;
+    if ( pVCalls & pVCallImageCopyWH ) {
+      ret = ((fltk3::Image_I*)_p)->copy(w, h);
+    } else {
+      pVCalls |= pVCallImageCopyWH;
+      ret = ((fltk3::Image_I*)_p)->copy(w, h);
+      pVCalls &= ~pVCallImageCopyWH;
+    }
+    return new Fl_Image( ret );
+  }
+  
   FLTK3_IMAGE_VCALLS(Fl_Image, Image)
 
   Fl_Image() { }

Modified: branches/branch-3.0/include/FL/Fl_Widget.H
===================================================================
--- branches/branch-3.0/include/FL/Fl_Widget.H  2012-03-30 17:38:19 UTC (rev 
9313)
+++ branches/branch-3.0/include/FL/Fl_Widget.H  2012-04-01 17:47:15 UTC (rev 
9314)
@@ -329,7 +329,7 @@
   }
   
   void image(Fl_Image* img) {
-    ((fltk3::Widget_I*)_p)->image( (fltk3::Image*)(img->_p) );
+    ((fltk3::Widget_I*)_p)->image( img?(fltk3::Image*)(img->_p):0 );
   }
   
   void image(Fl_Image& img) {

Modified: branches/branch-3.0/include/fltk3/Wrapper.h
===================================================================
--- branches/branch-3.0/include/fltk3/Wrapper.h 2012-03-30 17:38:19 UTC (rev 
9313)
+++ branches/branch-3.0/include/fltk3/Wrapper.h 2012-04-01 17:47:15 UTC (rev 
9314)
@@ -315,6 +315,7 @@
   FLTK3_WIDGET_VCALLS(type1, type3) \
   FLTK3_WRAPPER_VCALLS_WIDGET(type3##_I, draw_overlay(), draw_overlay(), 
DrawOverlay)
 
+/*
 #define FLTK3_IMAGE_VCALLS(type1, type3) \
   FLTK3_WRAPPER_VCALLS_OBJECT_DTOR(type1, type3##_I) \
   FLTK3_WRAPPER_VCALLS_IMAGE_RET(fltk3::Image *, type3##_I, copy(int w, int 
h), copy(w, h), CopyWH) \
@@ -324,6 +325,15 @@
   FLTK3_WRAPPER_VCALLS_IMAGE(type3##_I, label(Fl_Menu_Item *w), 
label((fltk3::MenuItem*)w), LabelM) \
   FLTK3_WRAPPER_VCALLS_IMAGE(type3##_I, draw(int X, int Y, int W, int H, int 
cx=0, int cy=0), draw(X, Y, W, H, cx, cy), Draw) \
   FLTK3_WRAPPER_VCALLS_IMAGE(type3##_I, uncache(), uncache(), Uncache)
+*/
+#define FLTK3_IMAGE_VCALLS(type1, type3) \
+FLTK3_WRAPPER_VCALLS_OBJECT_DTOR(type1, type3##_I) \
+FLTK3_WRAPPER_VCALLS_IMAGE(type3##_I, color_average(Fl_Color c, float i), 
color_average(fltk3::_1to3_color(c), i), ColorAverage) \
+FLTK3_WRAPPER_VCALLS_IMAGE(type3##_I, desaturate(), desaturate(), Desaturate) \
+FLTK3_WRAPPER_VCALLS_IMAGE(type3##_I, label(Fl_Widget *w), 
label(fltk3::_1to3_widget(w)), LabelW) \
+FLTK3_WRAPPER_VCALLS_IMAGE(type3##_I, label(Fl_Menu_Item *w), 
label((fltk3::MenuItem*)w), LabelM) \
+FLTK3_WRAPPER_VCALLS_IMAGE(type3##_I, draw(int X, int Y, int W, int H, int 
cx=0, int cy=0), draw(X, Y, W, H, cx, cy), Draw) \
+FLTK3_WRAPPER_VCALLS_IMAGE(type3##_I, uncache(), uncache(), Uncache)
 
 
 namespace fltk3 {

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to