Well I was sort of thinking about the reverse, where sfGtkWidget (probably a bad name as well) "is-a" sfWindow, and "has-a" the appropriate Gtk+ information (such as a handle to the widget and any associated data) In which case it (to me) seems important to be able to override things like UseVerticalSync(), SetCurrent(), and Display() because they could be vastly different (I think?) between different "backends" (at least thats how I was envisioning the setup)
http://picasaweb.google.com/ademan555/Misc/photo#5098490718798421314This is sort of what I was envisioning as far as the usage goes.
sfWindow & Window = sfGetGtkWidget(sfVideoMode(640, 480, 32), "gtkWidget");
sfWindowImpl * Impl = dynamic_cast <sfGtkWidgetImpl> (Window.GetImpl());
if (Impl)
gtk_widget_add(SomeOtherGtkWidget, Impl->GetGtkWidget()); //thereby adding the GtkWidget to SomeOtherGtkWidget
The factory would return sfWindows but the sfWindowImpl would depend on the function called, GetGtkWidget would obviously return a sfWindow with a sfGtkWidgetImpl which would internally handle all of the things needed by an application (such as initializing the surface, switching modes, flipping the front and back buffers).
And as far as my factory class, the more I think about it the sillier i think it is, there could be a CreateWindow() function (free of any class) which takes an implementation type enum(gtk, qt, whatever), or even just CreateGtkWidgetWindow() or something like that.
(I realized that deducing the correct sfWindowImpl based on the things required of it is sort of impossible considering the program needs to know whether it's a wxWidget or a GtkWidget that's being returned)
Anyways, its rather late and I need some sleep (probably evident in my deteriorating grammar) but I'll be back.
cheers
-Dan