Author: matt
Date: 2009-10-05 13:00:40 -0700 (Mon, 05 Oct 2009)
New Revision: 6916
Log:
FLTK3: Reverting previous attempt. Let's give it another try ;-)

Added:
   branches/branch-3.0-matt/FL3/
Modified:
   branches/branch-3.0-matt/FL/Fl.H
   branches/branch-3.0-matt/FL/Fl_Window.H
   branches/branch-3.0-matt/FL/mac.H
   branches/branch-3.0-matt/README.123
   branches/branch-3.0-matt/src/Fl.cxx
   branches/branch-3.0-matt/src/Fl_Menu_global.cxx
   branches/branch-3.0-matt/src/Fl_Window.cxx
   branches/branch-3.0-matt/src/Fl_Window_fullscreen.cxx
   branches/branch-3.0-matt/src/Fl_Window_hotspot.cxx
   branches/branch-3.0-matt/src/Fl_Window_iconize.cxx
   branches/branch-3.0-matt/src/Fl_arg.cxx
   branches/branch-3.0-matt/src/Fl_grab.cxx
   branches/branch-3.0-matt/src/Fl_mac.cxx
   branches/branch-3.0-matt/src/fl_cursor.cxx

Modified: branches/branch-3.0-matt/FL/Fl.H
===================================================================
--- branches/branch-3.0-matt/FL/Fl.H    2009-10-05 13:06:33 UTC (rev 6915)
+++ branches/branch-3.0-matt/FL/Fl.H    2009-10-05 20:00:40 UTC (rev 6916)
@@ -52,10 +52,6 @@
 class Fl_Image;
 struct Fl_Label;
 
-namespace fltk {
-  class Window;
-};
-
 /** signature of some label drawing functions passed as parameters */
 typedef void (Fl_Label_Draw_F)(const Fl_Label*, int,int,int,int, Fl_Align);
 
@@ -98,8 +94,8 @@
   static Fl_Widget* focus_;
   static int damage_;
   static Fl_Widget* selection_owner_;
-  static fltk::Window* modal_;
-  static fltk::Window* grab_;
+  static Fl_Window* modal_;
+  static Fl_Window* grab_;
   static int compose_state;
   static int visible_focus_;
   static int dnd_text_ops_;
