Author: matt
Date: 2011-01-11 01:31:35 -0800 (Tue, 11 Jan 2011)
New Revision: 8250
Log:
Some more random transations.

Modified:
   branches/branch-3.0-2011/FL/Enumerations.H
   branches/branch-3.0-2011/FL/Fl_Window.H
   branches/branch-3.0-2011/fltk/Widget.h
   branches/branch-3.0-2011/fltk/Window.h
   branches/branch-3.0-2011/fltk3/Window.h
   branches/branch-3.0-2011/fltk3/Wrapper.h

Modified: branches/branch-3.0-2011/FL/Enumerations.H
===================================================================
--- branches/branch-3.0-2011/FL/Enumerations.H  2011-01-10 22:25:59 UTC (rev 
8249)
+++ branches/branch-3.0-2011/FL/Enumerations.H  2011-01-11 09:31:35 UTC (rev 
8250)
@@ -604,6 +604,8 @@
 
 //*...@}*/             // group: Colors
 
+#endif // TODO: FLTK123
+
 /** \name Cursors
 
     The following constants define the mouse cursors that are available in 
FLTK.
@@ -642,6 +644,8 @@
   //FL_CURSOR_WE       = 55,
 };
 
+#if 0 // TODO: FLTK123
+
 enum { // values for "when" passed to Fl::add_fd()
   FL_READ = 1,
   FL_WRITE = 4,

Modified: branches/branch-3.0-2011/FL/Fl_Window.H
===================================================================
--- branches/branch-3.0-2011/FL/Fl_Window.H     2011-01-10 22:25:59 UTC (rev 
8249)
+++ branches/branch-3.0-2011/FL/Fl_Window.H     2011-01-11 09:31:35 UTC (rev 
8250)
@@ -36,68 +36,27 @@
 
 #if 0 // TODO: FLTK123
 
-#define FL_WINDOW 0xF0         ///< window type id all subclasses have type() 
>= this
-#define FL_DOUBLE_WINDOW 0xF1   ///< double window type id
+#define FL_WINDOW 0xF0
+#define FL_DOUBLE_WINDOW 0xF1
 
 class Fl_X;
 
+
 #endif // TODO: FLTK123
 
 class FL_EXPORT Fl_Window : public Fl_Group {
 
-#if 0  // TODO: FLTK123
-  static char *default_xclass_;
-
-  friend class Fl_X;
-  Fl_X *i; // points at the system-specific stuff
-
-  const char* iconlabel_;
-  char* xclass_;
-  const void* icon_;
-  // size_range stuff:
-  int minw, minh, maxw, maxh;
-  int dw, dh, aspect;
-  uchar size_range_set;
-  // cursor stuff
-  Fl_Cursor cursor_default;
-  Fl_Color cursor_fg, cursor_bg;
-  void size_range_();
-  void _Fl_Window(); // constructor innards
-
-  // unimplemented copy ctor and assignment operator
-  Fl_Window(const Fl_Window&);
-  Fl_Window& operator=(const Fl_Window&);
-
 protected:
 
-  /** Stores the last window that was made current. See current() const */
-  static Fl_Window *current_;
-  virtual void draw();
-  /** Forces the window to be drawn, this window is also made current and 
calls draw(). */
-  virtual void flush();
-
-  /**
-    Sets an internal flag that tells FLTK and the window manager to
-    honor position requests.
-
-    This is used internally and should not be needed by user code.
-
-    \param[in] force 1 to set the FORCE_POSITION flag, 0 to clear it
-  */
+  // in Wrapper: virtual void draw();
+  
+  // TODO: FLTK123  virtual void flush();
   void force_position(int force) {
-    if (force) set_flag(FORCE_POSITION);
-    else clear_flag(FORCE_POSITION);
+    ((fltk3::Window*)_p)->force_position(force); 
   }
-  /**
-    Returns the internal state of the window's FORCE_POSITION flag.
-
-    \retval 1 if flag is set
-    \retval 0 otherwise
-
-    \see force_position(int)
-  */
-  int force_position() const { return ((flags() & FORCE_POSITION)?1:0); }
-#endif
+  int force_position() const {
+    return ((fltk3::Window*)_p)->force_position(); 
+  }
   
 public:
 
@@ -105,300 +64,145 @@
     _p = new fltk3::Window(w, h, title); 
     _p->wrapper(this);
   }
