Author: matt
Date: 2011-07-13 07:26:13 -0700 (Wed, 13 Jul 2011)
New Revision: 8861
Log:
123: Imporving the independence of the FLTK1 wrapper

Modified:
   branches/branch-3.0/FL/Fl_Adjuster.H
   branches/branch-3.0/FL/Fl_Box.H
   branches/branch-3.0/FL/Fl_Widget.H
   branches/branch-3.0/fltk3/Adjuster.h
   branches/branch-3.0/fltk3/Box.h
   branches/branch-3.0/fltk3/Wrapper.h
   branches/branch-3.0/src/Fl_Adjuster.cxx
   branches/branch-3.0/src/Fl_Box.cxx

Modified: branches/branch-3.0/FL/Fl_Adjuster.H
===================================================================
--- branches/branch-3.0/FL/Fl_Adjuster.H        2011-07-13 14:25:30 UTC (rev 
8860)
+++ branches/branch-3.0/FL/Fl_Adjuster.H        2011-07-13 14:26:13 UTC (rev 
8861)
@@ -33,33 +33,36 @@
 #include "Fl_Valuator.H"
 
 
+FLTK3_WRAPPER_INTERFACE_BEGIN(Fl_Adjuster, Adjuster)
+FLTK3_WRAPPER_INTERFACE_WIDGET(Fl_Adjuster, Adjuster)
+FLTK3_WRAPPER_INTERFACE_END()
+
+
 class FL_EXPORT Fl_Adjuster : public Fl_Valuator {
   
 protected:
   
-  FLTK3_WRAPPER_VCALLS_OBJECT(Adjuster, draw(), draw(), Draw)
-  
-  FLTK3_WRAPPER_VCALLS_OBJECT_RET(int, Adjuster, handle(int event), 
handle(event), Handle)
-    
   void value_damage() {
-    ((fltk3::Adjuster*)_p)->value_damage();
+    ((fltk3::Adjuster_I*)_p)->value_damage();
   }
   
 public:
   
+  FLTK3_WIDGET_VCALLS(Adjuster)
+  
   Fl_Adjuster() { /* empty */ }
   
   Fl_Adjuster(int x, int y, int w, int h, const char *label=0) {
-    _p = new fltk3::Adjuster(x, y, w, h, label);
+    _p = new fltk3::Adjuster_I(x, y, w, h, label);
     _p->wrapper(this);
   }
 
   void soft(int s) {
-    ((fltk3::Adjuster*)_p)->soft(s);
+    ((fltk3::Adjuster_I*)_p)->soft(s);
   }
   
   int soft() const {
-    return ((fltk3::Adjuster*)_p)->soft();
+    return ((fltk3::Adjuster_I*)_p)->soft();
   }
 };
 

Modified: branches/branch-3.0/FL/Fl_Box.H
===================================================================
--- branches/branch-3.0/FL/Fl_Box.H     2011-07-13 14:25:30 UTC (rev 8860)
+++ branches/branch-3.0/FL/Fl_Box.H     2011-07-13 14:26:13 UTC (rev 8861)
@@ -32,15 +32,20 @@
 #include <fltk3/Box.h>
 #include "Fl_Widget.H"
 
+
+FLTK3_WRAPPER_INTERFACE_BEGIN(Fl_Box, Box)
+FLTK3_WRAPPER_INTERFACE_WIDGET(Fl_Box, Box)
+FLTK3_WRAPPER_INTERFACE_END()
+
+
 class FL_EXPORT Fl_Box : public Fl_Widget {
 
-protected:
-  
-  FLTK3_WRAPPER_VCALLS_OBJECT(Box, draw(), draw(), Draw)
+public:
 
-public:
+  FLTK3_WIDGET_VCALLS(Box)
+
   Fl_Box(int x, int y, int w, int h, const char *label=0) {
-    _p = new fltk3::Box(x, y, w, h, label);
+    _p = new fltk3::Box_I(x, y, w, h, label);
     _p->wrapper(this);
   }
   
@@ -49,9 +54,9 @@
     _p->wrapper(this);
   }
   
-  FLTK3_WRAPPER_VCALLS_OBJECT_RET(int, Box, handle(int event), handle(event), 
Handle)
 };
 
+
 #endif
 
 //

Modified: branches/branch-3.0/FL/Fl_Widget.H
===================================================================
--- branches/branch-3.0/FL/Fl_Widget.H  2011-07-13 14:25:30 UTC (rev 8860)
+++ branches/branch-3.0/FL/Fl_Widget.H  2011-07-13 14:26:13 UTC (rev 8861)
@@ -75,37 +75,10 @@
 };
 #endif
 
-class Fl_Widget;
+FLTK3_WRAPPER_INTERFACE_BEGIN(Fl_Widget, Widget)
+FLTK3_WRAPPER_INTERFACE_WIDGET(Fl_Widget, Widget)
+FLTK3_WRAPPER_INTERFACE_END()
 