@@ -332,8 +328,8 @@
       Windows and standard dialogs handling
     @{ */
   static Fl_Window* first_window();
-  static void first_window(fltk::Window*);
-  static Fl_Window* next_window(const fltk::Window*);
+  static void first_window(Fl_Window*);
+  static Fl_Window* next_window(const Fl_Window*);
 
   /**
     Returns the top-most modal() window currently shown.
@@ -344,7 +340,7 @@
     for all events, and no other windows will have handle()
     called (grab() overrides this).
   */
-  static Fl_Window* modal() {return (Fl_Window*)modal_;}
+  static Fl_Window* modal() {return modal_;}
   /**
     This is used when pop-up menu systems are active.
     
@@ -369,9 +365,9 @@
     limit mouse pointer grabbing to the time during which a mouse button 
     is held down. Some OS's may not support grabbing at all.
   */
-  static Fl_Window* grab() {return (Fl_Window*)grab_;}
+  static Fl_Window* grab() {return grab_;}
   /** Selects the window to grab. See Fl_Window* Fl::grab() */
-  static void grab(fltk::Window*); // platform dependent
+  static void grab(Fl_Window*); // platform dependent
   /** @} */
 
   /** \defgroup fl_events Events handling functions
@@ -595,7 +591,7 @@
   static int test_shortcut(Fl_Shortcut);
 
   // event destinations:
-  static int handle(int, fltk::Window*);
+  static int handle(int, Fl_Window*);
   /**  Gets the widget that is below the mouse. 
        \see  belowmouse(Fl_Widget*) */
   static Fl_Widget* belowmouse() {return belowmouse_;}
@@ -769,12 +765,12 @@
     @{ */
   /** For back compatibility, sets the void Fl::fatal handler callback */
   static void set_abort(void (*f)(const char*,...)) {fatal = f;}
-  static void (*atclose)(fltk::Window*,void*);
-  static void default_atclose(fltk::Window*,void*);
+  static void (*atclose)(Fl_Window*,void*);
+  static void default_atclose(Fl_Window*,void*);
   /** For back compatibility, sets the Fl::atclose handler callback. You
       can now simply change the callback for the window instead.
       \see Fl_Window::callback(Fl_Callback*) */
-  static void set_atclose(void (*f)(fltk::Window*,void*)) {atclose = f;}
+  static void set_atclose(void (*f)(Fl_Window*,void*)) {atclose = f;}
   /**   @} */
 
   /** \addtogroup fl_events 
@@ -818,7 +814,7 @@
   */
   static void set_idle(void (*cb)()) {idle = cb;}
   /** See Fl_Window* grab() */
-  static void grab(fltk::Window&win) {grab(&win);}
+  static void grab(Fl_Window&win) {grab(&win);}
   /** Releases the current grabbed window, equals grab(0).
   \deprecated Use Fl::grab(0) instead.
   \see Fl_Window* grab() */
@@ -915,7 +911,7 @@
   */
 public:
   // Cairo support API
-  static cairo_t * cairo_make_current(fltk::Window* w);
+  static cairo_t * cairo_make_current(Fl_Window* w);
    /** when HAVE_CAIRO is defined and cairo_autolink_context() is true, 
       any current window dc is linked to a current context.
       This is not the default, because it may not be necessary

Modified: branches/branch-3.0-matt/FL/Fl_Window.H
===================================================================
--- branches/branch-3.0-matt/FL/Fl_Window.H     2009-10-05 13:06:33 UTC (rev 
6915)
+++ branches/branch-3.0-matt/FL/Fl_Window.H     2009-10-05 20:00:40 UTC (rev 
6916)
@@ -30,19 +30,371 @@
 
 #ifndef Fl_Window_H
 #define Fl_Window_H
-#include "../fltk/Window.h"
 
-// stub class to map Fl_Window to fltk::Window
-class Fl_Window : public fltk::Window {
+#include "Fl_Group.H"
+
+#define FL_WINDOW 0xF0         ///< window type id all subclasses have type() 
>= this
+#define FL_DOUBLE_WINDOW 0xF1   ///< double window type id
+
+class Fl_X;
+
+/**
+  This widget produces an actual window.  This can either be a main
+  window, with a border and title and all the window management controls,
+  or a "subwindow" inside a window.  This is controlled by whether or not
+  the window has a parent().
+  <P>Once you create a window, you usually add children Fl_Widget
+  's to it by using window-&gt;add(child) for each new widget.  See Fl_Group 
for more information
+  on how to add and remove children. </P>
+  <P>There are several subclasses of Fl_Window that provide
+  double-buffering, overlay, menu, and OpenGL support. </P>
+  <P>The window's callback is done if the user tries to close a window
+  using the window manager and 
+  Fl::modal() is zero or equal to the window. Fl_Window
+  has a default callback that calls Fl_Window::hide().
+*/
+class FL_EXPORT Fl_Window : public Fl_Group {
+
   friend class Fl_X;
-public:
-  Fl_Window(int w, int h, const char* title= 0) 
-  : fltk::Window(w, h, title) { }
-  Fl_Window(int x, int y, int w, int h, const char* title = 0) 
-  : fltk::Window(x, y, w, h, title) { }
-private:
+  Fl_X *i; // points at the system-specific stuff
+
+  const char* iconlabel_;
+  const 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();
+
+public:
+
+  /**
+    Creates a window from the given size and title. 
+    If Fl_Group::current() is not NULL, the window is created as a 
+    subwindow of the parent window.</p>
+    
+    <p>The first form of the constructor creates a top-level window
+    and asks the window manager to position the window. The second
+    form of the constructor either creates a subwindow or a
+    top-level window at the specified location (x,y) , subject to window
+    manager configuration. If you do not specify the position of the
+    window, the window manager will pick a place to show the window
+    or allow the user to pick a location. Use position(x,y)
+    or hotspot() before calling show() to request a
+    position on the screen. See Fl_Window::resize() 
+    for some more details on positioning windows.</p>
+    
+    <p>Top-level windows initially have visible() set to 0
+    and parent() set to NULL. Subwindows initially
+    have visible() set to 1 and parent() set to
+    the parent window pointer.</p>
+    
+    <P>Fl_Widget::box() defaults to FL_FLAT_BOX. If you
+    plan to completely fill the window with children widgets you should
+    change this to FL_NO_BOX. If you turn the window border off
+    you may want to change this to FL_UP_BOX.
+  */
+    Fl_Window(int w, int h, const char* title= 0);
+  /** 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 it's 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.
+    <P>You can also call the Fl_Widget methods size(x,y)
+    and position(w,h), which are inline wrappers for this virtual
+    function. </P>
+    <P>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);
+  /**
+    Gets or sets whether or not the window manager border is around the
+    window.  The default value is true. border(n) can be used to
+    turn the border on and off, and returns non-zero if the value has been
+    changed. <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 border
+    off. It only works before show() is called.
+  */
+  void clear_border()  {set_flag(NOBORDER);}
+  /** See int Fl_Window::border(int) */
+  unsigned int border() const  {return !(flags() & NOBORDER);}
+  /** Activate 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;}
+
+  /**
+    Position 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.
+  */
+  void free_position() {clear_flag(FORCE_POSITION);}
+  /**
+    Set 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 it's 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().
+  */
+  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*);
+  /** Gets or sets the icon label. */
+  void label(const char* label, const char* iconlabel); // platform dependent 
+  void copy_label(const char* a);
+  /** See void Fl_Window::xclass(const char*) */
+  const char* xclass() const   {return xclass_;}
+  /**
+    A string used to tell the system what type of window this is. Mostly
+    this identifies the picture to draw in the icon. <I>Under X, this is
+    turned into a XA_WM_CLASS pair by truncating at the first
+    non-alphanumeric character and capitalizing the first character, and
+    the second one if the first is 'x'.  Thus "foo" turns into "foo, Foo",
+    and "xprog.1" turns into "xprog, XProg".</I> This only works if called <I>
+    before</I> calling show().
+    <P>Under Microsoft Windows this string is used as the name of the
+    WNDCLASS structure, though it is not clear if this can have any
+    visible effect. The passed pointer is stored unchanged. The string 
+    is not copied.
+  */
+  void xclass(const char* c)   {xclass_ = 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-&gt;shown()
+    &!w-&gt;visible()).
+  */
+  int shown() {return i != 0;}
+  /**
+    Put the window on the screen.  Usually this has the side effect of
+    opening the display. The second form is used for top-level
+    windows and allow standard arguments to be parsed from the
+    command-line.
+    <P>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.
+  */
+  virtual void show();
+  /**
+    Remove 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();
+  /**
+    See virtual void Fl_Window::show() 
+  */
+  void show(int, char**);
+  /**
+    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.
+    <P>Call show() to restore the window. </P>
+    <P>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. </P>
+    <P>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 &lt;FL/fl_draw.H&gt; 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>
+    <P>This method only works for the Fl_Window and 
+    Fl_Gl_Window derived classes.
+  */
+  void make_current();
+
+  // for back-compatibility only:
+  /**
+    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 varaible and call this only if the new cursor
+    is different. 
+
+    <P>The type Fl_Cursor is an enumeration defined in  &lt;Enumerations.H&gt;.
+    (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.
+    <P> 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

Modified: branches/branch-3.0-matt/FL/mac.H
===================================================================
--- branches/branch-3.0-matt/FL/mac.H   2009-10-05 13:06:33 UTC (rev 6915)
+++ branches/branch-3.0-matt/FL/mac.H   2009-10-05 20:00:40 UTC (rev 6916)
@@ -64,7 +64,7 @@
 public:
   Window xid;              // Mac WindowPtr
   GWorldPtr other_xid;     // pointer for offscreen bitmaps (doublebuffer)
-  fltk::Window *w;            // FLTK window for 
+  Fl_Window *w;            // FLTK window for 
   Fl_Region region;
   Fl_Region subRegion;     // region for this specific subwindow
   Fl_X *next;              // linked tree to support subwindows
@@ -72,9 +72,9 @@
   int wait_for_expose;
   CursHandle cursor;
   static Fl_X* first;
-  static Fl_X* i(const fltk::Window* w) {return w->i;}
-  static int fake_X_wm(const fltk::Window*,int&,int&,int&,int&,int&);
-  static void make(fltk::Window*);
+  static Fl_X* i(const Fl_Window* w) {return w->i;}
+  static int fake_X_wm(const Fl_Window*,int&,int&,int&,int&,int&);
+  static void make(Fl_Window*);
   void flush();
   // Quartz additions:
   CGContextRef gc;                 // graphics context (NULL when using QD)
@@ -87,12 +87,12 @@
   static void q_end_image();
 };
 
-extern void MacDestroyWindow(fltk::Window*,WindowPtr);
-extern void MacMapWindow(fltk::Window*,WindowPtr);
-extern void MacUnmapWindow(fltk::Window*,WindowPtr);
+extern void MacDestroyWindow(Fl_Window*,WindowPtr);
+extern void MacMapWindow(Fl_Window*,WindowPtr);
+extern void MacUnmapWindow(Fl_Window*,WindowPtr);
 extern int MacUnlinkWindow(Fl_X*,Fl_X*start=0L);
 
-inline Window fl_xid(const fltk::Window*w) 
+inline Window fl_xid(const Fl_Window*w) 
 {
   return Fl_X::i(w)->xid;
 }

Modified: branches/branch-3.0-matt/README.123
===================================================================
--- branches/branch-3.0-matt/README.123 2009-10-05 13:06:33 UTC (rev 6915)
+++ branches/branch-3.0-matt/README.123 2009-10-05 20:00:40 UTC (rev 6916)
@@ -75,6 +75,9 @@
 (and often repeated) parameters of every widget. API's are similar though,
 so this is luckily another pretty straight-forward upgrade.
 
+(8) Symbols: FLTK 2 combines vector drawings and images into a common base
+class called Symbols. These can be used within labels etc. . This is nice
+and flexibe and should be possible to implement/port.
 
  Comparison Chart by Class
 ---------------------------

Modified: branches/branch-3.0-matt/src/Fl.cxx
===================================================================
--- branches/branch-3.0-matt/src/Fl.cxx 2009-10-05 13:06:33 UTC (rev 6915)
+++ branches/branch-3.0-matt/src/Fl.cxx 2009-10-05 20:00:40 UTC (rev 6916)
@@ -81,10 +81,10 @@
 int            Fl::visible_focus_ = 1,
                Fl::dnd_text_ops_ = 1;
 
-fltk::Window *fl_xfocus;       // which window X thinks has focus
-fltk::Window *fl_xmousewin;     // which window X thinks has FL_ENTER
-fltk::Window *Fl::grab_;       // most recent Fl::grab()
-fltk::Window *Fl::modal_;      // topmost modal() window
+Fl_Window *fl_xfocus;  // which window X thinks has focus
+Fl_Window *fl_xmousewin;// which window X thinks has FL_ENTER
+Fl_Window *Fl::grab_;  // most recent Fl::grab()
+Fl_Window *Fl::modal_; // topmost modal() window
 
 #endif // FL_DOXYGEN
 
@@ -599,7 +599,7 @@
        window->next = Fl_X::first;
        Fl_X::first = window;
       }
-      return (Fl_Window*)window->w;
+      return window->w;
     }
   return 0;
 }
@@ -618,22 +618,22 @@
 */
 Fl_Window* Fl::first_window() {
   Fl_X* i = Fl_X::first;
-  return i ? (Fl_Window*)i->w : 0;
+  return i ? i->w : 0;
 }
 
 /**
   Returns the next top-level window in the list of shown() windows.  You can
   use this call to iterate through all the windows that are shown().
 */
-Fl_Window* Fl::next_window(const fltk::Window* window) {
+Fl_Window* Fl::next_window(const Fl_Window* window) {
   Fl_X* i = Fl_X::i(window)->next;
-  return i ? (Fl_Window*)i->w : 0;
+  return i ? i->w : 0;
 }
 
 /**
   See Fl_Window* first_window()
 */
-void Fl::first_window(fltk::Window* window) {
+void Fl::first_window(Fl_Window* window) {
   if (!window || !window->shown()) return;
   fl_find(fl_xid(window));
 }
@@ -661,7 +661,7 @@
     damage_ = 0;
     for (Fl_X* i = Fl_X::first; i; i = i->next) {
       if (i->wait_for_expose) {damage_ = 1; continue;}
-      fltk::Window* wi = i->w;
+      Fl_Window* wi = i->w;
       if (!wi->visible_r()) continue;
       if (wi->damage()) {i->flush(); wi->clear_damage();}
       // destroy damage regions for windows that don't use them:
@@ -764,7 +764,7 @@
     // make sure that fl_xfocus is set to the top level window
     // of this widget, or fl_fix_focus will clear our focus again
     if (o) {
-      fltk::Window *win = 0, *w1 = o->window();
+      Fl_Window *win = 0, *w1 = o->window();
       while (w1) { win=w1; w1=win->window(); }
       if (win) fl_xfocus = win;
     }
@@ -922,7 +922,7 @@
 // Call to->handle but first replace the mouse x/y with the correct
 // values to account for nested X windows. 'window' is the outermost
 // window the event was posted to by X:
-static int send(int event, Fl_Widget* to, fltk::Window* window) {
+static int send(int event, Fl_Widget* to, Fl_Window* window) {
   int dx, dy;
   int old_event = Fl::e_number;
   if (window) {
@@ -942,7 +942,7 @@
   return ret;
 }
 
-int Fl::handle(int e, fltk::Window* window)
+int Fl::handle(int e, Fl_Window* window)
 /**
   Sends the event to a window for processing.  Returns non-zero if any
   widget uses the event.
@@ -1159,7 +1159,7 @@
 extern void fl_destroy_xft_draw(Window);
 #endif
 
-void fltk::Window::hide() {
+void Fl_Window::hide() {
   clear_visible();
 
   if (!shown()) return;
@@ -1180,7 +1180,7 @@
 
   // recursively remove any subwindows:
   for (Fl_X *wi = Fl_X::first; wi;) {
-    fltk::Window* W = wi->w;
+    Fl_Window* W = wi->w;
     if (W->window() == this) {
       W->hide();
       W->set_visible();
@@ -1189,7 +1189,7 @@
   }
 
   if (this == Fl::modal_) { // we are closing the modal window, find next one:
-    fltk::Window* W;
+    Fl_Window* W;
     for (W = Fl::first_window(); W; W = Fl::next_window(W))
       if (W->modal()) break;
     Fl::modal_ = W;
@@ -1203,7 +1203,7 @@
   // this little trick keeps the current clipboard alive, even if we are about
   // to destroy the window that owns the selection.
   if (GetClipboardOwner()==ip->xid) {
-    fltk::Window *w1 = Fl::first_window();
+    Fl_Window *w1 = Fl::first_window();
     if (w1 && OpenClipboard(fl_xid(w1))) {
       EmptyClipboard();
       SetClipboardData(CF_TEXT, NULL);
@@ -1218,7 +1218,7 @@
       fl_window = (HWND)-1;
       fl_gc = 0;
 # ifdef USE_CAIRO
-      if (Fl::cairo_autolink_context()) Fl::cairo_make_current((fltk::Window*) 
0);
+      if (Fl::cairo_autolink_context()) Fl::cairo_make_current((Fl_Window*) 0);
 # endif
     }
 #elif defined(__APPLE_QUARTZ__)
@@ -1256,7 +1256,7 @@
   delete ip;
 }
 
-fltk::Window::~Window() {
+Fl_Window::~Fl_Window() {
   hide();
 }
 
@@ -1268,7 +1268,7 @@
 // Fl_Window::show() or Fl_Window::hide() is called, or in response to
 // iconize/deiconize events from the system.
 
-int fltk::Window::handle(int ev)
+int Fl_Window::handle(int ev)
 {
   if (parent()) {
     switch (ev) {
@@ -1408,7 +1408,7 @@
     damage(fl, x(), y(), w(), h());
   } else {
     // damage entire window by deleting the region:
-    Fl_X* i = Fl_X::i((fltk::Window*)this);
+    Fl_X* i = Fl_X::i((Fl_Window*)this);
     if (!i) return; // window not mapped, so ignore it
     if (i->region) {XDestroyRegion(i->region); i->region = 0;}
     damage_ |= fl;
@@ -1425,7 +1425,7 @@
     if (!wi) return;
     fl = FL_DAMAGE_CHILD;
   }
-  Fl_X* i = Fl_X::i((fltk::Window*)wi);
+  Fl_X* i = Fl_X::i((Fl_Window*)wi);
   if (!i) return; // window not mapped, so ignore it
 
   // clip the damage to the window and quit if none:
@@ -1470,7 +1470,7 @@
   }
   Fl::damage(FL_DAMAGE_CHILD);
 }
-void fltk::Window::flush() {
+void Fl_Window::flush() {
   make_current();
 //if (damage() == FL_DAMAGE_EXPOSE && can_boxcheat(box())) fl_boxcheat = this;
   fl_clip_region(i->region); i->region = 0;

Modified: branches/branch-3.0-matt/src/Fl_Menu_global.cxx
===================================================================
--- branches/branch-3.0-matt/src/Fl_Menu_global.cxx     2009-10-05 13:06:33 UTC 
(rev 6915)
+++ branches/branch-3.0-matt/src/Fl_Menu_global.cxx     2009-10-05 20:00:40 UTC 
(rev 6916)
@@ -31,7 +31,6 @@
 
 #include <FL/Fl.H>
 #include <FL/Fl_Menu_.H>
-#include <FL/Fl_Window.H>
 
 static Fl_Menu_* the_widget;
 

Modified: branches/branch-3.0-matt/src/Fl_Window.cxx
===================================================================
--- branches/branch-3.0-matt/src/Fl_Window.cxx  2009-10-05 13:06:33 UTC (rev 
6915)
+++ branches/branch-3.0-matt/src/Fl_Window.cxx  2009-10-05 20:00:40 UTC (rev 
6916)
@@ -25,7 +25,7 @@
 //     http://www.fltk.org/str.php
 //
 
-// The fltk::Window is a window in the fltk library.
+// The Fl_Window is a window in the fltk library.
 // This is the system-independent portions.  The huge amount of 
 // crap you need to do to communicate with X is in Fl_x.cxx, the
 // equivalent (but totally different) crap for MSWindows is in Fl_win32.cxx
@@ -39,7 +39,7 @@
 #include <FL/fl_draw.H>
 #endif
 
-void fltk::Window::_Window() {
+void Fl_Window::_Fl_Window() {
   type(FL_WINDOW);
   box(FL_FLAT_BOX);
   if (Fl::scheme_bg_) {
@@ -59,24 +59,24 @@
   callback((Fl_Callback*)default_callback);
 }
 
-fltk::Window::Window(int X,int Y,int W, int H, const char *l)
+Fl_Window::Fl_Window(int X,int Y,int W, int H, const char *l)
 : Fl_Group(X, Y, W, H, l) {
   cursor_default = FL_CURSOR_DEFAULT;
   cursor_fg      = FL_BLACK;
   cursor_bg      = FL_WHITE;
 
-  _Window();
+  _Fl_Window();
   set_flag(FORCE_POSITION);
 }
 
-fltk::Window::Window(int W, int H, const char *l)
+Fl_Window::Fl_Window(int W, int H, const char *l)
 // fix common user error of a missing end() with current(0):
   : Fl_Group((Fl_Group::current(0),0), 0, W, H, l) {
   cursor_default = FL_CURSOR_DEFAULT;
   cursor_fg      = FL_BLACK;
   cursor_bg      = FL_WHITE;
 
-  _Window();
+  _Fl_Window();
   clear_visible();
 }
 
@@ -86,19 +86,19 @@
   return 0;
 }
 /** Gets the x position of the window on the screen */
-int fltk::Window::x_root() const {
-  fltk::Window *p = window();
+int Fl_Window::x_root() const {
+  Fl_Window *p = window();
   if (p) return p->x_root() + x();
   return x();
 }
 /** Gets the y position of the window on the screen */
-int fltk::Window::y_root() const {
-  fltk::Window *p = window();
+int Fl_Window::y_root() const {
+  Fl_Window *p = window();
   if (p) return p->y_root() + y();
   return y();
 }
 
-void fltk::Window::draw() {
+void Fl_Window::draw() {
 
   // The following is similar to Fl_Group::draw(), but ...
   //  - we draw the box with x=0 and y=0 instead of x() and y()
@@ -135,11 +135,11 @@
 # endif
 }
 
-void fltk::Window::label(const char *name) {
+void Fl_Window::label(const char *name) {
   label(name, iconlabel());
 }
 
-void fltk::Window::copy_label(const char *a) {
+void Fl_Window::copy_label(const char *a) {
   if (flags() & COPIED_LABEL) {
     free((void *)label());
     clear_flag(COPIED_LABEL);
@@ -150,7 +150,7 @@
 }
 
 
-void fltk::Window::iconlabel(const char *iname) {
+void Fl_Window::iconlabel(const char *iname) {
   unsigned saveflags = flags();
   label(label(), iname);
   set_flag(saveflags);
@@ -160,20 +160,20 @@
 // can now just change the callback for the window instead.
 
 /** Default callback for window widgets. It hides the window and then calls 
the default widget callback. */
-void Fl::default_atclose(fltk::Window* window, void* v) {
+void Fl::default_atclose(Fl_Window* window, void* v) {
   window->hide();
   Fl_Widget::default_callback(window, v); // put on Fl::read_queue()
 }
 /** Back compatibility: default window callback handler \see Fl::set_atclose() 
*/
-void (*Fl::atclose)(fltk::Window*, void*) = default_atclose;
+void (*Fl::atclose)(Fl_Window*, void*) = default_atclose;
 /** Back compatibility: Sets the default callback v for win to call on close 
event */
-void fltk::Window::default_callback(fltk::Window* win, void* v) {
+void Fl_Window::default_callback(Fl_Window* win, void* v) {
   Fl::atclose(win, v);
 }
 
-/**  Returns the last window that was made current. \see 
fltk::Window::make_current() */
-Fl_Window *fltk::Window::current() {
-  return (Fl_Window*)current_;
+/**  Returns the last window that was made current. \see 
Fl_Window::make_current() */
+Fl_Window *Fl_Window::current() {
+  return current_;
 }
 
 

Modified: branches/branch-3.0-matt/src/Fl_Window_fullscreen.cxx
===================================================================
--- branches/branch-3.0-matt/src/Fl_Window_fullscreen.cxx       2009-10-05 
13:06:33 UTC (rev 6915)
+++ branches/branch-3.0-matt/src/Fl_Window_fullscreen.cxx       2009-10-05 
20:00:40 UTC (rev 6916)
@@ -40,7 +40,7 @@
 
 #include <config.h>
 
-void fltk::Window::border(int b) {
+void Fl_Window::border(int b) {
   if (b) {
     if (border()) return;
     clear_flag(NOBORDER);
@@ -60,7 +60,7 @@
 #endif
 }
 
-void fltk::Window::fullscreen() {
+void Fl_Window::fullscreen() {
 #ifndef WIN32
   //this would clobber the fake wm, since it relies on the border flags to
   //determine its thickness
@@ -82,7 +82,7 @@
 #endif
 }
 
-void fltk::Window::fullscreen_off(int X,int Y,int W,int H) {
+void Fl_Window::fullscreen_off(int X,int Y,int W,int H) {
   // this order produces less blinking on IRIX:
   resize(X,Y,W,H);
 #ifndef WIN32

Modified: branches/branch-3.0-matt/src/Fl_Window_hotspot.cxx
===================================================================
--- branches/branch-3.0-matt/src/Fl_Window_hotspot.cxx  2009-10-05 13:06:33 UTC 
(rev 6915)
+++ branches/branch-3.0-matt/src/Fl_Window_hotspot.cxx  2009-10-05 20:00:40 UTC 
(rev 6916)
@@ -30,7 +30,7 @@
 #include <FL/x.H>
 #include <stdio.h>
 
-void fltk::Window::hotspot(int X, int Y, int offscreen) {
+void Fl_Window::hotspot(int X, int Y, int offscreen) {
   int mx,my;
 
   // Update the screen position based on the mouse position.
@@ -84,7 +84,7 @@
   position(X,Y);
 }
 
-void fltk::Window::hotspot(const Fl_Widget *o, int offscreen) {
+void Fl_Window::hotspot(const Fl_Widget *o, int offscreen) {
   int X = o->w()/2;
   int Y = o->h()/2;
   while (o != this && o) {

Modified: branches/branch-3.0-matt/src/Fl_Window_iconize.cxx
===================================================================
--- branches/branch-3.0-matt/src/Fl_Window_iconize.cxx  2009-10-05 13:06:33 UTC 
(rev 6915)
+++ branches/branch-3.0-matt/src/Fl_Window_iconize.cxx  2009-10-05 20:00:40 UTC 
(rev 6916)
@@ -29,7 +29,7 @@
 
 extern char fl_show_iconic; // in Fl_x.cxx
 
-void fltk::Window::iconize() {
+void Fl_Window::iconize() {
   if (!shown()) {
     fl_show_iconic = 1;
     show();

Modified: branches/branch-3.0-matt/src/Fl_arg.cxx
===================================================================
--- branches/branch-3.0-matt/src/Fl_arg.cxx     2009-10-05 13:06:33 UTC (rev 
6915)
+++ branches/branch-3.0-matt/src/Fl_arg.cxx     2009-10-05 20:00:40 UTC (rev 
6916)
@@ -250,7 +250,7 @@
   
        <LI>-iconic
   
-       <P>Iconifies the window using fltk::Window::iconize().</LI>
+       <P>Iconifies the window using Fl_Window::iconize().</LI>
   
        <LI>-kbd and -nokbd
   
@@ -259,7 +259,7 @@
   
        <LI>-name string
   
-       <P>Sets the window class using fltk::Window::xclass().</LI>
+       <P>Sets the window class using Fl_Window::xclass().</LI>
   
        <LI>-scheme string
   
@@ -267,7 +267,7 @@
   
        <LI>-title string
   
-       <P>Sets the window title using fltk::Window::label().</LI>
+       <P>Sets the window title using Fl_Window::label().</LI>
   
        <LI>-tooltips and -notooltips
   
@@ -295,7 +295,7 @@
 }
 
 // show a main window, use any parsed arguments
-void fltk::Window::show(int argc, char **argv) {
+void Fl_Window::show(int argc, char **argv) {
   if (argc && !arg_called) Fl::args(argc,argv);
 
   Fl::get_system_colors();

Modified: branches/branch-3.0-matt/src/Fl_grab.cxx
===================================================================
--- branches/branch-3.0-matt/src/Fl_grab.cxx    2009-10-05 13:06:33 UTC (rev 
6915)
+++ branches/branch-3.0-matt/src/Fl_grab.cxx    2009-10-05 20:00:40 UTC (rev 
6916)
@@ -34,7 +34,7 @@
 // Events are all sent to the "grab window", which does not even
 // have to be displayed (and in the case of Fl_Menu.cxx it isn't).
 // The system is also told to "grab" events and send them to this app.
-// This also modifies how fltk::Window::show() works, on X it turns on
+// This also modifies how Fl_Window::show() works, on X it turns on
 // override_redirect, it does similar things on WIN32.
 
 extern void fl_fix_focus(); // in Fl.cxx
@@ -51,7 +51,7 @@
 extern WindowRef fl_capture;
 #endif
 
-void Fl::grab(fltk::Window* win) {
+void Fl::grab(Fl_Window* win) {
   if (win) {
     if (!grab_) {
 #ifdef WIN32

Modified: branches/branch-3.0-matt/src/Fl_mac.cxx
===================================================================
--- branches/branch-3.0-matt/src/Fl_mac.cxx     2009-10-05 13:06:33 UTC (rev 
6915)
+++ branches/branch-3.0-matt/src/Fl_mac.cxx     2009-10-05 20:00:40 UTC (rev 
6916)
@@ -106,7 +106,7 @@
 const Fl_Window* fl_modal_for;       // parent of modal() window
 Fl_Region fl_window_region = 0;
 Window fl_window;
-fltk::Window *fltk::Window::current_;
+Fl_Window *Fl_Window::current_;
 EventRef fl_os_event;          // last (mouse) event
 
 // forward declarations of variables in this file
@@ -1731,7 +1731,7 @@
 /**
  * \todo this is a leftover from OS9 times. Please check how much applies to 
Carbon!
  */
-int Fl_X::fake_X_wm(const fltk::Window* w,int &X,int &Y, int &bt,int &bx, int 
&by) {
+int Fl_X::fake_X_wm(const Fl_Window* w,int &X,int &Y, int &bt,int &bx, int 
&by) {
   int W, H, xoff, yoff, dx, dy;
   int ret = bx = by = bt = 0;
   if (w->border() && !w->parent()) {
@@ -2099,7 +2099,7 @@
  * go ahead, create that (sub)window
  * \todo we should make menu windows slightly transparent for the new Mac look
  */
-void Fl_X::make(fltk::Window* w)
+void Fl_X::make(Fl_Window* w)
 {
   static int xyPos = 100;
   if ( w->parent() ) // create a subwindow
@@ -2194,7 +2194,7 @@
 
     if (w->non_modal() && Fl_X::first && !fl_disable_transient_for) {
       // find some other window to be "transient for":
-      fltk::Window* w = Fl_X::first->w;
+      Fl_Window* w = Fl_X::first->w;
       while (w->parent()) w = w->window(); // todo: this code does not make 
any sense! (w!=w??)
     }
 
@@ -2324,7 +2324,7 @@
 /**
  * Tell the OS what window sizes we want to allow
  */
-void fltk::Window::size_range_() {
+void Fl_Window::size_range_() {
   size_range_set = 1;
   HISize minSize = { minw, minh };
   HISize maxSize = { maxw?maxw:32000, maxh?maxh:32000 };
@@ -2359,7 +2359,7 @@
  * set the window title bar
  * \todo make the titlebar icon work!
  */
-void fltk::Window::label(const char *name,const char * /*iname*/) {
+void Fl_Window::label(const char *name,const char */*iname*/) {
   Fl_Widget::label(name);
 
   if (shown() || i) {
@@ -2371,7 +2371,7 @@
 /**
  * make a window visible
  */
-void fltk::Window::show() {
+void Fl_Window::show() {
   image(Fl::scheme_bg_);
   if (Fl::scheme_bg_) {
     labeltype(FL_NORMAL_LABEL);
@@ -2398,7 +2398,7 @@
 /**
  * resize a window
  */
-void fltk::Window::resize(int X,int Y,int W,int H) {
+void Fl_Window::resize(int X,int Y,int W,int H) {
   if (W<=0) W = 1; // OS X does not like zero width windows
   if (H<=0) H = 1;
   int is_a_resize = (W != w() || H != h());
@@ -2440,7 +2440,7 @@
 /**
  * make all drawing go into this window (called by subclass flush() impl.)
  */
-void fltk::Window::make_current() 
+void Fl_Window::make_current() 
 {
 #ifdef __APPLE_QUARTZ__
   OSStatus err;
@@ -2454,7 +2454,7 @@
   SetPort( GetWindowPort(i->xid) ); // \todo check for the handling of 
doublebuffered windows
 
   int xp = 0, yp = 0;
-  fltk::Window *win = this;
+  Fl_Window *win = this;
   while ( win ) 
   {
     if ( !win->window() )
@@ -2470,7 +2470,7 @@
   // \todo for performance reasons: we don't have to create this unless the 
child windows moved
   for ( Fl_X *cx = i->xidChildren; cx; cx = cx->xidNext )
   {
-    fltk::Window *cw = cx->w;
+    Fl_Window *cw = cx->w;
     if (!cw->visible_r()) continue;
     Fl_Region r = NewRgn();
     SetRectRgn( r, cw->x() - xp, cw->y() - yp, 
@@ -2848,13 +2848,13 @@
   p->xidChildren = x;
 }
 
-void MacDestroyWindow(fltk::Window *w, WindowPtr p) {
+void MacDestroyWindow(Fl_Window *w, WindowPtr p) {
   MacUnmapWindow(w, p);
   if (w && !w->parent() && p)
     DisposeWindow(p);
 }
 
-void MacMapWindow(fltk::Window *w, WindowPtr p) {
+void MacMapWindow(Fl_Window *w, WindowPtr p) {
   if (w && p)
     ShowWindow(p);
   //+ link to window list
@@ -2864,7 +2864,7 @@
   }
 }
 
-void MacUnmapWindow(fltk::Window *w, WindowPtr p) {
+void MacUnmapWindow(Fl_Window *w, WindowPtr p) {
   if (w && !w->parent() && p) 
     HideWindow(p);
   if (w && Fl_X::i(w)) 

Modified: branches/branch-3.0-matt/src/fl_cursor.cxx
===================================================================
--- branches/branch-3.0-matt/src/fl_cursor.cxx  2009-10-05 13:06:33 UTC (rev 
6915)
+++ branches/branch-3.0-matt/src/fl_cursor.cxx  2009-10-05 20:00:40 UTC (rev 
6916)
@@ -28,7 +28,7 @@
 // Change the current cursor.
 // Under X the cursor is attached to the X window.  I tried to hide
 // this and pretend that changing the cursor is a drawing function.
-// This avoids a field in the fltk::Window, and I suspect is more
+// This avoids a field in the Fl_Window, and I suspect is more
 // portable to other systems.
 
 #include <FL/Fl.H>
@@ -51,7 +51,7 @@
 
     For back compatibility only.
 */
-void fltk::Window::default_cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
+void Fl_Window::default_cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
 //  if (c == FL_CURSOR_DEFAULT) c = FL_CURSOR_ARROW;
 
   cursor_default = c;
@@ -67,10 +67,10 @@
 #    define IDC_HAND   MAKEINTRESOURCE(32649)
 #  endif // !IDC_HAND
 
-void fltk::Window::cursor(Fl_Cursor c, Fl_Color c1, Fl_Color c2) {
+void Fl_Window::cursor(Fl_Cursor c, Fl_Color c1, Fl_Color c2) {
   if (!shown()) return;
   // the cursor must be set for the top level window, not for subwindows
-  fltk::Window *w = window(), *toplevel = this;
+  Fl_Window *w = window(), *toplevel = this;
   while (w) { toplevel = w; w = w->window(); }
   if (toplevel != this) { toplevel->cursor(c, c1, c2); return; }
   // now set the actual cursor
@@ -209,7 +209,7 @@
 
 #undef E
 
-void fltk::Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) {
+void Fl_Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) {
   if (c == FL_CURSOR_DEFAULT) {
     c = cursor_default;
   }
@@ -292,7 +292,7 @@
   {{0}, {0}} // FL_CURSOR_NONE & unknown
 };
 
-void fltk::Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
+void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) {
   if (!shown()) return;
   Cursor xc;
   int deleteit = 0;

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

Reply via email to