-  
-#if 0 // TODO: FLTK123
-  /** Creates a window from the given position, size and title.
-
-    \see Fl_Window::Fl_Window(int w, int h, const char *title = 0)
-  */
-    Fl_Window(int x, int y, int w, int h, const char* title = 0);
-  /**
-    The destructor <I>also deletes all the children</I>. This allows a
-    whole tree to be deleted at once, without having to keep a pointer to
-    all the children in the user code. A kludge has been done so the 
-    Fl_Window and all of its children can be automatic (local)
-    variables, but you must declare the Fl_Window <I>first</I> so
-    that it is destroyed last.
-  */
-    virtual ~Fl_Window();
-
-  virtual int handle(int);
-
-  /**
-    Changes the size and position of the window.  If shown() is true,
-    these changes are communicated to the window server (which may
-    refuse that size and cause a further resize).  If shown() is
-    false, the size and position are used when show() is called.
-    See Fl_Group for the effect of resizing on the child widgets.
-
-    You can also call the Fl_Widget methods size(x,y) and position(w,h),
-    which are inline wrappers for this virtual function.
-
-    A top-level window can not force, but merely suggest a position and 
-    size to the operating system. The window manager may not be willing or 
-    able to display a window at the desired position or with the given 
-    dimensions. It is up to the application developer to verify window 
-    parameters after the resize request.
-  */
-  virtual void resize(int,int,int,int);
-  /**
-    Sets whether or not the window manager border is around the
-    window.  The default value is true. void border(int) can be
-    used to turn the border on and off. <I>Under most X window
-    managers this does not work after show() has been called,
-    although SGI's 4DWM does work.</I>
-  */
-  void border(int b);
-  /**
-    Fast inline function to turn the window manager border
-    off. It only works before show() is called.
-  */
-  void clear_border()  {set_flag(NOBORDER);}
-  /** See void Fl_Window::border(int) */
-  unsigned int border() const  {return !(flags() & NOBORDER);}
-  /** Activates the flags NOBORDER|FL_OVERRIDE */
-  void set_override()  {set_flag(NOBORDER|OVERRIDE);}
-  /** Returns non zero if FL_OVERRIDE flag is set, 0 otherwise. */
-  unsigned int override() const  { return flags()&OVERRIDE; }
-  /**
-    A "modal" window, when shown(), will prevent any events from
-    being delivered to other windows in the same program, and will also
-    remain on top of the other windows (if the X window manager supports
-    the "transient for" property).  Several modal windows may be shown at
-    once, in which case only the last one shown gets events.  You can see
-    which window (if any) is modal by calling Fl::modal().
-  */
-  void set_modal()     {set_flag(MODAL);}
-  /**  Returns true if this window is modal.  */
-  unsigned int modal() const   {return flags() & MODAL;}
-  /**
-    A "non-modal" window (terminology borrowed from Microsoft Windows)
-    acts like a modal() one in that it remains on top, but it has
-    no effect on event delivery.  There are <I>three</I> states for a
-    window: modal, non-modal, and normal.
-  */
-  void set_non_modal() {set_flag(NON_MODAL);}
-  /**  Returns true if this window is modal or non-modal. */
-  unsigned int non_modal() const {return flags() & (NON_MODAL|MODAL);}
-
-  /**
-    Marks the window as a menu window.
-
-    This is intended for internal use, but it can also be used if you
-    write your own menu handling. However, this is not recommended.
-
-    This flag is used for correct "parenting" of windows in communication
-    with the windowing system. Modern X window managers can use different
-    flags to distinguish menu and tooltip windows from normal windows.
-
-    This must be called before the window is shown and cannot be changed
-    later.
-  */
-  void set_menu_window()       {set_flag(MENU_WINDOW);}
-
-  /**  Returns true if this window is a menu window. */
-  unsigned int menu_window() const {return flags() & MENU_WINDOW;}
-
-  /**
-    Marks the window as a tooltip window.
-
-    This is intended for internal use, but it can also be used if you
-    write your own tooltip handling. However, this is not recommended.
-
-    This flag is used for correct "parenting" of windows in communication
-    with the windowing system. Modern X window managers can use different
-    flags to distinguish menu and tooltip windows from normal windows.
-
-    This must be called before the window is shown and cannot be changed
-    later.
-
-    \note Since Fl_Tooltip_Window is derived from Fl_Menu_Window, this
-    also \b clears the menu_window() state.
-  */
-  void set_tooltip_window()    { set_flag(TOOLTIP_WINDOW);
-                                 clear_flag(MENU_WINDOW); }
-  /**  Returns true if this window is a tooltip window. */
-  unsigned int tooltip_window() const {return flags() & TOOLTIP_WINDOW;}
-
-  /**
-    Positions the window so that the mouse is pointing at the given
-    position, or at the center of the given widget, which may be the
-    window itself.  If the optional offscreen parameter is
-    non-zero, then the window is allowed to extend off the screen (this
-    does not work with some X window managers). \see position()
-  */
-  void hotspot(int x, int y, int offscreen = 0);
-  /** See void Fl_Window::hotspot(int x, int y, int offscreen = 0) */
-  void hotspot(const Fl_Widget*, int offscreen = 0);
-  /** See void Fl_Window::hotspot(int x, int y, int offscreen = 0) */
-  void hotspot(const Fl_Widget& p, int offscreen = 0) {hotspot(&p,offscreen);}
-
-  /**
-    Undoes the effect of a previous resize() or show() so that the next time
-    show() is called the window manager is free to position the window.
-
-    This is for Forms compatibility only.
-
-    \deprecated please use force_position(0) instead
-  */
-  void free_position() {clear_flag(FORCE_POSITION);}
-  /**
-    Sets the allowable range the user can resize this window to.
-    This only works for top-level windows.
-    <UL>
-    <LI>minw and minh are the smallest the window can be.
-       Either value must be greater than 0.</LI>
-    <LI>maxw and maxh are the largest the window can be. If either is
-       <I>equal</I> to the minimum then you cannot resize in that direction.
-       If either is zero  then FLTK picks a maximum size in that direction
-       such that the window will fill the screen.</LI>
-    <LI>dw and dh are size increments.  The  window will be constrained
-       to widths of minw + N * dw,  where N is any non-negative integer.
-       If these are less or equal to 1 they are ignored (this is ignored
-       on WIN32).</LI>
-    <LI>aspect is a flag that indicates that the window should preserve its
-       aspect ratio.  This only works if both the maximum and minimum have
-       the same aspect ratio (ignored on WIN32 and by many X window managers).
-       </LI>
-    </UL>
-
-    If this function is not called, FLTK tries to figure out the range
-    from the setting of resizable():
-    <UL>
-    <LI>If resizable() is NULL (this is the  default) then the window cannot
-       be resized and the resize border and max-size control will not be
-       displayed for the window.</LI>
-    <LI>If either dimension of resizable() is less than 100, then that is
-       considered the minimum size.  Otherwise the resizable() has a minimum
-       size of 100.</LI>
-    <LI>If either dimension of resizable() is zero, then that is also the
-       maximum size (so the window cannot resize in that direction).</LI>
-    </UL>
-
-    It is undefined what happens if the current size does not fit in the
-    constraints passed to size_range().
-  */
+  Fl_Window(int x, int y, int w, int h, const char* title = 0) {
+    _p = new fltk3::Window(x, y, w, h, title);
+    _p->wrapper(this);
+  }
+  virtual Fl_Window* as_window() { 
+    return this; 
+  }
+  // in Wrapper: virtual ~Fl_Window();  
+  // in Wrapper: virtual int handle(int);
+  // in Wrapper: virtual void resize(int,int,int,int);
+  // in Wrapper: virtual void show();
+  // in Wrapper: virtual void hide();
+  void show(int argc, char **argv) { 
+    ((fltk3::Window*)_p)->show(argc, argv); 
+  }
+  void border(int b) {
+    ((fltk3::Window*)_p)->border(b); 
+  }
+  void clear_border() {
+    ((fltk3::Window*)_p)->clear_border(); 
+  }
+  unsigned int border() const {
+    return ((fltk3::Window*)_p)->border(); 
+  }
+  void set_override() {
+    ((fltk3::Window*)_p)->set_override(); 
+  }
+  unsigned int override() {
+    return ((fltk3::Window*)_p)->override(); 
+  }
+  void set_modal() {
+    ((fltk3::Window*)_p)->set_modal(); 
+  }
+  unsigned int modal() {
+    return ((fltk3::Window*)_p)->modal(); 
+  }
+  void set_non_modal() {
+    ((fltk3::Window*)_p)->set_non_modal(); 
+  }
+  unsigned int non_modal() const {
+    return ((fltk3::Window*)_p)->non_modal(); 
+  }
+  void set_menu_window() {
+    ((fltk3::Window*)_p)->set_menu_window(); 
+  }
+  unsigned int menu_window() const {
+    return ((fltk3::Window*)_p)->menu_window(); 
+  }
+  void set_tooltip_window() {
+    ((fltk3::Window*)_p)->set_tooltip_window(); 
+  }
+  unsigned int tooltip_window() const {
+    return ((fltk3::Window*)_p)->tooltip_window(); 
+  }
+  void hotspot(int x, int y, int offscreen = 0) {
+    ((fltk3::Window*)_p)->hotspot(x, y, offscreen); 
+  }
+  void hotspot(const Fl_Widget *w, int offscreen = 0) {
+    ((fltk3::Window*)_p)->hotspot((fltk3::Widget*)((Fl_Widget*)w)->_p, 
offscreen); 
+  }
+  void hotspot(const Fl_Widget& p, int offscreen = 0) {
+    hotspot(&p, offscreen);
+  }
+  void free_position() {
+    ((fltk3::Window*)_p)->free_position(); 
+  }
   void size_range(int a, int b, int c=0, int d=0, int e=0, int f=0, int g=0) {
-    minw=a; minh=b; maxw=c; maxh=d; dw=e; dh=f; aspect=g; size_range_();}
-
-  /** See void Fl_Window::label(const char*)   */
-  const char* label() const    {return Fl_Widget::label();}
-  /**  See void Fl_Window::iconlabel(const char*)   */
-  const char* iconlabel() const        {return iconlabel_;}
-  /** Sets the window title bar label. */
-  void label(const char*);
-  /** Sets the icon label. */
-  void iconlabel(const char*);
-  /** Sets the icon label. */
-  void label(const char* label, const char* iconlabel); // platform dependent 
-  void copy_label(const char* a);
-
-  static void default_xclass(const char*);
-  static const char *default_xclass();
-  const char* xclass() const;
-  void xclass(const char* c);
-  /** Gets the current icon window target dependent data. */
-  const void* icon() const     {return icon_;}
-  /** Sets the current icon window target dependent data. */
-  void icon(const void * ic)   {icon_ = ic;}
-
-  /**
-    Returns non-zero if show() has been called (but not hide()
-    ). You can tell if a window is iconified with (w->shown()
-    && !w->visible()).
-  */
-  int shown() {return i != 0;}
-  /**
-    Puts the window on the screen. Usually (on X) this has the side
-    effect of opening the display. 
-
-    If the window is already shown then it is restored and raised to the
-    top.  This is really convenient because your program can call show()
-    at any time, even if the window is already up.  It also means that 
-    show() serves the purpose of raise() in other toolkits.
-    
-    Fl_Window::show(int argc, char **argv) is used for top-level
-    windows and allows standard arguments to be parsed from the
-    command-line.
-    
-    \see Fl_Window::show(int argc, char **argv)
-  */
-  virtual void show();
-  /**
-    Removes the window from the screen.  If the window is already hidden or
-    has not been shown then this does nothing and is harmless.
-  */
-  virtual void hide();
+    ((fltk3::Window*)_p)->size_range(a, b, c, d, e, f, g); 
+  }
+  const char* label() const {
+    return ((fltk3::Window*)_p)->label(); 
+  }
+  const char* iconlabel() const {
+    return ((fltk3::Window*)_p)->iconlabel(); 
+  }
+  void label(const char *l) {
+    ((fltk3::Window*)_p)->label(l); 
+  }
+  void iconlabel(const char *il) {
+    ((fltk3::Window*)_p)->iconlabel(il); 
+  }
+  void label(const char* label, const char* iconlabel) {
+    ((fltk3::Window*)_p)->label(label, iconlabel); 
+  }
+  void copy_label(const char* a) {
+    ((fltk3::Window*)_p)->copy_label(a); 
+  }
+  const char* xclass() const {
+    return ((fltk3::Window*)_p)->xclass(); 
+  }
+  void xclass(const char* c) {
+    ((fltk3::Window*)_p)->xclass(c); 
+  }
+  const void* icon() const {
+    return ((fltk3::Window*)_p)->icon(); 
+  }
+  void icon(const void * ic) {
+    ((fltk3::Window*)_p)->icon(ic); 
+  }
+  int shown() {
+    return ((fltk3::Window*)_p)->shown(); 
+  }
+  void fullscreen() {
+    ((fltk3::Window*)_p)->fullscreen(); 
+  }
+  void fullscreen_off(int x, int y, int w, int h) {
+    ((fltk3::Window*)_p)->fullscreen_off(x, y, w, h); 
+  }
+  void iconize() {
+    ((fltk3::Window*)_p)->iconize(); 
+  }
+  int x_root() const {
+    return ((fltk3::Window*)_p)->x_root(); 
+  }
+  int y_root() const {
+    return ((fltk3::Window*)_p)->y_root(); 
+  }
+  void make_current() {
+    ((fltk3::Window*)_p)->make_current(); 
+  }
+  void cursor(Fl_Cursor a, Fl_Color b=FL_BLACK, Fl_Color c=FL_WHITE) {
+    ((fltk3::Window*)_p)->cursor((fltk3::Cursor)a, (fltk3::Color)b, 
(fltk3::Color)c); 
+  }
+  void default_cursor(Fl_Cursor a, Fl_Color b=FL_BLACK, Fl_Color c=FL_WHITE) {
+    ((fltk3::Window*)_p)->default_cursor((fltk3::Cursor)a, (fltk3::Color)b, 
(fltk3::Color)c); 
+  }  
+  static Fl_Window *current() {
+    return (Fl_Window*)( fltk3::Window::current()->wrapper() );
+  }
+  static void default_callback(Fl_Window *w, void* v) {
+    fltk3::Window::default_callback((fltk3::Window*)((Fl_Widget*)w)->_p,v);
+  }
+  static void default_xclass(const char *c) {
+    fltk3::Window::default_xclass(c);
+  }
+  static const char *default_xclass() {
+    return fltk3::Window::default_xclass();
+  }
   
