On 12.03.2010, at 22:54, [email protected] wrote:

> 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)

[...]

> -/* \file
> -   Fl_Window widget . */
> +#include "../fltk3/Window.h"

Unfortunately "../fltk3/Window.h" is missing in svn. Please see also
below.

> 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

This should IMHO read:

    *svn* copy the FLTK1 header to fltk3

This would serve two purposes:

  (1) nobody can forget to check in the added header file

  (2) if there is any chance that your experimental branch would
eventually become the "real" branch (or better: head), we wouldn't
lose the history of files.

Maybe this would also apply to the fltk2 headers, but as I can see
from your first conversion, they would end up as "empty" compatibility
headers anyway, so that wouldn't matter (?).

> +- 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
> +

Can you elaborate what your current plan is? I'm curious ;-)


> 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);


Hmm, the above is maybe wrong. Does it compile?

There's a _typedef_ in the old code (and that is really confusing for
me, but Manolo should know about it) at line 79 in FL/mac.H:


#ifdef __APPLE_COCOA__
[...]
typedef void *Window; // this is really a pter to the subclass FLWindow 
of NSWindow


(see the comment), and then there is this at line 125:


// This object contains all mac-specific stuff about a window:
// WARNING: this object is highly subject to change!
class Fl_X
{
public:
   Window xid;              // Cocoa: FLWindow* ; Carbon: WindowRef


Sorry if I'm wrong, but I thought it's worth to be checked. I found
it by reading the diff, no testing or compiling ...

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

Reply via email to