Author: matt Date: 2010-03-12 13:54:51 -0800 (Fri, 12 Mar 2010) New Revision: 7251 Log: FLTK 123: ad-hoc converted Fl_Window. 'hello.cxx' sample code still compiles.
Modified: branches/branch-3.0-matt/FL/Fl_Window.H branches/branch-3.0-matt/README.123 branches/branch-3.0-matt/fltk/Window.h branches/branch-3.0-matt/ide/Xcode3/FLTK.xcodeproj/project.pbxproj branches/branch-3.0-matt/src/Fl.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_cocoa.mm branches/branch-3.0-matt/src/fl_cursor.cxx Modified: branches/branch-3.0-matt/FL/Fl_Window.H =================================================================== --- branches/branch-3.0-matt/FL/Fl_Window.H 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/FL/Fl_Window.H 2010-03-12 21:54:51 UTC (rev 7251) @@ -1,450 +1,9 @@ // // "$Id$" // -// Window header file for the Fast Light Tool Kit (FLTK). -// -// Copyright 1998-2009 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems on the following page: -// -// http://www.fltk.org/str.php -// -/* \file - Fl_Window widget . */ +#include "../fltk3/Window.h" -#ifndef Fl_Window_H -#define Fl_Window_H - -#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(). - - Once you create a window, you usually add children Fl_Widget - 's to it by using window->add(child) for each new widget. - See Fl_Group for more information on how to add and remove children. - - There are several subclasses of Fl_Window that provide - double-buffering, overlay, menu, and OpenGL support. - - 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; - 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(); - - /** - 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 - */ - void force_position(int force) { - if (force) set_flag(FORCE_POSITION); - else clear_flag(FORCE_POSITION); - } - /** - 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); } - -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. - - 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. - - 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. - - 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. - - \see Fl_Window(int x, int y, int w, int h, const char* title = 0) - */ - 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 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(). - */ - 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); - /** 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(). - - 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->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. The second form is used for top-level - windows and allows standard arguments to be parsed from the - command-line. - - 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(); - /** - 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(); - /** - 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. - - 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(); - - /** Returns an Fl_Window pointer if this widget is an Fl_Window. - - \retval NULL if this widget is not derived from Fl_Window. - \note This method is provided to avoid dynamic_cast. - \todo More documentation ... - */ - virtual Fl_Window* as_window() const { return (Fl_Window*)this; } - - // 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 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 - // // End of "$Id$". // Modified: branches/branch-3.0-matt/README.123 =================================================================== --- branches/branch-3.0-matt/README.123 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/README.123 2010-03-12 21:54:51 UTC (rev 7251) @@ -687,3 +687,17 @@ 2: struct NamedStyle + CONVERTING A CLASS + +- find the matchin headers +- copy the FLTK1 header to fltk3 +- append the same header agin +- append the fltk2 header +- fix the #ifdef's +- put the main class into the new namespace and rename the class +- write a new stub that is derived from the class above with the old class name +- fix constructor and destructor +- fix the class part of all method implementations +- do *not* change any parameters, variable types, or return types yet +- compile. Wherever there is an illegal conversion error, simply insert a cast for now + Modified: branches/branch-3.0-matt/fltk/Window.h =================================================================== --- branches/branch-3.0-matt/fltk/Window.h 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/fltk/Window.h 2010-03-12 21:54:51 UTC (rev 7251) @@ -1,158 +1,9 @@ +// // "$Id: Window.h 6150 2008-08-04 22:53:30Z spitzak $" // -// Window widget. This must be the outermost group. You can also put -// them inside other widgets to use the system's window hierarchy. -// -// Copyright 1998-2006 by Bill Spitzak and others. -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Library General Public -// License as published by the Free Software Foundation; either -// version 2 of the License, or (at your option) any later version. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Library General Public License for more details. -// -// You should have received a copy of the GNU Library General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 -// USA. -// -// Please report all bugs and problems to "[email protected]". -#ifndef fltk_Window_h -#define fltk_Window_h +#include "../fltk3/Window.h" -#include "Group.h" - -namespace fltk { - -// value for x,y to indicate window system places window -const int USEDEFAULT = ((int)0x80000000); // same as Win32 value - -class CreatedWindow; -class Monitor; - -// implementations of methods of Window are in different files in src/ - -class FL_API Window : public Group { -public: - - Window(int,int,int,int, const char* = 0, bool begin = false); - Window(int,int, const char* = 0); - 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;} - - 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! - - 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_(); } - bool get_size_range( int *min_w, int *min_h, int *max_w, int *max_h ); - - bool shown() const {return i != 0;} - void show(); - void show(int, char**); - 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 - // // End of "$Id: Window.h 6150 2008-08-04 22:53:30Z spitzak $". // Modified: branches/branch-3.0-matt/ide/Xcode3/FLTK.xcodeproj/project.pbxproj =================================================================== --- branches/branch-3.0-matt/ide/Xcode3/FLTK.xcodeproj/project.pbxproj 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/ide/Xcode3/FLTK.xcodeproj/project.pbxproj 2010-03-12 21:54:51 UTC (rev 7251) @@ -439,6 +439,7 @@ C84D499C11BC81C1A4336044 /* Fl_Single_Window.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 45E8C30F9147F7F23B15E75F /* Fl_Single_Window.cxx */; }; C8C88B82EBB4DFA43BB3A147 /* jmemnobs.c in Sources */ = {isa = PBXBuildFile; fileRef = D278AF96FBF5F474BE2C348D /* jmemnobs.c */; }; C9039A6D472AFBDB4D5D3581 /* fltkgl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4AED96DAF2EDB1950E04795 /* fltkgl.framework */; }; + C9345D2C114AE69A00612CF1 /* AudioToolbox.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9345D2B114AE69A00612CF1 /* AudioToolbox.framework */; }; C9C84B2983DC793B141DDC70 /* ide_maketools.cxx in Sources */ = {isa = PBXBuildFile; fileRef = B65FCD2B8489E2BBAA3F695A /* ide_maketools.cxx */; }; CA0BD11A864DD8E6018DDC43 /* Fl_File_Input.cxx in Sources */ = {isa = PBXBuildFile; fileRef = 19E46DC28A1945E3BB3FA0EC /* Fl_File_Input.cxx */; }; CA29F412020993F3D156CA64 /* jdinput.c in Sources */ = {isa = PBXBuildFile; fileRef = E28D295E888C8D18A99E45DB /* jdinput.c */; }; @@ -3851,6 +3852,7 @@ C7F31D0DB5A326C914FBFE48 /* fl_file_dir.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fl_file_dir.cxx; path = ../../src/fl_file_dir.cxx; sourceTree = SOURCE_ROOT; }; C8320D29ED1BA62DF881FD21 /* jidctred.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = jidctred.c; path = ../../jpeg/jidctred.c; sourceTree = SOURCE_ROOT; }; C8FCAB4E2E2C4369C61BFD12 /* Fluid_Image.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Fluid_Image.cxx; path = ../../fluid/Fluid_Image.cxx; sourceTree = SOURCE_ROOT; }; + C9345D2B114AE69A00612CF1 /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; }; C9F70AA7DF730564A9DD1BFD /* pngwtran.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pngwtran.c; path = ../../png/pngwtran.c; sourceTree = SOURCE_ROOT; }; CA38333A14E4BA43F4E01CAA /* fl_show_colormap.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = fl_show_colormap.cxx; path = ../../src/fl_show_colormap.cxx; sourceTree = SOURCE_ROOT; }; CA39566FD1F25D47C83DE042 /* glut_font.cxx */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glut_font.cxx; path = ../../src/glut_font.cxx; sourceTree = SOURCE_ROOT; }; @@ -4425,6 +4427,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + C9345D2C114AE69A00612CF1 /* AudioToolbox.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -5170,6 +5173,7 @@ 2F51AF9376F9742B795012D0 /* case.c */, 78080C8ABD6D3BAFFC7F7A30 /* is_right2left.c */, 66D525B9A0312CF58C18AB45 /* is_spacing.c */, + C9345D2B114AE69A00612CF1 /* AudioToolbox.framework */, ); name = fltk; sourceTree = "<group>"; Modified: branches/branch-3.0-matt/src/Fl.cxx =================================================================== --- branches/branch-3.0-matt/src/Fl.cxx 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/src/Fl.cxx 2010-03-12 21:54:51 UTC (rev 7251) @@ -1171,7 +1171,7 @@ extern void fl_destroy_xft_draw(Window); #endif -void Fl_Window::hide() { +void fltk::Window::hide() { clear_visible(); if (!shown()) return; @@ -1255,7 +1255,7 @@ } XDestroyWindow(fl_display, ip->xid); #elif defined(__APPLE_QUARTZ__) - MacDestroyWindow(this, ip->xid); + MacDestroyWindow((Fl_Window*)this, ip->xid); #else # error unsupported platform #endif @@ -1268,7 +1268,7 @@ delete ip; } -Fl_Window::~Fl_Window() { +fltk::Window::~Window() { hide(); } @@ -1280,7 +1280,7 @@ // Fl_Window::show() or Fl_Window::hide() is called, or in response to // iconize/deiconize events from the system. -int Fl_Window::handle(int ev) +int fltk::Window::handle(int ev) { if (parent()) { switch (ev) { @@ -1291,9 +1291,9 @@ XMapWindow(fl_display, fl_xid(this)); // extra map calls are harmless #elif defined(__APPLE_QUARTZ__) #ifdef __APPLE_COCOA__ - MacMapWindow(this, i->xid); + MacMapWindow((Fl_Window*)this, i->xid); #else - MacMapWindow(this, fl_xid(this)); + MacMapWindow((Fl_Window*)this, fl_xid(this)); #endif #else # error unsupported platform @@ -1317,9 +1317,9 @@ XUnmapWindow(fl_display, fl_xid(this)); #elif defined(__APPLE_QUARTZ__) #ifdef __APPLE_COCOA__ - MacUnmapWindow(this, i->xid); + MacUnmapWindow((Fl_Window*)this, i->xid); #else - MacUnmapWindow(this, fl_xid(this)); + MacUnmapWindow((Fl_Window*)this, fl_xid(this)); #endif #else # error platform unsupported @@ -1502,7 +1502,7 @@ } Fl::damage(FL_DAMAGE_CHILD); } -void Fl_Window::flush() { +void fltk::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_Window.cxx =================================================================== --- branches/branch-3.0-matt/src/Fl_Window.cxx 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/src/Fl_Window.cxx 2010-03-12 21:54:51 UTC (rev 7251) @@ -40,7 +40,7 @@ #include <FL/fl_draw.H> #endif -void Fl_Window::_Fl_Window() { +void fltk::Window::_Window() { type(FL_WINDOW); box(FL_FLAT_BOX); if (Fl::scheme_bg_) { @@ -60,24 +60,24 @@ callback((Fl_Callback*)default_callback); } -Fl_Window::Fl_Window(int X,int Y,int W, int H, const char *l) +fltk::Window::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; - _Fl_Window(); + _Window(); set_flag(FORCE_POSITION); } -Fl_Window::Fl_Window(int W, int H, const char *l) +fltk::Window::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; - _Fl_Window(); + _Window(); clear_visible(); } @@ -87,19 +87,19 @@ return 0; } /** Gets the x position of the window on the screen */ -int Fl_Window::x_root() const { +int fltk::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 Fl_Window::y_root() const { +int fltk::Window::y_root() const { Fl_Window *p = window(); if (p) return p->y_root() + y(); return y(); } -void Fl_Window::draw() { +void fltk::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() @@ -140,11 +140,11 @@ # endif } -void Fl_Window::label(const char *name) { +void fltk::Window::label(const char *name) { label(name, iconlabel()); } -void Fl_Window::copy_label(const char *a) { +void fltk::Window::copy_label(const char *a) { if (flags() & COPIED_LABEL) { free((void *)label()); clear_flag(COPIED_LABEL); @@ -155,7 +155,7 @@ } -void Fl_Window::iconlabel(const char *iname) { +void fltk::Window::iconlabel(const char *iname) { label(label(), iname); } @@ -170,12 +170,12 @@ /** Back compatibility: default window callback handler \see Fl::set_atclose() */ void (*Fl::atclose)(Fl_Window*, void*) = default_atclose; /** Back compatibility: Sets the default callback v for win to call on close event */ -void Fl_Window::default_callback(Fl_Window* win, void* v) { - Fl::atclose(win, v); +void fltk::Window::default_callback(fltk::Window* win, void* v) { + Fl::atclose((Fl_Window*)win, v); } /** Returns the last window that was made current. \see Fl_Window::make_current() */ -Fl_Window *Fl_Window::current() { +Fl_Window *fltk::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 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/src/Fl_Window_fullscreen.cxx 2010-03-12 21:54:51 UTC (rev 7251) @@ -40,7 +40,7 @@ #include <config.h> -void Fl_Window::border(int b) { +void fltk::Window::border(int b) { if (b) { if (border()) return; clear_flag(NOBORDER); @@ -60,7 +60,7 @@ #endif } -void Fl_Window::fullscreen() { +void fltk::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 Fl_Window::fullscreen_off(int X,int Y,int W,int H) { +void fltk::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 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/src/Fl_Window_hotspot.cxx 2010-03-12 21:54:51 UTC (rev 7251) @@ -30,7 +30,7 @@ #include <FL/x.H> #include <stdio.h> -void Fl_Window::hotspot(int X, int Y, int offscreen) { +void fltk::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 Fl_Window::hotspot(const Fl_Widget *o, int offscreen) { +void fltk::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 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/src/Fl_Window_iconize.cxx 2010-03-12 21:54:51 UTC (rev 7251) @@ -29,7 +29,7 @@ extern char fl_show_iconic; // in Fl_x.cxx -void Fl_Window::iconize() { +void fltk::Window::iconize() { if (!shown()) { fl_show_iconic = 1; show(); @@ -38,7 +38,7 @@ ShowWindow(i->xid, SW_SHOWMINNOACTIVE); #elif defined(__APPLE__) #ifdef __APPLE_COCOA__ - MacCollapseWindow((Window)i->xid); + MacCollapseWindow((Fl_Window*)i->xid); #else CollapseWindow( i->xid, true ); #endif Modified: branches/branch-3.0-matt/src/Fl_arg.cxx =================================================================== --- branches/branch-3.0-matt/src/Fl_arg.cxx 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/src/Fl_arg.cxx 2010-03-12 21:54:51 UTC (rev 7251) @@ -288,7 +288,7 @@ } // show a main window, use any parsed arguments -void Fl_Window::show(int argc, char **argv) { +void fltk::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_cocoa.mm =================================================================== --- branches/branch-3.0-matt/src/Fl_cocoa.mm 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/src/Fl_cocoa.mm 2010-03-12 21:54:51 UTC (rev 7251) @@ -164,7 +164,7 @@ int fl_disable_transient_for; // secret method of removing TRANSIENT_FOR //const Fl_Window* fl_modal_for; // parent of modal() window Window fl_window; -Fl_Window *Fl_Window::current_; +Fl_Window *fltk::Window::current_; //EventRef fl_os_event; // last (mouse) event // forward declarations of variables in this file @@ -2253,7 +2253,7 @@ /* * Tell the OS what window sizes we want to allow */ -void Fl_Window::size_range_() { +void fltk::Window::size_range_() { int bx, by, bt; get_window_frame_sizes(bx, by, bt); size_range_set = 1; @@ -2291,7 +2291,7 @@ * set the window title bar * \todo make the titlebar icon work! */ -void Fl_Window::label(const char *name,const char */*iname*/) { +void fltk::Window::label(const char *name,const char */*iname*/) { Fl_Widget::label(name); if (shown() || i) { q_set_window_title((NSWindow*)i->xid, name); @@ -2302,7 +2302,7 @@ /* * make a window visible */ -void Fl_Window::show() { +void fltk::Window::show() { image(Fl::scheme_bg_); if (Fl::scheme_bg_) { labeltype(FL_NORMAL_LABEL); @@ -2312,7 +2312,7 @@ } Fl_Tooltip::exit(this); if (!shown() || !i) { - Fl_X::make(this); + Fl_X::make((Fl_Window*)this); } else { if ( !parent() ) { if ([(NSWindow*)i->xid isMiniaturized]) { @@ -2330,14 +2330,14 @@ /* * resize a window */ -void Fl_Window::resize(int X,int Y,int W,int H) { +void fltk::Window::resize(int X,int Y,int W,int H) { int bx, by, bt; if ( ! this->border() ) bt = 0; else get_window_frame_sizes(bx, by, bt); 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()); - // printf("Fl_Window::resize(X=%d, Y=%d, W=%d, H=%d), is_a_resize=%d, resize_from_system=%p, this=%p\n", + // printf("fltk::Window::resize(X=%d, Y=%d, W=%d, H=%d), is_a_resize=%d, resize_from_system=%p, this=%p\n", // X, Y, W, H, is_a_resize, resize_from_system, this); if (X != x() || Y != y()) set_flag(FORCE_POSITION); else if (!is_a_resize) return; @@ -2380,14 +2380,14 @@ /* * make all drawing go into this window (called by subclass flush() impl.) */ -void Fl_Window::make_current() +void fltk::Window::make_current() { Fl_X::q_release_context(); fl_window = i->xid; - current_ = this; + current_ = (Fl_Window*)this; int xp = 0, yp = 0; - Fl_Window *win = this; + Fl_Window *win = (Fl_Window*)this; while ( win ) { if ( !win->window() ) break; @@ -2417,7 +2417,7 @@ CGFloat hgt = [[(NSWindow*)fl_window contentView] frame].size.height; CGContextTranslateCTM(fl_gc, 0.5, hgt-0.5f); CGContextScaleCTM(fl_gc, 1.0f, -1.0f); // now 0,0 is top-left point of the window - win = this; + win = (Fl_Window*)this; while(win && win->window()) { // translate to subwindow origin if this is a subwindow context CGContextTranslateCTM(fl_gc, win->x(), win->y()); win = win->window(); Modified: branches/branch-3.0-matt/src/fl_cursor.cxx =================================================================== --- branches/branch-3.0-matt/src/fl_cursor.cxx 2010-03-12 21:14:19 UTC (rev 7250) +++ branches/branch-3.0-matt/src/fl_cursor.cxx 2010-03-12 21:54:51 UTC (rev 7251) @@ -51,7 +51,7 @@ For back compatibility only. */ -void Fl_Window::default_cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) { +void fltk::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,7 +67,7 @@ # define IDC_HAND MAKEINTRESOURCE(32649) # endif // !IDC_HAND -void Fl_Window::cursor(Fl_Cursor c, Fl_Color c1, Fl_Color c2) { +void fltk::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 Fl_Window *w = window(), *toplevel = this; @@ -229,7 +229,7 @@ return (CGContextRef)off; } -void Fl_Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) { +void fltk::Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) { if (c == FL_CURSOR_DEFAULT) { c = cursor_default; } @@ -316,7 +316,7 @@ #undef E -void Fl_Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) { +void fltk::Window::cursor(Fl_Cursor c, Fl_Color, Fl_Color) { if (c == FL_CURSOR_DEFAULT) { c = cursor_default; } @@ -401,7 +401,7 @@ {{0}, {0}} // FL_CURSOR_NONE & unknown }; -void Fl_Window::cursor(Fl_Cursor c, Fl_Color fg, Fl_Color bg) { +void fltk::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