-#endif // TODO: FLTK123
-  
-  void show(int argc, char **argv) { ((fltk3::Window*)_p)->show(argc, argv); }
-  
-#if 0 // TODO: FLTK123
-  /**
-    Makes the window completely fill the screen, without any window
-    manager border visible.  You must use fullscreen_off() to undo
-    this. This may not work with all window managers.
-  */
-  void fullscreen();
-  /**
-    Turns off any side effects of fullscreen() and does 
-    resize(x,y,w,h).
-  */
-  void fullscreen_off(int,int,int,int);
-  /**
-    Iconifies the window.  If you call this when shown() is false
-    it will show() it as an icon.  If the window is already
-    iconified this does nothing.
-
-    Call show() to restore the window.
-
-    When a window is iconified/restored (either by these calls or by the
-    user) the handle() method is called with FL_HIDE and 
-    FL_SHOW events and visible() is turned on and off.
-
-    There is no way to control what is drawn in the icon except with the
-    string passed to Fl_Window::xclass().  You should not rely on
-    window managers displaying the icons.
-  */
-  void iconize();
-
-  int x_root() const ;
-  int y_root() const ;
-
- static Fl_Window *current();
-  /**
-    Sets things up so that the drawing functions in <FL/fl_draw.H> will go
-    into this window. This is useful for incremental update of windows, such
-    as in an idle callback, which will make your program behave much better
-    if it draws a slow graphic. <B>Danger: incremental update is very hard to
-    debug and maintain!</B>
-
-    This method only works for the Fl_Window and Fl_Gl_Window derived classes.
-  */
-  void make_current();
-
-  // Note: Doxygen docs in Fl_Widget.H to avoid redundancy.
-  virtual Fl_Window* as_window() { return this; }
-
-  /**
-    Changes the cursor for this window.  This always calls the system, if
-    you are changing the cursor a lot you may want to keep track of how
-    you set it in a static variable and call this only if the new cursor
-    is different.
-
-    The type Fl_Cursor is an enumeration defined in <FL/Enumerations.H>.
-    (Under X you can get any XC_cursor value by passing 
-    Fl_Cursor((XC_foo/2)+1)).  The colors only work on X, they are
-    not implemented on WIN32.
-
-    For back compatibility only.
-  */
-  void cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE); // platform 
dependent
-  void default_cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE);
-  static void default_callback(Fl_Window*, void* v);
-#endif  // TODO: FLTK123
-  
 };
 
 #endif