-namespace fltk3 {
-  class Widget_W : public Widget {
-    friend class ::Fl_Widget;
-  public:
-    Widget_W(int x, int y, int w, int h, const char *l) 
-    : Widget(x, y, w, h, l) { }
-    void show() {
-      FLTK3_OBJECT_VCALLS_WRAPPER(show(), Show)
-      Widget::show();
-    }
-    void hide() {
-      FLTK3_OBJECT_VCALLS_WRAPPER(hide(), Hide)
-      Widget::hide();
-    }
-    void resize(int X, int Y, int W, int H) {
-      FLTK3_OBJECT_VCALLS_WRAPPER(resize(X, Y, W, H), Resize)
-      Widget::resize(X, Y, W, H);
-    }
-    void draw() {
-      FLTK3_OBJECT_VCALLS_WRAPPER(draw(), Draw)
-      Widget::draw();
-    }
-    int handle(int event) {
-      FLTK3_OBJECT_VCALLS_WRAPPER_RET(int, handle(event), Handle)
-      return Widget::handle(event);
-    }
-  };
-}
-
 class FL_EXPORT Fl_Widget : public fltk3::WidgetWrapper {
   
   friend class Fl_Group;
@@ -113,31 +86,31 @@
 protected:
   
   void x(int v) {
-    ((fltk3::Widget_W*)_p)->x(v);
+    ((fltk3::Widget_I*)_p)->x(v);
   }
   
   void y(int v) {
-    ((fltk3::Widget_W*)_p)->y(v);
+    ((fltk3::Widget_I*)_p)->y(v);
   }
   
   void w(int v) {
-    ((fltk3::Widget_W*)_p)->w(v);
+    ((fltk3::Widget_I*)_p)->w(v);
   }
   
   void h(int v) {
-    ((fltk3::Widget_W*)_p)->h(v);
+    ((fltk3::Widget_I*)_p)->h(v);
   }
   
   unsigned int flags() const {
-    return ((fltk3::Widget_W*)_p)->flags();
+    return ((fltk3::Widget_I*)_p)->flags();
   }
   
   void set_flag(unsigned int c) {
-    ((fltk3::Widget_W*)_p)->set_flag(c);
+    ((fltk3::Widget_I*)_p)->set_flag(c);
   }
   
   void clear_flag(unsigned int c) {
-    ((fltk3::Widget_W*)_p)->clear_flag(c);
+    ((fltk3::Widget_I*)_p)->clear_flag(c);
   }
   
   enum {
@@ -165,35 +138,35 @@
   };
   
   void draw_box() const {
-    ((fltk3::Widget_W*)_p)->draw_box();
+    ((fltk3::Widget_I*)_p)->draw_box();
   }
   
   void draw_box(Fl_Boxtype t, Fl_Color c) const {
-    ((fltk3::Widget_W*)_p)->draw_box(fltk3::_1to3_boxtype(t), 
fltk3::_1to3_color(c));
+    ((fltk3::Widget_I*)_p)->draw_box(fltk3::_1to3_boxtype(t), 
fltk3::_1to3_color(c));
   }
   
   void draw_box(Fl_Boxtype t, int x,int y,int w,int h, Fl_Color c) const {
-    ((fltk3::Widget_W*)_p)->draw_box(fltk3::_1to3_boxtype(t), x, y, w, h, 
fltk3::_1to3_color(c));
+    ((fltk3::Widget_I*)_p)->draw_box(fltk3::_1to3_boxtype(t), x, y, w, h, 
fltk3::_1to3_color(c));
   }
   
   void draw_backdrop() const {
-    ((fltk3::Widget_W*)_p)->draw_backdrop();
+    ((fltk3::Widget_I*)_p)->draw_backdrop();
   }
   
   void draw_focus() {
-    ((fltk3::Widget_W*)_p)->draw_focus();
+    ((fltk3::Widget_I*)_p)->draw_focus();
   }
   
   void draw_focus(Fl_Boxtype t, int x,int y,int w,int h) const {
-    ((fltk3::Widget_W*)_p)->draw_focus(fltk3::_1to3_boxtype(t), x, y, w, h);
+    ((fltk3::Widget_I*)_p)->draw_focus(fltk3::_1to3_boxtype(t), x, y, w, h);
   }
   
   void draw_label() const {
-    ((fltk3::Widget_W*)_p)->draw_label();
+    ((fltk3::Widget_I*)_p)->draw_label();
   }
   
   void draw_label(int x, int y, int w, int h) const {
-    ((fltk3::Widget_W*)_p)->draw_label(x, y, w, h);
+    ((fltk3::Widget_I*)_p)->draw_label(x, y, w, h);
   }
   
 public:
@@ -201,7 +174,7 @@
   Fl_Widget() { /*blank */ }
 
   Fl_Widget(int x, int y, int w, int h, const char *label=0L) {
-    _p = new fltk3::Widget_W(x, y, w, h, label);
+    _p = new fltk3::Widget_I(x, y, w, h, label);
     _p->wrapper(this);
   }
 
@@ -211,7 +184,7 @@
   
   FLTK3_WRAPPER_VCALLS_OBJECT(Widget, show(), show(), Show)
 
-  FLTK3_WRAPPER_VCALLS_OBJECT(Widget_W, draw(), draw(), Draw)
+  FLTK3_WRAPPER_VCALLS_OBJECT(Widget_I, draw(), draw(), Draw)
 
   FLTK3_WRAPPER_VCALLS_OBJECT_RET(int, Widget, handle(int event), 
handle(event), Handle)
   
@@ -222,378 +195,378 @@
   virtual class Fl_Gl_Window* as_gl_window() {return 0;}
   
   Fl_Group *parent() const {
-    return fltk3::_3to1_group( ((fltk3::Widget_W*)_p)->parent() );
+    return fltk3::_3to1_group( ((fltk3::Widget_I*)_p)->parent() );
   }
   
   void parent(Fl_Group* p) {
-    ((fltk3::Widget_W*)_p)->parent( ((fltk3::Group*)((Fl_Widget*)p)->_p) );
+    ((fltk3::Widget_I*)_p)->parent( ((fltk3::Group*)((Fl_Widget*)p)->_p) );
   }
   
   Fl_Window* window() const {
-    return fltk3::_3to1_window( ((fltk3::Widget_W*)_p)->window() );
+    return fltk3::_3to1_window( ((fltk3::Widget_I*)_p)->window() );
   }
 
   uchar type() const {
-    return ((fltk3::Widget_W*)_p)->type();
+    return ((fltk3::Widget_I*)_p)->type();
   }
   
   void type(uchar t) {
-    ((fltk3::Widget_W*)_p)->type(t);
+    ((fltk3::Widget_I*)_p)->type(t);
   }
   
   int x() const {
-    return ((fltk3::Widget_W*)_p)->x();
+    return ((fltk3::Widget_I*)_p)->x();
   }
   
   int y() const {
-    return ((fltk3::Widget_W*)_p)->y();
+    return ((fltk3::Widget_I*)_p)->y();
   }
   
   int w() const {
-    return ((fltk3::Widget_W*)_p)->w();
+    return ((fltk3::Widget_I*)_p)->w();
   }
   
   int h() const {
-    return ((fltk3::Widget_W*)_p)->h();
+    return ((fltk3::Widget_I*)_p)->h();
   }
   
   int damage_resize(int,int,int,int);
   
   void position(int x, int y) {
-    ((fltk3::Widget_W*)_p)->position(x, y);;
+    ((fltk3::Widget_I*)_p)->position(x, y);;
   }
   
   void size(int w, int h) {
-    ((fltk3::Widget_W*)_p)->size(w, h);;
+    ((fltk3::Widget_I*)_p)->size(w, h);;
   }
   
   Fl_Align align() const {
-    return fltk3::_3to1_align(((fltk3::Widget_W*)_p)->align());
+    return fltk3::_3to1_align(((fltk3::Widget_I*)_p)->align());
   }
   
   void align(Fl_Align a) {
-    ((fltk3::Widget_W*)_p)->align(fltk3::_1to3_align(a));
+    ((fltk3::Widget_I*)_p)->align(fltk3::_1to3_align(a));
   }
   
   Fl_Boxtype box() const {
-    return fltk3::_3to1_boxtype(((fltk3::Widget_W*)_p)->box());
+    return fltk3::_3to1_boxtype(((fltk3::Widget_I*)_p)->box());
   }
   
   void box(Fl_Boxtype new_box) {
-    ((fltk3::Widget_W*)_p)->box( fltk3::_1to3_boxtype(new_box) );
+    ((fltk3::Widget_I*)_p)->box( fltk3::_1to3_boxtype(new_box) );
   }
   
   Fl_Color color() const {
-    return fltk3::_3to1_color( ((fltk3::Widget_W*)_p)->color() );
+    return fltk3::_3to1_color( ((fltk3::Widget_I*)_p)->color() );
   }
 
   void color(Fl_Color bg) {
-    ((fltk3::Widget_W*)_p)->color( fltk3::_1to3_color(bg) );
+    ((fltk3::Widget_I*)_p)->color( fltk3::_1to3_color(bg) );
   }
   
   Fl_Color selection_color() const {
-    return fltk3::_3to1_color( ((fltk3::Widget_W*)_p)->selection_color() );
+    return fltk3::_3to1_color( ((fltk3::Widget_I*)_p)->selection_color() );
   }
     
   void selection_color(Fl_Color a) {
-    ((fltk3::Widget_W*)_p)->selection_color( fltk3::_1to3_color(a) );
+    ((fltk3::Widget_I*)_p)->selection_color( fltk3::_1to3_color(a) );
   }
   
   void color(Fl_Color bg, Fl_Color sel) {
-    ((fltk3::Widget_W*)_p)->color( fltk3::_1to3_color(bg), 
fltk3::_1to3_color(sel) );
+    ((fltk3::Widget_I*)_p)->color( fltk3::_1to3_color(bg), 
fltk3::_1to3_color(sel) );
   }
   
   const char* label() const {
-    return ((fltk3::Widget_W*)_p)->label();
+    return ((fltk3::Widget_I*)_p)->label();
   }
   
   void label(const char* text) {
-    ((fltk3::Widget_W*)_p)->label(text);
+    ((fltk3::Widget_I*)_p)->label(text);
   }
   
   void copy_label(const char *new_label) {
-    ((fltk3::Widget_W*)_p)->label(new_label);
+    ((fltk3::Widget_I*)_p)->label(new_label);
   }
     
   void label(Fl_Labeltype a, const char* b) {
-    ((fltk3::Widget_W*)_p)->label( fltk3::_1to3_labeltype(a), b );
+    ((fltk3::Widget_I*)_p)->label( fltk3::_1to3_labeltype(a), b );
   }
   
   Fl_Color labelcolor() const {
-    return fltk3::_3to1_color( ((fltk3::Widget_W*)_p)->labelcolor() );
+    return fltk3::_3to1_color( ((fltk3::Widget_I*)_p)->labelcolor() );
   }
   
   void labelcolor(Fl_Color c) {
-    ((fltk3::Widget_W*)_p)->labelcolor( fltk3::_1to3_color(c) );
+    ((fltk3::Widget_I*)_p)->labelcolor( fltk3::_1to3_color(c) );
   }
 
   Fl_Labeltype labeltype() const {
-    return fltk3::_3to1_labeltype( ((fltk3::Widget_W*)_p)->labeltype() );
+    return fltk3::_3to1_labeltype( ((fltk3::Widget_I*)_p)->labeltype() );
   }
   
   void labeltype(Fl_Labeltype a) {
-    ((fltk3::Widget_W*)_p)->labeltype( fltk3::_1to3_labeltype(a) );
+    ((fltk3::Widget_I*)_p)->labeltype( fltk3::_1to3_labeltype(a) );
   }
   
   
   Fl_Font labelfont() const {
-    return fltk3::_3to1_font( ((fltk3::Widget_W*)_p)->labelfont() );
+    return fltk3::_3to1_font( ((fltk3::Widget_I*)_p)->labelfont() );
   }
   
   void labelfont(Fl_Font f) {
-    ((fltk3::Widget_W*)_p)->labelfont( fltk3::_1to3_font(f) );
+    ((fltk3::Widget_I*)_p)->labelfont( fltk3::_1to3_font(f) );
   }
   
   Fl_Fontsize labelsize() const {
-    return fltk3::_3to1_fontsize( ((fltk3::Widget_W*)_p)->labelsize() );
+    return fltk3::_3to1_fontsize( ((fltk3::Widget_I*)_p)->labelsize() );
   }
   
   void labelsize(Fl_Fontsize pix) {
-    ((fltk3::Widget_W*)_p)->labelsize( fltk3::_1to3_fontsize(pix) );
+    ((fltk3::Widget_I*)_p)->labelsize( fltk3::_1to3_fontsize(pix) );
   }
 
   Fl_Image* image() {
-    return fltk3::_3to1_image(((fltk3::Widget_W*)_p)->image());
+    return fltk3::_3to1_image(((fltk3::Widget_I*)_p)->image());
   }
   
   const Fl_Image* image() const {
-    return fltk3::_3to1_image(((fltk3::Widget_W*)_p)->image());
+    return fltk3::_3to1_image(((fltk3::Widget_I*)_p)->image());
   }
   
   void image(Fl_Image* img) {
-    ((fltk3::Widget_W*)_p)->image( (fltk3::Image*)(img->_p) );
+    ((fltk3::Widget_I*)_p)->image( (fltk3::Image*)(img->_p) );
   }
   
   void image(Fl_Image& img) {
-    ((fltk3::Widget_W*)_p)->image( *(fltk3::Image*)(img._p) );
+    ((fltk3::Widget_I*)_p)->image( *(fltk3::Image*)(img._p) );
   }
   
   Fl_Image* deimage() {
-    return fltk3::_3to1_image(((fltk3::Widget_W*)_p)->deimage());
+    return fltk3::_3to1_image(((fltk3::Widget_I*)_p)->deimage());
   }
   
   const Fl_Image* deimage() const {
-    return fltk3::_3to1_image(((fltk3::Widget_W*)_p)->deimage());
+    return fltk3::_3to1_image(((fltk3::Widget_I*)_p)->deimage());
   }
   
   void deimage(Fl_Image* img) {
-    ((fltk3::Widget_W*)_p)->deimage( (fltk3::Image*)(img->_p) );
+    ((fltk3::Widget_I*)_p)->deimage( (fltk3::Image*)(img->_p) );
   }
   
   void deimage(Fl_Image& img) {
-    ((fltk3::Widget_W*)_p)->deimage( *(fltk3::Image*)(img._p) );
+    ((fltk3::Widget_I*)_p)->deimage( *(fltk3::Image*)(img._p) );
   }
   
   const char *tooltip() const {
-    return ((fltk3::Widget_W*)_p)->tooltip();
+    return ((fltk3::Widget_I*)_p)->tooltip();
   }
   
   void tooltip(const char *text) {
-    ((fltk3::Widget_W*)_p)->tooltip(text);
+    ((fltk3::Widget_I*)_p)->tooltip(text);
   }
   
   void copy_tooltip(const char *text) {
-    ((fltk3::Widget_W*)_p)->copy_tooltip(text);
+    ((fltk3::Widget_I*)_p)->copy_tooltip(text);
   }
   
   Fl_Callback_p callback() const {
-    return (Fl_Callback_p)((fltk3::Widget_W*)_p)->callback();
+    return (Fl_Callback_p)((fltk3::Widget_I*)_p)->callback();
   }
   
   void callback(Fl_Callback* cb, void* p) {
-    ((fltk3::Widget_W*)_p)->callback( (fltk3::Callback*)cb, p );
+    ((fltk3::Widget_I*)_p)->callback( (fltk3::Callback*)cb, p );
   }
   
   void callback(Fl_Callback* cb) {
-    ((fltk3::Widget_W*)_p)->callback( (fltk3::Callback*)cb );
+    ((fltk3::Widget_I*)_p)->callback( (fltk3::Callback*)cb );
   }
   
   void callback(Fl_Callback0*cb) {
-    ((fltk3::Widget_W*)_p)->callback( (fltk3::Callback0*)cb );
+    ((fltk3::Widget_I*)_p)->callback( (fltk3::Callback0*)cb );
   }
   
   void callback(Fl_Callback1*cb, long p=0) {
-    ((fltk3::Widget_W*)_p)->callback( (fltk3::Callback1*)cb, p );
+    ((fltk3::Widget_I*)_p)->callback( (fltk3::Callback1*)cb, p );
   }
 
   void *user_data() const {
-    return ((fltk3::Widget_W*)_p)->user_data();
+    return ((fltk3::Widget_I*)_p)->user_data();
   }
   
   void user_data(void *v) {
-    ((fltk3::Widget_W*)_p)->user_data(v);
+    ((fltk3::Widget_I*)_p)->user_data(v);
   }
   
   long argument() const {
-    return ((fltk3::Widget_W*)_p)->argument();
+    return ((fltk3::Widget_I*)_p)->argument();
   }
   
   void argument(long v) {
-    ((fltk3::Widget_W*)_p)->argument(v);
+    ((fltk3::Widget_I*)_p)->argument(v);
   }
   
   Fl_When when() const {
-    return fltk3::_3to1_when( ((fltk3::Widget_W*)_p)->when() );
+    return fltk3::_3to1_when( ((fltk3::Widget_I*)_p)->when() );
   }
   
   void when(uchar i) {
-    ((fltk3::Widget_W*)_p)->when( fltk3::_1to3_when((Fl_When)i) );
+    ((fltk3::Widget_I*)_p)->when( fltk3::_1to3_when((Fl_When)i) );
   }
   
   unsigned int visible() const {
-    return ((fltk3::Widget_W*)_p)->visible();
+    return ((fltk3::Widget_I*)_p)->visible();
   }    
   
   int visible_r() const {
-    return ((fltk3::Widget_W*)_p)->visible_r();
+    return ((fltk3::Widget_I*)_p)->visible_r();
   }
   
   void set_visible() {
-    ((fltk3::Widget_W*)_p)->set_visible();
+    ((fltk3::Widget_I*)_p)->set_visible();
   }
   
   void clear_visible() {
-    ((fltk3::Widget_W*)_p)->clear_visible();
+    ((fltk3::Widget_I*)_p)->clear_visible();
   }
 
   unsigned int active() const {
-    return ((fltk3::Widget_W*)_p)->active();
+    return ((fltk3::Widget_I*)_p)->active();
   }
   
   int active_r() const {
-    return ((fltk3::Widget_W*)_p)->active_r();
+    return ((fltk3::Widget_I*)_p)->active_r();
   }
     
   void activate() {
-    ((fltk3::Widget_W*)_p)->activate();
+    ((fltk3::Widget_I*)_p)->activate();
   }
     
   void deactivate() {
-    ((fltk3::Widget_W*)_p)->deactivate();
+    ((fltk3::Widget_I*)_p)->deactivate();
   }
     
   unsigned int output() const {
-    return ((fltk3::Widget_W*)_p)->output();
+    return ((fltk3::Widget_I*)_p)->output();
   }
 
   void set_output() {
-    ((fltk3::Widget_W*)_p)->set_output();
+    ((fltk3::Widget_I*)_p)->set_output();
   }
     
   void clear_output() {
-    ((fltk3::Widget_W*)_p)->clear_output();
+    ((fltk3::Widget_I*)_p)->clear_output();
   }
     
   unsigned int takesevents() const {
-    return ((fltk3::Widget_W*)_p)->takesevents();
+    return ((fltk3::Widget_I*)_p)->takesevents();
   }
   
   unsigned int changed() const {
-    return ((fltk3::Widget_W*)_p)->changed();
+    return ((fltk3::Widget_I*)_p)->changed();
   }
   
   void set_changed() {
-    ((fltk3::Widget_W*)_p)->set_changed();
+    ((fltk3::Widget_I*)_p)->set_changed();
   }
   
   void clear_changed() {
-    ((fltk3::Widget_W*)_p)->clear_changed();
+    ((fltk3::Widget_I*)_p)->clear_changed();
   }
   
   int take_focus() {
-    return ((fltk3::Widget_W*)_p)->take_focus();
+    return ((fltk3::Widget_I*)_p)->take_focus();
   }
     
   void set_visible_focus() {
-    ((fltk3::Widget_W*)_p)->set_visible_focus();
+    ((fltk3::Widget_I*)_p)->set_visible_focus();
   }
 
   void clear_visible_focus() {
-    ((fltk3::Widget_W*)_p)->clear_visible_focus();
+    ((fltk3::Widget_I*)_p)->clear_visible_focus();
   }
 
   void visible_focus(int v) {
-    ((fltk3::Widget_W*)_p)->visible_focus(v);
+    ((fltk3::Widget_I*)_p)->visible_focus(v);
   }
   
   unsigned int  visible_focus() {
-    return ((fltk3::Widget_W*)_p)->visible_focus();
+    return ((fltk3::Widget_I*)_p)->visible_focus();
   }
     
   static void default_callback(Fl_Widget *cb, void *d) {
-    fltk3::Widget_W::default_callback( (fltk3::Widget_W*)(cb->_p), d );
+    fltk3::Widget_I::default_callback( (fltk3::Widget_I*)(cb->_p), d );
   }
   
   void do_callback() {
-    ((fltk3::Widget_W*)_p)->do_callback();
+    ((fltk3::Widget_I*)_p)->do_callback();
   }
   
   void do_callback(Fl_Widget* o,long arg) {
-    ((fltk3::Widget_W*)_p)->do_callback( (fltk3::Widget_W*)(o->_p), arg );
+    ((fltk3::Widget_I*)_p)->do_callback( (fltk3::Widget_I*)(o->_p), arg );
   }
   
   void do_callback(Fl_Widget* o,void* arg=0) {
-    ((fltk3::Widget_W*)_p)->do_callback( (fltk3::Widget_W*)(o->_p), arg );
+    ((fltk3::Widget_I*)_p)->do_callback( (fltk3::Widget_I*)(o->_p), arg );
   }
     
   int test_shortcut() {
-    return ((fltk3::Widget_W*)_p)->test_shortcut();
+    return ((fltk3::Widget_I*)_p)->test_shortcut();
   }
 
   static unsigned int label_shortcut(const char *t) {
-    return fltk3::Widget_W::label_shortcut(t);
+    return fltk3::Widget_I::label_shortcut(t);
   }
 
   static int test_shortcut(const char *s, const bool require_alt = false) {
-    return fltk3::Widget_W::test_shortcut(s, require_alt);
+    return fltk3::Widget_I::test_shortcut(s, require_alt);
   }
   
   int contains(const Fl_Widget *w) const {
-    return ((fltk3::Widget_W*)_p)->contains((fltk3::Widget_W*)(w->_p));
+    return ((fltk3::Widget_I*)_p)->contains((fltk3::Widget_I*)(w->_p));
   }
 
   int inside(const Fl_Widget* w) const {
-    return ((fltk3::Widget_W*)_p)->inside((fltk3::Widget_W*)(w->_p));
+    return ((fltk3::Widget_I*)_p)->inside((fltk3::Widget_I*)(w->_p));
   }
   
   void redraw() {
-    ((fltk3::Widget_W*)_p)->redraw();
+    ((fltk3::Widget_I*)_p)->redraw();
   }
 
   void redraw_label() {
-    ((fltk3::Widget_W*)_p)->redraw_label();
+    ((fltk3::Widget_I*)_p)->redraw_label();
   }
 
   uchar damage() const {
-    return fltk3::_3to1_damage( ((fltk3::Widget_W*)_p)->damage() );
+    return fltk3::_3to1_damage( ((fltk3::Widget_I*)_p)->damage() );
   }
     
   void clear_damage(uchar c = 0) {
-    ((fltk3::Widget_W*)_p)->clear_damage();
+    ((fltk3::Widget_I*)_p)->clear_damage();
   }
   
   void damage(uchar c) {
-    ((fltk3::Widget_W*)_p)->damage( fltk3::_1to3_damage((Fl_Damage)c) );
+    ((fltk3::Widget_I*)_p)->damage( fltk3::_1to3_damage((Fl_Damage)c) );
   }
   
   void damage(uchar c, int x, int y, int w, int h) {
-    ((fltk3::Widget_W*)_p)->damage( fltk3::_1to3_damage((Fl_Damage)c), x, y, 
w, h );
+    ((fltk3::Widget_I*)_p)->damage( fltk3::_1to3_damage((Fl_Damage)c), x, y, 
w, h );
   }
   
   void draw_label(int x, int y, int w, int h, Fl_Align a) const {
-    ((fltk3::Widget_W*)_p)->draw_label( x, y, w, h, fltk3::_1to3_align(a) );
+    ((fltk3::Widget_I*)_p)->draw_label( x, y, w, h, fltk3::_1to3_align(a) );
   }
   
   void measure_label(int& ww, int& hh) const {
-    ((fltk3::Widget_W*)_p)->measure_label( ww, hh );
+    ((fltk3::Widget_I*)_p)->measure_label( ww, hh );
   }
   
   Fl_Color color2() const {
-    return fltk3::_3to1_color(((fltk3::Widget_W*)_p)->color2());
+    return fltk3::_3to1_color(((fltk3::Widget_I*)_p)->color2());
   }
   
   void color2(unsigned a) {
-    ((fltk3::Widget_W*)_p)->color2( fltk3::_1to3_color(a) );
+    ((fltk3::Widget_I*)_p)->color2( fltk3::_1to3_color(a) );
   }
 };
 