Modified: branches/branch-3.0-2011/fltk/Widget.h
===================================================================
--- branches/branch-3.0-2011/fltk/Widget.h      2011-01-10 22:25:59 UTC (rev 
8249)
+++ branches/branch-3.0-2011/fltk/Widget.h      2011-01-11 09:31:35 UTC (rev 
8250)
@@ -33,11 +33,12 @@
 
 namespace fltk {
 
+  class FL_API Group;
+  class FL_API Widget;
+  class FL_API Window;
+
 #if 0 // TODO: FLTK123
-class FL_API Widget;
-class FL_API Window;
 class FL_API Symbol;
-class FL_API Group;
 class FL_API AssociationType;
 class FL_API AssociationFunctor;
 struct Cursor;
@@ -55,12 +56,6 @@
   
   class FL_API Widget : public fltk3::WidgetWrapper {
   
-#if 0 // TODO: FLTK123
-  // disable the copy assignment/constructors:
-  Widget & operator=(const Widget &);
-  Widget(const Widget &);
-#endif // TODO: FLTK123
-  
 public:
 
     Widget() {}
@@ -68,57 +63,92 @@
       _p = new fltk3::Widget(x, y, w, h, l);
       _p->wrapper(this);
     }
-  
+    // in Wrapper: virtual ~Widget();
+    // in Wrapper: virtual void draw();
+    // in Wrapper: virtual int handle(int);
+    void box(Box *f) {
+      ((fltk3::Widget*)_p)->box(f->fltk3_id);
+    }
+    Box *box() const {
+      return fltk2_box_list + ((fltk3::Widget*)_p)->box();
+    }    
+    Box *buttonbox() const {
+      // TODO: not in F3  return fltk2_box_list + 
((fltk3::Widget*)_p)->buttonbox();
+      return 0;
+    }
+    void buttonbox(Box *f) {
+      // TODO: not in F3  ((fltk3::Widget*)_p)->buttonbox(f->fltk3_id);
+    }
+    void labelfont(Font *f) {
+      ((fltk3::Widget*)_p)->labelfont(f->fltk3_id);
+    }
+    Font *labelfont() const {
+      return fltk2_font_list + ((fltk3::Widget*)_p)->labelfont();
+    }
+    void labeltype(LabelType *l) {
+      ((fltk3::Widget*)_p)->labeltype(l->fltk3_id);
+    }
+    void labelsize(float a) {
+      ((fltk3::Widget*)_p)->labelsize((fltk3::Fontsize)a);
+    }
+    Group* parent() const { 
+      return (Group*)( ((fltk3::Widget*)_p)->parent()->wrapper() );
+    }
+    void parent(Group* w) {
+      ((fltk3::Widget*)_p)->parent( (fltk3::Group*)( ((Widget*)w)->_p ) );
+    }
+    Window* window() const {
+      return (Window*)( ((fltk3::Widget*)_p)->window()->wrapper() );
+    }
+    uchar type() const {
+      // TODO: synchronize the type variables!
+      return ((fltk3::Widget*)_p)->type();
+    }
+    void type(uchar t) {
+      // TODO: synchronize the type variables!
+      ((fltk3::Widget*)_p)->type(t);
+    }
+    const char* label() const {
+      return ((fltk3::Widget*)_p)->label();
+    }
+    void label(const char* a) {
+      ((fltk3::Widget*)_p)->label(a);
+    }
+    void copy_label(const char* a) {
+      ((fltk3::Widget*)_p)->copy_label(a);
+    }
+    const char *tooltip() const        {
+      return ((fltk3::Widget*)_p)->tooltip();
+    }
+    void tooltip(const char *t)        {
+      ((fltk3::Widget*)_p)->tooltip(t);
+    }
+    
 #if 0 // TODO: FLTK123
-  virtual ~Widget();
-
-  virtual void draw();
-  virtual int handle(int);
   int  send(int event);
   virtual void layout();
-
   const Style* style() const { return style_; }
   void style(const Style* s) { style_ = s; }
   void style(const Style& s) { style_ = &s; }
   bool copy_style(const Style* s);
   static NamedStyle* default_style;
   static Symbol* default_glyph;
-
-  Group* parent() const        { return parent_; }
-  void parent(Group* w)        { parent_ = w; }
-  Window* window() const       ;
-
   enum WidgetVisualType {
-    // Values for type() shared by Button and menu Item, and for fake RTTI:
     RESERVED_TYPE      = 0x64,
     TOGGLE    = RESERVED_TYPE+1,
     RADIO     = RESERVED_TYPE+2,
     GROUP_TYPE         = 0xe0,
     WINDOW_TYPE        = 0xf0
   };
-
-  uchar        type() const            { return type_; }
-  void type(uchar t)           { type_ = t; }
   bool is_group() const        { return type_ >= GROUP_TYPE; }
   bool is_window() const       { return type_ >= WINDOW_TYPE; }
-
   bool  resize(int x,int y,int w,int h);
   bool position(int x, int y)  ;
   bool resize(int w, int h)    ;
-
   void  get_absolute_rect( Rectangle *rect ) const;
-
-  const char* label() const    { return label_; }
-  void label(const char* a);
-  void copy_label(const char* a);
-
   const Symbol* image() const  { return image_; }
   void image(const Symbol* a)  { image_ = a; }
   void image(const Symbol& a)  { image_ = &a; }
-
-  const char *tooltip() const  { return tooltip_; }
-  void tooltip(const char *t)  { tooltip_ = t; }
-
   unsigned shortcut() const    ;
   void shortcut(unsigned key)  ;
   bool add_shortcut(unsigned key);
@@ -128,7 +158,6 @@
   bool test_label_shortcut() const;
   bool test_shortcut() const   ;
   bool  test_shortcut(bool) const;
-
   Callback_p callback() const  { return callback_; }
   void callback(Callback* c, void* p) { callback_=c; user_data_=p; }
   void callback(Callback* c)   { callback_=c; }
@@ -140,7 +169,6 @@
   void argument(long v)        { user_data_ = (void*)v; }
   uchar when() const           { return when_; }
   void when(uchar i)           { when_ = i; }
-
   static void default_callback(Widget*, void*);
   void do_callback()           { callback_(this,user_data_); }
   void do_callback(Widget* o,void* arg=0) { callback_(o,arg); }
@@ -150,7 +178,6 @@
   bool pushed() const          ;
   bool focused() const         ;
   bool belowmouse() const      ;
-
   Flags        flags() const           { return flags_; }
   void flags(Flags f)          { flags_ = f; }
   void set_flag(unsigned f)    { flags_ |= f; }
@@ -160,13 +187,11 @@
   bool flag(unsigned f) const  { return (flags_ & f) != 0; }
   bool any_of(unsigned f) const{ return (flags_ & f) != 0; }
   bool all_of(unsigned f) const{ return (flags_ & f) == f; }
-
   bool state() const           { return flag(STATE); }
   bool  state(bool);
   bool set()                   { return state(true); }
   bool clear()                 { return state(false); }
   void setonly();
-
   Flags        align() const           { return flags_&ALIGN_MASK; }
   void align(unsigned a)       { flags_ = (flags_ & (~ALIGN_MASK)) | a; }
   bool visible() const         { return !flag(INVISIBLE); }
@@ -200,10 +225,8 @@
   bool vertical() const        { return flag(LAYOUT_VERTICAL);}
   void set_horizontal()        { clear_flag(LAYOUT_VERTICAL); }
   void set_vertical()          { set_flag(LAYOUT_VERTICAL); }
-
   bool take_focus()            ;
   void throw_focus()           ;
-
   void redraw()                ;
   void redraw(uchar c)         ;
   void redraw_label()          ;
@@ -211,16 +234,13 @@
   void redraw(const Rectangle&);
   uchar        damage() const          { return damage_; }
   void set_damage(uchar c)     { damage_ = c; } // should be called damage(c)
-
   void  relayout()             ;
   void relayout(uchar damage)  ;
   uchar layout_damage() const  { return layout_damage_; }
   void layout_damage(uchar c)  { layout_damage_ = c; }
-
   void add_timeout(float)      ;
   void repeat_timeout(float)   ;
   void  remove_timeout()       ;
-
   void make_current() const    ;
   void draw_background() const ;
   void  draw_frame() const     ;
@@ -230,27 +250,7 @@
   void  draw_label(const Rectangle&, Flags) const ;
   void  draw_glyph(int, const Rectangle&) const ;
   void cursor(Cursor*) const   ;
-
   void measure_label(int&, int&) const ;
-    
-#endif
-    
-    void box(Box *f) {
-      ((fltk3::Widget*)_p)->box(f->fltk3_id);
-    }
-    Box *box() const {
-      return fltk2_box_list + ((fltk3::Widget*)_p)->box();
-    }    
-    Box *buttonbox() const {
-      // TODO: not in F3  return fltk2_box_list + 
((fltk3::Widget*)_p)->buttonbox();
-      return 0;
-    }
-    void buttonbox(Box *f) {
-      // TODO: not in F3  ((fltk3::Widget*)_p)->buttonbox(f->fltk3_id);
-    }
-    
-#if 0
-
   Symbol* glyph()              const;
   Font*        textfont()              const;
   LabelType* labeltype()       const;
@@ -267,21 +267,7 @@
   float leading()              const;
   unsigned char scrollbar_align() const;
   unsigned char scrollbar_width() const;
-
   void glyph(Symbol*)          ;
-#endif  // TODO: FLTK123
-
-    void labelfont(Font *f) {
-      ((fltk3::Widget*)_p)->labelfont(f->fltk3_id);
-    }
-    Font *labelfont() const {
-      return fltk2_font_list + ((fltk3::Widget*)_p)->labelfont();
-    }
-    void labeltype(LabelType *l) {
-      ((fltk3::Widget*)_p)->labeltype(l->fltk3_id);
-    }
-    
-#if 0  // TODO: FLTK123
   void textfont(Font*)         ;
   void color(Color)            ;
   void textcolor(Color a)      ;
@@ -291,56 +277,16 @@
   void labelcolor(Color)       ;
   void highlight_color(Color)  ;
   void highlight_textcolor(Color);
-#endif  // TODO: FLTK123
-    
-    void labelsize(float a) {
-      ((fltk3::Widget*)_p)->labelsize((fltk3::Fontsize)a);
-    }
-    
-#if 0  // TODO: FLTK123
   void textsize(float a)       ;
   void leading(float a)                ;
   void scrollbar_align(unsigned char);
   void scrollbar_width(unsigned char);
-
   void  add(const AssociationType&, void* data);
   void  set(const AssociationType&, void* data);
   void* get(const AssociationType&) const;
   void* foreach(const AssociationType&, AssociationFunctor&) const;
   bool  remove(const AssociationType&, void* data);
   bool  find(const AssociationType&, void* data) const;
-
-#ifdef FLTK_1_WIDGET  // back-compatability section:
-
-  Box* down_box()              const { return box(); }
-  Box* slider()                const { return buttonbox(); }
-  Box* box2()                  const { return box(); }
-  Box* fly_box()               const { return box(); }
-  Color        color2()                const { return selection_color(); }
-  Color        color3()                const { return buttoncolor(); }
-  Color        down_labelcolor()       const { return selection_textcolor(); }
-  Color        fly_color()             const { return highlight_color(); }
-  Color        selected_textcolor()    const { return selection_textcolor(); }
-  Color        cursor_color()          const { return selection_color(); }
-  float text_size()            const { return textsize(); }
-  float label_size()           const { return labelsize(); }
-
-  void down_box(Box* a)                { box(a); }
-  void slider(Box* a)          { buttonbox(a); }
-  void fly_box(Box*)           { }
-  void color(Color a, Color b) { color(a); selection_color(b); }
-  void color2(Color a)         { selection_color(a); }
-  void color3(Color a)         { buttoncolor(a); }
-  void down_labelcolor(Color a)        { selection_textcolor(a); }
-  void labelfont(unsigned a)   { labelfont(font(a)); }
-  void fly_color(Color a)      { highlight_color(a); }
-  void textfont(unsigned a)    { textfont(font(a)); }
-  void selected_textcolor(Color a) { selection_textcolor(a); }
-  void cursor_color(Color a)   { selection_color(a); }
-  void text_size(float n)      { textsize(n); }
-  void label_size(float n)     { labelsize(n); }
-
-#endif
 #endif // TODO: FLTK123
 };
 

Modified: branches/branch-3.0-2011/fltk/Window.h
===================================================================
--- branches/branch-3.0-2011/fltk/Window.h      2011-01-10 22:25:59 UTC (rev 
8249)
+++ branches/branch-3.0-2011/fltk/Window.h      2011-01-11 09:31:35 UTC (rev 
8250)
@@ -30,7 +30,7 @@
 
 namespace fltk {
 
-#if 0 // TODo: FLTK123
+#if 0 // TODO: FLTK123
   
 // value for x,y to indicate window system places window
 const int USEDEFAULT = ((int)0x80000000); // same as Win32 value
@@ -46,120 +46,107 @@
   Window(int W, int H, const char *l = 0) {
     _p = new fltk3::Window(W, H, l);
     _p->wrapper(this);
-    // FIXME: this should not cause a begine in FLTK3 for compatibility
+    // FIXME: this should not cause a begin in FLTK3 for compatibility
   }
+  Window(int X, int Y, int W, int H, const char *l = 0, bool fBegin = false) {
+    _p = new fltk3::Window(X, Y, W, H, l);
+    _p->wrapper(this);
+    // FIXME: this should not cause a begin in FLTK3 for compatibility
+    if (fBegin) begin();
+  }
+  void show(int argc, char **argv) {
+    ((fltk3::Window*)_p)->show(argc, argv); 
+  }
+  void fullscreen_off(int x, int y, int w, int h) {
+    ((fltk3::Window*)_p)->fullscreen_off(x, y, w, h); 
+  }
+  void iconize() {
+    ((fltk3::Window*)_p)->iconize(); 
+  }
+  void fullscreen() {
+    ((fltk3::Window*)_p)->fullscreen(); 
+  }
+  const char* label() const {
+    return ((fltk3::Window*)_p)->label(); 
+  }
+  const char* iconlabel() {
+    return ((fltk3::Window*)_p)->iconlabel(); 
+  }
+  void label(const char *p) {
+    ((fltk3::Window*)_p)->label(p); 
+  }
+  void iconlabel(const char *il) {
+    ((fltk3::Window*)_p)->iconlabel(il); 
+  }
+  void label(const char* label, const char* iconlabel) {
+    ((fltk3::Window*)_p)->label(label, iconlabel); 
+  }
+  void copy_label(const char* c) {
+    ((fltk3::Window*)_p)->copy_label(c); 
+  }
+  const void* icon() const {
+    return ((fltk3::Window*)_p)->icon(); 
+  }
+  void icon(const void * ic) {
+    ((fltk3::Window*)_p)->icon(ic); 
+  }
+  static const char* xclass() {
+    return fltk3::Window::default_xclass(); 
+  }
+  static void xclass(const char* v) {
+    fltk3::Window::default_xclass(v); 
+  }
   
-#if 0 // TODo: FLTK123  
-  Window(int,int,int,int, const char* = 0, bool begin = false);
-  static NamedStyle* default_style;
-  virtual ~Window();
-
-  const char* label() const    {return Widget::label();}
-  const char* iconlabel() const        {return iconlabel_;}
-  void label(const char*);
-  void iconlabel(const char*);
-  void label(const char* label, const char* iconlabel);
-  void copy_label(const char* c) {Widget::copy_label(c); label(label());}
-  const void* icon() const     {return icon_;}
-  void icon(const void * ic)   {icon_ = ic;}
-  static const char* xclass()  {return xclass_;}
-  static void xclass(const char* v) {xclass_ = v;}
-
+#if 0 // TODO: FLTK123
+  void maximize() {
+    ((fltk3::Window*)_p)->maximize(); 
+  }
+  virtual ~Window();  
   void border(bool set)        {set ? clear_flag(NOBORDER) : 
set_flag(NOBORDER);}
-  /*! \deprecated compat. api only, please use Window::border(bool)*/
   void clear_border()    {set_flag(NOBORDER);} 
   bool border() const  {return !flag(NOBORDER);}
   void set_override()  {set_flag(NOBORDER|OVERRIDE);}
   bool override() const {return flag(OVERRIDE); }
   const Window* child_of() const {return child_of_;}
   void child_of(const Window* w);
-  void set_modal()     {set_flag(MODAL);} // back compatability only!
-  void set_non_modal() {set_flag(NON_MODAL);} // back compatability only!
-
+  void set_modal()     {set_flag(MODAL);}
+  void set_non_modal() {set_flag(NON_MODAL);}
   bool double_buffer() const {return flag(DOUBLE);}
   void set_double_buffer() {set_flag(DOUBLE);}
   void clear_double_buffer() {clear_flag(DOUBLE);}
   void free_backbuffer();
-
   virtual void draw_overlay();
   void redraw_overlay();
   void erase_overlay();
-
   void hotspot(int x, int y, bool offscreen = false);
   void hotspot(const Widget*, bool offscreen = false);
   void hotspot(const Widget& p, bool offscrn = false) {hotspot(&p,offscrn);}
-  void size_range(int a, int b, int c=0, int d=0, int e=0, int f=0)
-    { minw=(short)a; minh=(short)b; maxw=(short)c; maxh=(short)d; dw=(uchar)e; 
dh=(uchar)f; size_range_(); }
+  void size_range(int a, int b, int c=0, int d=0, int e=0, int f=0){ 
minw=(short)a; minh=(short)b; maxw=(short)c; maxh=(short)d; dw=(uchar)e; 
dh=(uchar)f; size_range_(); }
   bool get_size_range( int *min_w, int *min_h, int *max_w, int *max_h );
-
   bool shown() const {return i != 0;}
   void show();
-#endif // TODO: FLTK123
-  
-  void show(int argc, char **argv) { ((fltk3::Window*)_p)->show(argc, argv); }
-  
-#if 0 // TODO: FLTK123
   void show(const Window* parent);
   bool exec(const Window* parent = 0, bool grab = false);
   void make_exec_return(bool);
   void show_inside(const Window* parent);
   virtual void destroy();
-
-  void iconize();
   bool iconic() const;
-
-  void maximize();
-
-  void fullscreen();
   void fullscreen(const Monitor&);
-  void fullscreen_off(int,int,int,int);
-
   static void default_callback(Window*, void* v);
-
   virtual int handle(int);
   virtual void layout();
   void system_layout();
   virtual void flush();
   virtual void draw();
-
   static Window* first();
   static void first(Window*);
   Window* next();
-
   void borders( Rectangle *r ) const;
-
   static const Window* drawing_window() {return drawing_window_;}
   static const Window* drawing_window_;
-
-  // fabien: used for my cairo experimentations,
-  // not sure i'll keep that opaque backbuffer access :
-  // at least it shouldn't stay public
   void* backbuffer() const;
-
 protected:
   virtual void create();
-
-private:
-
-  friend class CreatedWindow;
-  CreatedWindow *i; // points at the system-specific stuff
-  const Window* child_of_;
-  const char* iconlabel_;
-  const void* icon_;
-  // size_range stuff:
-  short minw, minh, maxw, maxh;
-  unsigned char dw, dh, size_range_set;
-  void size_range_();
-  // values for flags():
-  enum {
-    MODAL          = 0x80000000,
-    NOBORDER       = 0x40000000,
-    OVERRIDE       = 0x20000000,
-    NON_MODAL      = 0x10000000,
-    DOUBLE         = 0x08000000
-  };
-  static const char* xclass_;
-  void _Window(); // constructor innards
 #endif // TODO: FLTK123
   
 };