Modified: branches/branch-3.0/fltk3/Adjuster.h
===================================================================
--- branches/branch-3.0/fltk3/Adjuster.h        2011-07-13 14:25:30 UTC (rev 
8860)
+++ branches/branch-3.0/fltk3/Adjuster.h        2011-07-13 14:26:13 UTC (rev 
8861)
@@ -37,7 +37,6 @@
 
 #include "Valuator.h"
 
-class Fl_Adjuster;
 
 namespace fltk3 {
   
@@ -54,9 +53,6 @@
    click decrements by 10 times  the amount.
    */
   class FLTK3_EXPORT Adjuster : public Valuator {
-    
-    friend class ::Fl_Adjuster;
-    
     int drag;
     int ix;
     int soft_;

Modified: branches/branch-3.0/fltk3/Box.h
===================================================================
--- branches/branch-3.0/fltk3/Box.h     2011-07-13 14:25:30 UTC (rev 8860)
+++ branches/branch-3.0/fltk3/Box.h     2011-07-13 14:26:13 UTC (rev 8861)
@@ -33,7 +33,6 @@
 
 #include "Widget.h"
 
-class Fl_Box;
 
 namespace fltk3 { 
   
@@ -46,10 +45,9 @@
    */
   class FLTK3_EXPORT Box : public fltk3::Widget {
     
-    friend class ::Fl_Box;
-    
   protected:
     void draw();
+    
   public:
     /**
      - The first constructor sets box() to fltk3::NO_BOX, which

Modified: branches/branch-3.0/fltk3/Wrapper.h
===================================================================
--- branches/branch-3.0/fltk3/Wrapper.h 2011-07-13 14:25:30 UTC (rev 8860)
+++ branches/branch-3.0/fltk3/Wrapper.h 2011-07-13 14:26:13 UTC (rev 8861)
@@ -181,6 +181,50 @@
   }
 
 
+#define FLTK3_WRAPPER_INTERFACE_BEGIN(type1, type3) \
+  class type1; \
+  namespace fltk3 { \
+    class type3##_I : public type3 { \
+      friend class ::type1; \
+    public: \
+      type3##_I(int x, int y, int w, int h, const char *l) \
+      : type3(x, y, w, h, l) { }
+
+#define FLTK3_WRAPPER_INTERFACE_WIDGET(type1, type3) \
+      void show() { \
+        FLTK3_OBJECT_VCALLS_WRAPPER(show(), Show) \
+        type3::show(); \
+      } \
+      void hide() { \
+        FLTK3_OBJECT_VCALLS_WRAPPER(hide(), Hide) \
+        type3::hide(); \
+      } \
+      void resize(int X, int Y, int W, int H) { \
+        FLTK3_OBJECT_VCALLS_WRAPPER(resize(X, Y, W, H), Resize) \
+        type3::resize(X, Y, W, H); \
+      } \
+      void draw() { \
+        FLTK3_OBJECT_VCALLS_WRAPPER(draw(), Draw) \
+        type3::draw(); \
+      } \
+      int handle(int event) { \
+        FLTK3_OBJECT_VCALLS_WRAPPER_RET(int, handle(event), Handle) \
+        return type3::handle(event); \
+      }
+
+#define FLTK3_WRAPPER_INTERFACE_END() \
+    }; \
+  }
+
+
+#define FLTK3_WIDGET_VCALLS(type3) \
+  FLTK3_WRAPPER_VCALLS_OBJECT(type3##_I, show(), hide(), Show) \
+  FLTK3_WRAPPER_VCALLS_OBJECT(type3##_I, hide(), show(), Hide) \
+  FLTK3_WRAPPER_VCALLS_OBJECT(type3##_I, draw(), draw(), Draw) \
+  FLTK3_WRAPPER_VCALLS_OBJECT(type3##_I, resize(int x, int y, int w, int h), 
resize(x, y, w, h), Resize) \
+  FLTK3_WRAPPER_VCALLS_OBJECT_RET(int, type3##_I, handle(int event), 
handle(event), Handle)
+
+
 namespace fltk3 {
   
   class Object;
@@ -198,6 +242,7 @@
     
     mutable unsigned int pVCalls;
     static const unsigned int pVCallDtor          = 1<<0;
+    
     static const unsigned int pVCallWidgetDraw    = 1<<1;
     static const unsigned int pVCallWidgetHandle  = 1<<2;
     static const unsigned int pVCallWidgetResize  = 1<<3;
@@ -221,6 +266,13 @@
     static const unsigned int pVCallWidgetBrowserItemSelect   = 1<<21;
     static const unsigned int pVCallWidgetBrowserItemSelected = 1<<22;
     
+    static const unsigned int pVCallImageCopyWH       = 1<<1;
+    static const unsigned int pVCallImageColorAverage = 1<<2;
+    static const unsigned int pVCallImageDesaturate   = 1<<3;
+    static const unsigned int pVCallImageLabelW       = 1<<4;
+    static const unsigned int pVCallImageLabelM       = 1<<5;
+    static const unsigned int pVCallImageDraw         = 1<<6;
+    static const unsigned int pVCallImageUncache      = 1<<7;
   };
 
   
@@ -252,6 +304,20 @@
   };
   
   
+  class ImageWrapper : public Wrapper {
+  public:
+    /*
+    virtual ~Image();
+    virtual fltk3::Image *copy(int W, int H);
+    virtual void color_average(fltk3::Color c, float i);
+    virtual void desaturate();
+    virtual void label(fltk3::Widget*w);
+    virtual void label(fltk3::MenuItem*m);
+    virtual void draw(int X, int Y, int W, int H, int cx=0, int cy=0); // 
platform dependent
+    virtual void uncache();
+     */
+  };
+  
 }; // namespace fltk3
 
 

Modified: branches/branch-3.0/src/Fl_Adjuster.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Adjuster.cxx     2011-07-13 14:25:30 UTC (rev 
8860)
+++ branches/branch-3.0/src/Fl_Adjuster.cxx     2011-07-13 14:26:13 UTC (rev 
8861)
@@ -42,7 +42,6 @@
 void fltk3::Adjuster::value_damage() {}
 
 void fltk3::Adjuster::draw() {
-  FLTK3_OBJECT_VCALLS_WRAPPER(draw(), Draw)
   int dx, dy, W, H;
   if (w()>=h()) {
     dx = W = w()/3;
@@ -68,7 +67,6 @@
 }
 
 int fltk3::Adjuster::handle(int event) {
-  FLTK3_OBJECT_VCALLS_WRAPPER_RET(int, handle(event), Handle)
   double v;
   int delta;
   int mx = fltk3::event_x();

Modified: branches/branch-3.0/src/Fl_Box.cxx
===================================================================
--- branches/branch-3.0/src/Fl_Box.cxx  2011-07-13 14:25:30 UTC (rev 8860)
+++ branches/branch-3.0/src/Fl_Box.cxx  2011-07-13 14:26:13 UTC (rev 8861)
@@ -31,14 +31,12 @@
 
 
 void fltk3::Box::draw() {
-  FLTK3_OBJECT_VCALLS_WRAPPER(draw(), Draw)
   draw_box();
   draw_label();
 }
 
 
 int fltk3::Box::handle(int event) {
-  FLTK3_OBJECT_VCALLS_WRAPPER_RET(int, handle(event), Handle)
   if (event == fltk3::ENTER || event == fltk3::LEAVE) return 1;
   else return 0;
 }

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

Reply via email to