Modified: branches/branch-3.0-2011/fltk3/Window.h
===================================================================
--- branches/branch-3.0-2011/fltk3/Window.h     2011-01-10 22:25:59 UTC (rev 
8249)
+++ branches/branch-3.0-2011/fltk3/Window.h     2011-01-11 09:31:35 UTC (rev 
8250)
@@ -38,6 +38,8 @@
 
 class Fl_X;
 
+class Fl_Window;
+
 namespace fltk3 {
   class Window;
 };
@@ -60,6 +62,8 @@
   window. fltk3::Window has a default callback that calls 
fltk3::Window::hide().
 */
 class FL_EXPORT fltk3::Window : public fltk3::Group {
+  
+  friend class ::Fl_Window;
 
   static char *default_xclass_;
 

Modified: branches/branch-3.0-2011/fltk3/Wrapper.h
===================================================================
--- branches/branch-3.0-2011/fltk3/Wrapper.h    2011-01-10 22:25:59 UTC (rev 
8249)
+++ branches/branch-3.0-2011/fltk3/Wrapper.h    2011-01-11 09:31:35 UTC (rev 
8250)
@@ -84,8 +84,8 @@
  */
   class Wrapper {
   protected:
+  public:
     Object *_p;
-  public:
     Wrapper() 
     : _p(0L), pVCalls(0) { }
     virtual ~Wrapper();

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

Reply via email to