]> git.saurik.com Git - wxWidgets.git/commitdiff
initial (not yet working) code for DirectFB port
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 27 Aug 2006 09:42:42 +0000 (09:42 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 27 Aug 2006 09:42:42 +0000 (09:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40865 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

66 files changed:
Makefile.in
autoconf_inc.m4
build/bakefiles/files.bkl
configure
configure.in
include/wx/app.h
include/wx/bitmap.h
include/wx/brush.h
include/wx/chkconf.h
include/wx/colour.h
include/wx/cursor.h
include/wx/dc.h
include/wx/dcclient.h
include/wx/dcmemory.h
include/wx/dcscreen.h
include/wx/defs.h
include/wx/dfb/app.h [new file with mode: 0644]
include/wx/dfb/bitmap.h [new file with mode: 0644]
include/wx/dfb/brush.h [new file with mode: 0644]
include/wx/dfb/chkconf.h [new file with mode: 0644]
include/wx/dfb/cursor.h [new file with mode: 0644]
include/wx/dfb/dc.h [new file with mode: 0644]
include/wx/dfb/dcclient.h [new file with mode: 0644]
include/wx/dfb/dcmemory.h [new file with mode: 0644]
include/wx/dfb/dcscreen.h [new file with mode: 0644]
include/wx/dfb/evtloop.h [new file with mode: 0644]
include/wx/dfb/font.h [new file with mode: 0644]
include/wx/dfb/ifacehelpers.h [new file with mode: 0644]
include/wx/dfb/pen.h [new file with mode: 0644]
include/wx/dfb/private.h [new file with mode: 0644]
include/wx/dfb/region.h [new file with mode: 0644]
include/wx/dfb/toplevel.h [new file with mode: 0644]
include/wx/dfb/window.h [new file with mode: 0644]
include/wx/encinfo.h
include/wx/evtloop.h
include/wx/features.h
include/wx/font.h
include/wx/icon.h
include/wx/pen.h
include/wx/platinfo.h
include/wx/region.h
include/wx/timer.h
include/wx/toplevel.h
include/wx/window.h
src/common/bmpbase.cpp
src/common/evtloopcmn.cpp
src/common/platinfo.cpp
src/dfb/app.cpp [new file with mode: 0644]
src/dfb/bitmap.cpp [new file with mode: 0644]
src/dfb/brush.cpp [new file with mode: 0644]
src/dfb/cursor.cpp [new file with mode: 0644]
src/dfb/dc.cpp [new file with mode: 0644]
src/dfb/dcclient.cpp [new file with mode: 0644]
src/dfb/dcmemory.cpp [new file with mode: 0644]
src/dfb/dcscreen.cpp [new file with mode: 0644]
src/dfb/evtloop.cpp [new file with mode: 0644]
src/dfb/font.cpp [new file with mode: 0644]
src/dfb/fontenum.cpp [new file with mode: 0644]
src/dfb/ifacehelpers.cpp [new file with mode: 0644]
src/dfb/pen.cpp [new file with mode: 0644]
src/dfb/region.cpp [new file with mode: 0644]
src/dfb/settings.cpp [new file with mode: 0644]
src/dfb/toplevel.cpp [new file with mode: 0644]
src/dfb/utils.cpp [new file with mode: 0644]
src/dfb/window.cpp [new file with mode: 0644]
src/univ/winuniv.cpp

index d1d9b2528b010c940996b694fe4ab4bccb223e95..6cc0c8afb2292224070a162f54afad628ed95d29 100644 (file)
@@ -1659,6 +1659,30 @@ COND_PLATFORM_WIN32_1_BASE_PLATFORM_HDR =  \
 @COND_PLATFORM_WIN32_1@NET_PLATFORM_HDR = \
 @COND_PLATFORM_WIN32_1@        wx/msw/gsockmsw.h $(NET_WINCE_HDR)
 @COND_TOOLKIT_COCOA@LOWLEVEL_HDR = 
+COND_TOOLKIT_DFB_LOWLEVEL_HDR =  \
+       wx/dfb/app.h \
+       wx/dfb/bitmap.h \
+       wx/dfb/brush.h \
+       wx/dfb/chkconf.h \
+       wx/dfb/cursor.h \
+       wx/dfb/dc.h \
+       wx/dfb/dcclient.h \
+       wx/dfb/dcmemory.h \
+       wx/dfb/dcscreen.h \
+       wx/dfb/evtloop.h \
+       wx/dfb/font.h \
+       wx/dfb/ifacehelpers.h \
+       wx/dfb/pen.h \
+       wx/dfb/popupwin.h \
+       wx/dfb/private.h \
+       wx/dfb/region.h \
+       wx/dfb/toplevel.h \
+       wx/dfb/window.h \
+       wx/generic/caret.h \
+       wx/generic/colour.h \
+       wx/generic/icon.h \
+       wx/generic/timer.h
+@COND_TOOLKIT_DFB@LOWLEVEL_HDR = $(COND_TOOLKIT_DFB_LOWLEVEL_HDR)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION__LOWLEVEL_HDR =  \
        wx/generic/caret.h \
        wx/unix/fontutil.h \
@@ -3534,6 +3558,30 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS =  \
 @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS)
 @COND_TOOLKIT_COCOA@__LOWLEVEL_SRC_OBJECTS = \
 @COND_TOOLKIT_COCOA@   monodll_gsockosx.o monodll_hid.o monodll_utilsexc_cf.o
+COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS =  \
+       monodll_app.o \
+       monodll_bitmap.o \
+       monodll_brush.o \
+       monodll_cursor.o \
+       monodll_dc.o \
+       monodll_dcclient.o \
+       monodll_dcmemory.o \
+       monodll_dcscreen.o \
+       monodll_evtloop.o \
+       monodll_font.o \
+       monodll_fontenum.o \
+       monodll_ifacehelpers.o \
+       monodll_pen.o \
+       monodll_region.o \
+       monodll_settings.o \
+       monodll_toplevel.o \
+       monodll_utils.o \
+       monodll_window.o \
+       monodll_caret.o \
+       monodll_colour.o \
+       monodll_icon.o \
+       monodll_timer.o
+@COND_TOOLKIT_DFB@__LOWLEVEL_SRC_OBJECTS = $(COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS =  \
        monodll_caret.o \
        monodll_dialup.o \
@@ -4327,6 +4375,30 @@ COND_PLATFORM_MACOSX_1___MAC_OSX_SRC_OBJECTS =  \
 @COND_PLATFORM_MACOSX_1@__MAC_OSX_SRC_OBJECTS = $(COND_PLATFORM_MACOSX_1___MAC_OSX_SRC_OBJECTS)
 @COND_TOOLKIT_COCOA@__LOWLEVEL_SRC_OBJECTS_1 = \
 @COND_TOOLKIT_COCOA@   monodll_gsockosx.o monodll_hid.o monodll_utilsexc_cf.o
+COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_1 =  \
+       monodll_app.o \
+       monodll_bitmap.o \
+       monodll_brush.o \
+       monodll_cursor.o \
+       monodll_dc.o \
+       monodll_dcclient.o \
+       monodll_dcmemory.o \
+       monodll_dcscreen.o \
+       monodll_evtloop.o \
+       monodll_font.o \
+       monodll_fontenum.o \
+       monodll_ifacehelpers.o \
+       monodll_pen.o \
+       monodll_region.o \
+       monodll_settings.o \
+       monodll_toplevel.o \
+       monodll_utils.o \
+       monodll_window.o \
+       monodll_caret.o \
+       monodll_colour.o \
+       monodll_icon.o \
+       monodll_timer.o
+@COND_TOOLKIT_DFB@__LOWLEVEL_SRC_OBJECTS_1 = $(COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_1)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_1 =  \
        monodll_caret.o \
        monodll_dialup.o \
@@ -5186,6 +5258,30 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1 =  \
 @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS_1 = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_1)
 @COND_TOOLKIT_COCOA@__LOWLEVEL_SRC_OBJECTS_2 = \
 @COND_TOOLKIT_COCOA@   monolib_gsockosx.o monolib_hid.o monolib_utilsexc_cf.o
+COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_2 =  \
+       monolib_app.o \
+       monolib_bitmap.o \
+       monolib_brush.o \
+       monolib_cursor.o \
+       monolib_dc.o \
+       monolib_dcclient.o \
+       monolib_dcmemory.o \
+       monolib_dcscreen.o \
+       monolib_evtloop.o \
+       monolib_font.o \
+       monolib_fontenum.o \
+       monolib_ifacehelpers.o \
+       monolib_pen.o \
+       monolib_region.o \
+       monolib_settings.o \
+       monolib_toplevel.o \
+       monolib_utils.o \
+       monolib_window.o \
+       monolib_caret.o \
+       monolib_colour.o \
+       monolib_icon.o \
+       monolib_timer.o
+@COND_TOOLKIT_DFB@__LOWLEVEL_SRC_OBJECTS_2 = $(COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_2)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_2 =  \
        monolib_caret.o \
        monolib_dialup.o \
@@ -5980,6 +6076,30 @@ COND_PLATFORM_MACOSX_1___MAC_OSX_SRC_OBJECTS_1 =  \
 @COND_PLATFORM_MACOSX_1@__MAC_OSX_SRC_OBJECTS_1 = $(COND_PLATFORM_MACOSX_1___MAC_OSX_SRC_OBJECTS_1)
 @COND_TOOLKIT_COCOA@__LOWLEVEL_SRC_OBJECTS_3 = \
 @COND_TOOLKIT_COCOA@   monolib_gsockosx.o monolib_hid.o monolib_utilsexc_cf.o
+COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_3 =  \
+       monolib_app.o \
+       monolib_bitmap.o \
+       monolib_brush.o \
+       monolib_cursor.o \
+       monolib_dc.o \
+       monolib_dcclient.o \
+       monolib_dcmemory.o \
+       monolib_dcscreen.o \
+       monolib_evtloop.o \
+       monolib_font.o \
+       monolib_fontenum.o \
+       monolib_ifacehelpers.o \
+       monolib_pen.o \
+       monolib_region.o \
+       monolib_settings.o \
+       monolib_toplevel.o \
+       monolib_utils.o \
+       monolib_window.o \
+       monolib_caret.o \
+       monolib_colour.o \
+       monolib_icon.o \
+       monolib_timer.o
+@COND_TOOLKIT_DFB@__LOWLEVEL_SRC_OBJECTS_3 = $(COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_3)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_3 =  \
        monolib_caret.o \
        monolib_dialup.o \
@@ -7057,6 +7177,30 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2 =  \
 @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS_2 = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_2)
 @COND_TOOLKIT_COCOA@__LOWLEVEL_SRC_OBJECTS_4 = \
 @COND_TOOLKIT_COCOA@   coredll_gsockosx.o coredll_hid.o coredll_utilsexc_cf.o
+COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_4 =  \
+       coredll_app.o \
+       coredll_bitmap.o \
+       coredll_brush.o \
+       coredll_cursor.o \
+       coredll_dc.o \
+       coredll_dcclient.o \
+       coredll_dcmemory.o \
+       coredll_dcscreen.o \
+       coredll_evtloop.o \
+       coredll_font.o \
+       coredll_fontenum.o \
+       coredll_ifacehelpers.o \
+       coredll_pen.o \
+       coredll_region.o \
+       coredll_settings.o \
+       coredll_toplevel.o \
+       coredll_utils.o \
+       coredll_window.o \
+       coredll_caret.o \
+       coredll_colour.o \
+       coredll_icon.o \
+       coredll_timer.o
+@COND_TOOLKIT_DFB@__LOWLEVEL_SRC_OBJECTS_4 = $(COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_4)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_4 =  \
        coredll_caret.o \
        coredll_dialup.o \
@@ -7851,6 +7995,30 @@ COND_PLATFORM_MACOSX_1___MAC_OSX_SRC_OBJECTS_2 =  \
 @COND_PLATFORM_MACOSX_1@__MAC_OSX_SRC_OBJECTS_2 = $(COND_PLATFORM_MACOSX_1___MAC_OSX_SRC_OBJECTS_2)
 @COND_TOOLKIT_COCOA@__LOWLEVEL_SRC_OBJECTS_5 = \
 @COND_TOOLKIT_COCOA@   coredll_gsockosx.o coredll_hid.o coredll_utilsexc_cf.o
+COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_5 =  \
+       coredll_app.o \
+       coredll_bitmap.o \
+       coredll_brush.o \
+       coredll_cursor.o \
+       coredll_dc.o \
+       coredll_dcclient.o \
+       coredll_dcmemory.o \
+       coredll_dcscreen.o \
+       coredll_evtloop.o \
+       coredll_font.o \
+       coredll_fontenum.o \
+       coredll_ifacehelpers.o \
+       coredll_pen.o \
+       coredll_region.o \
+       coredll_settings.o \
+       coredll_toplevel.o \
+       coredll_utils.o \
+       coredll_window.o \
+       coredll_caret.o \
+       coredll_colour.o \
+       coredll_icon.o \
+       coredll_timer.o
+@COND_TOOLKIT_DFB@__LOWLEVEL_SRC_OBJECTS_5 = $(COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_5)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_5 =  \
        coredll_caret.o \
        coredll_dialup.o \
@@ -8406,6 +8574,30 @@ COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3 =  \
 @COND_USE_GUI_1_WXUNIV_1@__CORE_SRC_OBJECTS_3 = $(COND_USE_GUI_1_WXUNIV_1___CORE_SRC_OBJECTS_3)
 @COND_TOOLKIT_COCOA@__LOWLEVEL_SRC_OBJECTS_6 = \
 @COND_TOOLKIT_COCOA@   corelib_gsockosx.o corelib_hid.o corelib_utilsexc_cf.o
+COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_6 =  \
+       corelib_app.o \
+       corelib_bitmap.o \
+       corelib_brush.o \
+       corelib_cursor.o \
+       corelib_dc.o \
+       corelib_dcclient.o \
+       corelib_dcmemory.o \
+       corelib_dcscreen.o \
+       corelib_evtloop.o \
+       corelib_font.o \
+       corelib_fontenum.o \
+       corelib_ifacehelpers.o \
+       corelib_pen.o \
+       corelib_region.o \
+       corelib_settings.o \
+       corelib_toplevel.o \
+       corelib_utils.o \
+       corelib_window.o \
+       corelib_caret.o \
+       corelib_colour.o \
+       corelib_icon.o \
+       corelib_timer.o
+@COND_TOOLKIT_DFB@__LOWLEVEL_SRC_OBJECTS_6 = $(COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_6)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_6 =  \
        corelib_caret.o \
        corelib_dialup.o \
@@ -9200,6 +9392,30 @@ COND_PLATFORM_MACOSX_1___MAC_OSX_SRC_OBJECTS_3 =  \
 @COND_PLATFORM_MACOSX_1@__MAC_OSX_SRC_OBJECTS_3 = $(COND_PLATFORM_MACOSX_1___MAC_OSX_SRC_OBJECTS_3)
 @COND_TOOLKIT_COCOA@__LOWLEVEL_SRC_OBJECTS_7 = \
 @COND_TOOLKIT_COCOA@   corelib_gsockosx.o corelib_hid.o corelib_utilsexc_cf.o
+COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_7 =  \
+       corelib_app.o \
+       corelib_bitmap.o \
+       corelib_brush.o \
+       corelib_cursor.o \
+       corelib_dc.o \
+       corelib_dcclient.o \
+       corelib_dcmemory.o \
+       corelib_dcscreen.o \
+       corelib_evtloop.o \
+       corelib_font.o \
+       corelib_fontenum.o \
+       corelib_ifacehelpers.o \
+       corelib_pen.o \
+       corelib_region.o \
+       corelib_settings.o \
+       corelib_toplevel.o \
+       corelib_utils.o \
+       corelib_window.o \
+       corelib_caret.o \
+       corelib_colour.o \
+       corelib_icon.o \
+       corelib_timer.o
+@COND_TOOLKIT_DFB@__LOWLEVEL_SRC_OBJECTS_7 = $(COND_TOOLKIT_DFB___LOWLEVEL_SRC_OBJECTS_7)
 COND_TOOLKIT_GTK_TOOLKIT_VERSION____LOWLEVEL_SRC_OBJECTS_7 =  \
        corelib_caret.o \
        corelib_dialup.o \
@@ -12460,6 +12676,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_utils.o: $(srcdir)/src/mgl/utils.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/utils.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_utils.o: $(srcdir)/src/dfb/utils.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/utils.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_utils.o: $(srcdir)/src/motif/utils.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/utils.cpp
 
@@ -12631,6 +12850,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_caret.o: $(srcdir)/src/generic/caret.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/caret.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_caret.o: $(srcdir)/src/generic/caret.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/caret.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@monodll_caret.o: $(srcdir)/src/msw/caret.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/caret.cpp
 
@@ -12676,6 +12898,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_fontenum.o: $(srcdir)/src/mgl/fontenum.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/fontenum.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_fontenum.o: $(srcdir)/src/dfb/fontenum.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/fontenum.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monodll_fontenum.o: $(srcdir)/src/mac/carbon/fontenum.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mac/carbon/fontenum.cpp
 
@@ -12751,6 +12976,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_icon.o: $(srcdir)/src/generic/icon.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/icon.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_icon.o: $(srcdir)/src/generic/icon.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/icon.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@monodll_icon.o: $(srcdir)/src/msw/icon.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/icon.cpp
 
@@ -12796,6 +13024,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_app.o: $(srcdir)/src/mgl/app.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/app.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_app.o: $(srcdir)/src/dfb/app.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/app.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_app.o: $(srcdir)/src/motif/app.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/app.cpp
 
@@ -12829,6 +13060,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_bitmap.o: $(srcdir)/src/mgl/bitmap.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/bitmap.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_bitmap.o: $(srcdir)/src/dfb/bitmap.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/bitmap.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monodll_bitmap.o: $(srcdir)/src/mac/carbon/bitmap.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mac/carbon/bitmap.cpp
 
@@ -12859,6 +13093,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_brush.o: $(srcdir)/src/mgl/brush.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/brush.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_brush.o: $(srcdir)/src/dfb/brush.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/brush.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monodll_brush.o: $(srcdir)/src/mac/carbon/brush.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mac/carbon/brush.cpp
 
@@ -12916,6 +13153,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_colour.o: $(srcdir)/src/generic/colour.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/colour.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_colour.o: $(srcdir)/src/generic/colour.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/colour.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_colour.o: $(srcdir)/src/motif/colour.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/colour.cpp
 
@@ -12946,6 +13186,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_cursor.o: $(srcdir)/src/mgl/cursor.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/cursor.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_cursor.o: $(srcdir)/src/dfb/cursor.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/cursor.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_cursor.o: $(srcdir)/src/motif/cursor.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/cursor.cpp
 
@@ -13033,6 +13276,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_dc.o: $(srcdir)/src/mgl/dc.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/dc.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_dc.o: $(srcdir)/src/dfb/dc.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/dc.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_dc.o: $(srcdir)/src/motif/dc.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/dc.cpp
 
@@ -13063,6 +13309,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_dcclient.o: $(srcdir)/src/mgl/dcclient.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/dcclient.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_dcclient.o: $(srcdir)/src/dfb/dcclient.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/dcclient.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_dcclient.o: $(srcdir)/src/motif/dcclient.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/dcclient.cpp
 
@@ -13093,6 +13342,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_dcmemory.o: $(srcdir)/src/mgl/dcmemory.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/dcmemory.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_dcmemory.o: $(srcdir)/src/dfb/dcmemory.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/dcmemory.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_dcmemory.o: $(srcdir)/src/motif/dcmemory.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/dcmemory.cpp
 
@@ -13123,6 +13375,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_dcscreen.o: $(srcdir)/src/mgl/dcscreen.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/dcscreen.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_dcscreen.o: $(srcdir)/src/dfb/dcscreen.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/dcscreen.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_dcscreen.o: $(srcdir)/src/motif/dcscreen.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/dcscreen.cpp
 
@@ -13165,6 +13420,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_evtloop.o: $(srcdir)/src/mgl/evtloop.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/evtloop.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_evtloop.o: $(srcdir)/src/dfb/evtloop.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/evtloop.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_evtloop.o: $(srcdir)/src/motif/evtloop.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/evtloop.cpp
 
@@ -13195,6 +13453,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_font.o: $(srcdir)/src/mgl/font.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/font.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_font.o: $(srcdir)/src/dfb/font.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/font.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_font.o: $(srcdir)/src/motif/font.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/font.cpp
 
@@ -13255,6 +13516,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_pen.o: $(srcdir)/src/mgl/pen.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/pen.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_pen.o: $(srcdir)/src/dfb/pen.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/pen.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monodll_pen.o: $(srcdir)/src/mac/carbon/pen.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mac/carbon/pen.cpp
 
@@ -13306,6 +13570,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_region.o: $(srcdir)/src/mgl/region.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/region.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_region.o: $(srcdir)/src/dfb/region.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/region.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monodll_region.o: $(srcdir)/src/mac/carbon/region.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mac/carbon/region.cpp
 
@@ -13348,6 +13615,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_settings.o: $(srcdir)/src/mgl/settings.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/settings.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_settings.o: $(srcdir)/src/dfb/settings.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/settings.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_settings.o: $(srcdir)/src/motif/settings.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/settings.cpp
 
@@ -13378,6 +13648,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_timer.o: $(srcdir)/src/generic/timer.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/timer.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_timer.o: $(srcdir)/src/generic/timer.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/timer.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_timer.o: $(srcdir)/src/motif/timer.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/timer.cpp
 
@@ -13429,6 +13702,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_toplevel.o: $(srcdir)/src/mgl/toplevel.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/toplevel.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_toplevel.o: $(srcdir)/src/dfb/toplevel.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/toplevel.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_toplevel.o: $(srcdir)/src/motif/toplevel.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/toplevel.cpp
 
@@ -13471,6 +13747,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_window.o: $(srcdir)/src/mgl/window.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/window.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_window.o: $(srcdir)/src/dfb/window.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/window.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_window.o: $(srcdir)/src/motif/window.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/window.cpp
 
@@ -13666,6 +13945,9 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monodll_dirmgl.o: $(srcdir)/src/mgl/dirmgl.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/dirmgl.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monodll_ifacehelpers.o: $(srcdir)/src/dfb/ifacehelpers.cpp $(MONODLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/dfb/ifacehelpers.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@monodll_accel.o: $(srcdir)/src/generic/accel.cpp $(MONODLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/generic/accel.cpp
 
@@ -16327,6 +16609,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_utils.o: $(srcdir)/src/mgl/utils.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/utils.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_utils.o: $(srcdir)/src/dfb/utils.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/utils.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_utils.o: $(srcdir)/src/motif/utils.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/utils.cpp
 
@@ -16498,6 +16783,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_caret.o: $(srcdir)/src/generic/caret.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/caret.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_caret.o: $(srcdir)/src/generic/caret.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/caret.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@monolib_caret.o: $(srcdir)/src/msw/caret.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/caret.cpp
 
@@ -16543,6 +16831,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_fontenum.o: $(srcdir)/src/mgl/fontenum.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/fontenum.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_fontenum.o: $(srcdir)/src/dfb/fontenum.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/fontenum.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monolib_fontenum.o: $(srcdir)/src/mac/carbon/fontenum.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mac/carbon/fontenum.cpp
 
@@ -16618,6 +16909,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_icon.o: $(srcdir)/src/generic/icon.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/icon.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_icon.o: $(srcdir)/src/generic/icon.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/icon.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@monolib_icon.o: $(srcdir)/src/msw/icon.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/icon.cpp
 
@@ -16663,6 +16957,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_app.o: $(srcdir)/src/mgl/app.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/app.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_app.o: $(srcdir)/src/dfb/app.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/app.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_app.o: $(srcdir)/src/motif/app.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/app.cpp
 
@@ -16696,6 +16993,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_bitmap.o: $(srcdir)/src/mgl/bitmap.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/bitmap.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_bitmap.o: $(srcdir)/src/dfb/bitmap.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/bitmap.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monolib_bitmap.o: $(srcdir)/src/mac/carbon/bitmap.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mac/carbon/bitmap.cpp
 
@@ -16726,6 +17026,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_brush.o: $(srcdir)/src/mgl/brush.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/brush.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_brush.o: $(srcdir)/src/dfb/brush.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/brush.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monolib_brush.o: $(srcdir)/src/mac/carbon/brush.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mac/carbon/brush.cpp
 
@@ -16783,6 +17086,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_colour.o: $(srcdir)/src/generic/colour.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/colour.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_colour.o: $(srcdir)/src/generic/colour.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/colour.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_colour.o: $(srcdir)/src/motif/colour.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/colour.cpp
 
@@ -16813,6 +17119,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_cursor.o: $(srcdir)/src/mgl/cursor.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/cursor.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_cursor.o: $(srcdir)/src/dfb/cursor.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/cursor.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_cursor.o: $(srcdir)/src/motif/cursor.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/cursor.cpp
 
@@ -16900,6 +17209,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_dc.o: $(srcdir)/src/mgl/dc.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/dc.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_dc.o: $(srcdir)/src/dfb/dc.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/dc.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_dc.o: $(srcdir)/src/motif/dc.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/dc.cpp
 
@@ -16930,6 +17242,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_dcclient.o: $(srcdir)/src/mgl/dcclient.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/dcclient.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_dcclient.o: $(srcdir)/src/dfb/dcclient.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/dcclient.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_dcclient.o: $(srcdir)/src/motif/dcclient.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/dcclient.cpp
 
@@ -16960,6 +17275,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_dcmemory.o: $(srcdir)/src/mgl/dcmemory.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/dcmemory.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_dcmemory.o: $(srcdir)/src/dfb/dcmemory.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/dcmemory.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_dcmemory.o: $(srcdir)/src/motif/dcmemory.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/dcmemory.cpp
 
@@ -16990,6 +17308,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_dcscreen.o: $(srcdir)/src/mgl/dcscreen.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/dcscreen.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_dcscreen.o: $(srcdir)/src/dfb/dcscreen.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/dcscreen.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_dcscreen.o: $(srcdir)/src/motif/dcscreen.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/dcscreen.cpp
 
@@ -17032,6 +17353,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_evtloop.o: $(srcdir)/src/mgl/evtloop.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/evtloop.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_evtloop.o: $(srcdir)/src/dfb/evtloop.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/evtloop.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_evtloop.o: $(srcdir)/src/motif/evtloop.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/evtloop.cpp
 
@@ -17062,6 +17386,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_font.o: $(srcdir)/src/mgl/font.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/font.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_font.o: $(srcdir)/src/dfb/font.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/font.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_font.o: $(srcdir)/src/motif/font.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/font.cpp
 
@@ -17122,6 +17449,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_pen.o: $(srcdir)/src/mgl/pen.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/pen.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_pen.o: $(srcdir)/src/dfb/pen.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/pen.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monolib_pen.o: $(srcdir)/src/mac/carbon/pen.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mac/carbon/pen.cpp
 
@@ -17173,6 +17503,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_region.o: $(srcdir)/src/mgl/region.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/region.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_region.o: $(srcdir)/src/dfb/region.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/region.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monolib_region.o: $(srcdir)/src/mac/carbon/region.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mac/carbon/region.cpp
 
@@ -17215,6 +17548,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_settings.o: $(srcdir)/src/mgl/settings.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/settings.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_settings.o: $(srcdir)/src/dfb/settings.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/settings.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_settings.o: $(srcdir)/src/motif/settings.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/settings.cpp
 
@@ -17245,6 +17581,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_timer.o: $(srcdir)/src/generic/timer.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/timer.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_timer.o: $(srcdir)/src/generic/timer.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/timer.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_timer.o: $(srcdir)/src/motif/timer.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/timer.cpp
 
@@ -17296,6 +17635,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_toplevel.o: $(srcdir)/src/mgl/toplevel.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/toplevel.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_toplevel.o: $(srcdir)/src/dfb/toplevel.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/toplevel.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_toplevel.o: $(srcdir)/src/motif/toplevel.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/toplevel.cpp
 
@@ -17338,6 +17680,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_window.o: $(srcdir)/src/mgl/window.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/window.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_window.o: $(srcdir)/src/dfb/window.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/window.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_window.o: $(srcdir)/src/motif/window.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/window.cpp
 
@@ -17533,6 +17878,9 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@monolib_dirmgl.o: $(srcdir)/src/mgl/dirmgl.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/dirmgl.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@monolib_ifacehelpers.o: $(srcdir)/src/dfb/ifacehelpers.cpp $(MONOLIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/dfb/ifacehelpers.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@monolib_accel.o: $(srcdir)/src/generic/accel.cpp $(MONOLIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/generic/accel.cpp
 
@@ -20716,6 +21064,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_utils.o: $(srcdir)/src/mgl/utils.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/utils.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_utils.o: $(srcdir)/src/dfb/utils.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/utils.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_utils.o: $(srcdir)/src/motif/utils.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/utils.cpp
 
@@ -20746,6 +21097,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_caret.o: $(srcdir)/src/generic/caret.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/caret.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_caret.o: $(srcdir)/src/generic/caret.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/caret.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@coredll_caret.o: $(srcdir)/src/msw/caret.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/caret.cpp
 
@@ -20791,6 +21145,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_fontenum.o: $(srcdir)/src/mgl/fontenum.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/fontenum.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_fontenum.o: $(srcdir)/src/dfb/fontenum.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/fontenum.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@coredll_fontenum.o: $(srcdir)/src/mac/carbon/fontenum.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mac/carbon/fontenum.cpp
 
@@ -20866,6 +21223,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_icon.o: $(srcdir)/src/generic/icon.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/icon.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_icon.o: $(srcdir)/src/generic/icon.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/icon.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@coredll_icon.o: $(srcdir)/src/msw/icon.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/icon.cpp
 
@@ -20911,6 +21271,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_app.o: $(srcdir)/src/mgl/app.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/app.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_app.o: $(srcdir)/src/dfb/app.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/app.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_app.o: $(srcdir)/src/motif/app.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/app.cpp
 
@@ -20944,6 +21307,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_bitmap.o: $(srcdir)/src/mgl/bitmap.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/bitmap.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_bitmap.o: $(srcdir)/src/dfb/bitmap.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/bitmap.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@coredll_bitmap.o: $(srcdir)/src/mac/carbon/bitmap.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mac/carbon/bitmap.cpp
 
@@ -20974,6 +21340,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_brush.o: $(srcdir)/src/mgl/brush.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/brush.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_brush.o: $(srcdir)/src/dfb/brush.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/brush.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@coredll_brush.o: $(srcdir)/src/mac/carbon/brush.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mac/carbon/brush.cpp
 
@@ -21031,6 +21400,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_colour.o: $(srcdir)/src/generic/colour.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/colour.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_colour.o: $(srcdir)/src/generic/colour.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/colour.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_colour.o: $(srcdir)/src/motif/colour.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/colour.cpp
 
@@ -21061,6 +21433,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_cursor.o: $(srcdir)/src/mgl/cursor.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/cursor.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_cursor.o: $(srcdir)/src/dfb/cursor.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/cursor.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_cursor.o: $(srcdir)/src/motif/cursor.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/cursor.cpp
 
@@ -21148,6 +21523,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_dc.o: $(srcdir)/src/mgl/dc.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/dc.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_dc.o: $(srcdir)/src/dfb/dc.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/dc.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_dc.o: $(srcdir)/src/motif/dc.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/dc.cpp
 
@@ -21178,6 +21556,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_dcclient.o: $(srcdir)/src/mgl/dcclient.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/dcclient.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_dcclient.o: $(srcdir)/src/dfb/dcclient.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/dcclient.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_dcclient.o: $(srcdir)/src/motif/dcclient.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/dcclient.cpp
 
@@ -21208,6 +21589,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_dcmemory.o: $(srcdir)/src/mgl/dcmemory.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/dcmemory.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_dcmemory.o: $(srcdir)/src/dfb/dcmemory.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/dcmemory.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_dcmemory.o: $(srcdir)/src/motif/dcmemory.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/dcmemory.cpp
 
@@ -21238,6 +21622,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_dcscreen.o: $(srcdir)/src/mgl/dcscreen.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/dcscreen.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_dcscreen.o: $(srcdir)/src/dfb/dcscreen.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/dcscreen.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_dcscreen.o: $(srcdir)/src/motif/dcscreen.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/dcscreen.cpp
 
@@ -21280,6 +21667,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_evtloop.o: $(srcdir)/src/mgl/evtloop.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/evtloop.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_evtloop.o: $(srcdir)/src/dfb/evtloop.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/evtloop.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_evtloop.o: $(srcdir)/src/motif/evtloop.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/evtloop.cpp
 
@@ -21310,6 +21700,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_font.o: $(srcdir)/src/mgl/font.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/font.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_font.o: $(srcdir)/src/dfb/font.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/font.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_font.o: $(srcdir)/src/motif/font.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/font.cpp
 
@@ -21370,6 +21763,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_pen.o: $(srcdir)/src/mgl/pen.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/pen.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_pen.o: $(srcdir)/src/dfb/pen.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/pen.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@coredll_pen.o: $(srcdir)/src/mac/carbon/pen.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mac/carbon/pen.cpp
 
@@ -21421,6 +21817,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_region.o: $(srcdir)/src/mgl/region.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/region.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_region.o: $(srcdir)/src/dfb/region.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/region.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@coredll_region.o: $(srcdir)/src/mac/carbon/region.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mac/carbon/region.cpp
 
@@ -21463,6 +21862,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_settings.o: $(srcdir)/src/mgl/settings.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/settings.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_settings.o: $(srcdir)/src/dfb/settings.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/settings.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_settings.o: $(srcdir)/src/motif/settings.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/settings.cpp
 
@@ -21493,6 +21895,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_timer.o: $(srcdir)/src/generic/timer.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/timer.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_timer.o: $(srcdir)/src/generic/timer.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/timer.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_timer.o: $(srcdir)/src/motif/timer.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/timer.cpp
 
@@ -21544,6 +21949,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_toplevel.o: $(srcdir)/src/mgl/toplevel.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/toplevel.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_toplevel.o: $(srcdir)/src/dfb/toplevel.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/toplevel.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_toplevel.o: $(srcdir)/src/motif/toplevel.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/toplevel.cpp
 
@@ -21586,6 +21994,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_window.o: $(srcdir)/src/mgl/window.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/window.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_window.o: $(srcdir)/src/dfb/window.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/window.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_window.o: $(srcdir)/src/motif/window.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/window.cpp
 
@@ -21781,6 +22192,9 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@coredll_dirmgl.o: $(srcdir)/src/mgl/dirmgl.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/dirmgl.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@coredll_ifacehelpers.o: $(srcdir)/src/dfb/ifacehelpers.cpp $(COREDLL_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/dfb/ifacehelpers.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@coredll_accel.o: $(srcdir)/src/generic/accel.cpp $(COREDLL_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/generic/accel.cpp
 
@@ -23518,6 +23932,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_utils.o: $(srcdir)/src/mgl/utils.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/utils.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_utils.o: $(srcdir)/src/dfb/utils.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/utils.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_utils.o: $(srcdir)/src/motif/utils.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/utils.cpp
 
@@ -23548,6 +23965,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_caret.o: $(srcdir)/src/generic/caret.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/caret.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_caret.o: $(srcdir)/src/generic/caret.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/caret.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@corelib_caret.o: $(srcdir)/src/msw/caret.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/caret.cpp
 
@@ -23593,6 +24013,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_fontenum.o: $(srcdir)/src/mgl/fontenum.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/fontenum.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_fontenum.o: $(srcdir)/src/dfb/fontenum.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/fontenum.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@corelib_fontenum.o: $(srcdir)/src/mac/carbon/fontenum.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mac/carbon/fontenum.cpp
 
@@ -23668,6 +24091,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_icon.o: $(srcdir)/src/generic/icon.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/icon.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_icon.o: $(srcdir)/src/generic/icon.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/icon.cpp
+
 @COND_TOOLKIT_MSW_USE_GUI_1@corelib_icon.o: $(srcdir)/src/msw/icon.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MSW_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/icon.cpp
 
@@ -23713,6 +24139,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_app.o: $(srcdir)/src/mgl/app.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/app.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_app.o: $(srcdir)/src/dfb/app.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/app.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_app.o: $(srcdir)/src/motif/app.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/app.cpp
 
@@ -23746,6 +24175,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_bitmap.o: $(srcdir)/src/mgl/bitmap.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/bitmap.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_bitmap.o: $(srcdir)/src/dfb/bitmap.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/bitmap.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@corelib_bitmap.o: $(srcdir)/src/mac/carbon/bitmap.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mac/carbon/bitmap.cpp
 
@@ -23776,6 +24208,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_brush.o: $(srcdir)/src/mgl/brush.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/brush.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_brush.o: $(srcdir)/src/dfb/brush.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/brush.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@corelib_brush.o: $(srcdir)/src/mac/carbon/brush.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mac/carbon/brush.cpp
 
@@ -23833,6 +24268,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_colour.o: $(srcdir)/src/generic/colour.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/colour.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_colour.o: $(srcdir)/src/generic/colour.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/colour.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_colour.o: $(srcdir)/src/motif/colour.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/colour.cpp
 
@@ -23863,6 +24301,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_cursor.o: $(srcdir)/src/mgl/cursor.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/cursor.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_cursor.o: $(srcdir)/src/dfb/cursor.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/cursor.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_cursor.o: $(srcdir)/src/motif/cursor.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/cursor.cpp
 
@@ -23950,6 +24391,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_dc.o: $(srcdir)/src/mgl/dc.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/dc.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_dc.o: $(srcdir)/src/dfb/dc.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/dc.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_dc.o: $(srcdir)/src/motif/dc.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/dc.cpp
 
@@ -23980,6 +24424,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_dcclient.o: $(srcdir)/src/mgl/dcclient.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/dcclient.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_dcclient.o: $(srcdir)/src/dfb/dcclient.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/dcclient.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_dcclient.o: $(srcdir)/src/motif/dcclient.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/dcclient.cpp
 
@@ -24010,6 +24457,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_dcmemory.o: $(srcdir)/src/mgl/dcmemory.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/dcmemory.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_dcmemory.o: $(srcdir)/src/dfb/dcmemory.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/dcmemory.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_dcmemory.o: $(srcdir)/src/motif/dcmemory.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/dcmemory.cpp
 
@@ -24040,6 +24490,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_dcscreen.o: $(srcdir)/src/mgl/dcscreen.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/dcscreen.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_dcscreen.o: $(srcdir)/src/dfb/dcscreen.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/dcscreen.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_dcscreen.o: $(srcdir)/src/motif/dcscreen.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/dcscreen.cpp
 
@@ -24082,6 +24535,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_evtloop.o: $(srcdir)/src/mgl/evtloop.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/evtloop.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_evtloop.o: $(srcdir)/src/dfb/evtloop.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/evtloop.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_evtloop.o: $(srcdir)/src/motif/evtloop.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/evtloop.cpp
 
@@ -24112,6 +24568,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_font.o: $(srcdir)/src/mgl/font.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/font.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_font.o: $(srcdir)/src/dfb/font.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/font.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_font.o: $(srcdir)/src/motif/font.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/font.cpp
 
@@ -24172,6 +24631,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_pen.o: $(srcdir)/src/mgl/pen.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/pen.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_pen.o: $(srcdir)/src/dfb/pen.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/pen.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@corelib_pen.o: $(srcdir)/src/mac/carbon/pen.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mac/carbon/pen.cpp
 
@@ -24223,6 +24685,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_region.o: $(srcdir)/src/mgl/region.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/region.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_region.o: $(srcdir)/src/dfb/region.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/region.cpp
+
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@corelib_region.o: $(srcdir)/src/mac/carbon/region.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@  $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mac/carbon/region.cpp
 
@@ -24265,6 +24730,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_settings.o: $(srcdir)/src/mgl/settings.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/settings.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_settings.o: $(srcdir)/src/dfb/settings.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/settings.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_settings.o: $(srcdir)/src/motif/settings.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/settings.cpp
 
@@ -24295,6 +24763,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_timer.o: $(srcdir)/src/generic/timer.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/timer.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_timer.o: $(srcdir)/src/generic/timer.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/timer.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_timer.o: $(srcdir)/src/motif/timer.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/timer.cpp
 
@@ -24346,6 +24817,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_toplevel.o: $(srcdir)/src/mgl/toplevel.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/toplevel.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_toplevel.o: $(srcdir)/src/dfb/toplevel.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/toplevel.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_toplevel.o: $(srcdir)/src/motif/toplevel.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/toplevel.cpp
 
@@ -24388,6 +24862,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_window.o: $(srcdir)/src/mgl/window.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/window.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_window.o: $(srcdir)/src/dfb/window.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/window.cpp
+
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_window.o: $(srcdir)/src/motif/window.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/window.cpp
 
@@ -24583,6 +25060,9 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@corelib_dirmgl.o: $(srcdir)/src/mgl/dirmgl.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_MGL_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/dirmgl.cpp
 
+@COND_TOOLKIT_DFB_USE_GUI_1@corelib_ifacehelpers.o: $(srcdir)/src/dfb/ifacehelpers.cpp $(CORELIB_ODEP)
+@COND_TOOLKIT_DFB_USE_GUI_1@   $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/dfb/ifacehelpers.cpp
+
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@corelib_accel.o: $(srcdir)/src/generic/accel.cpp $(CORELIB_ODEP)
 @COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0@        $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/generic/accel.cpp
 
index 8d74b0a6cce7154d6baaf65a6283c4a787b5f1e6..568de1d5a99bca4e1c2055c617ad8665cc437d63 100644 (file)
@@ -536,6 +536,18 @@ dnl ### begin block 20_COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0[wx.bkl] ###
         COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0=""
     fi
     AC_SUBST(COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0)
+dnl ### begin block 20_COND_TOOLKIT_DFB[wx.bkl] ###
+    COND_TOOLKIT_DFB="#"
+    if test "x$TOOLKIT" = "xDFB" ; then
+        COND_TOOLKIT_DFB=""
+    fi
+    AC_SUBST(COND_TOOLKIT_DFB)
+dnl ### begin block 20_COND_TOOLKIT_DFB_USE_GUI_1[wx.bkl] ###
+    COND_TOOLKIT_DFB_USE_GUI_1="#"
+    if test "x$TOOLKIT" = "xDFB" -a "x$USE_GUI" = "x1" ; then
+        COND_TOOLKIT_DFB_USE_GUI_1=""
+    fi
+    AC_SUBST(COND_TOOLKIT_DFB_USE_GUI_1)
 dnl ### begin block 20_COND_TOOLKIT_GTK[wx.bkl] ###
     COND_TOOLKIT_GTK="#"
     if test "x$TOOLKIT" = "xGTK" ; then
index 1234898ad7a565477857071d16143e38e947b172..a9145827796491814047f83e0597a3129337ce10 100644 (file)
@@ -1773,6 +1773,61 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
 </set>
 
 
+<!-- ====================================================================== -->
+<!--                                wxDFB                                   -->
+<!-- ====================================================================== -->
+
+<set var="DFB_LOWLEVEL_SRC" hints="files">
+    src/dfb/app.cpp
+    src/dfb/bitmap.cpp
+    src/dfb/brush.cpp
+    src/dfb/cursor.cpp
+    <!--    src/dfb/data.cpp -->
+    src/dfb/dc.cpp
+    src/dfb/dcclient.cpp
+    src/dfb/dcmemory.cpp
+    src/dfb/dcscreen.cpp
+    src/dfb/evtloop.cpp
+    src/dfb/font.cpp
+    src/dfb/fontenum.cpp
+    src/dfb/ifacehelpers.cpp
+    src/dfb/pen.cpp
+    src/dfb/region.cpp
+    src/dfb/settings.cpp
+    src/dfb/toplevel.cpp
+    src/dfb/utils.cpp
+    src/dfb/window.cpp
+    src/generic/caret.cpp
+    src/generic/colour.cpp
+    src/generic/icon.cpp
+    src/generic/timer.cpp
+</set>
+<set var="DFB_LOWLEVEL_HDR" hints="files">
+    wx/dfb/app.h
+    wx/dfb/bitmap.h
+    wx/dfb/brush.h
+    wx/dfb/chkconf.h
+    wx/dfb/cursor.h
+    wx/dfb/dc.h
+    wx/dfb/dcclient.h
+    wx/dfb/dcmemory.h
+    wx/dfb/dcscreen.h
+    wx/dfb/evtloop.h
+    wx/dfb/font.h
+    wx/dfb/ifacehelpers.h
+    wx/dfb/pen.h
+    wx/dfb/popupwin.h
+    wx/dfb/private.h
+    wx/dfb/region.h
+    wx/dfb/toplevel.h
+    wx/dfb/window.h
+    wx/generic/caret.h
+    wx/generic/colour.h
+    wx/generic/icon.h
+    wx/generic/timer.h
+</set>
+
+
 <!-- ====================================================================== -->
 <!--                               wxOS/2                                   -->
 <!-- ====================================================================== -->
@@ -3128,6 +3183,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
         <if cond="TOOLKIT=='PM'">$(OS2_LOWLEVEL_SRC)</if>
         <if cond="TOOLKIT=='X11'">$(X11_LOWLEVEL_SRC)</if>
         <if cond="TOOLKIT=='MGL'">$(MGL_LOWLEVEL_SRC)</if>
+        <if cond="TOOLKIT=='DFB'">$(DFB_LOWLEVEL_SRC)</if>
     </set>
     <set var="LOWLEVEL_HDR" hints="files">
         <if cond="TOOLKIT=='GTK' and TOOLKIT_VERSION=='2'">$(GTK_LOWLEVEL_HDR)</if>
@@ -3140,6 +3196,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
         <if cond="TOOLKIT=='PM'">$(OS2_LOWLEVEL_HDR)</if>
         <if cond="TOOLKIT=='X11'">$(X11_LOWLEVEL_HDR)</if>
         <if cond="TOOLKIT=='MGL'">$(MGL_LOWLEVEL_HDR)</if>
+        <if cond="TOOLKIT=='DFB'">$(DFB_LOWLEVEL_HDR)</if>
     </set>
 
     <set var="GUI_SRC" hints="files">
index 8ca8b7d679acbda2e00ea1e2b5a13584e8dde941..a55c75a6ea392b9fac2c30b4f869a3e07dcd3a5c 100755 (executable)
--- a/configure
+++ b/configure
@@ -313,7 +313,7 @@ ac_includes_default="\
 #endif"
 
 ac_subdirs_all="$ac_subdirs_all src/expat"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP CXX CXXFLAGS ac_ct_CXX RANLIB ac_ct_RANLIB AR ac_ct_AR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES DLLTOOL ac_ct_DLLTOOL IF_GNU_MAKE LN_S CXXCPP subdirs PKG_CONFIG GTK_CFLAGS GTK_LIBS GTK_CONFIG X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS ac_pt_PKG_CONFIG PANGOX_CFLAGS PANGOX_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS PANGOXFT_CFLAGS PANGOXFT_LIBS REZ DEREZ SETFILE LIBICONV EXTRALIBS_ESD SDL_CONFIG SDL_CFLAGS SDL_LIBS LIBGNOMEPRINTUI_CFLAGS LIBGNOMEPRINTUI_LIBS GNOMEVFS_CFLAGS GNOMEVFS_LIBS HILDON_CFLAGS HILDON_LIBS GST_CFLAGS GST_LIBS CORE_BASE_LIBS CORE_GUI_LIBS wxUSE_ZLIB wxUSE_REGEX wxUSE_EXPAT wxUSE_ODBC wxUSE_LIBJPEG wxUSE_LIBPNG wxUSE_LIBTIFF VENDOR OFFICIAL_BUILD WX_FLAVOUR WX_LIB_FLAVOUR WXUNIV MONOLITHIC USE_PLUGINS EXTRALIBS EXTRALIBS_XML EXTRALIBS_HTML EXTRALIBS_ODBC EXTRALIBS_GUI EXTRALIBS_OPENGL EXTRALIBS_SDL WITH_PLUGIN_SDL EXTRALIBS_GNOMEPRINT EXTRALIBS_GNOMEVFS EXTRALIBS_HILDON UNICODE BUILD DEBUG_INFO DEBUG_FLAG TOOLKIT_LOWERCASE TOOLKIT_VERSION SAMPLES_RPATH_FLAG SAMPLES_RPATH_POSTLINK HOST_SUFFIX CPPUNIT_CFLAGS CPPUNIT_LIBS SET_MAKE MAKE_SET NM ac_ct_NM INSTALL_DIR LDFLAGS_GUI PLATFORM_UNIX PLATFORM_WIN32 PLATFORM_MSDOS PLATFORM_MAC PLATFORM_MACOS PLATFORM_MACOSX PLATFORM_OS2 PLATFORM_BEOS SO_SUFFIX SO_SUFFIX_MODULE DLLIMP_SUFFIX LIBPREFIX LIBEXT DLLPREFIX DLLPREFIX_MODULE dlldir AIX_CXX_LD SHARED_LD_CC SHARED_LD_CXX SHARED_LD_MODULE_CC SHARED_LD_MODULE_CXX PIC_FLAG WINDOWS_IMPLIB USE_SOVERSION USE_SOVERLINUX USE_SOVERSOLARIS USE_SOVERCYGWIN USE_MACVERSION USE_SOSYMLINKS SONAME_FLAG DEPS_TRACKING GCC_PCH ICC_PCH COND_BUILD_DEBUG COND_BUILD_DEBUG_DEBUG_FLAG_DEFAULT COND_BUILD_DEBUG_DEBUG_INFO_DEFAULT COND_BUILD_DEBUG_UNICODE_0 COND_BUILD_DEBUG_UNICODE_1 COND_BUILD_RELEASE COND_BUILD_RELEASE_DEBUG_INFO_DEFAULT COND_BUILD_RELEASE_UNICODE_0 COND_BUILD_RELEASE_UNICODE_1 COND_DEBUG_FLAG_1 COND_DEBUG_INFO_0 COND_DEBUG_INFO_1 COND_DEPS_TRACKING_0 COND_DEPS_TRACKING_1 COND_GCC_PCH_1 COND_ICC_PCH_1 COND_MONOLITHIC_0 COND_MONOLITHIC_0_SHARED_0 COND_MONOLITHIC_0_SHARED_0_USE_AUI_1 COND_MONOLITHIC_0_SHARED_0_USE_GUI_1 COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_HTML_1 COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_MEDIA_1 COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_ODBC_1 COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_QA_1 COND_MONOLITHIC_0_SHARED_0_USE_ODBC_1 COND_MONOLITHIC_0_SHARED_0_USE_RICHTEXT_1 COND_MONOLITHIC_0_SHARED_0_USE_XRC_1 COND_MONOLITHIC_0_SHARED_1 COND_MONOLITHIC_0_SHARED_1_USE_AUI_1 COND_MONOLITHIC_0_SHARED_1_USE_GUI_1 COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_HTML_1 COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_MEDIA_1 COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_ODBC_1 COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_QA_1 COND_MONOLITHIC_0_SHARED_1_USE_ODBC_1 COND_MONOLITHIC_0_SHARED_1_USE_RICHTEXT_1 COND_MONOLITHIC_0_SHARED_1_USE_XRC_1 COND_MONOLITHIC_0_USE_MEDIA_1 COND_MONOLITHIC_0_USE_ODBC_1 COND_MONOLITHIC_1 COND_MONOLITHIC_1_SHARED_0 COND_MONOLITHIC_1_SHARED_1 COND_OFFICIAL_BUILD_0_PLATFORM_WIN32_1 COND_OFFICIAL_BUILD_1_PLATFORM_WIN32_1 COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1 COND_PLATFORM_MACOSX_0_USE_SOVERSION_1 COND_PLATFORM_MACOSX_1 COND_PLATFORM_MACOSX_1_TOOLKIT_ COND_PLATFORM_MACOSX_1_TOOLKIT_COCOA COND_PLATFORM_MACOSX_1_TOOLKIT_GTK COND_PLATFORM_MACOSX_1_TOOLKIT_MAC COND_PLATFORM_MACOSX_1_TOOLKIT_MAC_USE_GUI_1 COND_PLATFORM_MACOSX_1_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0 COND_PLATFORM_MACOSX_1_TOOLKIT_MOTIF COND_PLATFORM_MACOSX_1_TOOLKIT_X11 COND_PLATFORM_MACOSX_1_USE_GUI_1 COND_PLATFORM_MACOSX_1_USE_SOVERSION_1 COND_PLATFORM_MACOS_1 COND_PLATFORM_MAC_1 COND_PLATFORM_MSDOS_0 COND_PLATFORM_MSDOS_1 COND_PLATFORM_OS2_1 COND_PLATFORM_UNIX_0 COND_PLATFORM_UNIX_1 COND_PLATFORM_UNIX_1_USE_GUI_1 COND_PLATFORM_UNIX_1_USE_PLUGINS_0 COND_PLATFORM_WIN32_0 COND_PLATFORM_WIN32_1 COND_SHARED_0 COND_SHARED_0_TOOLKIT_MAC_WXUNIV_0 COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0 COND_SHARED_0_TOOLKIT_PM_WXUNIV_0 COND_SHARED_0_USE_GUI_1_USE_OPENGL_1 COND_SHARED_0_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN COND_SHARED_0_USE_GUI_1_WXUSE_LIBPNG_BUILTIN COND_SHARED_0_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN COND_SHARED_0_USE_XRC_1 COND_SHARED_0_WXUSE_EXPAT_BUILTIN COND_SHARED_0_WXUSE_ODBC_BUILTIN COND_SHARED_0_WXUSE_REGEX_BUILTIN COND_SHARED_0_WXUSE_ZLIB_BUILTIN COND_SHARED_1 COND_SHARED_1_USE_GUI_1_USE_OPENGL_1 COND_SHARED_1_USE_XRC_1 COND_TOOLKIT_ COND_TOOLKIT_COCOA COND_TOOLKIT_COCOA_USE_GUI_1 COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_GTK COND_TOOLKIT_GTK_TOOLKIT_VERSION_ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2 COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1 COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1 COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0 COND_TOOLKIT_GTK_USE_GUI_1 COND_TOOLKIT_MAC COND_TOOLKIT_MAC_USE_GUI_1 COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_MGL COND_TOOLKIT_MGL_USE_GUI_1 COND_TOOLKIT_MOTIF COND_TOOLKIT_MOTIF_USE_GUI_1 COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_MSW COND_TOOLKIT_MSW_USE_GUI_1 COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_MSW_WXUNIV_0 COND_TOOLKIT_PM COND_TOOLKIT_PM_USE_GUI_1 COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_WINCE COND_TOOLKIT_WINCE_USE_GUI_1 COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_WINCE_WXUNIV_0 COND_TOOLKIT_X11 COND_TOOLKIT_X11_USE_GUI_1 COND_UNICODE_1 COND_USE_EXCEPTIONS_0 COND_USE_EXCEPTIONS_1 COND_USE_GUI_0 COND_USE_GUI_1 COND_USE_GUI_1_WXUNIV_0 COND_USE_GUI_1_WXUNIV_1 COND_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN COND_USE_GUI_1_WXUSE_LIBPNG_BUILTIN COND_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN COND_USE_ODBC_1 COND_USE_OPENGL_1 COND_USE_PCH_1 COND_USE_PLUGINS_0 COND_USE_RTTI_0 COND_USE_RTTI_1 COND_USE_SOSYMLINKS_1 COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1 COND_USE_SOVERLINUX_1 COND_USE_SOVERSION_0 COND_USE_SOVERSOLARIS_1 COND_USE_THREADS_0 COND_USE_THREADS_1 COND_USE_XRC_1 COND_WINDOWS_IMPLIB_1 COND_WITH_PLUGIN_SDL_1 COND_WXUNIV_0 COND_WXUNIV_1 COND_WXUSE_EXPAT_BUILTIN COND_WXUSE_LIBJPEG_BUILTIN COND_WXUSE_LIBPNG_BUILTIN COND_WXUSE_LIBTIFF_BUILTIN COND_WXUSE_ODBC_BUILTIN COND_WXUSE_REGEX_BUILTIN COND_WXUSE_ZLIB_BUILTIN SHARED WX_LIBRARY_BASENAME_NOGUI WX_LIBRARY_BASENAME_GUI USE_GUI AFMINSTALL WIN32INSTALL TOOLKIT TOOLKIT_DIR TOOLCHAIN_NAME TOOLCHAIN_FULLNAME cross_compiling WIDGET_SET WX_RELEASE WX_VERSION WX_SUBVERSION WX_CHARTYPE WX_DEBUGTYPE WXCONFIG_CPPFLAGS WXCONFIG_CFLAGS WXCONFIG_CXXFLAGS WXCONFIG_LIBS WXCONFIG_RPATH WXCONFIG_LDFLAGS_GUI WXCONFIG_RESFLAGS EXE_LINKER GUIDIST DISTDIR SAMPLES_SUBDIRS LDFLAGS_GL OPENGL_LIBS DMALLOC_LIBS WX_VERSION_TAG RESCOMP RESFLAGS RESPROGRAMOBJ WX_RESOURCES_MACOSX_ASCII WX_RESOURCES_MACOSX_DATA LIBWXMACRES POSTLINK_COMMAND MACSETFILE GCC CPPUNIT_CONFIG LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP CXX CXXFLAGS ac_ct_CXX RANLIB ac_ct_RANLIB AR ac_ct_AR INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA STRIP ac_ct_STRIP WINDRES ac_ct_WINDRES DLLTOOL ac_ct_DLLTOOL IF_GNU_MAKE LN_S CXXCPP subdirs PKG_CONFIG GTK_CFLAGS GTK_LIBS GTK_CONFIG ac_pt_PKG_CONFIG DIRECTFB_CFLAGS DIRECTFB_LIBS X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS PANGOX_CFLAGS PANGOX_LIBS PANGOFT2_CFLAGS PANGOFT2_LIBS PANGOXFT_CFLAGS PANGOXFT_LIBS REZ DEREZ SETFILE LIBICONV EXTRALIBS_ESD SDL_CONFIG SDL_CFLAGS SDL_LIBS LIBGNOMEPRINTUI_CFLAGS LIBGNOMEPRINTUI_LIBS GNOMEVFS_CFLAGS GNOMEVFS_LIBS HILDON_CFLAGS HILDON_LIBS GST_CFLAGS GST_LIBS CORE_BASE_LIBS CORE_GUI_LIBS wxUSE_ZLIB wxUSE_REGEX wxUSE_EXPAT wxUSE_ODBC wxUSE_LIBJPEG wxUSE_LIBPNG wxUSE_LIBTIFF VENDOR OFFICIAL_BUILD WX_FLAVOUR WX_LIB_FLAVOUR WXUNIV MONOLITHIC USE_PLUGINS EXTRALIBS EXTRALIBS_XML EXTRALIBS_HTML EXTRALIBS_ODBC EXTRALIBS_GUI EXTRALIBS_OPENGL EXTRALIBS_SDL WITH_PLUGIN_SDL EXTRALIBS_GNOMEPRINT EXTRALIBS_GNOMEVFS EXTRALIBS_HILDON UNICODE BUILD DEBUG_INFO DEBUG_FLAG TOOLKIT_LOWERCASE TOOLKIT_VERSION SAMPLES_RPATH_FLAG SAMPLES_RPATH_POSTLINK HOST_SUFFIX CPPUNIT_CFLAGS CPPUNIT_LIBS SET_MAKE MAKE_SET NM ac_ct_NM INSTALL_DIR LDFLAGS_GUI PLATFORM_UNIX PLATFORM_WIN32 PLATFORM_MSDOS PLATFORM_MAC PLATFORM_MACOS PLATFORM_MACOSX PLATFORM_OS2 PLATFORM_BEOS SO_SUFFIX SO_SUFFIX_MODULE DLLIMP_SUFFIX LIBPREFIX LIBEXT DLLPREFIX DLLPREFIX_MODULE dlldir AIX_CXX_LD SHARED_LD_CC SHARED_LD_CXX SHARED_LD_MODULE_CC SHARED_LD_MODULE_CXX PIC_FLAG WINDOWS_IMPLIB USE_SOVERSION USE_SOVERLINUX USE_SOVERSOLARIS USE_SOVERCYGWIN USE_MACVERSION USE_SOSYMLINKS SONAME_FLAG DEPS_TRACKING GCC_PCH ICC_PCH COND_BUILD_DEBUG COND_BUILD_DEBUG_DEBUG_FLAG_DEFAULT COND_BUILD_DEBUG_DEBUG_INFO_DEFAULT COND_BUILD_DEBUG_UNICODE_0 COND_BUILD_DEBUG_UNICODE_1 COND_BUILD_RELEASE COND_BUILD_RELEASE_DEBUG_INFO_DEFAULT COND_BUILD_RELEASE_UNICODE_0 COND_BUILD_RELEASE_UNICODE_1 COND_DEBUG_FLAG_1 COND_DEBUG_INFO_0 COND_DEBUG_INFO_1 COND_DEPS_TRACKING_0 COND_DEPS_TRACKING_1 COND_GCC_PCH_1 COND_ICC_PCH_1 COND_MONOLITHIC_0 COND_MONOLITHIC_0_SHARED_0 COND_MONOLITHIC_0_SHARED_0_USE_AUI_1 COND_MONOLITHIC_0_SHARED_0_USE_GUI_1 COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_HTML_1 COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_MEDIA_1 COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_ODBC_1 COND_MONOLITHIC_0_SHARED_0_USE_GUI_1_USE_QA_1 COND_MONOLITHIC_0_SHARED_0_USE_ODBC_1 COND_MONOLITHIC_0_SHARED_0_USE_RICHTEXT_1 COND_MONOLITHIC_0_SHARED_0_USE_XRC_1 COND_MONOLITHIC_0_SHARED_1 COND_MONOLITHIC_0_SHARED_1_USE_AUI_1 COND_MONOLITHIC_0_SHARED_1_USE_GUI_1 COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_HTML_1 COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_MEDIA_1 COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_ODBC_1 COND_MONOLITHIC_0_SHARED_1_USE_GUI_1_USE_QA_1 COND_MONOLITHIC_0_SHARED_1_USE_ODBC_1 COND_MONOLITHIC_0_SHARED_1_USE_RICHTEXT_1 COND_MONOLITHIC_0_SHARED_1_USE_XRC_1 COND_MONOLITHIC_0_USE_MEDIA_1 COND_MONOLITHIC_0_USE_ODBC_1 COND_MONOLITHIC_1 COND_MONOLITHIC_1_SHARED_0 COND_MONOLITHIC_1_SHARED_1 COND_OFFICIAL_BUILD_0_PLATFORM_WIN32_1 COND_OFFICIAL_BUILD_1_PLATFORM_WIN32_1 COND_PLATFORM_MACOSX_0_USE_SOVERCYGWIN_0_USE_SOVERSION_1 COND_PLATFORM_MACOSX_0_USE_SOVERSION_1 COND_PLATFORM_MACOSX_1 COND_PLATFORM_MACOSX_1_TOOLKIT_ COND_PLATFORM_MACOSX_1_TOOLKIT_COCOA COND_PLATFORM_MACOSX_1_TOOLKIT_GTK COND_PLATFORM_MACOSX_1_TOOLKIT_MAC COND_PLATFORM_MACOSX_1_TOOLKIT_MAC_USE_GUI_1 COND_PLATFORM_MACOSX_1_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0 COND_PLATFORM_MACOSX_1_TOOLKIT_MOTIF COND_PLATFORM_MACOSX_1_TOOLKIT_X11 COND_PLATFORM_MACOSX_1_USE_GUI_1 COND_PLATFORM_MACOSX_1_USE_SOVERSION_1 COND_PLATFORM_MACOS_1 COND_PLATFORM_MAC_1 COND_PLATFORM_MSDOS_0 COND_PLATFORM_MSDOS_1 COND_PLATFORM_OS2_1 COND_PLATFORM_UNIX_0 COND_PLATFORM_UNIX_1 COND_PLATFORM_UNIX_1_USE_GUI_1 COND_PLATFORM_UNIX_1_USE_PLUGINS_0 COND_PLATFORM_WIN32_0 COND_PLATFORM_WIN32_1 COND_SHARED_0 COND_SHARED_0_TOOLKIT_MAC_WXUNIV_0 COND_SHARED_0_TOOLKIT_MSW_WXUNIV_0 COND_SHARED_0_TOOLKIT_PM_WXUNIV_0 COND_SHARED_0_USE_GUI_1_USE_OPENGL_1 COND_SHARED_0_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN COND_SHARED_0_USE_GUI_1_WXUSE_LIBPNG_BUILTIN COND_SHARED_0_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN COND_SHARED_0_USE_XRC_1 COND_SHARED_0_WXUSE_EXPAT_BUILTIN COND_SHARED_0_WXUSE_ODBC_BUILTIN COND_SHARED_0_WXUSE_REGEX_BUILTIN COND_SHARED_0_WXUSE_ZLIB_BUILTIN COND_SHARED_1 COND_SHARED_1_USE_GUI_1_USE_OPENGL_1 COND_SHARED_1_USE_XRC_1 COND_TOOLKIT_ COND_TOOLKIT_COCOA COND_TOOLKIT_COCOA_USE_GUI_1 COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_DFB COND_TOOLKIT_DFB_USE_GUI_1 COND_TOOLKIT_GTK COND_TOOLKIT_GTK_TOOLKIT_VERSION_ COND_TOOLKIT_GTK_TOOLKIT_VERSION_2 COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1 COND_TOOLKIT_GTK_TOOLKIT_VERSION_2_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1 COND_TOOLKIT_GTK_TOOLKIT_VERSION__USE_GUI_1_WXUNIV_0 COND_TOOLKIT_GTK_USE_GUI_1 COND_TOOLKIT_MAC COND_TOOLKIT_MAC_USE_GUI_1 COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_MGL COND_TOOLKIT_MGL_USE_GUI_1 COND_TOOLKIT_MOTIF COND_TOOLKIT_MOTIF_USE_GUI_1 COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_MSW COND_TOOLKIT_MSW_USE_GUI_1 COND_TOOLKIT_MSW_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_MSW_WXUNIV_0 COND_TOOLKIT_PM COND_TOOLKIT_PM_USE_GUI_1 COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_WINCE COND_TOOLKIT_WINCE_USE_GUI_1 COND_TOOLKIT_WINCE_USE_GUI_1_WXUNIV_0 COND_TOOLKIT_WINCE_WXUNIV_0 COND_TOOLKIT_X11 COND_TOOLKIT_X11_USE_GUI_1 COND_UNICODE_1 COND_USE_EXCEPTIONS_0 COND_USE_EXCEPTIONS_1 COND_USE_GUI_0 COND_USE_GUI_1 COND_USE_GUI_1_WXUNIV_0 COND_USE_GUI_1_WXUNIV_1 COND_USE_GUI_1_WXUSE_LIBJPEG_BUILTIN COND_USE_GUI_1_WXUSE_LIBPNG_BUILTIN COND_USE_GUI_1_WXUSE_LIBTIFF_BUILTIN COND_USE_ODBC_1 COND_USE_OPENGL_1 COND_USE_PCH_1 COND_USE_PLUGINS_0 COND_USE_RTTI_0 COND_USE_RTTI_1 COND_USE_SOSYMLINKS_1 COND_USE_SOVERCYGWIN_1_USE_SOVERSION_1 COND_USE_SOVERLINUX_1 COND_USE_SOVERSION_0 COND_USE_SOVERSOLARIS_1 COND_USE_THREADS_0 COND_USE_THREADS_1 COND_USE_XRC_1 COND_WINDOWS_IMPLIB_1 COND_WITH_PLUGIN_SDL_1 COND_WXUNIV_0 COND_WXUNIV_1 COND_WXUSE_EXPAT_BUILTIN COND_WXUSE_LIBJPEG_BUILTIN COND_WXUSE_LIBPNG_BUILTIN COND_WXUSE_LIBTIFF_BUILTIN COND_WXUSE_ODBC_BUILTIN COND_WXUSE_REGEX_BUILTIN COND_WXUSE_ZLIB_BUILTIN SHARED WX_LIBRARY_BASENAME_NOGUI WX_LIBRARY_BASENAME_GUI USE_GUI AFMINSTALL WIN32INSTALL TOOLKIT TOOLKIT_DIR TOOLCHAIN_NAME TOOLCHAIN_FULLNAME cross_compiling WIDGET_SET WX_RELEASE WX_VERSION WX_SUBVERSION WX_CHARTYPE WX_DEBUGTYPE WXCONFIG_CPPFLAGS WXCONFIG_CFLAGS WXCONFIG_CXXFLAGS WXCONFIG_LIBS WXCONFIG_RPATH WXCONFIG_LDFLAGS_GUI WXCONFIG_RESFLAGS EXE_LINKER GUIDIST DISTDIR SAMPLES_SUBDIRS LDFLAGS_GL OPENGL_LIBS DMALLOC_LIBS WX_VERSION_TAG RESCOMP RESFLAGS RESPROGRAMOBJ WX_RESOURCES_MACOSX_ASCII WX_RESOURCES_MACOSX_DATA LIBWXMACRES POSTLINK_COMMAND MACSETFILE GCC CPPUNIT_CONFIG LIBOBJS LTLIBOBJS'
 ac_subst_files=''
 
 # Initialize some variables set by options.
@@ -790,6 +790,14 @@ ac_env_PKG_CONFIG_set=${PKG_CONFIG+set}
 ac_env_PKG_CONFIG_value=$PKG_CONFIG
 ac_cv_env_PKG_CONFIG_set=${PKG_CONFIG+set}
 ac_cv_env_PKG_CONFIG_value=$PKG_CONFIG
+ac_env_DIRECTFB_CFLAGS_set=${DIRECTFB_CFLAGS+set}
+ac_env_DIRECTFB_CFLAGS_value=$DIRECTFB_CFLAGS
+ac_cv_env_DIRECTFB_CFLAGS_set=${DIRECTFB_CFLAGS+set}
+ac_cv_env_DIRECTFB_CFLAGS_value=$DIRECTFB_CFLAGS
+ac_env_DIRECTFB_LIBS_set=${DIRECTFB_LIBS+set}
+ac_env_DIRECTFB_LIBS_value=$DIRECTFB_LIBS
+ac_cv_env_DIRECTFB_LIBS_set=${DIRECTFB_LIBS+set}
+ac_cv_env_DIRECTFB_LIBS_value=$DIRECTFB_LIBS
 ac_env_PANGOX_CFLAGS_set=${PANGOX_CFLAGS+set}
 ac_env_PANGOX_CFLAGS_value=$PANGOX_CFLAGS
 ac_cv_env_PANGOX_CFLAGS_set=${PANGOX_CFLAGS+set}
@@ -1139,6 +1147,7 @@ Optional Packages:
   --with-msw              use MS-Windows
   --with-pm               use OS/2 Presentation Manager
   --with-mgl              use SciTech MGL
+  --with-directfb         use DirectFB
   --with-microwin         use MicroWindows
   --with-x11              use X11
   --with-libpng           use libpng (PNG image format)
@@ -1178,6 +1187,10 @@ Some influential environment variables:
   CXXFLAGS    C++ compiler flags
   CXXCPP      C++ preprocessor
   PKG_CONFIG  path to pkg-config utility
+  DIRECTFB_CFLAGS
+              C compiler flags for DIRECTFB, overriding pkg-config
+  DIRECTFB_LIBS
+              linker flags for DIRECTFB, overriding pkg-config
   PANGOX_CFLAGS
               C compiler flags for PANGOX, overriding pkg-config
   PANGOX_LIBS linker flags for PANGOX, overriding pkg-config
@@ -1801,7 +1814,7 @@ USE_ALPHA=
 
 NEEDS_D_REENTRANT_FOR_R_FUNCS=0
 
-ALL_TOOLKITS="COCOA GTK MAC MGL MICROWIN MOTIF MSW PM X11"
+ALL_TOOLKITS="COCOA GTK MAC MGL MICROWIN MOTIF MSW PM X11 DFB"
 
 DEFAULT_wxUSE_COCOA=0
 DEFAULT_wxUSE_GTK=0
@@ -1812,6 +1825,7 @@ DEFAULT_wxUSE_MOTIF=0
 DEFAULT_wxUSE_MSW=0
 DEFAULT_wxUSE_PM=0
 DEFAULT_wxUSE_X11=0
+DEFAULT_wxUSE_DFB=0
 
 DEFAULT_DEFAULT_wxUSE_COCOA=0
 DEFAULT_DEFAULT_wxUSE_GTK=0
@@ -1822,6 +1836,7 @@ DEFAULT_DEFAULT_wxUSE_MOTIF=0
 DEFAULT_DEFAULT_wxUSE_MSW=0
 DEFAULT_DEFAULT_wxUSE_PM=0
 DEFAULT_DEFAULT_wxUSE_X11=0
+DEFAULT_DEFAULT_wxUSE_DFB=0
 
 PROGRAM_EXT=
 SO_SUFFIX=so
@@ -2844,6 +2859,12 @@ if test "${with_mgl+set}" = set; then
   wxUSE_MGL="$withval" wxUSE_UNIVERSAL="yes" CACHE_MGL=1 TOOLKIT_GIVEN=1
 fi;
 
+# Check whether --with-directfb or --without-directfb was given.
+if test "${with_directfb+set}" = set; then
+  withval="$with_directfb"
+  wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1
+fi;
+
 # Check whether --with-microwin or --without-microwin was given.
 if test "${with_microwin+set}" = set; then
   withval="$with_microwin"
@@ -11356,7 +11377,7 @@ echo "$as_me: error: BeOS GUI is not supported yet, use --disable-gui" >&2;}
     fi
 
             NUM_TOOLKITS=`expr ${wxUSE_COCOA:-0} + ${wxUSE_GTK:-0} + ${wxUSE_MAC:-0} \
-                  + ${wxUSE_MGL:-0} + ${wxUSE_MICROWIN:-0} \
+                  + ${wxUSE_MGL:-0} + ${wxUSE_DFB:-0} + ${wxUSE_MICROWIN:-0} \
                   + ${wxUSE_MOTIF:-0} + ${wxUSE_MSW:-0} + ${wxUSE_X11:-0}`
 
         case "${host}" in
@@ -28573,6 +28594,199 @@ echo "${ECHO_T}\"$MGL_ROOT/lib/$mgl_lib_type/$mgl_os\"" >&6
         GUIDIST=MGL_DIST
     fi
 
+    if test "$wxUSE_DFB" = 1; then
+
+
+if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
+       if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
+set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+
+if test -n "$PKG_CONFIG"; then
+  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
+echo "${ECHO_T}$PKG_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_path_PKG_CONFIG"; then
+  ac_pt_PKG_CONFIG=$PKG_CONFIG
+  # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  case $ac_pt_PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+
+  ;;
+esac
+fi
+ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
+
+if test -n "$ac_pt_PKG_CONFIG"; then
+  echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
+echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
+else
+  echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+  PKG_CONFIG=$ac_pt_PKG_CONFIG
+else
+  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
+fi
+
+fi
+if test -n "$PKG_CONFIG"; then
+       _pkg_min_version=0.9.0
+       echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
+echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6
+       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
+               echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+       else
+               echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+               PKG_CONFIG=""
+       fi
+
+fi
+
+pkg_failed=no
+echo "$as_me:$LINENO: checking for DIRECTFB" >&5
+echo $ECHO_N "checking for DIRECTFB... $ECHO_C" >&6
+
+if test -n "$PKG_CONFIG"; then
+    if test -n "$DIRECTFB_CFLAGS"; then
+        pkg_cv_DIRECTFB_CFLAGS="$DIRECTFB_CFLAGS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"directfb >= 0.9.25\"") >&5
+  ($PKG_CONFIG --exists --print-errors "directfb >= 0.9.25") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_DIRECTFB_CFLAGS=`$PKG_CONFIG --cflags "directfb >= 0.9.25" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+if test -n "$PKG_CONFIG"; then
+    if test -n "$DIRECTFB_LIBS"; then
+        pkg_cv_DIRECTFB_LIBS="$DIRECTFB_LIBS"
+    else
+        if test -n "$PKG_CONFIG" && \
+    { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"directfb >= 0.9.25\"") >&5
+  ($PKG_CONFIG --exists --print-errors "directfb >= 0.9.25") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  pkg_cv_DIRECTFB_LIBS=`$PKG_CONFIG --libs "directfb >= 0.9.25" 2>/dev/null`
+else
+  pkg_failed=yes
+fi
+    fi
+else
+       pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               DIRECTFB_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "directfb >= 0.9.25"`
+        else
+               DIRECTFB_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "directfb >= 0.9.25"`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$DIRECTFB_PKG_ERRORS" >&5
+
+
+                           { { echo "$as_me:$LINENO: error: DirectFB not found." >&5
+echo "$as_me: error: DirectFB not found." >&2;}
+   { (exit 1); exit 1; }; }
+
+
+elif test $pkg_failed = untried; then
+
+                           { { echo "$as_me:$LINENO: error: DirectFB not found." >&5
+echo "$as_me: error: DirectFB not found." >&2;}
+   { (exit 1); exit 1; }; }
+
+
+else
+       DIRECTFB_CFLAGS=$pkg_cv_DIRECTFB_CFLAGS
+       DIRECTFB_LIBS=$pkg_cv_DIRECTFB_LIBS
+        echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+                           wxUSE_UNIVERSAL="yes"
+                           TOOLKIT_INCLUDE="$DIRECTFB_CFLAGS"
+                           GUI_TK_LIBRARY="$DIRECTFB_LIBS"
+                           TOOLKIT=DFB
+                           GUIDIST=DFB_DIST
+
+fi
+    fi
+
     if test "$wxUSE_MICROWIN" = 1; then
         echo "$as_me:$LINENO: checking for MicroWindows" >&5
 echo $ECHO_N "checking for MicroWindows... $ECHO_C" >&6
@@ -30025,111 +30239,6 @@ _ACEOF
 
         if test "$wxUSE_UNICODE" = "yes"; then
 
-
-if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
-       if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
-set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  ;;
-esac
-fi
-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
-
-if test -n "$PKG_CONFIG"; then
-  echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
-echo "${ECHO_T}$PKG_CONFIG" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_path_PKG_CONFIG"; then
-  ac_pt_PKG_CONFIG=$PKG_CONFIG
-  # Extract the first word of "pkg-config", so it can be a program name with args.
-set dummy pkg-config; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-  case $ac_pt_PKG_CONFIG in
-  [\\/]* | ?:[\\/]*)
-  ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
-  ;;
-  *)
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-  for ac_exec_ext in '' $ac_executable_extensions; do
-  if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
-    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-done
-
-  ;;
-esac
-fi
-ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
-
-if test -n "$ac_pt_PKG_CONFIG"; then
-  echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
-echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6
-else
-  echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-  PKG_CONFIG=$ac_pt_PKG_CONFIG
-else
-  PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
-fi
-
-fi
-if test -n "$PKG_CONFIG"; then
-       _pkg_min_version=0.9.0
-       echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
-echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6
-       if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
-               echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
-       else
-               echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-               PKG_CONFIG=""
-       fi
-
-fi
-
 pkg_failed=no
 echo "$as_me:$LINENO: checking for PANGOX" >&5
 echo $ECHO_N "checking for PANGOX... $ECHO_C" >&6
@@ -48432,6 +48541,16 @@ EOF
         COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0=""
     fi
 
+    COND_TOOLKIT_DFB="#"
+    if test "x$TOOLKIT" = "xDFB" ; then
+        COND_TOOLKIT_DFB=""
+    fi
+
+    COND_TOOLKIT_DFB_USE_GUI_1="#"
+    if test "x$TOOLKIT" = "xDFB" -a "x$USE_GUI" = "x1" ; then
+        COND_TOOLKIT_DFB_USE_GUI_1=""
+    fi
+
     COND_TOOLKIT_GTK="#"
     if test "x$TOOLKIT" = "xGTK" ; then
         COND_TOOLKIT_GTK=""
@@ -49783,11 +49902,13 @@ s,@PKG_CONFIG@,$PKG_CONFIG,;t t
 s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t
 s,@GTK_LIBS@,$GTK_LIBS,;t t
 s,@GTK_CONFIG@,$GTK_CONFIG,;t t
+s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
+s,@DIRECTFB_CFLAGS@,$DIRECTFB_CFLAGS,;t t
+s,@DIRECTFB_LIBS@,$DIRECTFB_LIBS,;t t
 s,@X_CFLAGS@,$X_CFLAGS,;t t
 s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t
 s,@X_LIBS@,$X_LIBS,;t t
 s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t
-s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t
 s,@PANGOX_CFLAGS@,$PANGOX_CFLAGS,;t t
 s,@PANGOX_LIBS@,$PANGOX_LIBS,;t t
 s,@PANGOFT2_CFLAGS@,$PANGOFT2_CFLAGS,;t t
@@ -49975,6 +50096,8 @@ s,@COND_TOOLKIT_@,$COND_TOOLKIT_,;t t
 s,@COND_TOOLKIT_COCOA@,$COND_TOOLKIT_COCOA,;t t
 s,@COND_TOOLKIT_COCOA_USE_GUI_1@,$COND_TOOLKIT_COCOA_USE_GUI_1,;t t
 s,@COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0@,$COND_TOOLKIT_COCOA_USE_GUI_1_WXUNIV_0,;t t
+s,@COND_TOOLKIT_DFB@,$COND_TOOLKIT_DFB,;t t
+s,@COND_TOOLKIT_DFB_USE_GUI_1@,$COND_TOOLKIT_DFB_USE_GUI_1,;t t
 s,@COND_TOOLKIT_GTK@,$COND_TOOLKIT_GTK,;t t
 s,@COND_TOOLKIT_GTK_TOOLKIT_VERSION_@,$COND_TOOLKIT_GTK_TOOLKIT_VERSION_,;t t
 s,@COND_TOOLKIT_GTK_TOOLKIT_VERSION_2@,$COND_TOOLKIT_GTK_TOOLKIT_VERSION_2,;t t
index 4fa6060386be8c0ff4571c32d1980eb2ab2f07bd..673405886e1d8ec0569284e922c5fcf9218db7ad 100644 (file)
@@ -89,7 +89,7 @@ NEEDS_D_REENTRANT_FOR_R_FUNCS=0
 dnl the list of all available toolkits
 dnl
 dnl update NUM_TOOLKITS calculation below when adding a new toolkit here!
-ALL_TOOLKITS="COCOA GTK MAC MGL MICROWIN MOTIF MSW PM X11"
+ALL_TOOLKITS="COCOA GTK MAC MGL MICROWIN MOTIF MSW PM X11 DFB"
 
 dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones
 dnl     which are either yes or no
@@ -102,6 +102,7 @@ DEFAULT_wxUSE_MOTIF=0
 DEFAULT_wxUSE_MSW=0
 DEFAULT_wxUSE_PM=0
 DEFAULT_wxUSE_X11=0
+DEFAULT_wxUSE_DFB=0
 
 dnl these are the values which are really default for the given platform -
 dnl they're not cached and are only used if no --with-toolkit was given *and*
@@ -115,6 +116,7 @@ DEFAULT_DEFAULT_wxUSE_MOTIF=0
 DEFAULT_DEFAULT_wxUSE_MSW=0
 DEFAULT_DEFAULT_wxUSE_PM=0
 DEFAULT_DEFAULT_wxUSE_X11=0
+DEFAULT_DEFAULT_wxUSE_DFB=0
 
 PROGRAM_EXT=
 SO_SUFFIX=so
@@ -839,6 +841,7 @@ AC_ARG_WITH(wine,          [  --with-wine             use Wine], [wxUSE_WINE="$w
 AC_ARG_WITH(msw,           [  --with-msw              use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(pm,            [  --with-pm               use OS/2 Presentation Manager], [wxUSE_PM="$withval" CACHE_PM=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(mgl,           [  --with-mgl              use SciTech MGL], [wxUSE_MGL="$withval" wxUSE_UNIVERSAL="yes" CACHE_MGL=1 TOOLKIT_GIVEN=1])
+AC_ARG_WITH(directfb,      [  --with-directfb         use DirectFB], [wxUSE_DFB="$withval" wxUSE_UNIVERSAL="yes" CACHE_DFB=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(microwin,      [  --with-microwin         use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1])
 AC_ARG_WITH(x11,           [  --with-x11              use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1])
 WX_ARG_ENABLE(nanox,       [  --enable-nanox          use NanoX], wxUSE_NANOX)
@@ -1320,7 +1323,7 @@ if test "$wxUSE_GUI" = "yes"; then
     dnl we suppose that expr is available (maybe there is a better way to do
     dnl this? what about using ALL_TOOLKITS? TODO)
     NUM_TOOLKITS=`expr ${wxUSE_COCOA:-0} + ${wxUSE_GTK:-0} + ${wxUSE_MAC:-0} \
-                  + ${wxUSE_MGL:-0} + ${wxUSE_MICROWIN:-0} \
+                  + ${wxUSE_MGL:-0} + ${wxUSE_DFB:-0} + ${wxUSE_MICROWIN:-0} \
                   + ${wxUSE_MOTIF:-0} + ${wxUSE_MSW:-0} + ${wxUSE_X11:-0}`
 
     dnl Allow wxUSE_PM only for OS/2 with EMX.
@@ -3154,6 +3157,22 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
         GUIDIST=MGL_DIST
     fi
 
+    if test "$wxUSE_DFB" = 1; then
+       PKG_CHECK_MODULES(DIRECTFB,
+                         [directfb >= 0.9.25],
+                         [
+                           wxUSE_UNIVERSAL="yes"
+                           TOOLKIT_INCLUDE="$DIRECTFB_CFLAGS"
+                           GUI_TK_LIBRARY="$DIRECTFB_LIBS"
+                           TOOLKIT=DFB
+                           GUIDIST=DFB_DIST
+                         ],
+                         [
+                           AC_MSG_ERROR([DirectFB not found.])
+                         ]
+                         )
+    fi
+
     if test "$wxUSE_MICROWIN" = 1; then
         AC_MSG_CHECKING(for MicroWindows)
         if test "x$MICROWINDOWS" = x ; then
index 4fc847b33c37ea7aa210f5d6a62686abb4912e53..c3f299f2658af8d771b98a4e55daec59dde8a4e7 100644 (file)
@@ -468,10 +468,10 @@ public:
     // ------------------------------------------------------------------------
 
         // Get display mode that is used use. This is only used in framebuffer
-        // wxWin ports (such as wxMGL).
+        // wxWin ports (such as wxMGL or wxDFB).
     virtual wxVideoMode GetDisplayMode() const { return wxVideoMode(); }
         // Set display mode to use. This is only used in framebuffer wxWin
-        // ports (such as wxMGL). This method should be called from
+        // ports (such as wxMGL or wxDFB). This method should be called from
         // wxApp::OnInitGui
     virtual bool SetDisplayMode(const wxVideoMode& WXUNUSED(info)) { return true; }
 
@@ -570,6 +570,8 @@ protected:
         #include "wx/motif/app.h"
     #elif defined(__WXMGL__)
         #include "wx/mgl/app.h"
+    #elif defined(__WXDFB__)
+        #include "wx/dfb/app.h"
     #elif defined(__WXGTK20__)
         #include "wx/gtk/app.h"
     #elif defined(__WXGTK__)
index 5924b00d3e19f3bc36ba77b9817f1e5bf370d95c..7d688bc7886b823b81173f8cfb38520e4349d0ae 100644 (file)
@@ -29,6 +29,7 @@ class WXDLLEXPORT wxMask;
 class WXDLLEXPORT wxPalette;
 
 #if defined(__WXMGL__) || \
+    defined(__WXDFB__) || \
     defined(__WXMAC__) || \
     defined(__WXGTK__) || \
     defined(__WXCOCOA__) || \
@@ -170,6 +171,8 @@ protected:
 #include "wx/x11/bitmap.h"
 #elif defined(__WXMGL__)
 #include "wx/mgl/bitmap.h"
+#elif defined(__WXDFB__)
+#include "wx/dfb/bitmap.h"
 #elif defined(__WXMAC__)
 #include "wx/mac/bitmap.h"
 #elif defined(__WXCOCOA__)
index f3ea86693329cda721da77b96c09c511735269bb..0c862b7e756fc1bc6d080b63a1bd5117113c426b 100644 (file)
@@ -40,6 +40,8 @@ public:
     #include "wx/gtk1/brush.h"
 #elif defined(__WXMGL__)
     #include "wx/mgl/brush.h"
+#elif defined(__WXDFB__)
+    #include "wx/dfb/brush.h"
 #elif defined(__WXMAC__)
     #include "wx/mac/brush.h"
 #elif defined(__WXCOCOA__)
index 4cb3801a9d598ed7dce704c6ec75e4a52be3e90b..e777919dca0f041ed025559d2288f876ee48d4cb 100644 (file)
@@ -27,6 +27,8 @@
 #  include "wx/os2/chkconf.h"
 #elif defined(__WXMGL__)
 #  include "wx/mgl/chkconf.h"
+#elif defined(__WXDFB__)
+#  include "wx/dfb/chkconf.h"
 #elif defined(__WXMOTIF__)
 #  include "wx/motif/chkconf.h"
 #elif defined(__WXX11__)
index 807fbfd68c97f2fbc68fa4fab5a5f3ddcf481e0c..685cab9d3dd2bd40774410dc6961a47e46b537ec 100644 (file)
@@ -126,6 +126,8 @@ public:
 #include "wx/gtk1/colour.h"
 #elif defined(__WXMGL__)
 #include "wx/generic/colour.h"
+#elif defined(__WXDFB__)
+#include "wx/generic/colour.h"
 #elif defined(__WXX11__)
 #include "wx/x11/colour.h"
 #elif defined(__WXMAC__)
index 78f847c2238c09e16eecc59598b57ef9e948501c..f77ecc2a4e69e112ae1900c8d876ece9229e3233 100644 (file)
@@ -28,6 +28,8 @@
     #include "wx/x11/cursor.h"
 #elif defined(__WXMGL__)
     #include "wx/mgl/cursor.h"
+#elif defined(__WXDFB__)
+    #include "wx/dfb/cursor.h"
 #elif defined(__WXMAC__)
     #include "wx/mac/cursor.h"
 #elif defined(__WXCOCOA__)
index a6423af998f99763c3208d3fe84ea1f280ac757d..668140b75821089b5920c4f35a4d8ed2bd968837 100644 (file)
@@ -827,6 +827,8 @@ private:
     #include "wx/x11/dc.h"
 #elif defined(__WXMGL__)
     #include "wx/mgl/dc.h"
+#elif defined(__WXDFB__)
+    #include "wx/dfb/dc.h"
 #elif defined(__WXMAC__)
     #include "wx/mac/dc.h"
 #elif defined(__WXCOCOA__)
index 2cff3cf3f6f10972202349c130a8eeaab5e2730e..d8076390a45b080f2be1fdaf972ae666a4f469f9 100644 (file)
@@ -28,6 +28,8 @@
 #include "wx/x11/dcclient.h"
 #elif defined(__WXMGL__)
 #include "wx/mgl/dcclient.h"
+#elif defined(__WXDFB__)
+#include "wx/dfb/dcclient.h"
 #elif defined(__WXMAC__)
 #include "wx/mac/dcclient.h"
 #elif defined(__WXCOCOA__)
index 68e5a11d95b9903d79135915bb6c2c5a129876bc..d1cf8efde93f3d949071e3e683828667fa6fffaa 100644 (file)
@@ -28,6 +28,8 @@
 #include "wx/x11/dcmemory.h"
 #elif defined(__WXMGL__)
 #include "wx/mgl/dcmemory.h"
+#elif defined(__WXDFB__)
+#include "wx/dfb/dcmemory.h"
 #elif defined(__WXMAC__)
 #include "wx/mac/dcmemory.h"
 #elif defined(__WXCOCOA__)
index a9eade9f27c981c9836650f6cf23e6c23dde4819..bd6fcb9f52035adc3943e158fee750178e254db3 100644 (file)
@@ -28,6 +28,8 @@
 #include "wx/x11/dcscreen.h"
 #elif defined(__WXMGL__)
 #include "wx/mgl/dcscreen.h"
+#elif defined(__WXDFB__)
+#include "wx/dfb/dcscreen.h"
 #elif defined(__WXMAC__)
 #include "wx/mac/dcscreen.h"
 #elif defined(__WXCOCOA__)
index d7f1cb4977bc32e5f9a0517fd3b49c26c2d316b6..fae61c24eda3968a22793739290eef828e373bb1 100644 (file)
@@ -35,6 +35,7 @@
          !defined(__WXCOCOA__) && \
          !defined(__X__)       && \
          !defined(__WXMGL__)   && \
+         !defined(__WXDFB__)   && \
          !defined(__WXX11__)   && \
           wxUSE_GUI
 #       ifdef __UNIX__
@@ -2891,6 +2892,12 @@ typedef struct _PangoFontDescription PangoFontDescription;
 typedef struct window_t *WXWidget;
 #endif /*  MGL */
 
+#ifdef __WXDFB__
+/* DirectFB doesn't have the concept of non-TLW window, so use
+   something arbitrary */
+typedef const void* WXWidget;
+#endif /*  DFB */
+
 /*  This is required because of clashing macros in windows.h, which may be */
 /*  included before or after wxWidgets classes, and therefore must be */
 /*  disabled here before any significant wxWidgets headers are included. */
diff --git a/include/wx/dfb/app.h b/include/wx/dfb/app.h
new file mode 100644 (file)
index 0000000..f1e8041
--- /dev/null
@@ -0,0 +1,49 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/app.h
+// Purpose:     wxApp class
+// Author:      Vaclav Slavik
+// Created:     2006-08-10
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_APP_H_
+#define _WX_DFB_APP_H_
+
+#include "wx/dfb/ifacehelpers.h"
+
+wxDFB_DECLARE_INTERFACE(IDirectFB);
+
+//-----------------------------------------------------------------------------
+// wxApp
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxApp: public wxAppBase
+{
+public:
+    wxApp();
+    ~wxApp();
+
+    // override base class (pure) virtuals
+    virtual bool Initialize(int& argc, wxChar **argv);
+    virtual void CleanUp();
+
+    virtual void WakeUpIdle();
+    virtual bool Yield(bool onlyIfNeeded = false);
+
+    virtual wxVideoMode GetDisplayMode() const;
+    virtual bool SetDisplayMode(const wxVideoMode& mode);
+
+    // implementation - get singleton DirectFB interface
+    IDirectFBPtr GetDirectFBInterface();
+
+private:
+    IDirectFBPtr m_dfb;
+    wxVideoMode m_videoMode;
+
+    DECLARE_DYNAMIC_CLASS(wxApp)
+    DECLARE_EVENT_TABLE()
+};
+
+#endif // _WX_DFB_APP_H_
diff --git a/include/wx/dfb/bitmap.h b/include/wx/dfb/bitmap.h
new file mode 100644 (file)
index 0000000..751535c
--- /dev/null
@@ -0,0 +1,125 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/bitmap.h
+// Purpose:     wxBitmap class
+// Author:      Vaclav Slavik
+// Created:     2006-08-04
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_BITMAP_H_
+#define _WX_DFB_BITMAP_H_
+
+#include "wx/dfb/ifacehelpers.h"
+
+wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
+
+//-----------------------------------------------------------------------------
+// wxMask
+//-----------------------------------------------------------------------------
+
+#warning "FIXME: move wxMask to common code"
+class WXDLLIMPEXP_CORE wxMask: public wxObject
+{
+public:
+    wxMask();
+    wxMask(const wxBitmap& bitmap);
+    wxMask(const wxBitmap& bitmap, const wxColour& colour);
+#if wxUSE_PALETTE
+    wxMask(const wxBitmap& bitmap, int paletteIndex);
+#endif
+    wxMask(const wxMask& mask);
+    ~wxMask();
+
+    bool Create(const wxBitmap& bitmap);
+    bool Create(const wxBitmap& bitmap, const wxColour& colour);
+#if wxUSE_PALETTE
+    bool Create(const wxBitmap& bitmap, int paletteIndex);
+#endif
+
+    // implementation
+    const wxBitmap& GetBitmap() const;
+
+private:
+    wxBitmap *m_bitmap;
+
+    DECLARE_DYNAMIC_CLASS(wxMask)
+};
+
+//-----------------------------------------------------------------------------
+// wxBitmap
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxBitmapHandler : public wxBitmapHandlerBase
+{
+public:
+    wxBitmapHandler() : wxBitmapHandlerBase() {}
+private:
+    DECLARE_DYNAMIC_CLASS(wxBitmapHandler)
+};
+
+class WXDLLIMPEXP_CORE wxBitmap: public wxBitmapBase
+{
+public:
+    wxBitmap() {}
+    wxBitmap(int width, int height, int depth = -1);
+    wxBitmap(const char bits[], int width, int height, int depth = 1);
+    wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
+    wxBitmap(const char **bits) { CreateFromXpm(bits); }
+    wxBitmap(char **bits) { CreateFromXpm((const char **)bits); }
+#if wxUSE_IMAGE
+    wxBitmap(const wxImage& image, int depth = -1);
+#endif
+
+    bool Ok() const;
+    bool operator==(const wxBitmap& bmp) const;
+    bool operator!=(const wxBitmap& bmp) const { return !(*this == bmp); }
+
+    bool Create(int width, int height, int depth = -1);
+
+    virtual int GetHeight() const;
+    virtual int GetWidth() const;
+    virtual int GetDepth() const;
+
+#if wxUSE_IMAGE
+    virtual wxImage ConvertToImage() const;
+#endif
+
+    virtual wxMask *GetMask() const;
+    virtual void SetMask(wxMask *mask);
+
+    virtual wxBitmap GetSubBitmap(const wxRect& rect) const;
+
+    virtual bool SaveFile(const wxString &name, wxBitmapType type, const wxPalette *palette = (wxPalette *) NULL) const;
+    virtual bool LoadFile(const wxString &name, wxBitmapType type = wxBITMAP_TYPE_RESOURCE);
+
+#if wxUSE_PALETTE
+    virtual wxPalette *GetPalette() const;
+    virtual void SetPalette(const wxPalette& palette);
+#endif
+
+    // copies the contents and mask of the given (colour) icon to the bitmap
+    virtual bool CopyFromIcon(const wxIcon& icon);
+
+    static void InitStandardHandlers();
+
+    // implementation:
+    virtual void SetHeight(int height);
+    virtual void SetWidth(int width);
+    virtual void SetDepth(int depth);
+
+    // get underlying native representation:
+    IDirectFBSurfacePtr GetDirectFBSurface() const;
+
+protected:
+    bool CreateFromXpm(const char **bits);
+
+    // ref counting code
+    virtual wxObjectRefData *CreateRefData() const;
+    virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
+
+    DECLARE_DYNAMIC_CLASS(wxBitmap)
+};
+
+#endif // _WX_DFB_BITMAP_H_
diff --git a/include/wx/dfb/brush.h b/include/wx/dfb/brush.h
new file mode 100644 (file)
index 0000000..9879123
--- /dev/null
@@ -0,0 +1,59 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/brush.h
+// Purpose:     wxBrush class declaration
+// Author:      Vaclav Slavik
+// Created:     2006-08-04
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_BRUSH_H_
+#define _WX_DFB_BRUSH_H_
+
+#include "wx/defs.h"
+#include "wx/object.h"
+#include "wx/string.h"
+#include "wx/gdiobj.h"
+#include "wx/bitmap.h"
+
+//-----------------------------------------------------------------------------
+// classes
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxBitmap;
+class WXDLLIMPEXP_CORE wxBrush;
+
+//-----------------------------------------------------------------------------
+// wxBrush
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxBrush: public wxBrushBase
+{
+public:
+    wxBrush() {}
+    wxBrush(const wxColour &colour, int style = wxSOLID);
+    wxBrush(const wxBitmap &stippleBitmap);
+
+    bool Ok() const;
+    bool operator==(const wxBrush& brush) const;
+    bool operator!=(const wxBrush& brush) const { return !(*this == brush); }
+
+    virtual int GetStyle() const;
+    wxColour &GetColour() const;
+    wxBitmap *GetStipple() const;
+
+    void SetColour(const wxColour& col);
+    void SetColour(unsigned char r, unsigned char g, unsigned char b);
+    void SetStyle(int style);
+    void SetStipple(const wxBitmap& stipple);
+
+protected:
+    // ref counting code
+    virtual wxObjectRefData *CreateRefData() const;
+    virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
+
+    DECLARE_DYNAMIC_CLASS(wxBrush)
+};
+
+#endif // _WX_DFB_BRUSH_H_
diff --git a/include/wx/dfb/chkconf.h b/include/wx/dfb/chkconf.h
new file mode 100644 (file)
index 0000000..860ea06
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Name:        wx/dfb/chkconf.h
+ * Author:      Vaclav Slavik
+ * Purpose:     Compiler-specific configuration checking
+ * Created:     2006-08-10
+ * RCS-ID:      $Id$
+ * Copyright:   (c) 2006 REA Elektronik GmbH
+ * Licence:     wxWindows licence
+ */
+
+/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
+
+#ifndef _WX_DFB_CHKCONF_H_
+#define _WX_DFB_CHKCONF_H_
+
+#ifndef __WXUNIVERSAL__
+#   error "wxDirectFB cannot be built without wxUniversal"
+#endif
+
+#endif /* _WX_DFB_CHKCONF_H_ */
diff --git a/include/wx/dfb/cursor.h b/include/wx/dfb/cursor.h
new file mode 100644 (file)
index 0000000..298cbe0
--- /dev/null
@@ -0,0 +1,50 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/cursor.h
+// Purpose:     wxCursor declaration
+// Author:      Vaclav Slavik
+// Created:     2006-08-08
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_CURSOR_H_
+#define _WX_DFB_CURSOR_H_
+
+#include "wx/object.h"
+#include "wx/gdicmn.h"
+
+class WXDLLIMPEXP_CORE wxBitmap;
+
+//-----------------------------------------------------------------------------
+// wxCursor
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxCursor: public wxObject
+{
+public:
+    wxCursor() {}
+    wxCursor(int cursorId);
+    wxCursor(const char bits[], int width, int  height,
+              int hotSpotX=-1, int hotSpotY=-1,
+              const char maskBits[]=0, wxColour *fg=0, wxColour *bg=0);
+    wxCursor(const wxString& name,
+             long flags = wxBITMAP_TYPE_CUR_RESOURCE,
+             int hotSpotX = 0, int hotSpotY = 0);
+
+    bool Ok() const;
+    bool operator==(const wxCursor& cursor) const;
+    bool operator!=(const wxCursor& cursor) const { return !(*this == cursor); }
+
+    // implementation
+    wxBitmap GetBitmap() const;
+
+protected:
+    // ref counting code
+    virtual wxObjectRefData *CreateRefData() const;
+    virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
+
+    DECLARE_DYNAMIC_CLASS(wxCursor)
+};
+
+#endif // _WX_DFB_CURSOR_H_
diff --git a/include/wx/dfb/dc.h b/include/wx/dfb/dc.h
new file mode 100644 (file)
index 0000000..e8690c1
--- /dev/null
@@ -0,0 +1,220 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/dc.h
+// Purpose:     wxDC class
+// Author:      Vaclav Slavik
+// Created:     2006-08-07
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_DC_H_
+#define _WX_DFB_DC_H_
+
+#include "wx/defs.h"
+#include "wx/region.h"
+#include "wx/dfb/ifacehelpers.h"
+
+wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
+
+//-----------------------------------------------------------------------------
+// wxDC
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxDC : public wxDCBase
+{
+public:
+    wxDC();
+
+    // Ctor.
+    // Takes ownership of the surface, i.e. does not call AddRef() on it
+    // but calls Release() on it from dtor.
+    wxDC(const IDirectFBSurfacePtr& surface);
+
+public:
+    // implement base class pure virtuals
+    // ----------------------------------
+
+    virtual void Clear();
+
+    virtual bool StartDoc(const wxString& message);
+    virtual void EndDoc();
+
+    virtual void StartPage();
+    virtual void EndPage();
+
+    virtual void SetFont(const wxFont& font);
+    virtual void SetPen(const wxPen& pen);
+    virtual void SetBrush(const wxBrush& brush);
+    virtual void SetBackground(const wxBrush& brush);
+    virtual void SetBackgroundMode(int mode);
+#if wxUSE_PALETTE
+    virtual void SetPalette(const wxPalette& palette);
+#endif
+
+    virtual void DestroyClippingRegion();
+
+    virtual wxCoord GetCharHeight() const;
+    virtual wxCoord GetCharWidth() const;
+    virtual void DoGetTextExtent(const wxString& string,
+                                 wxCoord *x, wxCoord *y,
+                                 wxCoord *descent = NULL,
+                                 wxCoord *externalLeading = NULL,
+                                 wxFont *theFont = NULL) const;
+
+    virtual bool CanDrawBitmap() const { return true; }
+    virtual bool CanGetTextExtent() const { return true; }
+    virtual int GetDepth() const;
+    virtual wxSize GetPPI() const;
+
+    virtual void SetMapMode(int mode);
+    virtual void SetUserScale(double x, double y);
+    virtual void SetLogicalScale(double x, double y);
+    virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
+    virtual void SetDeviceOrigin(wxCoord x, wxCoord y);
+    virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
+    virtual void SetLogicalFunction(int function);
+
+    // implementation from now on
+    // --------------------------
+
+    virtual void ComputeScaleAndOrigin();
+
+    wxCoord XDEV2LOG(wxCoord x) const
+    {
+        wxCoord new_x = x - m_deviceOriginX;
+        if (new_x > 0)
+            return (wxCoord)((double)(new_x) / m_scaleX + 0.5) * m_signX + m_logicalOriginX;
+        else
+            return (wxCoord)((double)(new_x) / m_scaleX - 0.5) * m_signX + m_logicalOriginX;
+    }
+    wxCoord XDEV2LOGREL(wxCoord x) const
+    {
+        if (x > 0)
+            return (wxCoord)((double)(x) / m_scaleX + 0.5);
+        else
+            return (wxCoord)((double)(x) / m_scaleX - 0.5);
+    }
+    wxCoord YDEV2LOG(wxCoord y) const
+    {
+        wxCoord new_y = y - m_deviceOriginY;
+        if (new_y > 0)
+            return (wxCoord)((double)(new_y) / m_scaleY + 0.5) * m_signY + m_logicalOriginY;
+        else
+            return (wxCoord)((double)(new_y) / m_scaleY - 0.5) * m_signY + m_logicalOriginY;
+    }
+    wxCoord YDEV2LOGREL(wxCoord y) const
+    {
+        if (y > 0)
+            return (wxCoord)((double)(y) / m_scaleY + 0.5);
+        else
+            return (wxCoord)((double)(y) / m_scaleY - 0.5);
+    }
+    wxCoord XLOG2DEV(wxCoord x) const
+    {
+        wxCoord new_x = x - m_logicalOriginX;
+        if (new_x > 0)
+            return (wxCoord)((double)(new_x) * m_scaleX + 0.5) * m_signX + m_deviceOriginX;
+        else
+            return (wxCoord)((double)(new_x) * m_scaleX - 0.5) * m_signX + m_deviceOriginX;
+    }
+    wxCoord XLOG2DEVREL(wxCoord x) const
+    {
+        if (x > 0)
+            return (wxCoord)((double)(x) * m_scaleX + 0.5);
+        else
+            return (wxCoord)((double)(x) * m_scaleX - 0.5);
+    }
+    wxCoord YLOG2DEV(wxCoord y) const
+    {
+        wxCoord new_y = y - m_logicalOriginY;
+        if (new_y > 0)
+            return (wxCoord)((double)(new_y) * m_scaleY + 0.5) * m_signY + m_deviceOriginY;
+        else
+            return (wxCoord)((double)(new_y) * m_scaleY - 0.5) * m_signY + m_deviceOriginY;
+    }
+    wxCoord YLOG2DEVREL(wxCoord y) const
+    {
+        if (y > 0)
+            return (wxCoord)((double)(y) * m_scaleY + 0.5);
+        else
+            return (wxCoord)((double)(y) * m_scaleY - 0.5);
+    }
+
+    // Returns the surface (and increases its ref count)
+    IDirectFBSurfacePtr GetDirectFBSurface() const { return m_surface; }
+
+protected:
+    // initializes the DC from a surface, must be called if default ctor
+    // was used
+    void Init(const IDirectFBSurfacePtr& surface);
+
+    virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
+                             int style = wxFLOOD_SURFACE);
+
+    virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const;
+
+    virtual void DoDrawPoint(wxCoord x, wxCoord y);
+    virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2);
+
+    virtual void DoDrawArc(wxCoord x1, wxCoord y1,
+                           wxCoord x2, wxCoord y2,
+                           wxCoord xc, wxCoord yc);
+    virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
+                                   double sa, double ea);
+
+    virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
+    virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
+                                        wxCoord width, wxCoord height,
+                                        double radius);
+    virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height);
+
+    virtual void DoCrossHair(wxCoord x, wxCoord y);
+
+    virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y);
+    virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
+                              bool useMask = false);
+
+    virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y);
+    virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
+                                   double angle);
+
+    virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
+                        wxDC *source, wxCoord xsrc, wxCoord ysrc,
+                        int rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1);
+
+    // this is gnarly - we can't even call this function DoSetClippingRegion()
+    // because of virtual function hiding
+    virtual void DoSetClippingRegionAsRegion(const wxRegion& region);
+    virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
+                                     wxCoord width, wxCoord height);
+
+    virtual void DoGetSize(int *width, int *height) const;
+    virtual void DoGetSizeMM(int* width, int* height) const;
+
+    virtual void DoDrawLines(int n, wxPoint points[],
+                             wxCoord xoffset, wxCoord yoffset);
+    virtual void DoDrawPolygon(int n, wxPoint points[],
+                               wxCoord xoffset, wxCoord yoffset,
+                               int fillStyle = wxODDEVEN_RULE);
+
+    // implementation from now on:
+
+private:
+    // Unified implementation of DrawIcon, DrawBitmap and Blit:
+    void DoDrawSubBitmap(const wxBitmap &bmp,
+                         wxCoord x, wxCoord y, wxCoord w, wxCoord h,
+                         wxCoord destx, wxCoord desty, int rop, bool useMask);
+
+    // selects colour into surface's state
+    void SelectColour(const wxColour& clr);
+
+protected:
+    IDirectFBSurfacePtr m_surface;
+
+    double            m_mm_to_pix_x, m_mm_to_pix_y;
+
+    DECLARE_DYNAMIC_CLASS(wxDC)
+};
+
+#endif // _WX_DFB_DC_H_
diff --git a/include/wx/dfb/dcclient.h b/include/wx/dfb/dcclient.h
new file mode 100644 (file)
index 0000000..5f1d767
--- /dev/null
@@ -0,0 +1,77 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/dcclient.h
+// Purpose:     wxWindowDC, wxClientDC and wxPaintDC
+// Author:      Vaclav Slavik
+// Created:     2006-08-10
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_DCCLIENT_H_
+#define _WX_DFB_DCCLIENT_H_
+
+#include "wx/dc.h"
+
+class WXDLLIMPEXP_CORE wxWindow;
+
+//-----------------------------------------------------------------------------
+// wxWindowDC
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxWindowDC : public wxDC
+{
+public:
+    wxWindowDC() {}
+    wxWindowDC(wxWindow *win);
+
+protected:
+    void InitForWin(wxWindow *win);
+
+    DECLARE_DYNAMIC_CLASS(wxWindowDC)
+    DECLARE_NO_COPY_CLASS(wxWindowDC)
+};
+
+//-----------------------------------------------------------------------------
+// base class for wxClientDC and wxPaintDC
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxClientDCBase : public wxWindowDC
+{
+public:
+    wxClientDCBase() {}
+    wxClientDCBase(wxWindow *win);
+};
+
+//-----------------------------------------------------------------------------
+// wxClientDC
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxClientDC : public wxClientDCBase
+{
+public:
+    wxClientDC() {}
+    wxClientDC(wxWindow *win) : wxClientDCBase(win) {}
+    ~wxClientDC();
+
+    DECLARE_DYNAMIC_CLASS(wxClientDC)
+    DECLARE_NO_COPY_CLASS(wxClientDC)
+};
+
+
+//-----------------------------------------------------------------------------
+// wxPaintDC
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxPaintDC : public wxClientDCBase
+{
+public:
+    wxPaintDC() {}
+    wxPaintDC(wxWindow *win) : wxClientDCBase(win) {}
+    ~wxPaintDC();
+
+    DECLARE_DYNAMIC_CLASS(wxPaintDC)
+    DECLARE_NO_COPY_CLASS(wxPaintDC)
+};
+
+#endif // _WX_DFB_DCCLIENT_H_
diff --git a/include/wx/dfb/dcmemory.h b/include/wx/dfb/dcmemory.h
new file mode 100644 (file)
index 0000000..afe7fcf
--- /dev/null
@@ -0,0 +1,29 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/dcmemory.h
+// Purpose:     wxMemoryDC class declaration
+// Created:     2006-08-10
+// Author:      Vaclav Slavik
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_DCMEMORY_H_
+#define _WX_DFB_DCMEMORY_H_
+
+#include "wx/dc.h"
+#include "wx/bitmap.h"
+
+class WXDLLIMPEXP_CORE wxMemoryDC : public wxDC
+{
+public:
+    wxMemoryDC();
+    wxMemoryDC(wxDC *dc); // create compatible DC
+
+    virtual void SelectObject(const wxBitmap& bitmap);
+
+    DECLARE_DYNAMIC_CLASS(wxMemoryDC)
+};
+
+#endif // _WX_DFB_DCMEMORY_H_
+
diff --git a/include/wx/dfb/dcscreen.h b/include/wx/dfb/dcscreen.h
new file mode 100644 (file)
index 0000000..25bccef
--- /dev/null
@@ -0,0 +1,31 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/dcscreen.h
+// Purpose:     wxScreenDC declaration
+// Author:      Vaclav Slavik
+// Created:     2006-08-10
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_DCSCREEN_H_
+#define _WX_DFB_DCSCREEN_H_
+
+#include "wx/dc.h"
+
+class WXDLLIMPEXP_CORE wxScreenDC: public wxDC
+{
+public:
+    wxScreenDC();
+
+    static bool StartDrawingOnTop(wxWindow *WXUNUSED(window))
+        { return true; }
+    static bool StartDrawingOnTop(wxRect *WXUNUSED(rect) = NULL)
+        { return true; }
+    static bool EndDrawingOnTop()
+        { return true; }
+
+    DECLARE_DYNAMIC_CLASS(wxScreenDC)
+};
+
+#endif // _WX_DFB_DCSCREEN_H_
diff --git a/include/wx/dfb/evtloop.h b/include/wx/dfb/evtloop.h
new file mode 100644 (file)
index 0000000..05a08f8
--- /dev/null
@@ -0,0 +1,51 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/evtloop.h
+// Purpose:     declares wxEventLoop class
+// Author:      Vaclav Slavik
+// Created:     2006-08-16
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_EVTLOOP_H_
+#define _WX_DFB_EVTLOOP_H_
+
+#include "wx/dfb/ifacehelpers.h"
+
+wxDFB_DECLARE_INTERFACE(IDirectFBEventBuffer);
+struct wxDFBEvent;
+
+// ----------------------------------------------------------------------------
+// wxEventLoop
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxEventLoop : public wxEventLoopManual
+{
+public:
+    wxEventLoop();
+
+    virtual bool Pending() const;
+    virtual bool Dispatch();
+
+    // returns DirectFB event buffer used by wx
+    static IDirectFBEventBufferPtr GetDirectFBEventBuffer();
+
+protected:
+    virtual void WakeUp();
+    virtual void OnNextIteration();
+
+    virtual void HandleDFBEvent(const wxDFBEvent& event);
+
+private:
+    static void InitBuffer();
+
+private:
+    static IDirectFBEventBufferPtr ms_buffer;
+
+    friend class wxApp; // calls WakeUp()
+
+    DECLARE_NO_COPY_CLASS(wxEventLoop)
+};
+
+#endif // _WX_DFB_EVTLOOP_H_
diff --git a/include/wx/dfb/font.h b/include/wx/dfb/font.h
new file mode 100644 (file)
index 0000000..0490917
--- /dev/null
@@ -0,0 +1,78 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/font.h
+// Author:      Vaclav Slavik
+// Purpose:     wxFont declaration
+// Created:     2006-08-08
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_FONT_H_
+#define _WX_DFB_FONT_H_
+
+#include "wx/dfb/ifacehelpers.h"
+
+wxDFB_DECLARE_INTERFACE(IDirectFBFont);
+
+// ----------------------------------------------------------------------------
+// wxFont
+// ----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxFont : public wxFontBase
+{
+public:
+    wxFont() {}
+    wxFont(const wxNativeFontInfo& info) { Create(info); }
+    wxFont(int size,
+           int family,
+           int style,
+           int weight,
+           bool underlined = false,
+           const wxString& face = wxEmptyString,
+           wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        Create(size, family, style, weight, underlined, face, encoding);
+    }
+
+    bool Create(int size,
+                int family,
+                int style,
+                int weight,
+                bool underlined = false,
+                const wxString& face = wxEmptyString,
+                wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+    bool Create(const wxNativeFontInfo& fontinfo);
+
+    // implement base class pure virtuals
+    virtual int GetPointSize() const;
+    virtual int GetFamily() const;
+    virtual int GetStyle() const;
+    virtual int GetWeight() const;
+    virtual wxString GetFaceName() const;
+    virtual bool GetUnderlined() const;
+    virtual wxFontEncoding GetEncoding() const;
+    virtual bool IsFixedWidth() const;
+    virtual const wxNativeFontInfo *GetNativeFontInfo() const;
+
+    virtual void SetPointSize(int pointSize);
+    virtual void SetFamily(int family);
+    virtual void SetStyle(int style);
+    virtual void SetWeight(int weight);
+    virtual bool SetFaceName(const wxString& faceName);
+    virtual void SetUnderlined(bool underlined);
+    virtual void SetEncoding(wxFontEncoding encoding);
+
+    // implementation from now on:
+    IDirectFBFontPtr GetDirectFBFont() const;
+
+protected:
+    // ref counting code
+    virtual wxObjectRefData *CreateRefData() const;
+    virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
+
+private:
+    DECLARE_DYNAMIC_CLASS(wxFont)
+};
+
+#endif // _WX_DFB_FONT_H_
diff --git a/include/wx/dfb/ifacehelpers.h b/include/wx/dfb/ifacehelpers.h
new file mode 100644 (file)
index 0000000..56a8808
--- /dev/null
@@ -0,0 +1,116 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/ifacehelpers.h
+// Purpose:     helpers for dealing with DFB interfaces
+// Author:      Vaclav Slavik
+// Created:     2006-08-09
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_IFACEHELPERS_H_
+#define _WX_DFB_IFACEHELPERS_H_
+
+//-----------------------------------------------------------------------------
+// wxDFB_DECLARE_INTERFACE
+//-----------------------------------------------------------------------------
+
+/**
+    Forward declares DirectFB interface @a name.
+
+    Also declares name##Ptr typedef for wxDfbPtr<name> pointer.
+
+    @param name  name of the DirectFB interface
+ */
+#define wxDFB_DECLARE_INTERFACE(name)            \
+    struct _##name;                              \
+    typedef _##name name;                        \
+    typedef wxDfbPtr<name> name##Ptr;
+
+
+//-----------------------------------------------------------------------------
+// wxDfbPtr
+//-----------------------------------------------------------------------------
+
+// base class for wxDfbPtr
+class wxDfbPtrBase
+{
+protected:
+    // increment/decrement refcount; see ifacehelpers.cpp for why using
+    // void* is safe
+    static void DoAddRef(void *ptr);
+    static void DoRelease(void *ptr);
+};
+
+/**
+    This template implements smart pointer for keeping pointers to DirectFB
+    interfaces. Interface's reference count is increased on copying and the
+    interface is released when the pointer is deleted.
+ */
+template<typename T>
+class wxDfbPtr : private wxDfbPtrBase
+{
+public:
+    /**
+        Creates the pointer from raw interface pointer.
+
+        Takes ownership of @a ptr, i.e. AddRef() is @em not called on it.
+     */
+    wxDfbPtr(T *ptr = NULL) : m_ptr(ptr) {}
+
+    /// Copy ctor
+    wxDfbPtr(const wxDfbPtr& ptr) { InitFrom(ptr); }
+
+    /// Dtor. Releases the interface
+    ~wxDfbPtr() { Reset(); }
+
+    /// Resets the pointer to NULL, decreasing reference count of the interface.
+    void Reset()
+    {
+        if ( m_ptr )
+        {
+            DoRelease(m_ptr);
+            m_ptr = NULL;
+        }
+    }
+
+    /// Cast to raw pointer
+    operator T*() const { return m_ptr; }
+
+    /**
+        Cast to @em writeable raw pointer so that code like
+        "dfb->CreateFont(dfb, NULL, &desc, &fontPtr)" works.
+
+        Note that this operator calls Reset(), so using it looses the value.
+     */
+    T** operator&()
+    {
+        Reset();
+        return &m_ptr;
+    }
+
+    // standard operators:
+
+    wxDfbPtr& operator=(const wxDfbPtr& ptr)
+    {
+        Reset();
+        InitFrom(ptr);
+        return *this;
+    }
+
+    T& operator*() const { return *m_ptr; }
+    T* operator->() const { return m_ptr; }
+
+private:
+    void InitFrom(const wxDfbPtr& ptr)
+    {
+        m_ptr = ptr.m_ptr;
+        if ( m_ptr )
+            DoAddRef(m_ptr);
+    }
+
+private:
+    T *m_ptr;
+};
+
+#endif // _WX_DFB_IFACEHELPERS_H_
diff --git a/include/wx/dfb/pen.h b/include/wx/dfb/pen.h
new file mode 100644 (file)
index 0000000..3f78357
--- /dev/null
@@ -0,0 +1,70 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/pen.h
+// Purpose:     wxPen class declaration
+// Author:      Vaclav Slavik
+// Created:     2006-08-04
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_PEN_H_
+#define _WX_DFB_PEN_H_
+
+#include "wx/defs.h"
+#include "wx/object.h"
+#include "wx/string.h"
+#include "wx/gdiobj.h"
+#include "wx/gdicmn.h"
+
+//-----------------------------------------------------------------------------
+// classes
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxBitmap;
+class WXDLLIMPEXP_CORE wxPen;
+
+//-----------------------------------------------------------------------------
+// wxPen
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxPen: public wxGDIObject
+{
+public:
+    wxPen() {}
+    wxPen(const wxColour &colour, int width = 1, int style = wxSOLID);
+    wxPen(const wxBitmap& stipple, int width);
+
+    bool operator==(const wxPen& pen) const;
+    bool operator!=(const wxPen& pen) const { return !(*this == pen); }
+
+    void SetColour(const wxColour &colour);
+    void SetColour(unsigned char red, unsigned char green, unsigned char blue);
+    void SetCap(int capStyle);
+    void SetJoin(int joinStyle);
+    void SetStyle(int style);
+    void SetWidth(int width);
+    void SetDashes(int number_of_dashes, const wxDash *dash);
+    void SetStipple(const wxBitmap& stipple);
+
+    wxColour &GetColour() const;
+    int GetCap() const;
+    int GetJoin() const;
+    int GetStyle() const;
+    int GetWidth() const;
+    int GetDashes(wxDash **ptr) const;
+    int GetDashCount() const;
+    wxDash* GetDash() const;
+    wxBitmap *GetStipple() const;
+
+    bool Ok() const;
+
+protected:
+    // ref counting code
+    virtual wxObjectRefData *CreateRefData() const;
+    virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
+
+    DECLARE_DYNAMIC_CLASS(wxPen)
+};
+
+#endif // _WX_DFB_PEN_H_
diff --git a/include/wx/dfb/private.h b/include/wx/dfb/private.h
new file mode 100644 (file)
index 0000000..0c82d8e
--- /dev/null
@@ -0,0 +1,156 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/private.h
+// Purpose:     private helpers for wxDFB implementation
+// Author:      Vaclav Slavik
+// Created:     2006-08-09
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_PRIVATE_H_
+#define _WX_DFB_PRIVATE_H_
+
+#include "wx/intl.h"
+#include "wx/log.h"
+
+#include <directfb.h>
+
+#include "wx/dfb/ifacehelpers.h"
+
+wxDFB_DECLARE_INTERFACE(IDirectFB);
+wxDFB_DECLARE_INTERFACE(IDirectFBDisplayLayer);
+wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
+wxDFB_DECLARE_INTERFACE(IDirectFBPalette);
+
+//-----------------------------------------------------------------------------
+// strings conversion
+//-----------------------------------------------------------------------------
+
+// convert string from wxString to UTF-8 encoded const char*
+#if wxUSE_UNICODE
+    #define wxSTR_TO_DFB(s)    (s).mb_str(wxConvUTF8)
+#else
+    #define wxSTR_TO_DFB(s)    wxConvUTF8.cWC2MB((s).wc_str(*wxConvUI))
+#endif
+
+//-----------------------------------------------------------------------------
+// error checking
+//-----------------------------------------------------------------------------
+
+inline bool wxDfbCheckReturn(DFBResult code)
+{
+    switch ( code )
+    {
+        case DFB_OK:
+            return true;
+
+        // these are programming errors, assert:
+        #define DFB_ASSERT(code)                                        \
+            case code:                                                  \
+                wxFAIL_MSG( _T("DirectFB error: ") _T(#code) );         \
+                return false                                            \
+
+        DFB_ASSERT(DFB_DEAD);
+        DFB_ASSERT(DFB_UNSUPPORTED);
+        DFB_ASSERT(DFB_UNIMPLEMENTED);
+        DFB_ASSERT(DFB_INVARG);
+        DFB_ASSERT(DFB_NOIMPL);
+        DFB_ASSERT(DFB_MISSINGFONT);
+        DFB_ASSERT(DFB_THIZNULL);
+        DFB_ASSERT(DFB_INVAREA);
+        DFB_ASSERT(DFB_DESTROYED);
+        DFB_ASSERT(DFB_NOSUCHMETHOD);
+        DFB_ASSERT(DFB_NOSUCHINSTANCE);
+        DFB_ASSERT(DFB_VERSIONMISMATCH);
+
+        #undef  DFB_ASSERT
+
+        // these are not errors, but valid return codes:
+        case DFB_INTERRUPTED:
+        case DFB_BUFFEREMPTY:
+            return true;
+
+        default:
+            // FIXME: should handle the errors individually
+            wxLogError(_("DirectFB error %d occured."), (int)code);
+            return false;
+    }
+}
+
+/**
+    Wrap all calls to DirectFB in this macro so that the return value is
+    checked and errors reported as appropriate.
+
+    Returns true if the call succeeded, false otherwise.
+ */
+#define DFB_CALL(call)      (wxDfbCheckReturn(call))
+
+
+//-----------------------------------------------------------------------------
+// surface manipulation helpers
+//-----------------------------------------------------------------------------
+
+/// Mode of wxDfbCloneSurface() call
+enum wxDfbCloneSurfaceMode
+{
+    /// Don't copy surface pixels, just clone surface size and attributes
+    wxDfbCloneSurface_NoPixels = 0,
+    /// Make exact copy, including the pixels
+    wxDfbCloneSurface_CopyPixels
+};
+
+/**
+    Creates a new surface by cloning existing one. Depending on @a mode,
+    either makes exact copy (wxDfbCloneSurface_CopyPixels) or only creates a
+    new surface with the same size and attributes (wxDfbCloneSurface_NoPixels).
+ */
+IDirectFBSurfacePtr wxDfbCloneSurface(const IDirectFBSurfacePtr& s,
+                                      wxDfbCloneSurfaceMode mode);
+
+/// Returns bit depth used by the surface
+int wxDfbGetSurfaceDepth(const IDirectFBSurfacePtr& s);
+
+/// Returns interface to the primary display layer:
+IDirectFBDisplayLayerPtr wxDfbGetDisplayLayer();
+
+/// Returns interface to the primary surface:
+IDirectFBSurfacePtr wxDfbGetPrimarySurface();
+
+
+//-----------------------------------------------------------------------------
+// wxDfbEvent
+//-----------------------------------------------------------------------------
+
+/**
+    The struct defined by this macro is a thin wrapper around DFB*Event type.
+    It is needed because DFB*Event are typedefs and so we can't forward declare
+    them, but we need to pass them to methods declared in public headers where
+    <directfb.h> cannot be included. So this struct just holds the event value,
+    it's sole purpose is that it can be forward declared.
+ */
+#define WXDFB_DEFINE_EVENT_WRAPPER(T)                                       \
+    struct wx##T                                                            \
+    {                                                                       \
+        wx##T() {}                                                          \
+        wx##T(const T& event) : m_event(event) {}                           \
+                                                                            \
+        operator T&() { return m_event; }                                   \
+        operator const T&() const { return m_event; }                       \
+        T* operator&() { return &m_event; }                                 \
+                                                                            \
+        DFBEventClass GetClass() const { return m_event.clazz; }            \
+                                                                            \
+    private:                                                                \
+        T m_event;                                                          \
+    };
+
+WXDFB_DEFINE_EVENT_WRAPPER(DFBEvent)
+WXDFB_DEFINE_EVENT_WRAPPER(DFBWindowEvent)
+
+/// Convert DirectFB timestamp to wxEvent one:
+#define wxDFB_EVENT_TIMESTAMP(event) \
+        ((event).timestamp.tv_sec * 1000 + (event).timestamp.tv_usec / 1000)
+
+
+#endif // _WX_DFB_PRIVATE_H_
diff --git a/include/wx/dfb/region.h b/include/wx/dfb/region.h
new file mode 100644 (file)
index 0000000..a7cdd83
--- /dev/null
@@ -0,0 +1,156 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/region.h
+// Purpose:     wxRegion class
+// Author:      Vaclav Slavik
+// Created:     2006-08-08
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_REGION_H_
+#define _WX_DFB_REGION_H_
+
+#include "wx/gdiobj.h"
+#include "wx/gdicmn.h"
+
+#warning "Move these to wx/region.h when common code is moved there"
+class WXDLLIMPEXP_CORE wxBitmap;
+class WXDLLIMPEXP_CORE wxColour;
+
+class WXDLLIMPEXP_CORE wxRegion : public wxGDIObject
+{
+
+public:
+    wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
+    wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
+    wxRegion(const wxRect& rect);
+    wxRegion(const wxBitmap& bmp)
+    {
+        Union(bmp);
+    }
+    wxRegion(const wxBitmap& bmp,
+             const wxColour& transColour, int tolerance = 0)
+    {
+        Union(bmp, transColour, tolerance);
+    }
+
+    wxRegion();
+    ~wxRegion();
+
+    #warning "FIXME: move this to common code? at least Ok()"
+    bool Ok() const { return m_refData != NULL; }
+
+    bool operator==(const wxRegion& region) const;
+    bool operator!=(const wxRegion& region) const { return !(*this == region); }
+
+    // Clear current region
+    void Clear();
+
+    bool Offset(wxCoord x, wxCoord y);
+
+    // Union rectangle or region with this.
+    bool Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+        { return Union(wxRect(x, y, width, height)); }
+    bool Union(const wxRect& rect);
+    bool Union(const wxRegion& region);
+
+    // Intersect rectangle or region with this.
+    bool Intersect(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+        { return Intersect(wxRect(x, y, width, height)); }
+    bool Intersect(const wxRect& rect);
+    bool Intersect(const wxRegion& region);
+
+    // Subtract rectangle or region from this:
+    // Combines the parts of 'this' that are not part of the second region.
+    bool Subtract(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+        { return Subtract(wxRect(x, y, width, height)); }
+    bool Subtract(const wxRect& rect);
+    bool Subtract(const wxRegion& region);
+
+    // XOR: the union of two combined regions except for any overlapping areas.
+    bool Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+        { return Xor(wxRect(x, y, width, height)); }
+    bool Xor(const wxRect& rect);
+    bool Xor(const wxRegion& region);
+
+    // Outer bounds of region
+    void GetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const;
+    wxRect GetBox(void) const;
+
+    // Is region empty?
+    bool Empty(void) const;
+    inline bool IsEmpty(void) const { return Empty(); }
+
+    // Does the region contain the point (x,y)?
+    wxRegionContain Contains(wxCoord x, wxCoord y) const;
+    // Does the region contain the point pt?
+    wxRegionContain Contains(const wxPoint& pt) const
+        { return Contains(pt.x, pt.y); }
+    // Does the region contain the rectangle rect?
+    wxRegionContain Contains(const wxRect& rect) const;
+    // Does the region contain the rectangle (x, y, w, h)?
+    wxRegionContain Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h) const
+        { return Contains(wxRect(x, y, w, h)); }
+
+
+    #warning "Move these union versions + ConvertToBitmap to wxRegionBase"
+    // Convert the region to a B&W bitmap with the white pixels being inside
+    // the region.
+    wxBitmap ConvertToBitmap() const;
+
+    // Use the non-transparent pixels of a wxBitmap for the region to combine
+    // with this region.  First version takes transparency from bitmap's mask,
+    // second lets the user specify the colour to be treated as transparent
+    // along with an optional tolerance value.
+    // NOTE: implemented in common/rgncmn.cpp
+    bool Union(const wxBitmap& bmp);
+    bool Union(const wxBitmap& bmp,
+               const wxColour& transColour, int tolerance = 0);
+
+    // NB: implementation detail of DirectFB, should be removed if full
+    //     (i.e. not rect-only version is implemented) so that all code that
+    //     assumes region==rect breaks
+    wxRect AsRect() const { return GetBox(); }
+
+protected:
+    // ref counting code
+    virtual wxObjectRefData *CreateRefData() const;
+    virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
+
+    friend class WXDLLIMPEXP_CORE wxRegionIterator;
+
+    DECLARE_DYNAMIC_CLASS(wxRegion);
+};
+
+
+class WXDLLIMPEXP_CORE wxRegionIterator : public wxObject
+{
+public:
+    wxRegionIterator() {}
+    wxRegionIterator(const wxRegion& region) { Reset(region); }
+
+    void Reset() { m_rect = wxRect(); }
+    void Reset(const wxRegion& region);
+
+    bool HaveRects() const { return !m_rect.IsEmpty(); }
+    operator bool() const { return HaveRects(); }
+
+    wxRegionIterator& operator++();
+    wxRegionIterator operator++(int);
+
+    wxCoord GetX() const { return m_rect.GetX(); }
+    wxCoord GetY() const { return m_rect.GetY(); }
+    wxCoord GetW() const { return m_rect.GetWidth(); }
+    wxCoord GetWidth() const { return GetW(); }
+    wxCoord GetH() const { return m_rect.GetHeight(); }
+    wxCoord GetHeight() const { return GetH(); }
+    wxRect GetRect() const { return m_rect; }
+
+private:
+    wxRect m_rect;
+
+    DECLARE_DYNAMIC_CLASS(wxRegionIterator);
+};
+
+#endif // _WX_DFB_REGION_H_
diff --git a/include/wx/dfb/toplevel.h b/include/wx/dfb/toplevel.h
new file mode 100644 (file)
index 0000000..82e797b
--- /dev/null
@@ -0,0 +1,127 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/toplevel.h
+// Purpose:     Top level window, abstraction of wxFrame and wxDialog
+// Author:      Vaclav Slavik
+// Created:     2006-08-10
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_TOPLEVEL_H_
+#define _WX_DFB_TOPLEVEL_H_
+
+#include "wx/dfb/ifacehelpers.h"
+
+wxDFB_DECLARE_INTERFACE(IDirectFBWindow);
+
+class wxDfbQueuedPaintRequests;
+struct wxDFBWindowEvent;
+
+//-----------------------------------------------------------------------------
+// wxTopLevelWindowDFB
+//-----------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxTopLevelWindowDFB : public wxTopLevelWindowBase
+{
+public:
+    // construction
+    wxTopLevelWindowDFB() { Init(); }
+    wxTopLevelWindowDFB(wxWindow *parent,
+                        wxWindowID id,
+                        const wxString& title,
+                        const wxPoint& pos = wxDefaultPosition,
+                        const wxSize& size = wxDefaultSize,
+                        long style = wxDEFAULT_FRAME_STYLE,
+                        const wxString& name = wxFrameNameStr)
+    {
+        Init();
+
+        Create(parent, id, title, pos, size, style, name);
+    }
+
+    bool Create(wxWindow *parent,
+                wxWindowID id,
+                const wxString& title,
+                const wxPoint& pos = wxDefaultPosition,
+                const wxSize& size = wxDefaultSize,
+                long style = wxDEFAULT_FRAME_STYLE,
+                const wxString& name = wxFrameNameStr);
+
+    virtual ~wxTopLevelWindowDFB();
+
+    // implement base class pure virtuals
+    virtual void Maximize(bool maximize = true);
+    virtual bool IsMaximized() const;
+    virtual void Iconize(bool iconize = true);
+    virtual bool IsIconized() const;
+    virtual void Restore();
+
+    virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL);
+    virtual bool IsFullScreen() const { return m_fsIsShowing; }
+
+    virtual bool Show(bool show = true);
+
+    virtual bool CanSetTransparent() { return true; }
+    virtual bool SetTransparent(wxByte alpha);
+
+    virtual void SetTitle(const wxString &title) { m_title = title; }
+    virtual wxString GetTitle() const { return m_title; }
+
+    virtual void Update();
+
+    // implementation from now on
+    // --------------------------
+
+    void OnInternalIdle();
+
+    IDirectFBWindowPtr GetDirectFBWindow() const { return m_dfbwin; }
+
+protected:
+    // common part of all ctors
+    void Init();
+
+    virtual IDirectFBSurfacePtr ObtainDfbSurface() const;
+
+    // overriden wxWindow methods
+    virtual void DoGetPosition(int *x, int *y) const;
+    virtual void DoGetSize(int *width, int *height) const;
+    virtual void DoMoveWindow(int x, int y, int width, int height);
+
+    virtual void DoRefreshRect(const wxRect& rect, bool eraseBack = true);
+
+private:
+    // do queued painting in idle time
+    void HandleQueuedPaintRequests();
+
+    // DirectFB events handling
+    static void HandleDFBWindowEvent(const wxDFBWindowEvent& event_);
+
+protected:
+    wxString      m_title;
+
+    bool          m_fsIsShowing:1;         /* full screen */
+    long          m_fsSaveStyle;
+    long          m_fsSaveFlag;
+    wxRect        m_fsSaveFrame;
+
+    // is the frame currently maximized?
+    bool          m_isMaximized:1;
+    wxRect        m_savedFrame;
+
+    // did we sent wxSizeEvent at least once?
+    bool          m_sizeSet:1;
+
+    // window's opacity (0: transparent, 255: opaque)
+    wxByte        m_opacity;
+
+    // interface to the underlying DirectFB window
+    IDirectFBWindowPtr m_dfbwin;
+
+private:
+    wxDfbQueuedPaintRequests *m_toPaint;
+
+    friend class wxEventLoop; // for HandleDFBWindowEvent
+};
+
+#endif // _WX_DFB_TOPLEVEL_H_
diff --git a/include/wx/dfb/window.h b/include/wx/dfb/window.h
new file mode 100644 (file)
index 0000000..98b10a4
--- /dev/null
@@ -0,0 +1,181 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        wx/dfb/window.h
+// Purpose:     wxWindow class
+// Author:      Vaclav Slavik
+// Created:     2006-08-10
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_DFB_WINDOW_H_
+#define _WX_DFB_WINDOW_H_
+
+// ---------------------------------------------------------------------------
+// headers
+// ---------------------------------------------------------------------------
+
+#include "wx/dfb/ifacehelpers.h"
+
+wxDFB_DECLARE_INTERFACE(IDirectFBSurface);
+struct wxDFBWindowEvent;
+
+class WXDLLIMPEXP_CORE wxFont;
+class WXDLLIMPEXP_CORE wxTopLevelWindowDFB;
+
+// ---------------------------------------------------------------------------
+// wxWindow
+// ---------------------------------------------------------------------------
+
+class WXDLLIMPEXP_CORE wxWindowDFB : public wxWindowBase
+{
+public:
+    wxWindowDFB() { Init(); }
+
+    wxWindowDFB(wxWindow *parent,
+                wxWindowID id,
+                const wxPoint& pos = wxDefaultPosition,
+                const wxSize& size = wxDefaultSize,
+                long style = 0,
+                const wxString& name = wxPanelNameStr)
+    {
+        Init();
+        Create(parent, id, pos, size, style, name);
+    }
+
+    virtual ~wxWindowDFB();
+
+    bool Create(wxWindow *parent,
+                wxWindowID id,
+                const wxPoint& pos = wxDefaultPosition,
+                const wxSize& size = wxDefaultSize,
+                long style = 0,
+                const wxString& name = wxPanelNameStr);
+
+    // implement base class (pure) virtual methods
+    // -------------------------------------------
+
+    virtual void SetLabel( const wxString &WXUNUSED(label) ) {}
+    virtual wxString GetLabel() const { return wxEmptyString; }
+
+    virtual void Raise();
+    virtual void Lower();
+
+    virtual bool Show(bool show = true);
+
+    virtual void SetFocus();
+
+    virtual bool Reparent(wxWindowBase *newParent);
+
+    virtual void WarpPointer(int x, int y);
+
+    virtual void Refresh(bool eraseBackground = true,
+                         const wxRect *rect = (const wxRect *) NULL);
+    virtual void Update();
+    virtual void Clear();
+    virtual void Freeze();
+    virtual void Thaw();
+    bool IsFrozen() const { return m_frozenness > 0; }
+
+    virtual bool SetCursor(const wxCursor &cursor);
+    virtual bool SetFont(const wxFont &font) { m_font = font; return true; }
+
+    virtual int GetCharHeight() const;
+    virtual int GetCharWidth() const;
+    virtual void GetTextExtent(const wxString& string,
+                               int *x, int *y,
+                               int *descent = (int *) NULL,
+                               int *externalLeading = (int *) NULL,
+                               const wxFont *theFont = (const wxFont *) NULL)
+                               const;
+
+#if wxUSE_DRAG_AND_DROP
+    virtual void SetDropTarget(wxDropTarget *dropTarget);
+
+    // Accept files for dragging
+    virtual void DragAcceptFiles(bool accept);
+#endif // wxUSE_DRAG_AND_DROP
+
+    virtual WXWidget GetHandle() const { return this; }
+
+    // implementation from now on
+    // --------------------------
+
+    // Returns DirectFB surface used for rendering of this window
+    IDirectFBSurfacePtr GetDfbSurface();
+
+    // returns toplevel window the window belongs to
+    wxTopLevelWindowDFB *GetTLW() const { return m_tlw; }
+
+    void OnInternalIdle();
+
+protected:
+    // implement the base class pure virtuals
+    virtual void DoClientToScreen(int *x, int *y) const;
+    virtual void DoScreenToClient(int *x, int *y) const;
+    virtual void DoGetPosition(int *x, int *y) const;
+    virtual void DoGetSize(int *width, int *height) const;
+    virtual void DoGetClientSize(int *width, int *height) const;
+    virtual void DoSetSize(int x, int y,
+                           int width, int height,
+                           int sizeFlags = wxSIZE_AUTO);
+    virtual void DoSetClientSize(int width, int height);
+
+    virtual void DoCaptureMouse();
+    virtual void DoReleaseMouse();
+
+    // move the window to the specified location and resize it: this is called
+    // from both DoSetSize() and DoSetClientSize() and would usually just call
+    // ::MoveWindow() except for composite controls which will want to arrange
+    // themselves inside the given rectangle
+    virtual void DoMoveWindow(int x, int y, int width, int height);
+
+    // return DFB surface used to render this window (will be assigned to
+    // m_surface if the window is visible)
+    virtual IDirectFBSurfacePtr ObtainDfbSurface() const;
+
+    // this method must be called when window's position, size or visibility
+    // changes; it resets m_surface so that ObtainDfbSurface has to be called
+    // next time GetDfbSurface is called
+    void InvalidateDfbSurface();
+
+    // called by parent to render (part of) the window
+    void PaintWindow(const wxRect& rect, bool eraseBackground);
+
+    // implementation of Refresh()
+    void DoRefreshWindow(bool eraseBack = true);
+    virtual void DoRefreshRect(const wxRect& rect, bool eraseBack = true);
+
+    // DirectFB events handling
+    void HandleKeyEvent(const wxDFBWindowEvent& event_);
+
+private:
+    // common part of all ctors
+    void Init();
+    // counterpart to SetFocus
+    void KillFocus();
+
+protected:
+    // toplevel window (i.e. DirectFB window) this window belongs to
+    wxTopLevelWindowDFB *m_tlw;
+
+private:
+    // subsurface of TLW's surface covered by this window
+    IDirectFBSurfacePtr m_surface;
+
+    // position of the window (relative to the parent, not used by wxTLW, so
+    // don't access it directly)
+    wxRect m_rect;
+
+    // number of calls to Freeze() minus number of calls to Thaw()
+    unsigned m_frozenness;
+
+    friend class wxTopLevelWindowDFB; // for HandleXXXEvent
+
+    DECLARE_DYNAMIC_CLASS(wxWindowDFB)
+    DECLARE_NO_COPY_CLASS(wxWindowDFB)
+    DECLARE_EVENT_TABLE()
+};
+
+
+#endif // _WX_DFB_WINDOW_H_
index 82d812846d3518180319f603d6fca31987674462..49f744bd69cd6e3910cae73720c5f1cee2894ee1 100644 (file)
@@ -58,10 +58,12 @@ struct WXDLLEXPORT wxNativeEncodingInfo
     // seems to be handled internally.
 #elif defined(__WXMGL__)
     int      mglEncoding;
+#elif defined(__WXDFB__)
+    // DirectFB uses UTF-8 internally, doesn't use font encodings
 #else
     #error "Unsupported toolkit"
 #endif
-#endif
+#endif // !__WXPALMOS__
     // this struct is saved in config by wxFontMapper, so it should know to
     // serialise itself (implemented in platform-specific code)
     bool FromString(const wxString& s);
index 4a70021ec3b32d2e11e53f659c25676fe2661c76..adbb15efa01d128190b5b464f624480ec3878c8d 100644 (file)
@@ -66,7 +66,7 @@ protected:
     DECLARE_NO_COPY_CLASS(wxEventLoopBase)
 };
 
-#if defined(__WXMSW__) || defined(__WXMAC__)
+#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXDFB__)
 
 // this class can be used to implement a standard event loop logic using
 // Pending() and Dispatch()
@@ -115,6 +115,8 @@ protected:
     #include "wx/msw/evtloop.h"
 #elif defined(__WXMAC__)
     #include "wx/mac/evtloop.h"
+#elif defined(__WXDFB__)
+    #include "wx/dfb/evtloop.h"
 #else // other platform
 
 class WXDLLEXPORT wxEventLoopImpl;
index 14f0f1821a2729604ce3b566800b31b30a4ebfb8..dbf93b4ff733839825e07ffc9cfb9896827feb8c 100644 (file)
@@ -25,7 +25,8 @@
 #endif
 
 /*  the raw keyboard codes are generated under wxGTK and wxMSW only */
-#if defined(__WXGTK__) || defined(__WXMSW__) || defined(__WXMAC__)
+#if defined(__WXGTK__) || defined(__WXMSW__) || defined(__WXMAC__) \
+    || defined(__WXDFB__)
     #define wxHAS_RAW_KEY_CODES
 #else
     #undef wxHAS_RAW_KEY_CODES
index 9ffccef70cc52390cf1dd92db6fd469908117310..8cb6a7e421abf57f18f5cf88f0725e2c02c60967 100644 (file)
@@ -241,6 +241,8 @@ private:
     #include "wx/x11/font.h"
 #elif defined(__WXMGL__)
     #include "wx/mgl/font.h"
+#elif defined(__WXDFB__)
+    #include "wx/dfb/font.h"
 #elif defined(__WXMAC__)
     #include "wx/mac/font.h"
 #elif defined(__WXCOCOA__)
index bb006a25406d09b56e93b88b5112c0cc56266a8e..34993fdb40db8b8372eaccd76af814dd79a83dae 100644 (file)
@@ -29,6 +29,8 @@
 #elif defined(__WXMGL__)
   #define wxICON_DEFAULT_BITMAP_TYPE wxBITMAP_TYPE_ICO_RESOURCE
   #include "wx/generic/icon.h"
+#elif defined(__WXDFB__)
+  #include "wx/generic/icon.h"
 #elif defined(__WXMAC__)
   #include "wx/mac/icon.h"
 #elif defined(__WXCOCOA__)
index 539d4f7531d47e24cbb03bc45a0df5ea16fb159f..f039ae06d4aa036dea5f09987d946c6206d5944a 100644 (file)
@@ -26,6 +26,8 @@
 #include "wx/gtk1/pen.h"
 #elif defined(__WXMGL__)
 #include "wx/mgl/pen.h"
+#elif defined(__WXDFB__)
+#include "wx/dfb/pen.h"
 #elif defined(__WXMAC__)
 #include "wx/mac/pen.h"
 #elif defined(__WXCOCOA__)
index c5f8a6cf81af22137cd84a5a0ebb84ce6168d79b..54a3af870c7773fa412243331994baf43f549734 100644 (file)
@@ -78,7 +78,8 @@ enum wxPortId
     wxPORT_MAC      = 1 << 7,       // wxMac, using Carbon or Classic Mac API
     wxPORT_COCOA    = 1 << 8,       // wxCocoa, using Cocoa NextStep/Mac API
     wxPORT_WINCE    = 1 << 9,       // wxWinCE, toolkit is WinCE SDK API
-    wxPORT_PALMOS   = 1 << 10       // wxPalmOS, toolkit is PalmOS API
+    wxPORT_PALMOS   = 1 << 10,      // wxPalmOS, toolkit is PalmOS API
+    wxPORT_DFB      = 1 << 11       // wxDFB, using wxUniversal
 };
 
 // architecture of the operating system
index 54e1bb5e785beb6766294e4cf19c95269eb28d92..3582ecab1cc4f4fbb4a3d764109f262f75ed3f21 100644 (file)
@@ -33,6 +33,8 @@ enum wxRegionContain
     #include "wx/x11/region.h"
 #elif defined(__WXMGL__)
     #include "wx/mgl/region.h"
+#elif defined(__WXDFB__)
+    #include "wx/dfb/region.h"
 #elif defined(__WXMAC__)
     #include "wx/mac/region.h"
 #elif defined(__WXCOCOA__)
index 38a746ffa9c621d2c55548976b4cb2c17ce6f12a..b0efc9d3ad305f7a884b6cfb5e4d6172f05c25af 100644 (file)
@@ -113,7 +113,7 @@ protected:
     #include "wx/gtk/timer.h"
 #elif defined(__WXGTK__)
     #include "wx/gtk1/timer.h"
-#elif defined(__WXX11__) || defined(__WXMGL__)
+#elif defined(__WXX11__) || defined(__WXMGL__) || defined(__WXDFB__)
     #include "wx/generic/timer.h"
 #elif defined (__WXCOCOA__)
     #include "wx/cocoa/timer.h"
index 2c601c70c51c3dd9a59102fe5e63220eb65b2149..b90c1a65840046581204b80b7ea6a9f538ac17ec 100644 (file)
@@ -316,6 +316,9 @@ protected:
 #elif defined(__WXMGL__)
     #include "wx/mgl/toplevel.h"
     #define wxTopLevelWindowNative wxTopLevelWindowMGL
+#elif defined(__WXDFB__)
+    #include "wx/dfb/toplevel.h"
+    #define wxTopLevelWindowNative wxTopLevelWindowDFB
 #elif defined(__WXMAC__)
     #include "wx/mac/toplevel.h"
     #define wxTopLevelWindowNative wxTopLevelWindowMac
index 00aac0051815cb9d3e7a40a6d270b50ce8a7e0d7..ad27c0c68ee1aaea0f73e6ae846bd2a581e68785 100644 (file)
@@ -1397,12 +1397,11 @@ private:
     #endif // wxUniv
     #include "wx/x11/window.h"
 #elif defined(__WXMGL__)
-    #ifdef __WXUNIVERSAL__
-        #define wxWindowNative wxWindowMGL
-    #else // !wxUniv
-        #define wxWindowMGL wxWindow
-    #endif // wxUniv
+    #define wxWindowNative wxWindowMGL
     #include "wx/mgl/window.h"
+#elif defined(__WXDFB__)
+    #define wxWindowNative wxWindowDFB
+    #include "wx/dfb/window.h"
 #elif defined(__WXMAC__)
     #ifdef __WXUNIVERSAL__
         #define wxWindowNative wxWindowMac
index c0a5d145514c80a3b5a1eefb64985ebb8ce5bb72..41a176ed3f712b7a33e5daa76fb3cd6a14a2aae0 100644 (file)
@@ -16,6 +16,7 @@
 #endif
 
 #if defined(__WXMGL__)   || \
+    defined(__WXDFB__)   || \
     defined(__WXMAC__)   || \
     defined(__WXGTK__)   || \
     defined(__WXMOTIF__) || \
index 21433e6b0680965214cb8edb71e27c747307efb2..711ada6006e6a85bd01a915140d665171db357a5 100644 (file)
@@ -37,7 +37,7 @@
 wxEventLoop *wxEventLoopBase::ms_activeLoop = NULL;
 
 // wxEventLoopManual is unused in the other ports
-#if defined(__WXMSW__) || defined(__WXMAC__)
+#if defined(__WXMSW__) || defined(__WXMAC__) || defined(__WXDFB__)
 
 // ============================================================================
 // wxEventLoopManual implementation
@@ -152,4 +152,4 @@ void wxEventLoopManual::Exit(int rc)
     WakeUp();
 }
 
-#endif // __WXMSW__ || __WXMAC__
+#endif // __WXMSW__ || __WXMAC__ || __WXDFB__
index e9d2553236876a1bfb478f65024ae1799c0f52f1..df765b153a79596f36726ad2d76826f0a5e87f15 100644 (file)
@@ -72,7 +72,8 @@ static const wxChar* const wxPortIdNames[] =
     _T("wxMac"),
     _T("wxCocoa"),
     _T("wxWinCE"),
-    _T("wxPalmOS")
+    _T("wxPalmOS"),
+    _T("wxDFB")
 };
 
 static const wxChar* const wxArchitectureNames[] =
diff --git a/src/dfb/app.cpp b/src/dfb/app.cpp
new file mode 100644 (file)
index 0000000..31bdf0f
--- /dev/null
@@ -0,0 +1,165 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/app.cpp
+// Purpose:     wxApp implementation
+// Author:      Vaclav Slavik
+//              based on MGL implementation
+// Created:     2006-08-16
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/app.h"
+
+#include "wx/evtloop.h"
+#include "wx/dfb/private.h"
+
+//-----------------------------------------------------------------------------
+// wxApp initialization
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxApp, wxEvtHandler)
+
+BEGIN_EVENT_TABLE(wxApp, wxEvtHandler)
+    EVT_IDLE(wxAppBase::OnIdle)
+END_EVENT_TABLE()
+
+wxApp::wxApp()
+{
+}
+
+wxApp::~wxApp()
+{
+}
+
+IDirectFBPtr wxApp::GetDirectFBInterface()
+{
+    return m_dfb;
+}
+
+bool wxApp::Initialize(int& argc, wxChar **argv)
+{
+    if ( !wxAppBase::Initialize(argc, argv) )
+        return false;
+
+    if ( !DFB_CALL( DirectFBInit(&argc, &argv) ) )
+        return false;
+
+    if ( !DFB_CALL( DirectFBCreate(&m_dfb) ) )
+        return false;
+
+    #warning "FIXME: theme override is temporary"
+    wxTheme::Set(wxTheme::Create(_T("gtk")));
+
+    return true;
+}
+
+void wxApp::CleanUp()
+{
+    wxAppBase::CleanUp();
+
+    m_dfb.Reset();
+}
+
+//-----------------------------------------------------------------------------
+// display mode
+//-----------------------------------------------------------------------------
+
+static wxVideoMode GetCurrentVideoMode()
+{
+    wxVideoMode m;
+
+    IDirectFBSurfacePtr surface(wxDfbGetPrimarySurface());
+    if ( !surface )
+        return m; // invalid
+
+    DFB_CALL( surface->GetSize(surface, &m.w, &m.h) );
+    m.bpp = wxDfbGetSurfaceDepth(surface);
+
+    return m;
+}
+
+wxVideoMode wxApp::GetDisplayMode() const
+{
+    if ( !m_videoMode.IsOk() )
+        wxConstCast(this, wxApp)->m_videoMode = GetCurrentVideoMode();
+
+    return m_videoMode;
+}
+
+bool wxApp::SetDisplayMode(const wxVideoMode& mode)
+{
+    if ( !DFB_CALL( m_dfb->SetVideoMode(m_dfb, mode.w, mode.h, mode.bpp) ) )
+        return false;
+
+    m_videoMode = mode;
+    return true;
+}
+
+//-----------------------------------------------------------------------------
+// events processing related
+//-----------------------------------------------------------------------------
+
+void wxApp::WakeUpIdle()
+{
+#if wxUSE_THREADS
+    if (!wxThread::IsMain())
+        wxMutexGuiEnter();
+#endif
+
+    wxEventLoop::GetActive()->WakeUp();
+
+#if wxUSE_THREADS
+    if (!wxThread::IsMain())
+        wxMutexGuiLeave();
+#endif
+}
+
+
+bool wxApp::Yield(bool onlyIfNeeded)
+{
+#if wxUSE_THREADS
+    if ( !wxThread::IsMain() )
+        return true; // can't process events from other threads
+#endif // wxUSE_THREADS
+
+    static bool s_inYield = false;
+
+    if ( s_inYield )
+    {
+        if ( !onlyIfNeeded )
+        {
+            wxFAIL_MSG( wxT("wxYield called recursively" ) );
+        }
+
+        return false;
+    }
+
+    s_inYield = true;
+
+    wxLog::Suspend();
+
+    if ( wxEventLoop::GetActive() )
+    {
+        while (wxEventLoop::GetActive()->Pending())
+            wxEventLoop::GetActive()->Dispatch();
+    }
+
+    // it's necessary to call ProcessIdle() to update the frames sizes which
+    // might have been changed (it also will update other things set from
+    // OnUpdateUI() which is a nice (and desired) side effect)
+    while ( ProcessIdle() ) {}
+
+    wxLog::Resume();
+
+    s_inYield = false;
+
+    return true;
+}
diff --git a/src/dfb/bitmap.cpp b/src/dfb/bitmap.cpp
new file mode 100644 (file)
index 0000000..691898d
--- /dev/null
@@ -0,0 +1,449 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/bitmap.cpp
+// Purpose:     wxBitmap implementation
+// Author:      Vaclav Slavik
+// Created:     2006-08-04
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/log.h"
+#endif
+
+#include "wx/bitmap.h"
+#include "wx/colour.h"
+#include "wx/image.h"
+
+#warning "move this to common"
+#include "wx/xpmdecod.h"
+
+#include "wx/dfb/private.h"
+
+//-----------------------------------------------------------------------------
+// helpers
+//-----------------------------------------------------------------------------
+
+// Convert wxColour into it's quantized value in lower-precision
+// pixel format (needed for masking by colour).
+static wxColour wxQuantizeColour(const wxColour& clr, const wxBitmap& bmp)
+{
+#if 0
+    pixel_format_t *pf = bmp.GetMGLbitmap_t()->pf;
+
+    if ( pf->redAdjust == 0 && pf->greenAdjust == 0 && pf->blueAdjust == 0 )
+        return clr;
+    else
+        return wxColour((unsigned char)((clr.Red() >> pf->redAdjust) << pf->redAdjust),
+                        (unsigned char)((clr.Green() >> pf->greenAdjust) << pf->greenAdjust),
+                        (unsigned char)((clr.Blue() >> pf->blueAdjust) << pf->blueAdjust));
+#endif
+}
+
+
+//-----------------------------------------------------------------------------
+// wxMask
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxMask, wxObject)
+
+wxMask::wxMask() : m_bitmap(NULL)
+{
+}
+
+wxMask::wxMask(const wxBitmap& bitmap)
+    : m_bitmap(NULL)
+{
+    Create(bitmap);
+}
+
+wxMask::wxMask(const wxBitmap& bitmap, const wxColour& colour)
+    : m_bitmap(NULL)
+{
+    Create(bitmap, colour);
+}
+
+#if wxUSE_PALETTE
+wxMask::wxMask(const wxBitmap& bitmap, int paletteIndex)
+    : m_bitmap(NULL)
+{
+    Create(bitmap, paletteIndex);
+}
+#endif // wxUSE_PALETTE
+
+wxMask::wxMask(const wxMask& mask)
+{
+    m_bitmap = mask.m_bitmap ? new wxBitmap(*mask.m_bitmap) : NULL;
+}
+
+wxMask::~wxMask()
+{
+    delete m_bitmap;
+}
+
+#warning "move this to common code"
+bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
+{
+    delete m_bitmap;
+    m_bitmap = NULL;
+
+    wxColour clr(wxQuantizeColour(colour, bitmap));
+
+    wxImage imgSrc(bitmap.ConvertToImage());
+    imgSrc.SetMask(false);
+    wxImage image(imgSrc.ConvertToMono(clr.Red(), clr.Green(), clr.Blue()));
+    if ( !image.Ok() )
+        return false;
+
+    m_bitmap = new wxBitmap(image, 1);
+
+    return m_bitmap->Ok();
+}
+
+#if wxUSE_PALETTE
+bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex)
+{
+    unsigned char r,g,b;
+    wxPalette *pal = bitmap.GetPalette();
+
+    wxCHECK_MSG( pal, false, wxT("Cannot create mask from bitmap without palette") );
+
+    pal->GetRGB(paletteIndex, &r, &g, &b);
+
+    return Create(bitmap, wxColour(r, g, b));
+}
+#endif // wxUSE_PALETTE
+
+bool wxMask::Create(const wxBitmap& bitmap)
+{
+    delete m_bitmap;
+    m_bitmap = NULL;
+
+    wxCHECK_MSG( bitmap.Ok(), false, wxT("Invalid bitmap") );
+    wxCHECK_MSG( bitmap.GetDepth() == 1, false, wxT("Cannot create mask from colour bitmap") );
+
+    m_bitmap = new wxBitmap(bitmap);
+    return true;
+}
+
+const wxBitmap& wxMask::GetBitmap() const
+{
+    return m_bitmap ? *m_bitmap : wxNullBitmap;
+}
+
+
+//-----------------------------------------------------------------------------
+// wxBitmapRefData
+//-----------------------------------------------------------------------------
+
+class wxBitmapRefData: public wxObjectRefData
+{
+public:
+    wxBitmapRefData()
+    {
+        m_mask = NULL;
+#if wxUSE_PALETTE
+        m_palette = NULL;
+#endif
+    }
+
+    wxBitmapRefData(const wxBitmapRefData& data)
+    {
+        m_surface = wxDfbCloneSurface(data.m_surface,
+                                      wxDfbCloneSurface_NoPixels);
+        m_mask = data.m_mask ? new wxMask(*data.m_mask) : NULL;
+#if wxUSE_PALETTE
+        m_palette = data.m_palette ? new wxPalette(*data.m_palette) : NULL;
+#endif
+    }
+
+    ~wxBitmapRefData()
+    {
+        delete m_mask;
+#if wxUSE_PALETTE
+        delete m_palette;
+#endif
+    }
+
+    IDirectFBSurfacePtr m_surface;
+    wxMask             *m_mask;
+#if wxUSE_PALETTE
+    wxPalette          *m_palette;
+#endif
+};
+
+#define M_BITMAP ((wxBitmapRefData *)m_refData)
+
+//-----------------------------------------------------------------------------
+// wxBitmap
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxBitmapHandler, wxObject)
+IMPLEMENT_DYNAMIC_CLASS(wxBitmap, wxBitmapBase)
+
+wxBitmap::wxBitmap(int width, int height, int depth)
+{
+    Create(width, height, depth);
+}
+
+bool wxBitmap::Create(int width, int height, int depth)
+{
+    UnRef();
+
+    wxCHECK_MSG( width > 0 && height > 0, false, wxT("invalid bitmap size") );
+
+    DFBSurfaceDescription desc;
+    desc.flags = (DFBSurfaceDescriptionFlags)(
+                        DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT);
+    desc.caps = DSCAPS_NONE;
+    desc.width = width;
+    desc.height = height;
+
+    IDirectFBSurfacePtr surface;
+    IDirectFBPtr dfb(wxTheApp->GetDirectFBInterface());
+    if ( !DFB_CALL( dfb->CreateSurface(dfb, &desc, &surface) ) )
+        return false;
+
+    m_refData = new wxBitmapRefData();
+    M_BITMAP->m_surface = surface;
+
+    return true;
+}
+
+#warning "FIXME: move this to common code"
+bool wxBitmap::CreateFromXpm(const char **bits)
+{
+    wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") );
+
+#if wxUSE_IMAGE && wxUSE_XPM
+    wxXPMDecoder decoder;
+    wxImage img = decoder.ReadData(bits);
+    wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") );
+
+    *this = wxBitmap(img);
+
+    return true;
+#else
+    wxFAIL_MSG( _T("creating bitmaps from XPMs not supported") );
+    return false;
+#endif // wxUSE_IMAGE && wxUSE_XPM
+}
+
+#if wxUSE_IMAGE
+wxBitmap::wxBitmap(const wxImage& image, int depth)
+{
+    wxCHECK_RET( image.Ok(), wxT("invalid image") );
+}
+
+wxImage wxBitmap::ConvertToImage() const
+{
+    wxCHECK_MSG( Ok(), wxNullImage, wxT("invalid bitmap") );
+
+    return wxNullImage; // FIXME
+}
+#endif // wxUSE_IMAGE
+
+wxBitmap::wxBitmap(const wxString &filename, wxBitmapType type)
+{
+    LoadFile(filename, type);
+}
+
+wxBitmap::wxBitmap(const char bits[], int width, int height, int depth)
+{
+    wxCHECK_RET( depth == 1, wxT("can only create mono bitmap from XBM data") );
+}
+
+bool wxBitmap::Ok() const
+{
+    return (m_refData != NULL && M_BITMAP->m_surface);
+}
+
+bool wxBitmap::operator==(const wxBitmap& bmp) const
+{
+    // FIXME: is this the right way to compare bitmaps?
+    return (m_refData == bmp.m_refData);
+}
+
+int wxBitmap::GetHeight() const
+{
+    wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+
+    int h = -1;
+    DFB_CALL( M_BITMAP->m_surface->GetSize(M_BITMAP->m_surface, NULL, &h) );
+    return h;
+}
+
+int wxBitmap::GetWidth() const
+{
+    wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+
+    int w = -1;
+    DFB_CALL( M_BITMAP->m_surface->GetSize(M_BITMAP->m_surface, &w, NULL) );
+    return w;
+}
+
+int wxBitmap::GetDepth() const
+{
+    wxCHECK_MSG( Ok(), -1, wxT("invalid bitmap") );
+
+    return wxDfbGetSurfaceDepth(M_BITMAP->m_surface);
+}
+
+wxMask *wxBitmap::GetMask() const
+{
+    wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+
+    return M_BITMAP->m_mask;
+}
+
+void wxBitmap::SetMask(wxMask *mask)
+{
+    wxCHECK_RET( Ok(), wxT("invalid bitmap") );
+
+    delete M_BITMAP->m_mask;
+    M_BITMAP->m_mask = mask;
+}
+
+bool wxBitmap::CopyFromIcon(const wxIcon& icon)
+{
+    *this = *((wxBitmap*)(&icon));
+    return true;
+}
+
+wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
+{
+    wxCHECK_MSG( Ok() &&
+                 rect.x >= 0 && rect.y >= 0 &&
+                 rect.x+rect.width <= GetWidth() &&
+                 rect.y+rect.height <= GetHeight(),
+                 wxNullBitmap,
+                 wxT("invalid bitmap or bitmap region") );
+
+}
+
+#warning "to common code"
+bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type)
+{
+    UnRef();
+
+    wxBitmapHandler *handler = FindHandler(type);
+
+    if ( handler == NULL )
+    {
+        wxImage image;
+        if ( !image.LoadFile(name, type) || !image.Ok() )
+        {
+            wxLogError("no bitmap handler for type %d defined.", type);
+            return false;
+        }
+        else
+        {
+            *this = wxBitmap(image);
+            return true;
+        }
+    }
+
+    m_refData = new wxBitmapRefData();
+
+    return handler->LoadFile(this, name, type, -1, -1);
+}
+
+#warning "to common code"
+bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPalette *palette) const
+{
+    wxCHECK_MSG( Ok(), false, wxT("invalid bitmap") );
+
+    wxBitmapHandler *handler = FindHandler(type);
+
+    if ( handler == NULL )
+    {
+        wxImage image = ConvertToImage();
+#if wxUSE_PALETTE
+        if ( palette )
+            image.SetPalette(*palette);
+#endif // wxUSE_PALETTE
+
+        if ( image.Ok() )
+            return image.SaveFile(filename, type);
+        else
+        {
+            wxLogError("no bitmap handler for type %d defined.", type);
+            return false;
+        }
+    }
+
+    return handler->SaveFile(this, filename, type, palette);
+}
+
+#if wxUSE_PALETTE
+wxPalette *wxBitmap::GetPalette() const
+{
+    wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+
+    return M_BITMAP->m_palette;
+}
+
+void wxBitmap::SetPalette(const wxPalette& palette)
+{
+    wxCHECK_RET( Ok(), wxT("invalid bitmap") );
+    wxCHECK_RET( GetDepth() > 1 && GetDepth() <= 8, wxT("cannot set palette for bitmap of this depth") );
+
+    delete M_BITMAP->m_palette;
+    M_BITMAP->m_palette = NULL;
+
+    if ( !palette.Ok() ) return;
+
+    M_BITMAP->m_palette = new wxPalette(palette);
+}
+#endif // wxUSE_PALETTE
+
+void wxBitmap::SetHeight(int height)
+{
+    AllocExclusive();
+#warning "todo"
+}
+
+void wxBitmap::SetWidth(int width)
+{
+    AllocExclusive();
+#warning "todo"
+}
+
+void wxBitmap::SetDepth(int depth)
+{
+    AllocExclusive();
+#warning "todo"
+}
+
+IDirectFBSurfacePtr wxBitmap::GetDirectFBSurface() const
+{
+    wxCHECK_MSG( Ok(), NULL, wxT("invalid bitmap") );
+
+    return M_BITMAP->m_surface;
+}
+
+wxObjectRefData *wxBitmap::CreateRefData() const
+{
+    return new wxBitmapRefData;
+}
+
+wxObjectRefData *wxBitmap::CloneRefData(const wxObjectRefData *data) const
+{
+    return new wxBitmapRefData(*(wxBitmapRefData *)data);
+}
+
+
+/*static*/
+void wxBitmap::InitStandardHandlers()
+{
+    // not wxBitmap handlers, we rely on wxImage
+}
diff --git a/src/dfb/brush.cpp b/src/dfb/brush.cpp
new file mode 100644 (file)
index 0000000..da4a693
--- /dev/null
@@ -0,0 +1,147 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/brush.cpp
+// Purpose:     wxBrush class implementation
+// Author:      Vaclav Slavik
+// Created:     2006-08-04
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/brush.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/colour.h"
+#endif
+
+
+//-----------------------------------------------------------------------------
+// wxBrush
+//-----------------------------------------------------------------------------
+
+class wxBrushRefData: public wxObjectRefData
+{
+public:
+    wxBrushRefData(const wxColour& clr = wxNullColour, int style = wxSOLID)
+    {
+        m_colour = clr;
+        SetStyle(style);
+    }
+
+    wxBrushRefData(const wxBrushRefData& data)
+    {
+        m_colour = data.m_colour;
+        m_style = data.m_style;
+    }
+
+    void SetStyle(int style)
+    {
+        if ( m_style != wxSOLID && m_style == wxTRANSPARENT )
+        {
+            wxFAIL_MSG( _T("only wxSOLID and wxTRANSPARENT styles are supported") );
+            style = wxSOLID;
+        }
+
+        m_style = style;
+    }
+
+    wxColour       m_colour;
+    int            m_style;
+};
+
+//-----------------------------------------------------------------------------
+
+#define M_BRUSHDATA ((wxBrushRefData *)m_refData)
+
+IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
+
+wxBrush::wxBrush(const wxColour &colour, int style)
+{
+    m_refData = new wxBrushRefData(colour, style);
+}
+
+wxBrush::wxBrush(const wxBitmap &stippleBitmap)
+{
+    wxFAIL_MSG( "brushes with stipple bitmaps not implemented" );
+
+    m_refData = new wxBrushRefData(*wxBLACK);
+}
+
+bool wxBrush::operator==(const wxBrush& brush) const
+{
+#warning "this is incorrect (MGL too)"
+    return m_refData == brush.m_refData;
+}
+
+bool wxBrush::Ok() const
+{
+    return ((m_refData) && M_BRUSHDATA->m_colour.Ok());
+}
+
+int wxBrush::GetStyle() const
+{
+    if (m_refData == NULL)
+    {
+        wxFAIL_MSG( wxT("invalid brush") );
+        return 0;
+    }
+
+    return M_BRUSHDATA->m_style;
+}
+
+wxColour& wxBrush::GetColour() const
+{
+    if (m_refData == NULL)
+    {
+        wxFAIL_MSG( wxT("invalid brush") );
+        return wxNullColour;
+    }
+
+    return M_BRUSHDATA->m_colour;
+}
+
+wxBitmap *wxBrush::GetStipple() const
+{
+    wxFAIL_MSG( "brushes with stipple bitmaps not implemented" );
+    return &wxNullBitmap;
+}
+
+void wxBrush::SetColour(const wxColour& col)
+{
+    AllocExclusive();
+    M_BRUSHDATA->m_colour = col;
+}
+
+void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
+{
+    AllocExclusive();
+    M_BRUSHDATA->m_colour.Set(r, g, b);
+}
+
+void wxBrush::SetStyle(int style)
+{
+    AllocExclusive();
+    M_BRUSHDATA->SetStyle(style);
+}
+
+void wxBrush::SetStipple(const wxBitmap& WXUNUSED(stipple))
+{
+    wxFAIL_MSG( "brushes with stipple bitmaps not implemented" );
+}
+
+wxObjectRefData *wxBrush::CreateRefData() const
+{
+    return new wxBrushRefData;
+}
+
+wxObjectRefData *wxBrush::CloneRefData(const wxObjectRefData *data) const
+{
+    return new wxBrushRefData(*(wxBrushRefData *)data);
+}
diff --git a/src/dfb/cursor.cpp b/src/dfb/cursor.cpp
new file mode 100644 (file)
index 0000000..58417b3
--- /dev/null
@@ -0,0 +1,146 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/cursor.cpp
+// Purpose:     wxCursor implementation
+// Author:      Vaclav Slavik
+// Created:     2006-08-08
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/cursor.h"
+#include "wx/bitmap.h"
+
+//-----------------------------------------------------------------------------
+// wxCursorRefData
+//-----------------------------------------------------------------------------
+
+class wxCursorRefData: public wxObjectRefData
+{
+public:
+    wxCursorRefData(const wxBitmap& bmp = wxNullBitmap, int id = -1)
+        : m_id(id), m_bitmap(bmp) {}
+
+    int      m_id;
+    wxBitmap m_bitmap;
+};
+
+#define M_CURSOR_OF(c) ((wxCursorRefData*)((c).m_refData))
+#define M_CURSOR       M_CURSOR_OF(*this)
+
+//-----------------------------------------------------------------------------
+// wxCursor
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxCursor, wxObject)
+
+wxCursor::wxCursor(int cursorId)
+{
+#warning "FIXME -- implement the cursor as bitmaps (that's what DFB uses)"
+}
+
+wxCursor::wxCursor(const char WXUNUSED(bits)[],
+                   int WXUNUSED(width),
+                   int WXUNUSED(height),
+                   int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY),
+                   const char WXUNUSED(maskBits)[],
+                   wxColour * WXUNUSED(fg), wxColour * WXUNUSED(bg) )
+{
+#warning "FIXME"
+}
+
+wxCursor::wxCursor(const wxString& cursor_file,
+                   long flags,
+                   int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY))
+{
+#warning "FIXME"
+}
+
+bool wxCursor::Ok() const
+{
+    return m_refData && M_CURSOR->m_bitmap.Ok();
+}
+
+bool wxCursor::operator==(const wxCursor& cursor) const
+{
+    if ( Ok() )
+    {
+        if ( !cursor.Ok() )
+            return false;
+        else if ( M_CURSOR->m_id != M_CURSOR_OF(cursor)->m_id )
+            return false;
+        else if ( M_CURSOR->m_id == -1 ) // non-stock cursor
+            return (m_refData == cursor.m_refData);
+        else
+            return true; // IDs != -1 and are the same
+    }
+    else
+    {
+        return !cursor.Ok();
+    }
+}
+
+wxObjectRefData *wxCursor::CreateRefData() const
+{
+    return new wxCursorRefData;
+}
+
+wxObjectRefData *wxCursor::CloneRefData(const wxObjectRefData *data) const
+{
+    return new wxCursorRefData(*(wxCursorRefData *)data);
+}
+
+
+// ----------------------------------------------------------------------------
+// Global cursor setting
+// ----------------------------------------------------------------------------
+
+void wxSetCursor(const wxCursor& cursor)
+{
+#warning "FIXME: implement"
+}
+
+
+
+//-----------------------------------------------------------------------------
+// busy cursor routines
+//-----------------------------------------------------------------------------
+
+#warning "FIXME: this should be common code"
+#if 0
+static wxCursor  gs_savedCursor = wxNullCursor;
+static int       gs_busyCount = 0;
+
+const wxCursor &wxBusyCursor::GetStoredCursor()
+{
+    return gs_savedCursor;
+}
+
+const wxCursor wxBusyCursor::GetBusyCursor()
+{
+    return gs_globalCursor;
+}
+#endif
+
+void wxEndBusyCursor()
+{
+    #warning "FIXME - do this logic in common code?"
+}
+
+void wxBeginBusyCursor(const wxCursor *cursor)
+{
+    #warning "FIXME"
+}
+
+bool wxIsBusy()
+{
+    #warning "FIXME"
+    return false;
+}
diff --git a/src/dfb/dc.cpp b/src/dfb/dc.cpp
new file mode 100644 (file)
index 0000000..d80c8ff
--- /dev/null
@@ -0,0 +1,807 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/dc.cpp
+// Purpose:     wxDC class
+// Author:      Vaclav Slavik
+// Created:     2006-08-07
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ===========================================================================
+// declarations
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// headers
+// ---------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#ifndef WX_PRECOMP
+    #include "wx/dc.h"
+    #include "wx/log.h"
+#endif
+
+#include "wx/dfb/private.h"
+
+// ===========================================================================
+// implementation
+// ===========================================================================
+
+//-----------------------------------------------------------------------------
+// wxDC
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase)
+
+// Default constructor
+wxDC::wxDC()
+{
+    m_ok = false;
+}
+
+wxDC::wxDC(const IDirectFBSurfacePtr& surface)
+{
+    Init(surface);
+}
+
+void wxDC::Init(const IDirectFBSurfacePtr& surface)
+{
+    m_ok = (surface != NULL);
+    wxCHECK_RET( surface != NULL, _T("invalid surface") );
+
+    m_surface = surface;
+
+    m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() /
+                    (double)wxGetDisplaySizeMM().GetWidth();
+    m_mm_to_pix_y = (double)wxGetDisplaySize().GetHeight() /
+                    (double)wxGetDisplaySizeMM().GetHeight();
+
+    SetFont(*wxNORMAL_FONT);
+    SetPen(*wxBLACK_PEN);
+    SetBrush(*wxWHITE_BRUSH);
+}
+
+
+// ---------------------------------------------------------------------------
+// clipping
+// ---------------------------------------------------------------------------
+
+
+#define DO_SET_CLIPPING_BOX(rg)                      \
+{                                                    \
+    wxRect rect = rg.GetBox();                       \
+    m_clipX1 = (wxCoord) XDEV2LOG(rect.GetLeft());   \
+    m_clipY1 = (wxCoord) YDEV2LOG(rect.GetTop());    \
+    m_clipX2 = (wxCoord) XDEV2LOG(rect.GetRight());  \
+    m_clipY2 = (wxCoord) YDEV2LOG(rect.GetBottom()); \
+}
+
+void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    DFBRegion r;
+    r.x1 = XLOG2DEV(cx);
+    r.y1 = YLOG2DEV(cy);
+    r.x2 = r.x1 + XLOG2DEVREL(cw) - 1;
+    r.y2 = r.y1 + XLOG2DEVREL(ch) - 1;
+
+    if ( !DFB_CALL( m_surface->SetClip(m_surface, &r) ) )
+        return;
+
+    m_clipX1 = cx;
+    m_clipY1 = cy;
+    m_clipX2 = cx + cw - 1;
+    m_clipY2 = cy + ch -1;
+    m_clipping = true;
+}
+
+void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
+{
+    // NB: this can be done because wxDFB only supports
+    //     rectangular regions
+    SetClippingRegion(region.AsRect());
+}
+
+void wxDC::DestroyClippingRegion()
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    DFB_CALL( m_surface->SetClip(m_surface, NULL) );
+
+    ResetClipping();
+}
+
+// ---------------------------------------------------------------------------
+// query capabilities
+// ---------------------------------------------------------------------------
+
+int wxDC::GetDepth() const
+{
+    return wxDfbGetSurfaceDepth(m_surface);
+}
+
+// ---------------------------------------------------------------------------
+// drawing
+// ---------------------------------------------------------------------------
+
+void wxDC::Clear()
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    if ( m_backgroundBrush.GetStyle() == wxTRANSPARENT )
+        return;
+
+    wxColour clr = m_backgroundBrush.GetColour();
+    DFB_CALL( m_surface->Clear(m_surface,
+                               clr.Red(), clr.Green(), clr.Blue(), 255) );
+}
+
+extern bool wxDoFloodFill(wxDC *dc, wxCoord x, wxCoord y,
+                          const wxColour & col, int style);
+
+bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
+                       const wxColour& col, int style)
+{
+    return wxDoFloodFill(this, x, y, col, style);
+}
+
+bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
+{
+    wxCHECK_MSG( col, false, _T("NULL colour parameter in wxDC::GetPixel"));
+
+    wxFAIL_MSG( _T("GetPixel not implemented") );
+    return false;
+}
+
+void wxDC::DoCrossHair(wxCoord x, wxCoord y)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxFAIL_MSG( _T("CrossHair not implemented") );
+}
+
+void wxDC::DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    if ( m_pen.GetStyle() == wxTRANSPARENT )
+        return;
+
+    DFB_CALL( m_surface->DrawLine(m_surface,
+                                  XLOG2DEV(x1), YLOG2DEV(y1),
+                                  XLOG2DEV(x2), YLOG2DEV(y2)) );
+
+    CalcBoundingBox(x1, y1);
+    CalcBoundingBox(x2, y2);
+}
+
+// Draws an arc of a circle, centred on (xc, yc), with starting point (x1, y1)
+// and ending at (x2, y2)
+void wxDC::DoDrawArc(wxCoord x1, wxCoord y1,
+                     wxCoord x2, wxCoord y2,
+                     wxCoord xc, wxCoord yc)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxFAIL_MSG( _T("DrawArc not implemented") );
+}
+
+void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxFAIL_MSG( _T("DrawPoint not implemented") );
+}
+
+void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int WXUNUSED(fillStyle))
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxFAIL_MSG( _T("DrawPolygon not implemented") );
+}
+
+void wxDC::DoDrawLines(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    // TODO: impl. using DirectDB's DrawLines
+    wxFAIL_MSG( _T("DrawLines not implemented") );
+}
+
+void wxDC::DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxCoord xx = XLOG2DEV(x);
+    wxCoord yy = YLOG2DEV(y);
+    wxCoord ww = m_signX * XLOG2DEVREL(width);
+    wxCoord hh = m_signY * YLOG2DEVREL(height);
+
+    if ( ww == 0 || hh == 0 ) return;
+
+    if ( ww < 0 )
+    {
+        ww = -ww;
+        xx = xx - ww;
+    }
+    if ( hh < 0 )
+    {
+        hh = -hh;
+        yy = yy - hh;
+    }
+
+    if ( m_brush.GetStyle() != wxTRANSPARENT )
+    {
+        SelectColour(m_brush.GetColour());
+        DFB_CALL( m_surface->FillRectangle(m_surface, xx, yy, ww, hh) );
+        // restore pen's colour
+        SelectColour(m_pen.GetColour());
+    }
+
+    if ( m_pen.GetStyle() != wxTRANSPARENT )
+    {
+        DFB_CALL( m_surface->DrawRectangle(m_surface, xx, yy, ww, hh) );
+    }
+
+    CalcBoundingBox(x, y);
+    CalcBoundingBox(x + width, y + height);
+}
+
+void wxDC::DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxFAIL_MSG( _T("DrawRoundedRectangle not implemented") );
+}
+
+void wxDC::DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxFAIL_MSG( _T("DrawElipse not implemented") );
+}
+
+void wxDC::DoDrawEllipticArc(wxCoord x,wxCoord y,wxCoord w,wxCoord h,double sa,double ea)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxFAIL_MSG( _T("DrawElipticArc not implemented") );
+}
+
+void wxDC::DoDrawText(const wxString& text, wxCoord x, wxCoord y)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxCoord xx = XLOG2DEV(x);
+    wxCoord yy = XLOG2DEV(y);
+
+    // update the bounding box
+    wxCoord w, h;
+    CalcBoundingBox(x, y);
+    GetTextExtent(text, &w, &h);
+    CalcBoundingBox(x + w, y + h);
+
+    // if background mode is solid, DrawText must paint text's background:
+    if ( m_backgroundMode == wxSOLID )
+    {
+        wxCHECK_RET( m_backgroundBrush.Ok(), wxT("invalid background brush") );
+
+        SelectColour(m_backgroundBrush.GetColour());
+        DFB_CALL( m_surface->FillRectangle(m_surface,
+                                           xx, yy,
+                                           XLOG2DEVREL(w), YLOG2DEVREL(h)) );
+        // restore pen's colour
+        SelectColour(m_pen.GetColour());
+    }
+
+    // finally draw the text itself:
+    DFB_CALL(m_surface->DrawString(m_surface,
+                                   wxSTR_TO_DFB(text), -1,
+                                   xx, yy,
+                                   DFBSurfaceTextFlags(DSTF_LEFT | DSTF_TOP)));
+}
+
+void wxDC::DoDrawRotatedText(const wxString& text,
+                             wxCoord x, wxCoord y,
+                             double angle)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxFAIL_MSG( _T("DrawRotatedText not implemented") );
+}
+
+// ---------------------------------------------------------------------------
+// set GDI objects
+// ---------------------------------------------------------------------------
+
+void wxDC::SetPen(const wxPen& pen)
+{
+    if ( !pen.Ok() ) return;
+    m_pen = pen;
+
+    SelectColour(m_pen.GetColour());
+}
+
+void wxDC::SetBrush(const wxBrush& brush)
+{
+    if ( !brush.Ok() ) return;
+    m_brush = brush;
+}
+
+void wxDC::SelectColour(const wxColour& clr)
+{
+    DFB_CALL( m_surface->SetColor(m_surface,
+                                  clr.Red(), clr.Green(), clr.Blue(), 255) );
+    #warning "use SetColorIndex?"
+}
+
+#if wxUSE_PALETTE
+void wxDC::SetPalette(const wxPalette& WXUNUSED(palette))
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxFAIL_MSG( _T("SetPalette not implemented") );
+}
+#endif // wxUSE_PALETTE
+
+void wxDC::SetFont(const wxFont& font)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    if ( !font.Ok() )
+        return;
+
+    if ( !DFB_CALL( m_surface->SetFont(m_surface, font.GetDirectFBFont()) ) )
+        return;
+
+    m_font = font;
+}
+
+void wxDC::SetBackground(const wxBrush& brush)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    if (!brush.Ok()) return;
+
+    m_backgroundBrush = brush;
+}
+
+void wxDC::SetBackgroundMode(int mode)
+{
+    m_backgroundMode = mode;
+}
+
+void wxDC::SetLogicalFunction(int function)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    wxFAIL_MSG( _T("SetLogicalFunction not implemented") );
+
+    m_logicalFunction = function;
+}
+
+bool wxDC::StartDoc(const wxString& WXUNUSED(message))
+{
+    // We might be previewing, so return true to let it continue.
+    return true;
+}
+
+void wxDC::EndDoc()
+{
+}
+
+void wxDC::StartPage()
+{
+}
+
+void wxDC::EndPage()
+{
+}
+
+// ---------------------------------------------------------------------------
+// text metrics
+// ---------------------------------------------------------------------------
+
+wxCoord wxDC::GetCharHeight() const
+{
+    wxCHECK_MSG( Ok(), -1, wxT("invalid dc") );
+    wxCHECK_MSG( m_font.Ok(), -1, wxT("no font selected") );
+
+    int h = -1;
+    IDirectFBFontPtr f = m_font.GetDirectFBFont();
+    DFB_CALL( f->GetHeight(f, &h) );
+    return YDEV2LOGREL(h);
+}
+
+wxCoord wxDC::GetCharWidth() const
+{
+    wxCHECK_MSG( Ok(), -1, wxT("invalid dc") );
+    wxCHECK_MSG( m_font.Ok(), -1, wxT("no font selected") );
+
+    int w = -1;
+    IDirectFBFontPtr f = m_font.GetDirectFBFont();
+    DFB_CALL( f->GetStringWidth(f, "H", 1, &w) );
+    // VS: YDEV is corrent, it should *not* be XDEV, because font's are only
+    //     scaled according to m_scaleY
+    return YDEV2LOGREL(w);
+}
+
+void wxDC::DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y,
+                           wxCoord *descent, wxCoord *externalLeading,
+                           wxFont *theFont) const
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+    wxCHECK_RET( m_font.Ok(), wxT("no font selected") );
+    wxCHECK_RET( !theFont || theFont->Ok(), wxT("invalid font") );
+
+    wxFont oldFont;
+    if ( theFont != NULL )
+    {
+        oldFont = m_font;
+        wxConstCast(this, wxDC)->SetFont(*theFont);
+    }
+
+    wxCoord xx = 0, yy = 0;
+    DFBRectangle rect;
+    IDirectFBFontPtr f = m_font.GetDirectFBFont();
+
+    if (DFB_CALL(f->GetStringExtents(f, wxSTR_TO_DFB(string), -1, &rect, NULL)))
+    {
+        // VS: YDEV is corrent, it should *not* be XDEV, because font's are
+        //     only scaled according to m_scaleY
+        xx = YDEV2LOGREL(rect.w);
+        yy = YDEV2LOGREL(rect.h);
+
+        if ( descent )
+        {
+            int d;
+            if ( DFB_CALL( f->GetDescender(f, &d) ) )
+                *descent = YDEV2LOGREL(-d);
+            else
+                *descent = 0;
+        }
+    }
+
+    if ( x ) *x = xx;
+    if ( y ) *y = yy;
+    if ( externalLeading ) *externalLeading = 0;
+
+    if ( theFont != NULL )
+        wxConstCast(this, wxDC)->SetFont(oldFont);
+}
+
+
+
+// ---------------------------------------------------------------------------
+// mapping modes
+// ---------------------------------------------------------------------------
+
+void wxDC::ComputeScaleAndOrigin()
+{
+    m_scaleX = m_logicalScaleX * m_userScaleX;
+    m_scaleY = m_logicalScaleY * m_userScaleY;
+
+    // FIXME_DFB: scaling affects pixel size of font, pens, brushes, which
+    //            is not currently implemented here; probably makes sense to
+    //            switch to Cairo instead of implementing everything for DFB
+    wxASSERT_MSG( m_scaleX == 1.0 && m_scaleY == 1.0,
+                  _T("scaling is not implemented in wxDFB") );
+}
+
+void wxDC::SetMapMode(int mode)
+{
+    #warning "move this to common code, it's shared by almost all ports!"
+    switch (mode)
+    {
+        case wxMM_TWIPS:
+          SetLogicalScale(twips2mm*m_mm_to_pix_x, twips2mm*m_mm_to_pix_y);
+          break;
+        case wxMM_POINTS:
+          SetLogicalScale(pt2mm*m_mm_to_pix_x, pt2mm*m_mm_to_pix_y);
+          break;
+        case wxMM_METRIC:
+          SetLogicalScale(m_mm_to_pix_x, m_mm_to_pix_y);
+          break;
+        case wxMM_LOMETRIC:
+          SetLogicalScale(m_mm_to_pix_x/10.0, m_mm_to_pix_y/10.0);
+          break;
+        default:
+        case wxMM_TEXT:
+          SetLogicalScale(1.0, 1.0);
+          break;
+    }
+    m_mappingMode = mode;
+}
+
+void wxDC::SetUserScale(double x, double y)
+{
+    #warning "move this to common code?"
+    // allow negative ? -> no
+    m_userScaleX = x;
+    m_userScaleY = y;
+    ComputeScaleAndOrigin();
+}
+
+void wxDC::SetLogicalScale(double x, double y)
+{
+    #warning "move this to common code?"
+    // allow negative ?
+    m_logicalScaleX = x;
+    m_logicalScaleY = y;
+    ComputeScaleAndOrigin();
+}
+
+void wxDC::SetLogicalOrigin( wxCoord x, wxCoord y )
+{
+    #warning "move this to common code?"
+    m_logicalOriginX = x * m_signX;   // is this still correct ?
+    m_logicalOriginY = y * m_signY;
+    ComputeScaleAndOrigin();
+}
+
+void wxDC::SetDeviceOrigin( wxCoord x, wxCoord y )
+{
+    #warning "move this to common code?"
+    // only wxPostScripDC has m_signX = -1, we override SetDeviceOrigin there
+    m_deviceOriginX = x;
+    m_deviceOriginY = y;
+    ComputeScaleAndOrigin();
+}
+
+void wxDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
+{
+    #warning "move this to common code?"
+    // only wxPostScripDC has m_signX = -1, we override SetAxisOrientation there
+    m_signX = (xLeftRight ?  1 : -1);
+    m_signY = (yBottomUp  ? -1 :  1);
+    ComputeScaleAndOrigin();
+}
+
+// ---------------------------------------------------------------------------
+// coordinates transformations
+// ---------------------------------------------------------------------------
+
+wxCoord wxDCBase::DeviceToLogicalX(wxCoord x) const
+{
+    return ((wxDC *)this)->XDEV2LOG(x);
+}
+
+wxCoord wxDCBase::DeviceToLogicalY(wxCoord y) const
+{
+    return ((wxDC *)this)->YDEV2LOG(y);
+}
+
+wxCoord wxDCBase::DeviceToLogicalXRel(wxCoord x) const
+{
+    return ((wxDC *)this)->XDEV2LOGREL(x);
+}
+
+wxCoord wxDCBase::DeviceToLogicalYRel(wxCoord y) const
+{
+    return ((wxDC *)this)->YDEV2LOGREL(y);
+}
+
+wxCoord wxDCBase::LogicalToDeviceX(wxCoord x) const
+{
+    return ((wxDC *)this)->XLOG2DEV(x);
+}
+
+wxCoord wxDCBase::LogicalToDeviceY(wxCoord y) const
+{
+    return ((wxDC *)this)->YLOG2DEV(y);
+}
+
+wxCoord wxDCBase::LogicalToDeviceXRel(wxCoord x) const
+{
+    return ((wxDC *)this)->XLOG2DEVREL(x);
+}
+
+wxCoord wxDCBase::LogicalToDeviceYRel(wxCoord y) const
+{
+    return ((wxDC *)this)->YLOG2DEVREL(y);
+}
+
+
+void wxDC::DoGetSize(int *w, int *h) const
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+
+    DFB_CALL( m_surface->GetSize(m_surface, w, h) );
+}
+
+void wxDC::DoGetSizeMM(int *width, int *height) const
+{
+    #warning "move this to common code?"
+    int w = 0;
+    int h = 0;
+    GetSize(&w, &h);
+    if ( width ) *width = int(double(w) / (m_userScaleX*m_mm_to_pix_x));
+    if ( height ) *height = int(double(h) / (m_userScaleY*m_mm_to_pix_y));
+}
+
+wxSize wxDC::GetPPI() const
+{
+    #warning "move this to common code?"
+    return wxSize(int(double(m_mm_to_pix_x) * inches2mm),
+                  int(double(m_mm_to_pix_y) * inches2mm));
+}
+
+
+// ---------------------------------------------------------------------------
+// Blitting
+// ---------------------------------------------------------------------------
+
+bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
+                  wxCoord width, wxCoord height,
+                  wxDC *source, wxCoord xsrc, wxCoord ysrc,
+                  int rop, bool useMask,
+                  wxCoord xsrcMask, wxCoord ysrcMask)
+{
+#warning "FIXME"
+    return false; 
+#if 0
+    wxCHECK_MSG( Ok(), false, wxT("invalid dc") );
+    wxCHECK_MSG( source, false, wxT("invalid source dc") );
+
+    // transform the source DC coords to the device ones
+    xsrc = source->LogicalToDeviceX(xsrc);
+    ysrc = source->LogicalToDeviceY(ysrc);
+
+    /* FIXME_MGL: use the mask origin when drawing transparently */
+    if (xsrcMask == -1 && ysrcMask == -1)
+    {
+        xsrcMask = xsrc; ysrcMask = ysrc;
+    }
+    else
+    {
+        xsrcMask = source->LogicalToDeviceX(xsrcMask);
+        ysrcMask = source->LogicalToDeviceY(ysrcMask);
+    }
+
+    CalcBoundingBox(xdest, ydest);
+    CalcBoundingBox(xdest + width, ydest + height);
+
+    /* scale/translate size and position */
+    wxCoord xx = XLOG2DEV(xdest);
+    wxCoord yy = YLOG2DEV(ydest);
+    wxCoord ww = XLOG2DEVREL(width);
+    wxCoord hh = YLOG2DEVREL(height);
+
+    if ( source->m_isMemDC )
+    {
+        wxMemoryDC *memDC = (wxMemoryDC*) source;
+        DoDrawSubBitmap(memDC->GetSelectedObject(), xsrc, ysrc, ww, hh,
+                        xdest, ydest, rop, useMask);
+    }
+    else
+    {
+        m_MGLDC->makeCurrent(); // will go away with MGL6.0
+        m_MGLDC->bitBlt(*source->GetMGLDC(),
+                        xsrc, ysrc, xsrc + ww, ysrc + hh,
+                        xx, yy, LogicalFunctionToMGLRop(rop));
+    }
+
+    return true;
+#endif
+}
+
+void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
+{
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+    wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );
+
+    wxCoord w = bmp.GetWidth();
+    wxCoord h = bmp.GetHeight();
+
+    DoDrawSubBitmap(bmp, 0, 0, w, h, x, y, m_logicalFunction, useMask);
+}
+
+void wxDC::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
+{
+    // VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
+    DoDrawBitmap((const wxBitmap&)icon, x, y, true);
+}
+
+void wxDC::DoDrawSubBitmap(const wxBitmap &bmp,
+                           wxCoord x, wxCoord y, wxCoord w, wxCoord h,
+                           wxCoord destx, wxCoord desty, int rop, bool useMask)
+{
+#if 0
+    wxCHECK_RET( Ok(), wxT("invalid dc") );
+    wxCHECK_RET( bmp.Ok(), wxT("invalid bitmap") );
+
+    CalcBoundingBox(x, y);
+    CalcBoundingBox(x + w, y + h);
+
+    wxCoord dx = XLOG2DEV(destx);
+    wxCoord dy = YLOG2DEV(desty);
+    wxCoord dw = XLOG2DEVREL(w);
+    wxCoord dh = YLOG2DEVREL(h);
+
+    m_MGLDC->makeCurrent(); // will go away with MGL6.0
+
+    bool useStretching = ((w != dw) || (h != dh));
+    bool putSection = (w != bmp.GetWidth() || h != bmp.GetHeight());
+    MGL_writeModeType mglRop = (MGL_writeModeType)LogicalFunctionToMGLRop(rop);
+
+    if ( bmp.GetDepth() == 1 )
+    {
+        // Mono bitmaps are handled in special way -- all 1s are drawn in
+        // foreground colours, all 0s in background colour.
+
+        ((wxBitmap&)bmp).SetMonoPalette(m_textForegroundColour, m_textBackgroundColour);
+    }
+
+    if ( useMask && bmp.GetMask() )
+    {
+        // Since MGL does not support masks directly (in MGL, mask is handled
+        // in same way as in wxImage, i.e. there is one "key" color), we
+        // simulate masked bitblt in 6 steps (same as in MSW):
+        //
+        // 1. Create a temporary bitmap and copy the destination area into it.
+        // 2. Copy the source area into the temporary bitmap using the
+        //    specified logical function.
+        // 3. Set the masked area in the temporary bitmap to BLACK by ANDing
+        //    the mask bitmap with the temp bitmap with the foreground colour
+        //    set to WHITE and the bg colour set to BLACK.
+        // 4. Set the unmasked area in the destination area to BLACK by
+        //    ANDing the mask bitmap with the destination area with the
+        //    foreground colour set to BLACK and the background colour set
+        //    to WHITE.
+        // 5. OR the temporary bitmap with the destination area.
+        // 6. Delete the temporary bitmap.
+        //
+        // This sequence of operations ensures that the source's transparent
+        // area need not be black, and logical functions are supported.
+
+        wxBitmap *mask = bmp.GetMask()->GetBitmap();
+
+        MGLMemoryDC *temp;
+
+        if ( GetDepth() <= 8 )
+        {
+            temp = new MGLMemoryDC(dw, dh, GetDepth(), NULL);
+            wxDC tempdc;
+            tempdc.SetMGLDC(temp, false);
+            tempdc.SetPalette(m_palette);
+        }
+        else
+        {
+            pixel_format_t pf;
+            m_MGLDC->getPixelFormat(pf);
+            temp = new MGLMemoryDC(dw, dh, GetDepth(), &pf);
+        }
+
+        wxCHECK_RET( temp->isValid(), wxT("cannot create temporary dc") );
+
+        temp->bitBlt(*m_MGLDC, dx, dy, dx + dw, dy + dh, 0, 0, MGL_REPLACE_MODE);
+
+        DoBitBlt(bmp, temp, x, y, w, h, 0, 0, dw, dh, mglRop,
+                 useStretching, putSection);
+
+        mask->SetMonoPalette(wxColour(0,0,0), wxColour(255,255,255));
+        DoBitBlt(*mask, temp, x, y, w, h, 0, 0, dw, dh, MGL_R2_MASKSRC,
+                 useStretching, putSection);
+        DoBitBlt(*mask, m_MGLDC, x, y, w, h, dx, dy, dw, dh, MGL_R2_MASKNOTSRC,
+                 useStretching, putSection);
+
+        m_MGLDC->bitBlt(*temp, 0, 0, dw, dh, dx, dy, MGL_OR_MODE);
+
+        delete temp;
+    }
+
+    else
+    {
+        DoBitBlt(bmp, m_MGLDC, x, y, w, h, dx, dy, dw, dh, mglRop,
+                 useStretching, putSection);
+    }
+#endif
+}
diff --git a/src/dfb/dcclient.cpp b/src/dfb/dcclient.cpp
new file mode 100644 (file)
index 0000000..257d73b
--- /dev/null
@@ -0,0 +1,107 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/dcclient.cpp
+// Purpose:     wxWindowDC, wxClientDC and wxPaintDC
+// Author:      Vaclav Slavik
+// Created:     2006-08-10
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ===========================================================================
+// declarations
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// headers
+// ---------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/dcclient.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/window.h"
+#endif
+
+#include "wx/dfb/private.h"
+
+// ===========================================================================
+// implementation
+// ===========================================================================
+
+//-----------------------------------------------------------------------------
+// wxWindowDC
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxWindowDC, wxDC)
+
+wxWindowDC::wxWindowDC(wxWindow *win)
+    : wxDC(win ? win->GetDfbSurface() : NULL)
+{
+    InitForWin(win);
+}
+
+void wxWindowDC::InitForWin(wxWindow *win)
+{
+    wxCHECK_RET( win, _T("invalid window") );
+
+    SetFont(win->GetFont());
+}
+
+//-----------------------------------------------------------------------------
+// base class for wxClientDC and wxPaintDC
+//-----------------------------------------------------------------------------
+
+wxClientDCBase::wxClientDCBase(wxWindow *win)
+{
+    wxCHECK_RET( win, _T("invalid window") );
+
+    wxRect rect = win->GetClientRect();
+    DFBRectangle dfbrect = { rect.x, rect.y, rect.width, rect.height };
+
+    IDirectFBSurfacePtr winsurf(win->GetDfbSurface());
+    IDirectFBSurfacePtr subsurf;
+    if ( !DFB_CALL( winsurf->GetSubSurface(winsurf, &dfbrect, &subsurf) ) )
+        return;
+
+    Init(subsurf);
+    InitForWin(win);
+
+    // offset coordinates to account for subsurface's origin coordinates:
+    SetDeviceOrigin(rect.x, rect.y);
+}
+
+//-----------------------------------------------------------------------------
+// wxClientDC
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxClientDC, wxWindowDC)
+
+wxClientDC::~wxClientDC()
+{
+    // flip to surface so that the changes become visible
+    IDirectFBSurfacePtr surface(GetDirectFBSurface());
+    if ( surface )
+        surface->Flip(surface, NULL, DSFLIP_NONE);
+}
+
+//-----------------------------------------------------------------------------
+// wxPaintDC
+//-----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxPaintDC, wxWindowDC)
+
+#warning "wxPaintDC ctor must respect m_updateRegion"
+
+wxPaintDC::~wxPaintDC()
+{
+    // NB: do *not* flip the surface: wxPaintDC is used with EVT_PAINT and the
+    //     surface will be flipped for the entire TLW once all children are
+    //     repainted
+}
diff --git a/src/dfb/dcmemory.cpp b/src/dfb/dcmemory.cpp
new file mode 100644 (file)
index 0000000..435667e
--- /dev/null
@@ -0,0 +1,61 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/dcmemory.cpp
+// Purpose:     wxMemoryDC implementation
+// Author:      Vaclav Slavik
+// Created:     2006-08-16
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ===========================================================================
+// declarations
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// headers
+// ---------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#include "wx/dcmemory.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/bitmap.h"
+#endif
+
+#include "wx/dfb/private.h"
+
+// ===========================================================================
+// implementation
+// ===========================================================================
+
+//-----------------------------------------------------------------------------
+// wxMemoryDC
+//-----------------------------------------------------------------------------
+
+#warning "FIXME: verify/fix that wxMemoryDC works correctly with mono bitmaps"
+
+IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
+
+wxMemoryDC::wxMemoryDC()
+{
+}
+
+wxMemoryDC::wxMemoryDC(wxDC *WXUNUSED(dc))
+{
+}
+
+void wxMemoryDC::SelectObject(const wxBitmap& bitmap)
+{
+    if ( !bitmap.Ok() )
+    {
+        // select the bitmap out of the DC
+        m_surface = NULL;
+        return;
+    }
+
+    // init the DC for drawing to this bitmap
+    Init(bitmap.GetDirectFBSurface());
+}
diff --git a/src/dfb/dcscreen.cpp b/src/dfb/dcscreen.cpp
new file mode 100644 (file)
index 0000000..f1218a9
--- /dev/null
@@ -0,0 +1,44 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/dcscreen.cpp
+// Purpose:     wxScreenDC implementation
+// Author:      Vaclav Slavik
+// Created:     2006-08-16
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ===========================================================================
+// declarations
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// headers
+// ---------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#include "wx/dcscreen.h"
+
+#include "wx/dfb/private.h"
+
+// ===========================================================================
+// implementation
+// ===========================================================================
+
+//-----------------------------------------------------------------------------
+// wxScreenDC
+//-----------------------------------------------------------------------------
+
+#warning "FIXME: verify that wxScreenDC works in 2nd DirectFB app started"
+// FIXME: maybe use a subsurface as well?
+
+IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxDC)
+
+wxScreenDC::wxScreenDC()
+{
+    Init(wxDfbGetPrimarySurface());
+}
+
+#warning "FIXME: does wxScreenDC need Flip call in dtor?"
diff --git a/src/dfb/evtloop.cpp b/src/dfb/evtloop.cpp
new file mode 100644 (file)
index 0000000..fcfeb0b
--- /dev/null
@@ -0,0 +1,157 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/evtloop.cpp
+// Purpose:     wxEventLoop implementation
+// Author:      Vaclav Slavik
+// Created:     2006-08-16
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ===========================================================================
+// declarations
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// headers
+// ---------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#include "wx/evtloop.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+#endif
+
+#include "wx/timer.h"
+#include "wx/dfb/private.h"
+
+#define TRACE_EVENTS _T("events")
+
+// ===========================================================================
+// implementation
+// ===========================================================================
+
+//-----------------------------------------------------------------------------
+// wxEventLoop initialization
+//-----------------------------------------------------------------------------
+
+IDirectFBEventBufferPtr wxEventLoop::ms_buffer;
+
+wxEventLoop::wxEventLoop()
+{
+    if ( !ms_buffer )
+        InitBuffer();
+}
+
+/* static */
+void wxEventLoop::InitBuffer()
+{
+    IDirectFBPtr dfb(wxTheApp->GetDirectFBInterface());
+    DFB_CALL( dfb->CreateEventBuffer(dfb, &ms_buffer) );
+}
+
+/* static */
+IDirectFBEventBufferPtr wxEventLoop::GetDirectFBEventBuffer()
+{
+    if ( !ms_buffer )
+        InitBuffer();
+
+    return ms_buffer;
+}
+
+//-----------------------------------------------------------------------------
+// events dispatch and loop handling
+//-----------------------------------------------------------------------------
+
+bool wxEventLoop::Pending() const
+{
+    wxCHECK_MSG( ms_buffer, false, _T("invalid event buffer") );
+
+    // returns DFB_OK if there is >=1 event, DFB_BUFFER_EMPTY otherwise
+    return ms_buffer->HasEvent(ms_buffer) == DFB_OK;
+}
+
+bool wxEventLoop::Dispatch()
+{
+    wxCHECK_MSG( ms_buffer, false, _T("invalid event buffer") );
+
+    // NB: we don't block indefinitely waiting for an event, but instead
+    //     time out after a brief period in order to make sure that
+    //     OnNextIteration() will be called frequently enough
+    //
+    //     FIXME: call NotifyTimers() from here (and loop) instead?
+    const int TIMEOUT = 100;
+
+    DFBResult ret = ms_buffer->WaitForEventWithTimeout(ms_buffer, 0, TIMEOUT);
+
+    switch ( ret )
+    {
+        case DFB_OK:
+        {
+            wxDFBEvent e;
+            ms_buffer->GetEvent(ms_buffer, &e);
+            HandleDFBEvent(e);
+            break;
+        }
+
+        case DFB_TIMEOUT:
+            // timed out, pretend we processed an event so that OnNextIteration
+            // is called
+            break;
+
+        default:
+            // report any errors, but don't terminate the loop due to them
+            wxDfbCheckReturn(ret);
+            break;
+    }
+
+    return true;
+}
+
+void wxEventLoop::WakeUp()
+{
+    wxCHECK_RET( ms_buffer, _T("invalid event buffer") );
+
+    DFB_CALL( ms_buffer->WakeUp(ms_buffer) );
+}
+
+void wxEventLoop::OnNextIteration()
+{
+#if wxUSE_TIMER
+    // see the comment in Dispatch
+    wxTimer::NotifyTimers();
+#endif
+}
+
+#warning "FIXME: cleanup wxEventLoop::ms_buffer before exiting"
+
+
+//-----------------------------------------------------------------------------
+// DirectFB -> wxWidgets events translation
+//-----------------------------------------------------------------------------
+
+void wxEventLoop::HandleDFBEvent(const wxDFBEvent& event)
+{
+    switch ( event.GetClass() )
+    {
+        case DFEC_WINDOW:
+        {
+            wxDFBWindowEvent winevent(((const DFBEvent&)event).window);
+            wxTopLevelWindowDFB::HandleDFBWindowEvent(winevent);
+            break;
+        }
+
+        case DFEC_NONE:
+        case DFEC_INPUT:
+        case DFEC_USER:
+        case DFEC_UNIVERSAL:
+        {
+            wxLogTrace(TRACE_EVENTS,
+                       _T("ignoring event of unsupported class %i"),
+                       (int)event.GetClass());
+        }
+    }
+}
diff --git a/src/dfb/font.cpp b/src/dfb/font.cpp
new file mode 100644 (file)
index 0000000..e954b9f
--- /dev/null
@@ -0,0 +1,275 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/font.cpp
+// Purpose:     wxFont implementation
+// Author:      Vaclav Slavik
+// Created:     2006-08-08
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ============================================================================
+// declarations
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// headers
+// ----------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/font.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+#endif
+
+#include "wx/fontutil.h"
+#include "wx/dfb/private.h"
+
+// ----------------------------------------------------------------------------
+// wxFontRefData
+// ----------------------------------------------------------------------------
+
+// FIXME: for now, always use single font
+static IDirectFBFontPtr gs_font = NULL;
+static unsigned gs_fontRefCnt = 0;
+
+class wxFontRefData : public wxObjectRefData
+{
+public:
+    wxFontRefData(int size = wxDEFAULT,
+                  int family = wxDEFAULT,
+                  int style = wxDEFAULT,
+                  int weight = wxDEFAULT,
+                  bool underlined = false,
+                  const wxString& faceName = wxEmptyString,
+                  wxFontEncoding encoding = wxFONTENCODING_DEFAULT)
+    {
+        if ( family == wxDEFAULT )
+            family = wxSWISS;
+        if ( style == wxDEFAULT )
+            style = wxNORMAL;
+        if ( weight == wxDEFAULT )
+            weight = wxNORMAL;
+        if ( size == wxDEFAULT )
+            size = 12;
+
+        m_info.family = (wxFontFamily)family;
+        m_info.faceName = faceName;
+        m_info.style = (wxFontStyle)style;
+        m_info.weight = (wxFontWeight)weight;
+        m_info.pointSize = size;
+        m_info.underlined = underlined;
+        m_info.encoding = encoding;
+
+        // FIXME: always use default font for now
+        if ( !gs_font )
+        {
+            IDirectFBPtr dfb(wxTheApp->GetDirectFBInterface());
+
+            DFBFontDescription desc;
+            desc.flags = (DFBFontDescriptionFlags)0;
+            IDirectFBFontPtr f;
+            if ( DFB_CALL( dfb->CreateFont(dfb, NULL, &desc, &f) ) )
+                gs_font = f;
+        }
+        if ( gs_font ) // the above may fail
+        {
+            gs_fontRefCnt++;
+            m_font = gs_font;
+        }
+    }
+
+    wxFontRefData(const wxFontRefData& data)
+    {
+        m_info = data.m_info;
+        m_font = data.m_font;
+    }
+
+    ~wxFontRefData()
+    {
+        if ( m_font )
+        {
+            m_font.Reset();
+            // FIXME
+            if ( --gs_fontRefCnt == 0 )
+                gs_font = NULL;
+        }
+    }
+
+    wxNativeFontInfo m_info;
+    IDirectFBFontPtr m_font;
+};
+
+
+// ----------------------------------------------------------------------------
+// wxFont
+// ----------------------------------------------------------------------------
+
+IMPLEMENT_DYNAMIC_CLASS(wxFont, wxGDIObject)
+
+bool wxFont::Create(const wxNativeFontInfo& info)
+{
+    return Create(info.pointSize, info.family, info.style, info.weight,
+                  info.underlined, info.faceName, info.encoding);
+}
+
+bool wxFont::Create(int pointSize,
+                    int family,
+                    int style,
+                    int weight,
+                    bool underlined,
+                    const wxString& face,
+                    wxFontEncoding encoding)
+{
+    m_refData = new wxFontRefData(pointSize, family, style, weight,
+                                  underlined, face, encoding);
+    return true;
+}
+
+wxObjectRefData *wxFont::CreateRefData() const
+{
+    return new wxFontRefData;
+}
+
+wxObjectRefData *wxFont::CloneRefData(const wxObjectRefData *data) const
+{
+    return new wxFontRefData(*(wxFontRefData *)data);
+}
+
+
+// ----------------------------------------------------------------------------
+// accessors
+// ----------------------------------------------------------------------------
+
+IDirectFBFontPtr wxFont::GetDirectFBFont() const
+{
+    wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
+
+    return M_FONTDATA->m_font;
+}
+
+int wxFont::GetPointSize() const
+{
+    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+
+    return M_FONTDATA->m_info.pointSize;
+}
+
+wxString wxFont::GetFaceName() const
+{
+    wxCHECK_MSG( Ok(), wxEmptyString, wxT("invalid font") );
+
+    return M_FONTDATA->m_info.faceName;
+}
+
+int wxFont::GetFamily() const
+{
+    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+
+    return M_FONTDATA->m_info.family;
+}
+
+int wxFont::GetStyle() const
+{
+    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+
+    return M_FONTDATA->m_info.style;
+}
+
+int wxFont::GetWeight() const
+{
+    wxCHECK_MSG( Ok(), 0, wxT("invalid font") );
+
+    return M_FONTDATA->m_info.weight;
+}
+
+bool wxFont::GetUnderlined() const
+{
+    wxCHECK_MSG( Ok(), false, wxT("invalid font") );
+
+    return M_FONTDATA->m_info.underlined;
+}
+
+
+wxFontEncoding wxFont::GetEncoding() const
+{
+    wxCHECK_MSG( Ok(), wxFONTENCODING_DEFAULT, wxT("invalid font") );
+
+    return M_FONTDATA->m_info.encoding;
+}
+
+bool wxFont::IsFixedWidth() const
+{
+    wxCHECK_MSG( Ok(), false, wxT("invalid font") );
+
+    return true; // FIXME_DFB
+}
+
+const wxNativeFontInfo *wxFont::GetNativeFontInfo() const
+{
+    wxCHECK_MSG( Ok(), NULL, wxT("invalid font") );
+
+    return &(M_FONTDATA->m_info);
+}
+
+// ----------------------------------------------------------------------------
+// change font attributes
+// ----------------------------------------------------------------------------
+
+void wxFont::SetPointSize(int pointSize)
+{
+    AllocExclusive();
+
+    M_FONTDATA->m_info.pointSize = pointSize;
+}
+
+void wxFont::SetFamily(int family)
+{
+    AllocExclusive();
+
+    M_FONTDATA->m_info.family = (wxFontFamily)family;
+}
+
+void wxFont::SetStyle(int style)
+{
+    AllocExclusive();
+
+    M_FONTDATA->m_info.style = (wxFontStyle)style;
+}
+
+void wxFont::SetWeight(int weight)
+{
+    AllocExclusive();
+
+    M_FONTDATA->m_info.weight = (wxFontWeight)weight;
+}
+
+bool wxFont::SetFaceName(const wxString& faceName)
+{
+    AllocExclusive();
+
+    M_FONTDATA->m_info.faceName = faceName;
+
+    return wxFontBase::SetFaceName(faceName);
+}
+
+void wxFont::SetUnderlined(bool underlined)
+{
+    AllocExclusive();
+
+    M_FONTDATA->m_info.underlined = underlined;
+}
+
+void wxFont::SetEncoding(wxFontEncoding encoding)
+{
+    AllocExclusive();
+
+    M_FONTDATA->m_info.encoding = encoding;
+}
diff --git a/src/dfb/fontenum.cpp b/src/dfb/fontenum.cpp
new file mode 100644 (file)
index 0000000..4e1f905
--- /dev/null
@@ -0,0 +1,36 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/fontenum.cpp
+// Purpose:     wxFontEnumerator class
+// Author:      Vaclav Slavik
+// Created:     2006-08-10
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/fontenum.h"
+
+// ----------------------------------------------------------------------------
+// wxFontEnumerator
+// ----------------------------------------------------------------------------
+
+bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding WXUNUSED(encoding),
+                                          bool WXUNUSED(fixedWidthOnly))
+{
+    // FIXME_DFB
+    OnFacename(_T("Default"));
+    return true;
+}
+
+bool wxFontEnumerator::EnumerateEncodings(const wxString& WXUNUSED(family))
+{
+    // FIXME_DFB
+    return false;
+}
diff --git a/src/dfb/ifacehelpers.cpp b/src/dfb/ifacehelpers.cpp
new file mode 100644 (file)
index 0000000..954a016
--- /dev/null
@@ -0,0 +1,48 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/ifacehelpers.cpp
+// Purpose:     helpers for dealing with DFB interfaces
+// Author:      Vaclav Slavik
+// Created:     2006-08-09
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/dfb/ifacehelpers.h"
+#include <directfb.h>
+
+//-----------------------------------------------------------------------------
+// wxDfbPtr
+//-----------------------------------------------------------------------------
+
+// NB: We can't call AddRef() and Release() directly from wxDfbPtr<T> because
+//     we don't have full type declarations for them if we don't include
+//     <directfb.h> (which user wx headers can't). Fortunately, all DirectFB
+//     interfaces are structs with common beginning that contains pointers to
+//     AddRef and Release, so we can safely cast interface pointer to void* and
+//     then back to arbitrary interface pointer and these calls will still work
+//     correctly. For this purpose, we declare a dummy DFB interface here.
+
+DECLARE_INTERFACE(wxDummyDFBInterface)
+DEFINE_INTERFACE(wxDummyDFBInterface, )
+
+/* static */
+void wxDfbPtrBase::DoAddRef(void *ptr)
+{
+    wxDummyDFBInterface *p = (wxDummyDFBInterface*)ptr;
+    p->AddRef(p);
+}
+
+/* static */
+void wxDfbPtrBase::DoRelease(void *ptr)
+{
+    wxDummyDFBInterface *p = (wxDummyDFBInterface*)ptr;
+    p->Release(p);
+}
diff --git a/src/dfb/pen.cpp b/src/dfb/pen.cpp
new file mode 100644 (file)
index 0000000..58da1f8
--- /dev/null
@@ -0,0 +1,205 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/pen.cpp
+// Purpose:     wxPen class implementation
+// Author:      Vaclav Slavik
+// Created:     2006-08-04
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/pen.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/bitmap.h"
+    #include "wx/colour.h"
+#endif
+
+//-----------------------------------------------------------------------------
+// wxPen
+//-----------------------------------------------------------------------------
+
+class wxPenRefData: public wxObjectRefData
+{
+public:
+    wxPenRefData(const wxColour& clr = wxNullColour, int style = wxSOLID)
+    {
+        m_colour = clr;
+        SetStyle(style);
+    }
+
+    wxPenRefData(const wxPenRefData& data)
+        : m_style(data.m_style), m_colour(data.m_colour) {}
+
+    void SetStyle(int style)
+    {
+        if ( m_style != wxSOLID && m_style == wxTRANSPARENT )
+        {
+            wxFAIL_MSG( _T("only wxSOLID and wxTRANSPARENT styles are supported") );
+            style = wxSOLID;
+        }
+
+        m_style = style;
+    }
+
+    int            m_style;
+    wxColour       m_colour;
+};
+
+//-----------------------------------------------------------------------------
+
+#define M_PENDATA ((wxPenRefData *)m_refData)
+
+IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
+
+wxPen::wxPen(const wxColour &colour, int width, int style)
+{
+    wxASSERT_MSG( width <= 1, _T("only width=0,1 are supported") );
+
+    m_refData = new wxPenRefData(colour, style);
+}
+
+wxPen::wxPen(const wxBitmap& WXUNUSED(stipple), int WXUNUSED(width))
+{
+    wxFAIL_MSG( _T("stipple pens not supported") );
+
+    m_refData = new wxPenRefData();
+}
+
+bool wxPen::operator==(const wxPen& pen) const
+{
+#warning "this is incorrect (MGL too)"
+    return m_refData == pen.m_refData;
+}
+
+void wxPen::SetColour(const wxColour &colour)
+{
+    AllocExclusive();
+    M_PENDATA->m_colour = colour;
+}
+
+void wxPen::SetDashes(int WXUNUSED(number_of_dashes), const wxDash *WXUNUSED(dash))
+{
+    wxFAIL_MSG( _T("SetDashes not implemented") );
+}
+
+void wxPen::SetColour(unsigned char red, unsigned char green, unsigned char blue)
+{
+    AllocExclusive();
+    M_PENDATA->m_colour.Set(red, green, blue);
+}
+
+void wxPen::SetCap(int WXUNUSED(capStyle))
+{
+    wxFAIL_MSG( _T("SetCap not implemented") );
+}
+
+void wxPen::SetJoin(int WXUNUSED(joinStyle))
+{
+    wxFAIL_MSG( _T("SetJoin not implemented") );
+}
+
+void wxPen::SetStyle(int style)
+{
+    AllocExclusive();
+    M_PENDATA->SetStyle(style);
+}
+
+void wxPen::SetStipple(const wxBitmap& WXUNUSED(stipple))
+{
+    wxFAIL_MSG( _T("SetStipple not implemented") );
+}
+
+void wxPen::SetWidth(int width)
+{
+    wxASSERT_MSG( width <= 1, _T("only width=0,1 are implemented") );
+}
+
+int wxPen::GetDashes(wxDash **ptr) const
+{
+    wxFAIL_MSG( _T("GetDashes not implemented") );
+
+    *ptr = NULL;
+    return 0;
+}
+
+int wxPen::GetDashCount() const
+{
+    wxFAIL_MSG( _T("GetDashCount not implemented") );
+
+    return 0;
+}
+
+wxDash* wxPen::GetDash() const
+{
+    wxFAIL_MSG( _T("GetDash not implemented") );
+
+    return NULL;
+}
+
+int wxPen::GetCap() const
+{
+    wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+
+    wxFAIL_MSG( _T("GetCap not implemented") );
+    return -1;
+}
+
+int wxPen::GetJoin() const
+{
+    wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+
+    wxFAIL_MSG( _T("GetJoin not implemented") );
+    return -1;
+}
+
+int wxPen::GetStyle() const
+{
+    wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+
+    return M_PENDATA->m_style;
+}
+
+int wxPen::GetWidth() const
+{
+    wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+
+    return 1;
+}
+
+wxColour &wxPen::GetColour() const
+{
+    wxCHECK_MSG( Ok(), wxNullColour, wxT("invalid pen") );
+
+    return M_PENDATA->m_colour;
+}
+
+wxBitmap *wxPen::GetStipple() const
+{
+    wxCHECK_MSG( Ok(), NULL, wxT("invalid pen") );
+
+    wxFAIL_MSG( _T("GetStipple not implemented") );
+    return NULL;
+}
+
+bool wxPen::Ok() const
+{
+    return ((m_refData) && M_PENDATA->m_colour.Ok());
+}
+
+wxObjectRefData *wxPen::CreateRefData() const
+{
+    return new wxPenRefData;
+}
+
+wxObjectRefData *wxPen::CloneRefData(const wxObjectRefData *data) const
+{
+    return new wxPenRefData(*(wxPenRefData *)data);
+}
diff --git a/src/dfb/region.cpp b/src/dfb/region.cpp
new file mode 100644 (file)
index 0000000..e2788df
--- /dev/null
@@ -0,0 +1,275 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:      src/mgl/region.cpp
+// Purpose:   Region handling for wxWidgets/DFB
+// Author:    Vaclav Slavik
+// Created:   2006-08-08
+// RCS-ID:    $Id$
+// Copyright: (c) 2006 REA Elektronik GmbH
+// Licence:   wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/region.h"
+
+IMPLEMENT_DYNAMIC_CLASS(wxRegion, wxGDIObject)
+IMPLEMENT_DYNAMIC_CLASS(wxRegionIterator, wxObject)
+
+//-----------------------------------------------------------------------------
+// wxRegionRefData
+//-----------------------------------------------------------------------------
+
+class WXDLLEXPORT wxRegionRefData : public wxGDIRefData
+{
+public:
+    wxRegionRefData() {}
+    wxRegionRefData(const wxRect& rect) : m_rect(rect) {}
+    wxRegionRefData(const wxRegionRefData& data) : m_rect(data.m_rect) {}
+
+    ~wxRegionRefData() {}
+
+    wxRect m_rect;
+};
+
+#define M_REGION_OF(r) ((wxRegionRefData*)((r).m_refData))
+#define M_REGION       M_REGION_OF(*this)
+
+//-----------------------------------------------------------------------------
+// wxRegion
+//-----------------------------------------------------------------------------
+
+wxObjectRefData *wxRegion::CreateRefData() const
+{
+    return new wxRegionRefData;
+}
+
+wxObjectRefData *wxRegion::CloneRefData(const wxObjectRefData *data) const
+{
+    return new wxRegionRefData(*(wxRegionRefData *)data);
+}
+
+wxRegion::wxRegion()
+{
+    m_refData = NULL;
+}
+
+wxRegion::wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
+{
+    m_refData = new wxRegionRefData(wxRect(x, y, w, h));
+}
+
+wxRegion::wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight)
+{
+    m_refData = new wxRegionRefData(wxRect(topLeft, bottomRight));
+}
+
+wxRegion::wxRegion(const wxRect& r)
+{
+    m_refData = new wxRegionRefData(r);
+}
+
+wxRegion::~wxRegion()
+{
+    // m_refData unrefed in ~wxObject
+}
+
+bool wxRegion::operator==(const wxRegion& region) const
+{
+    if ( m_refData != region.m_refData )
+        return false;
+
+    if ( !Ok() )
+        return true; // both invalid
+
+    return M_REGION->m_rect == M_REGION_OF(region)->m_rect;
+}
+
+//-----------------------------------------------------------------------------
+// Information about the region
+//-----------------------------------------------------------------------------
+
+void wxRegion::GetBox(wxCoord& x, wxCoord& y, wxCoord&w, wxCoord &h) const
+{
+    wxRect r = GetBox();
+    x = r.GetX();
+    y = r.GetY();
+    w = r.GetWidth();
+    h = r.GetHeight();
+}
+
+wxRect wxRegion::GetBox() const
+{
+    if (m_refData)
+        return M_REGION->m_rect;
+    else
+        return wxRect();
+}
+
+bool wxRegion::Empty() const
+{
+    if (!m_refData)
+        return true;
+
+    return M_REGION->m_rect.IsEmpty();
+}
+
+//-----------------------------------------------------------------------------
+// Modifications
+//-----------------------------------------------------------------------------
+
+void wxRegion::Clear()
+{
+    UnRef();
+}
+
+bool wxRegion::Offset(wxCoord x, wxCoord y)
+{
+    AllocExclusive();
+    M_REGION->m_rect.Offset(x, y);
+    return true;
+}
+
+bool wxRegion::Union(const wxRect& rect)
+{
+    AllocExclusive();
+
+    if ( M_REGION->m_rect.Inside(rect) )
+    {
+        return true;
+    }
+    else if ( rect.Inside(M_REGION->m_rect) )
+    {
+        M_REGION->m_rect = rect;
+        return true;
+    }
+    else
+    {
+        wxFAIL_MSG( _T("only rectangular regions are supported") );
+        return false;
+    }
+}
+
+bool wxRegion::Union(const wxRegion& region)
+{
+    wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+    return Union(M_REGION_OF(region)->m_rect);
+}
+
+bool wxRegion::Intersect(const wxRect& rect)
+{
+    AllocExclusive();
+    M_REGION->m_rect.Intersect(rect);
+    return true;
+}
+
+bool wxRegion::Intersect(const wxRegion& region)
+{
+    wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+    return Intersect(M_REGION_OF(region)->m_rect);
+}
+
+bool wxRegion::Subtract(const wxRect& rect)
+{
+    wxCHECK_MSG( Ok(), false, _T("invalid region") );
+
+    if ( rect.Inside(M_REGION->m_rect) )
+    {
+        // subtracted rectangle contains this one, so the result is empty
+        // rectangle
+        M_REGION->m_rect = wxRect();
+        return true;
+    }
+    else if ( !M_REGION->m_rect.Intersects(rect) )
+    {
+        // the rectangles are disjoint, so substracting has no effect
+        return true;
+    }
+    else
+    {
+        wxFAIL_MSG( _T("only rectangular regions implemented") );
+        return false;
+    }
+}
+
+bool wxRegion::Subtract(const wxRegion& region)
+{
+    wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+    return Subtract(M_REGION_OF(region)->m_rect);
+}
+
+bool wxRegion::Xor(const wxRect& rect)
+{
+    wxFAIL_MSG( _T("Xor not implemented") );
+    return false;
+}
+
+bool wxRegion::Xor(const wxRegion& region)
+{
+    wxCHECK_MSG( region.Ok(), false, _T("invalid region") );
+    return Xor(M_REGION_OF(region)->m_rect);
+}
+
+
+//-----------------------------------------------------------------------------
+// Tests
+//-----------------------------------------------------------------------------
+
+wxRegionContain wxRegion::Contains(wxCoord x, wxCoord y) const
+{
+    wxCHECK_MSG( Ok(), wxOutRegion, _T("invalid region") );
+
+    if (M_REGION->m_rect.Inside(x, y))
+        return wxInRegion;
+    else
+        return wxOutRegion;
+}
+
+wxRegionContain wxRegion::Contains(const wxRect& rect) const
+{
+    wxCHECK_MSG( Ok(), wxOutRegion, _T("invalid region") );
+
+    // 1) is the rectangle entirely covered by the region?
+    if (M_REGION->m_rect.Inside(rect))
+        return wxInRegion;
+
+    // 2) is the rectangle completely outside the region?
+    if (!M_REGION->m_rect.Intersects(rect))
+        return wxOutRegion;
+
+    // 3) neither case happened => it is partially covered:
+    return wxPartRegion;
+}
+
+//-----------------------------------------------------------------------------
+// wxRegionIterator
+//-----------------------------------------------------------------------------
+
+void wxRegionIterator::Reset(const wxRegion& region)
+{
+    wxRegionRefData *d = M_REGION_OF(region);
+    m_rect = d ? d->m_rect : wxRect();
+}
+
+wxRegionIterator& wxRegionIterator::operator++()
+{
+    // there's only one rectangle in the iterator, so iterating always
+    // reaches the end:
+    Reset();
+    return *this;
+}
+
+wxRegionIterator wxRegionIterator::operator++(int)
+{
+    wxRegionIterator tmp = *this;
+
+    // there's only one rectangle in the iterator, so iterating always
+    // reaches the end:
+    Reset();
+
+    return tmp;
+}
diff --git a/src/dfb/settings.cpp b/src/dfb/settings.cpp
new file mode 100644 (file)
index 0000000..308e924
--- /dev/null
@@ -0,0 +1,108 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/settings.cpp
+// Purpose:     wxSystemSettings implementation
+// Author:      Vaclav Slavik
+// Created:     2006-08-08
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/settings.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/colour.h"
+    #include "wx/font.h"
+    #include "wx/gdicmn.h"
+#endif
+
+#include "wx/dfb/private.h"
+
+
+wxColour wxSystemSettingsNative::GetColour(wxSystemColour WXUNUSED(index))
+{
+    // not implemented, the mean is in wxUniversal
+    return wxColour(0,0,0);
+}
+
+wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
+{
+    switch (index)
+    {
+        case wxSYS_OEM_FIXED_FONT:
+        case wxSYS_ANSI_FIXED_FONT:
+        case wxSYS_SYSTEM_FIXED_FONT:
+        {
+            // FIXME_DFB
+            return wxFont(12,
+                          wxFONTFAMILY_TELETYPE,
+                          wxFONTSTYLE_NORMAL,
+                          wxFONTWEIGHT_NORMAL);
+        }
+
+        case wxSYS_ANSI_VAR_FONT:
+        case wxSYS_SYSTEM_FONT:
+        case wxSYS_DEVICE_DEFAULT_FONT:
+        case wxSYS_DEFAULT_GUI_FONT:
+        {
+            // FIXME_DFB
+            return wxFont(12,
+                          wxFONTFAMILY_DEFAULT,
+                          wxFONTSTYLE_NORMAL,
+                          wxFONTWEIGHT_NORMAL);
+        }
+
+        default:
+            wxFAIL_MSG( _T("unknown font type") );
+            return wxNullFont;
+    }
+}
+
+int wxSystemSettingsNative::GetMetric(wxSystemMetric index,
+                                      wxWindow* WXUNUSED(win))
+{
+    int val;
+
+    switch (index)
+    {
+        case wxSYS_SCREEN_X:
+            wxDisplaySize(&val, NULL);
+            return val;
+        case wxSYS_SCREEN_Y:
+            wxDisplaySize(NULL, &val);
+            return val;
+
+#warning "FIXME this"
+#if 0
+        case wxSYS_VSCROLL_X:
+        case wxSYS_HSCROLL_Y:
+            return 15;
+#endif
+
+        default:
+            wxFAIL_MSG( _T("unsupported metric") );
+            return -1;
+    }
+}
+
+bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
+{
+    switch (index)
+    {
+        case wxSYS_CAN_ICONIZE_FRAME:
+        case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
+        case wxSYS_TABLET_PRESENT:
+            return false;
+
+        default:
+            wxFAIL_MSG( _T("unknown feature") );
+            return false;
+    }
+}
diff --git a/src/dfb/toplevel.cpp b/src/dfb/toplevel.cpp
new file mode 100644 (file)
index 0000000..98b77b9
--- /dev/null
@@ -0,0 +1,457 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/toplevel.cpp
+// Purpose:     Top level window, abstraction of wxFrame and wxDialog
+// Author:      Vaclav Slavik
+// Created:     2006-08-10
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#include "wx/toplevel.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+    #include "wx/dynarray.h"
+#endif // WX_PRECOMP
+
+#include "wx/hashmap.h"
+#include "wx/evtloop.h"
+#include "wx/dfb/private.h"
+
+#define TRACE_EVENTS _T("events")
+#define TRACE_PAINT  _T("paint")
+
+// ============================================================================
+// globals
+// ============================================================================
+
+// mapping of DirectFB windows to wxTLWs:
+WX_DECLARE_HASH_MAP(DFBWindowID, wxTopLevelWindowDFB*,
+                    wxIntegerHash, wxIntegerEqual,
+                    wxDfbWindowsMap);
+static wxDfbWindowsMap gs_dfbWindowsMap;
+
+// ============================================================================
+// helpers
+// ============================================================================
+
+struct wxDfbPaintRequest
+{
+    wxDfbPaintRequest(const wxRect& rect, bool eraseBackground)
+        : m_rect(rect), m_eraseBackground(eraseBackground) {}
+    wxDfbPaintRequest(const wxDfbPaintRequest& r)
+        : m_rect(r.m_rect), m_eraseBackground(r.m_eraseBackground) {}
+
+    wxRect m_rect;
+    bool   m_eraseBackground;
+};
+
+WX_DEFINE_ARRAY_PTR(wxDfbPaintRequest*, wxDfbQueuedPaintRequests);
+
+// ============================================================================
+// wxTopLevelWindowDFB
+// ============================================================================
+
+// ----------------------------------------------------------------------------
+// creation & destruction
+// ----------------------------------------------------------------------------
+
+void wxTopLevelWindowDFB::Init()
+{
+    m_isShown = false;
+    m_isMaximized = false;
+    m_fsIsShowing = false;
+    m_sizeSet = false;
+    m_opacity = 255;
+    m_toPaint = new wxDfbQueuedPaintRequests;
+}
+
+bool wxTopLevelWindowDFB::Create(wxWindow *parent,
+                                 wxWindowID id,
+                                 const wxString& title,
+                                 const wxPoint& posOrig,
+                                 const wxSize& sizeOrig,
+                                 long style,
+                                 const wxString &name)
+{
+    m_tlw = this;
+
+    // always create a frame of some reasonable, even if arbitrary, size (at
+    // least for MSW compatibility)
+    wxSize size(sizeOrig);
+    if ( size.x == wxDefaultCoord || size.y == wxDefaultCoord )
+    {
+        wxSize sizeDefault = GetDefaultSize();
+        if ( size.x == wxDefaultCoord )
+            size.x = sizeDefault.x;
+        if ( size.y == wxDefaultCoord )
+            size.y = sizeDefault.y;
+    }
+
+    wxPoint pos(posOrig);
+    if ( pos.x == wxDefaultCoord )
+        pos.x = 0;
+    if ( pos.y == wxDefaultCoord )
+        pos.y = 0;
+
+    // create DirectFB window:
+    IDirectFBDisplayLayerPtr layer = wxDfbGetDisplayLayer();
+    wxCHECK_MSG( layer, false, _T("no display layer") );
+
+    DFBWindowDescription desc;
+    desc.flags = (DFBWindowDescriptionFlags)
+                   (DWDESC_CAPS |
+                    DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_POSX | DWDESC_POSY);
+    desc.caps = DWCAPS_DOUBLEBUFFER;
+    desc.posx = pos.x;
+    desc.posy = pos.y;
+    desc.width = size.x;
+    desc.height = size.y;
+    if ( !DFB_CALL( layer->CreateWindow(layer, &desc, &m_dfbwin) ) )
+        return false;
+
+    // add the new TLW to DFBWindowID->wxTLW map:
+    DFBWindowID winid;
+    if ( !DFB_CALL( m_dfbwin->GetID(m_dfbwin, &winid) ) )
+        return false;
+    gs_dfbWindowsMap[winid] = this;
+
+    // TLWs are created initially hidden:
+    if ( !DFB_CALL( m_dfbwin->SetOpacity(m_dfbwin, 0) ) )
+        return false;
+
+    wxWindow::Create(NULL, id, pos, size, style, name);
+
+    SetParent(parent);
+    if ( parent )
+        parent->AddChild(this);
+
+    wxTopLevelWindows.Append(this);
+    m_title = title;
+
+    if ( style & (wxSTAY_ON_TOP | wxPOPUP_WINDOW) )
+    {
+        DFB_CALL( m_dfbwin->SetStackingClass(m_dfbwin, DWSC_UPPER) );
+    }
+
+    // direct events in this window to the global event buffer:
+    DFB_CALL( m_dfbwin->AttachEventBuffer(
+                            m_dfbwin, wxEventLoop::GetDirectFBEventBuffer()) );
+
+    return true;
+}
+
+wxTopLevelWindowDFB::~wxTopLevelWindowDFB()
+{
+    m_isBeingDeleted = true;
+
+    wxTopLevelWindows.DeleteObject(this);
+
+    if ( wxTheApp->GetTopWindow() == this )
+        wxTheApp->SetTopWindow(NULL);
+
+    if ( wxTopLevelWindows.empty() && wxTheApp->GetExitOnFrameDelete() )
+    {
+        wxTheApp->ExitMainLoop();
+    }
+
+    WX_CLEAR_ARRAY(*m_toPaint);
+    wxDELETE(m_toPaint);
+
+    // remove the TLW from DFBWindowID->wxTLW map:
+    DFBWindowID winid;
+    if ( DFB_CALL( m_dfbwin->GetID(m_dfbwin, &winid) ) )
+        gs_dfbWindowsMap.erase(winid);
+}
+
+// ----------------------------------------------------------------------------
+// window size & position
+// ----------------------------------------------------------------------------
+
+void wxTopLevelWindowDFB::DoGetPosition(int *x, int *y) const
+{
+    DFB_CALL( m_dfbwin->GetPosition(m_dfbwin, x, y) );
+}
+
+void wxTopLevelWindowDFB::DoGetSize(int *width, int *height) const
+{
+    DFB_CALL( m_dfbwin->GetSize(m_dfbwin, width, height) );
+}
+
+void wxTopLevelWindowDFB::DoMoveWindow(int x, int y, int width, int height)
+{
+    wxPoint curpos = GetPosition();
+    if ( curpos.x != x || curpos.y != y )
+    {
+        DFB_CALL( m_dfbwin->MoveTo(m_dfbwin, x, y) );
+    }
+
+    wxSize cursize = GetSize();
+    if ( cursize.x != width || cursize.y != height )
+    {
+        DFB_CALL( m_dfbwin->Resize(m_dfbwin, width, height) );
+        // we must repaint the window after it changed size:
+        Refresh();
+    }
+}
+
+// ----------------------------------------------------------------------------
+// showing and hiding
+// ----------------------------------------------------------------------------
+
+#warning "FIXME: the rest of this file is almost same as for MGL, merge it"
+bool wxTopLevelWindowDFB::ShowFullScreen(bool show, long style)
+{
+    if (show == m_fsIsShowing) return false; // return what?
+
+    m_fsIsShowing = show;
+
+    if (show)
+    {
+        m_fsSaveStyle = m_windowStyle;
+        m_fsSaveFlag = style;
+        GetPosition(&m_fsSaveFrame.x, &m_fsSaveFrame.y);
+        GetSize(&m_fsSaveFrame.width, &m_fsSaveFrame.height);
+
+        if ( style & wxFULLSCREEN_NOCAPTION )
+            m_windowStyle &= ~wxCAPTION;
+        if ( style & wxFULLSCREEN_NOBORDER )
+            m_windowStyle = wxSIMPLE_BORDER;
+
+        int x, y;
+        wxDisplaySize(&x, &y);
+        SetSize(0, 0, x, y);
+    }
+    else
+    {
+        m_windowStyle = m_fsSaveStyle;
+        SetSize(m_fsSaveFrame.x, m_fsSaveFrame.y,
+                m_fsSaveFrame.width, m_fsSaveFrame.height);
+    }
+
+    return true;
+}
+
+bool wxTopLevelWindowDFB::Show(bool show)
+{
+    if ( !wxTopLevelWindowBase::Show(show) )
+        return false;
+
+    // hide/show the window by setting its opacity to 0/full:
+    DFB_CALL( m_dfbwin->SetOpacity(m_dfbwin, show ? m_opacity : 0) );
+
+    // If this is the first time Show was called, send size event,
+    // so that the frame can adjust itself (think auto layout or single child)
+    if ( !m_sizeSet )
+    {
+        m_sizeSet = true;
+        wxSizeEvent event(GetSize(), GetId());
+        event.SetEventObject(this);
+        GetEventHandler()->ProcessEvent(event);
+    }
+
+    // FIXME_DFB: do this at all?
+    if ( show && AcceptsFocus() )
+        SetFocus();
+        // FIXME_DFB -- don't do this for popup windows?
+
+    return true;
+}
+
+bool wxTopLevelWindowDFB::SetTransparent(wxByte alpha)
+{
+    if ( IsShown() )
+    {
+        if ( !DFB_CALL( m_dfbwin->SetOpacity(m_dfbwin, alpha) ) )
+            return false;
+    }
+
+    m_opacity = alpha;
+    return true;
+}
+
+// ----------------------------------------------------------------------------
+// maximize, minimize etc.
+// ----------------------------------------------------------------------------
+
+void wxTopLevelWindowDFB::Maximize(bool maximize)
+{
+    int x, y, w, h;
+    wxClientDisplayRect(&x, &y, &w, &h);
+
+    if ( maximize && !m_isMaximized )
+    {
+        m_isMaximized = true;
+
+        GetPosition(&m_savedFrame.x, &m_savedFrame.y);
+        GetSize(&m_savedFrame.width, &m_savedFrame.height);
+
+        SetSize(x, y, w, h);
+    }
+    else if ( !maximize && m_isMaximized )
+    {
+        m_isMaximized = false;
+        SetSize(m_savedFrame.x, m_savedFrame.y,
+                m_savedFrame.width, m_savedFrame.height);
+    }
+}
+
+bool wxTopLevelWindowDFB::IsMaximized() const
+{
+    return m_isMaximized;
+}
+
+void wxTopLevelWindowDFB::Restore()
+{
+    if ( IsMaximized() )
+    {
+        Maximize(false);
+    }
+}
+
+void wxTopLevelWindowDFB::Iconize(bool WXUNUSED(iconize))
+{
+    wxFAIL_MSG(wxT("Iconize not supported under wxDFB"));
+}
+
+bool wxTopLevelWindowDFB::IsIconized() const
+{
+    return false;
+}
+
+
+// ----------------------------------------------------------------------------
+// surfaces and painting
+// ----------------------------------------------------------------------------
+
+IDirectFBSurfacePtr wxTopLevelWindowDFB::ObtainDfbSurface() const
+{
+    IDirectFBSurfacePtr surface;
+    DFB_CALL( m_dfbwin->GetSurface(m_dfbwin, &surface) );
+    return surface;
+}
+
+void wxTopLevelWindowDFB::HandleQueuedPaintRequests()
+{
+    wxDfbQueuedPaintRequests& toPaint = *m_toPaint;
+    if ( toPaint.empty() )
+        return; // nothing to do
+
+    // process queued paint requests:
+    wxRect winRect(wxPoint(0, 0), GetSize());
+    wxRect paintedRect;
+
+    size_t cnt = toPaint.size();
+    for ( size_t i = 0; i < cnt; ++i )
+    {
+        const wxDfbPaintRequest& request = *toPaint[i];
+
+        wxRect clipped(request.m_rect);
+
+        wxLogTrace(TRACE_PAINT,
+                   _T("%p ('%s'): processing paint request [x=%i,y=%i,w=%i,h=%i]"),
+                   this, GetName().c_str(),
+                   clipped.x, clipped.y, clipped.width, clipped.height);
+
+        clipped.Intersect(winRect);
+        if ( clipped.IsEmpty() )
+            continue; // nothing to refresh
+
+        PaintWindow(clipped, request.m_eraseBackground);
+
+        // remember rectangle covering all repainted areas:
+        if ( paintedRect.IsEmpty() )
+            paintedRect = clipped;
+        else
+            paintedRect.Union(clipped);
+    }
+
+    WX_CLEAR_ARRAY(toPaint);
+
+    if ( paintedRect.IsEmpty() )
+        return; // no painting occurred, no need to flip
+
+    // flip the surface to make the changes visible:
+    DFBRegion r = {paintedRect.GetLeft(), paintedRect.GetTop(),
+                   paintedRect.GetRight(), paintedRect.GetBottom()};
+    DFBRegion *rptr = (winRect == paintedRect) ? NULL : &r;
+
+    IDirectFBSurfacePtr surface(GetDfbSurface());
+    DFB_CALL( surface->Flip(surface, rptr, DSFLIP_NONE) );
+}
+
+void wxTopLevelWindowDFB::DoRefreshRect(const wxRect& rect, bool eraseBack)
+{
+    // defer paiting until idle time or until Update() is called:
+    m_toPaint->push_back(new wxDfbPaintRequest(rect, eraseBack));
+}
+
+void wxTopLevelWindowDFB::Update()
+{
+    HandleQueuedPaintRequests();
+}
+
+// ---------------------------------------------------------------------------
+// events handling
+// ---------------------------------------------------------------------------
+
+/* static */
+void wxTopLevelWindowDFB::HandleDFBWindowEvent(const wxDFBWindowEvent& event_)
+{
+    const DFBWindowEvent& event = event_;
+
+    if ( gs_dfbWindowsMap.find(event.window_id) == gs_dfbWindowsMap.end() )
+    {
+        wxLogTrace(TRACE_EVENTS,
+                   _T("received event for unknown DirectFB window, ignoring"));
+        return;
+    }
+
+    wxTopLevelWindowDFB *tlw = gs_dfbWindowsMap[event.window_id];
+    wxWindow *recipient = NULL;
+    void (wxWindow::*handlerFunc)(const wxDFBWindowEvent&) = NULL;
+
+    switch ( event.type )
+    {
+        case DWET_KEYDOWN:
+        case DWET_KEYUP:
+        {
+            recipient = wxWindow::FindFocus();
+            handlerFunc = &wxWindowDFB::HandleKeyEvent;
+            break;
+        }
+
+        case DWET_NONE:
+        case DWET_ALL:
+        {
+            wxFAIL_MSG( _T("invalid event type") );
+            break;
+        }
+    }
+
+    if ( !recipient )
+    {
+        wxLogTrace(TRACE_EVENTS, _T("ignoring event: no recipient window"));
+        return;
+    }
+
+    wxCHECK_RET( recipient && recipient->GetTLW() == tlw,
+                 _T("event recipient not in TLW which received the event") );
+
+    // process the event:
+    (recipient->*handlerFunc)(event_);
+}
+
+// ---------------------------------------------------------------------------
+// idle events processing
+// ---------------------------------------------------------------------------
+
+void wxTopLevelWindowDFB::OnInternalIdle()
+{
+    wxTopLevelWindowBase::OnInternalIdle();
+    HandleQueuedPaintRequests();
+}
diff --git a/src/dfb/utils.cpp b/src/dfb/utils.cpp
new file mode 100644 (file)
index 0000000..e9e8d8e
--- /dev/null
@@ -0,0 +1,200 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/utils.cpp
+// Purpose:     Miscellaneous utility functions and classes
+// Author:      Vaclav Slavik
+// Created:     2006-08-08
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/utils.h"
+#include "wx/apptrait.h"
+#include "wx/unix/execute.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/app.h"
+#endif
+
+#include "wx/dfb/private.h"
+#include <directfb_version.h>
+
+// ----------------------------------------------------------------------------
+// toolkit info
+// ----------------------------------------------------------------------------
+
+wxPortId wxGUIAppTraits::GetToolkitVersion(int *verMaj, int *verMin) const
+{
+    if ( verMaj ) *verMaj = DIRECTFB_MAJOR_VERSION;
+    if ( verMin ) *verMaj = DIRECTFB_MINOR_VERSION;
+
+    return wxPORT_DFB;
+}
+
+// ----------------------------------------------------------------------------
+// display characteristics
+// ----------------------------------------------------------------------------
+
+bool wxColourDisplay()
+{
+    #warning "FIXME: wxColourDisplay"
+    return true;
+}
+
+int wxDisplayDepth()
+{
+    return wxTheApp->GetDisplayMode().bpp;
+}
+
+void wxDisplaySize(int *width, int *height)
+{
+    wxVideoMode mode(wxTheApp->GetDisplayMode());
+    if ( width ) *width = mode.w;
+    if ( height ) *height = mode.h;
+}
+
+void wxDisplaySizeMM(int *width, int *height)
+{
+    // FIXME: there's no way to get physical resolution using the DirectDB
+    //        API, we hardcode a commonly used value of 72dpi
+    #define DPI          72.0
+    #define PX_TO_MM(x)  (int(((x) / DPI) * inches2mm))
+
+    wxDisplaySize(width, height);
+    if ( width ) *width = PX_TO_MM(*width);
+    if ( height ) *height = PX_TO_MM(*height);
+
+    #undef DPI
+    #undef PX_TO_MM
+}
+
+void wxClientDisplayRect(int *x, int *y, int *width, int *height)
+{
+    // return desktop dimensions minus any panels, menus, trays:
+    if (x) *x = 0;
+    if (y) *y = 0;
+    wxDisplaySize(width, height);
+}
+
+//-----------------------------------------------------------------------------
+// surface manipulation helpers
+//-----------------------------------------------------------------------------
+
+IDirectFBSurfacePtr wxDfbCloneSurface(const IDirectFBSurfacePtr& s,
+                                      wxDfbCloneSurfaceMode mode)
+{
+    if ( !s )
+        return NULL;
+
+    DFBSurfaceDescription desc;
+    desc.flags = (DFBSurfaceDescriptionFlags)(
+            DSDESC_CAPS | DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT);
+    s->GetCapabilities(s, &desc.caps);
+    s->GetSize(s, &desc.width, &desc.height);
+    s->GetPixelFormat(s, &desc.pixelformat);
+
+    IDirectFBPtr dfb(wxTheApp->GetDirectFBInterface());
+
+    IDirectFBSurfacePtr snew;
+    if ( !DFB_CALL( dfb->CreateSurface(dfb, &desc, &snew) ) )
+        return NULL;
+
+    IDirectFBPalettePtr pal;
+    if ( s->GetPalette(s, &pal) == DFB_OK )
+    {
+        if ( !DFB_CALL( snew->SetPalette(snew, pal) ) )
+            return NULL;
+    }
+
+    if ( mode == wxDfbCloneSurface_CopyPixels )
+    {
+        if ( !DFB_CALL( snew->SetBlittingFlags(snew, DSBLIT_NOFX) ) )
+            return NULL;
+        if ( !DFB_CALL( snew->Blit(snew, s, NULL, 0, 0) ) )
+            return NULL;
+    }
+
+    return snew;
+}
+
+int wxDfbGetSurfaceDepth(const IDirectFBSurfacePtr& s)
+{
+    wxCHECK_MSG( s, -1, _T("invalid surface") );
+
+    DFBSurfacePixelFormat format = DSPF_UNKNOWN;
+
+    if ( !DFB_CALL( s->GetPixelFormat(s, &format) ) )
+        return -1;
+
+    return DFB_BITS_PER_PIXEL(format);
+}
+
+IDirectFBDisplayLayerPtr wxDfbGetDisplayLayer()
+{
+    IDirectFBPtr dfb(wxTheApp->GetDirectFBInterface());
+
+    IDirectFBDisplayLayerPtr layer;
+    if ( !DFB_CALL( dfb->GetDisplayLayer(dfb, DLID_PRIMARY, &layer) ) )
+        return NULL;
+
+    return layer;
+}
+
+IDirectFBSurfacePtr wxDfbGetPrimarySurface()
+{
+    IDirectFBDisplayLayerPtr layer(wxDfbGetDisplayLayer());
+    IDirectFBSurfacePtr surface;
+    DFB_CALL( layer->GetSurface(layer, &surface) );
+    return surface;
+}
+
+
+//-----------------------------------------------------------------------------
+// mouse
+//-----------------------------------------------------------------------------
+
+void wxGetMousePosition(int *x, int *y)
+{
+    IDirectFBDisplayLayerPtr layer(wxDfbGetDisplayLayer());
+    DFB_CALL( layer->GetCursorPosition(layer, x, y) );
+}
+
+wxPoint wxGetMousePosition()
+{
+    wxPoint pt;
+    wxGetMousePosition(&pt.x, &pt.y);
+    return pt;
+}
+
+//-----------------------------------------------------------------------------
+// keyboard
+//-----------------------------------------------------------------------------
+
+bool wxGetKeyState(wxKeyCode key)
+{
+    wxASSERT_MSG(key != WXK_LBUTTON && key != WXK_RBUTTON && key != WXK_MBUTTON,
+                 _T("can't use wxGetKeyState() for mouse buttons"));
+
+    return false; // FIXME
+}
+
+//----------------------------------------------------------------------------
+// misc.
+//----------------------------------------------------------------------------
+
+void wxBell()
+{
+}
+
+int wxAddProcessCallback(wxEndProcessData *proc_data, int fd)
+{
+    wxFAIL_MSG( _T("wxAddProcessCallback not implemented") );
+    return 0;
+}
diff --git a/src/dfb/window.cpp b/src/dfb/window.cpp
new file mode 100644 (file)
index 0000000..532bf24
--- /dev/null
@@ -0,0 +1,993 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name:        src/dfb/window.cpp
+// Purpose:     wxWindow
+// Author:      Vaclav Slavik
+//              (based on GTK, MSW, MGL implementations)
+// Created:     2006-80-10
+// RCS-ID:      $Id$
+// Copyright:   (c) 2006 REA Elektronik GmbH
+// Licence:     wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+// ===========================================================================
+// declarations
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// headers
+// ---------------------------------------------------------------------------
+
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
+#ifdef __BORLANDC__
+    #pragma hdrstop
+#endif
+
+#include "wx/window.h"
+
+#ifndef WX_PRECOMP
+    #include "wx/dcclient.h"
+#endif
+
+#include "wx/caret.h"
+
+#include "wx/dfb/private.h"
+
+#define TRACE_EVENTS _T("events")
+#define TRACE_PAINT  _T("paint")
+
+// ===========================================================================
+// implementation
+// ===========================================================================
+
+// ---------------------------------------------------------------------------
+// global variables
+// ---------------------------------------------------------------------------
+
+// the window that has keyboard focus:
+static wxWindowDFB *gs_focusedWindow = NULL;
+// the window that is about to be focused after currently focused
+// one looses focus:
+static wxWindow *gs_toBeFocusedWindow = NULL;
+// the window that has mouse capture
+static wxWindowDFB *gs_mouseCapture = NULL;
+
+// ---------------------------------------------------------------------------
+// event tables
+// ---------------------------------------------------------------------------
+
+// in wxUniv this class is abstract because it doesn't have DoPopupMenu()
+IMPLEMENT_ABSTRACT_CLASS(wxWindowDFB, wxWindowBase)
+
+BEGIN_EVENT_TABLE(wxWindowDFB, wxWindowBase)
+END_EVENT_TABLE()
+
+// ----------------------------------------------------------------------------
+// constructors and such
+// ----------------------------------------------------------------------------
+
+void wxWindowDFB::Init()
+{
+    m_isShown = true;
+    m_frozenness = 0;
+    m_tlw = NULL;
+}
+
+// Destructor
+wxWindowDFB::~wxWindowDFB()
+{
+    SendDestroyEvent();
+
+    m_isBeingDeleted = true;
+
+    if ( gs_mouseCapture == this )
+        ReleaseMouse();
+
+#warning "FIXME: what to do with gs_activeFrame here and elsewhere?"
+#if 0
+    if (gs_activeFrame == this)
+    {
+        gs_activeFrame = NULL;
+        // activate next frame in Z-order:
+        if ( m_wnd->prev )
+        {
+            wxWindowDFB *win = (wxWindowDFB*)m_wnd->prev->userData;
+            win->SetFocus();
+        }
+        else if ( m_wnd->next )
+        {
+            wxWindowDFB *win = (wxWindowDFB*)m_wnd->next->userData;
+            win->SetFocus();
+        }
+    }
+#endif
+
+    if ( gs_focusedWindow == this )
+        KillFocus();
+
+    DestroyChildren();
+}
+
+// real construction (Init() must have been called before!)
+bool wxWindowDFB::Create(wxWindow *parent,
+                         wxWindowID id,
+                         const wxPoint& pos,
+                         const wxSize& size,
+                         long style,
+                         const wxString& name)
+{
+    if ( !m_tlw && parent )
+        m_tlw = parent->GetTLW();
+
+    if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
+        return false;
+
+    if ( parent )
+        parent->AddChild(this);
+
+    int x, y, w, h;
+    x = pos.x, y = pos.y;
+    if ( x == -1  ) x = 0;
+    if ( y == -1 ) y = 0;
+    w = WidthDefault(size.x);
+    h = HeightDefault(size.y);
+    SetSize(x, y, w, h);
+
+    return true;
+}
+
+// ---------------------------------------------------------------------------
+// surface access
+// ---------------------------------------------------------------------------
+
+IDirectFBSurfacePtr wxWindowDFB::ObtainDfbSurface() const
+{
+    wxCHECK_MSG( m_parent, NULL, _T("parentless window?") );
+
+    IDirectFBSurfacePtr parentSurface(m_parent->GetDfbSurface());
+    wxCHECK_MSG( parentSurface, NULL, _T("invalid parent surface") );
+
+    wxRect r(GetRect());
+    AdjustForParentClientOrigin(r.x, r.y, 0);
+    DFBRectangle rect = { r.x, r.y, r.width, r.height };
+
+    IDirectFBSurfacePtr surface;
+    DFB_CALL( parentSurface->GetSubSurface(parentSurface, &rect, &surface) );
+    return surface;
+}
+
+IDirectFBSurfacePtr wxWindowDFB::GetDfbSurface()
+{
+    if ( !m_surface )
+    {
+        m_surface = ObtainDfbSurface();
+        wxASSERT_MSG( m_surface, _T("invalid DirectFB surface") );
+    }
+
+    return m_surface;
+}
+
+void wxWindowDFB::InvalidateDfbSurface()
+{
+    m_surface = NULL;
+}
+
+// ---------------------------------------------------------------------------
+// basic operations
+// ---------------------------------------------------------------------------
+
+void wxWindowDFB::SetFocus()
+{
+    if ( gs_focusedWindow == this ) return;
+
+    wxWindowDFB *oldFocusedWindow = gs_focusedWindow;
+
+    if ( gs_focusedWindow )
+    {
+        gs_toBeFocusedWindow = (wxWindow*)this;
+        gs_focusedWindow->KillFocus();
+        gs_toBeFocusedWindow = NULL;
+    }
+
+#warning "FIXME: implement in terms of DWET_{GOT,LOST}FOCUS"
+
+    IDirectFBWindowPtr dfbwin(m_tlw->GetDirectFBWindow());
+#warning "FIXME: RequestFocus() may only be called on visible TLW"
+    if ( !DFB_CALL( dfbwin->RequestFocus(dfbwin) ) )
+        return;
+
+    gs_focusedWindow = this;
+
+    #warning "FIXME: keep this or not? not, think multiapp core"
+#if 0
+    wxWindowDFB *active = wxGetTopLevelParent((wxWindow*)this);
+    if ( !(m_windowStyle & wxPOPUP_WINDOW) && active != gs_activeFrame )
+    {
+        if ( gs_activeFrame )
+        {
+            wxActivateEvent event(wxEVT_ACTIVATE, false, gs_activeFrame->GetId());
+            event.SetEventObject(gs_activeFrame);
+            gs_activeFrame->GetEventHandler()->ProcessEvent(event);
+        }
+
+        gs_activeFrame = active;
+        wxActivateEvent event(wxEVT_ACTIVATE, true, gs_activeFrame->GetId());
+        event.SetEventObject(gs_activeFrame);
+        gs_activeFrame->GetEventHandler()->ProcessEvent(event);
+    }
+#endif
+
+    wxFocusEvent event(wxEVT_SET_FOCUS, GetId());
+    event.SetEventObject(this);
+    event.SetWindow((wxWindow*)oldFocusedWindow);
+    GetEventHandler()->ProcessEvent(event);
+
+#if wxUSE_CARET
+    // caret needs to be informed about focus change
+    wxCaret *caret = GetCaret();
+    if ( caret )
+        caret->OnSetFocus();
+#endif // wxUSE_CARET
+}
+
+void wxWindowDFB::KillFocus()
+{
+    if ( gs_focusedWindow != this ) return;
+    gs_focusedWindow = NULL;
+
+    if ( m_isBeingDeleted ) return;
+
+#if wxUSE_CARET
+    // caret needs to be informed about focus change
+    wxCaret *caret = GetCaret();
+    if ( caret )
+        caret->OnKillFocus();
+#endif // wxUSE_CARET
+
+    wxFocusEvent event(wxEVT_KILL_FOCUS, GetId());
+    event.SetEventObject(this);
+    event.SetWindow(gs_toBeFocusedWindow);
+    GetEventHandler()->ProcessEvent(event);
+}
+
+// ----------------------------------------------------------------------------
+// this wxWindowBase function is implemented here (in platform-specific file)
+// because it is static and so couldn't be made virtual
+// ----------------------------------------------------------------------------
+wxWindow *wxWindowBase::DoFindFocus()
+{
+    return (wxWindow*)gs_focusedWindow;
+}
+
+bool wxWindowDFB::Show(bool show)
+{
+    if ( !wxWindowBase::Show(show) )
+        return false;
+
+    // Unlike Refresh(), DoRefreshWindow() doesn't check visibility, so
+    // call it to force refresh of either this window (if showing) or its
+    // parent area at the place of this window (if hiding):
+    DoRefreshWindow();
+
+#warning "FIXME: all of this must be implemented for DFB"
+#if 0
+    DFB_wmShowWindow(m_wnd, show);
+
+    if (!show && gs_activeFrame == this)
+    {
+        // activate next frame in Z-order:
+        if ( m_wnd->prev )
+        {
+            wxWindowDFB *win = (wxWindowDFB*)m_wnd->prev->userData;
+            win->SetFocus();
+        }
+        else if ( m_wnd->next )
+        {
+            wxWindowDFB *win = (wxWindowDFB*)m_wnd->next->userData;
+            win->SetFocus();
+        }
+        else
+        {
+            gs_activeFrame = NULL;
+        }
+    }
+#endif
+
+    return true;
+}
+
+// Raise the window to the top of the Z order
+void wxWindowDFB::Raise()
+{
+    wxFAIL_MSG( _T("Raise() not implemented") );
+}
+
+// Lower the window to the bottom of the Z order
+void wxWindowDFB::Lower()
+{
+    wxFAIL_MSG( _T("Lower() not implemented") );
+}
+
+void wxWindowDFB::DoCaptureMouse()
+{
+#warning "implement this"
+#if 0
+    if ( gs_mouseCapture )
+        DFB_wmUncaptureEvents(gs_mouseCapture->m_wnd, wxDFB_CAPTURE_MOUSE);
+#endif
+    gs_mouseCapture = this;
+#if 0
+    DFB_wmCaptureEvents(m_wnd, EVT_MOUSEEVT, wxDFB_CAPTURE_MOUSE);
+#endif
+}
+
+void wxWindowDFB::DoReleaseMouse()
+{
+    wxASSERT_MSG( gs_mouseCapture == this, wxT("attempt to release mouse, but this window hasn't captured it") );
+
+#warning "implement this"
+#if 0
+    DFB_wmUncaptureEvents(m_wnd, wxDFB_CAPTURE_MOUSE);
+#endif
+    gs_mouseCapture = NULL;
+}
+
+/* static */ wxWindow *wxWindowBase::GetCapture()
+{
+    return (wxWindow*)gs_mouseCapture;
+}
+
+bool wxWindowDFB::SetCursor(const wxCursor& cursor)
+{
+    if ( !wxWindowBase::SetCursor(cursor) )
+    {
+        // no change
+        return false;
+    }
+
+#warning "implement this"
+#if 0
+    if ( m_cursor.Ok() )
+        DFB_wmSetWindowCursor(m_wnd, *m_cursor.GetDFBCursor());
+    else
+        DFB_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetDFBCursor());
+#endif
+
+    return true;
+}
+
+void wxWindowDFB::WarpPointer(int x, int y)
+{
+    int w, h;
+    wxDisplaySize(&w, &h);
+
+    ClientToScreen(&x, &y);
+    if ( x < 0 ) x = 0;
+    if ( y < 0 ) y = 0;
+    if ( x >= w ) x = w-1;
+    if ( y >= h ) y = h-1;
+
+    IDirectFBDisplayLayerPtr layer = wxDfbGetDisplayLayer();
+    wxCHECK_RET( layer, _T("no display layer") );
+
+    layer->WarpCursor(layer, x, y);
+}
+
+// Set this window to be the child of 'parent'.
+bool wxWindowDFB::Reparent(wxWindowBase *parent)
+{
+    if ( !wxWindowBase::Reparent(parent) )
+        return false;
+
+#warning "implement this"
+    wxFAIL_MSG( _T("reparenting not yet implemented") );
+
+    return true;
+}
+
+// ---------------------------------------------------------------------------
+// moving and resizing
+// ---------------------------------------------------------------------------
+
+// Get total size
+void wxWindowDFB::DoGetSize(int *x, int *y) const
+{
+    if (x) *x = m_rect.width;
+    if (y) *y = m_rect.height;
+}
+
+void wxWindowDFB::DoGetPosition(int *x, int *y) const
+{
+    if (x) *x = m_rect.x;
+    if (y) *y = m_rect.y;
+}
+
+static wxPoint GetScreenPosOfClientOrigin(const wxWindowDFB *win)
+{
+    wxCHECK_MSG( win, wxPoint(0, 0), _T("no window provided") );
+
+    wxPoint pt(win->GetPosition() + win->GetClientAreaOrigin());
+
+    if ( !win->IsTopLevel() )
+        pt += GetScreenPosOfClientOrigin(win->GetParent());
+
+    return pt;
+}
+
+void wxWindowDFB::DoScreenToClient(int *x, int *y) const
+{
+    wxPoint o = GetScreenPosOfClientOrigin(this);
+
+    if (x) *x -= o.x;
+    if (y) *y -= o.y;
+}
+
+void wxWindowDFB::DoClientToScreen(int *x, int *y) const
+{
+    wxPoint o = GetScreenPosOfClientOrigin(this);
+
+    if (x) *x += o.x;
+    if (y) *y += o.y;
+}
+
+// Get size *available for subwindows* i.e. excluding menu bar etc.
+void wxWindowDFB::DoGetClientSize(int *x, int *y) const
+{
+    DoGetSize(x, y);
+}
+
+void wxWindowDFB::DoMoveWindow(int x, int y, int width, int height)
+{
+    wxRect oldpos(m_rect);
+    wxRect newpos(x, y, width, height);
+
+    m_rect = newpos;
+
+    // window's position+size changed and so did the subsurface that covers it
+    InvalidateDfbSurface();
+
+    if ( IsShown() )
+    {
+        // queue both former and new position of the window for repainting:
+        wxWindow *parent = GetParent();
+        wxPoint origin(parent->GetClientAreaOrigin());
+        oldpos.Offset(origin);
+        newpos.Offset(origin);
+        parent->RefreshRect(oldpos);
+        parent->RefreshRect(newpos);
+    }
+}
+
+// set the size of the window: if the dimensions are positive, just use them,
+// but if any of them is equal to -1, it means that we must find the value for
+// it ourselves (unless sizeFlags contains wxSIZE_ALLOW_MINUS_ONE flag, in
+// which case -1 is a valid value for x and y)
+//
+// If sizeFlags contains wxSIZE_AUTO_WIDTH/HEIGHT flags (default), we calculate
+// the width/height to best suit our contents, otherwise we reuse the current
+// width/height
+void wxWindowDFB::DoSetSize(int x, int y, int width, int height, int sizeFlags)
+{
+    // get the current size and position...
+    int currentX, currentY;
+    GetPosition(&currentX, &currentY);
+    int currentW,currentH;
+    GetSize(&currentW, &currentH);
+
+    if ( x == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
+        x = currentX;
+    if ( y == -1 && !(sizeFlags & wxSIZE_ALLOW_MINUS_ONE) )
+        y = currentY;
+
+    // ... and don't do anything (avoiding flicker) if it's already ok
+    if ( x == currentX && y == currentY &&
+         width == currentW && height == currentH )
+    {
+        return;
+    }
+
+    AdjustForParentClientOrigin(x, y, sizeFlags);
+
+    wxSize size(-1, -1);
+    if ( width == -1 )
+    {
+        if ( sizeFlags & wxSIZE_AUTO_WIDTH )
+        {
+            size = DoGetBestSize();
+            width = size.x;
+        }
+        else
+        {
+            // just take the current one
+            width = currentW;
+        }
+    }
+
+    if ( height == -1 )
+    {
+        if ( sizeFlags & wxSIZE_AUTO_HEIGHT )
+        {
+            if ( size.x == -1 )
+            {
+                size = DoGetBestSize();
+            }
+            //else: already called DoGetBestSize() above
+
+            height = size.y;
+        }
+        else
+        {
+            // just take the current one
+            height = currentH;
+        }
+    }
+
+    int maxWidth = GetMaxWidth(),
+        minWidth = GetMinWidth(),
+        maxHeight = GetMaxHeight(),
+        minHeight = GetMinHeight();
+
+    if ( minWidth != -1 && width < minWidth ) width = minWidth;
+    if ( maxWidth != -1 && width > maxWidth ) width = maxWidth;
+    if ( minHeight != -1 && height < minHeight ) height = minHeight;
+    if ( maxHeight != -1 && height > maxHeight ) height = maxHeight;
+
+    if ( m_rect.x != x || m_rect.y != y ||
+         m_rect.width != width || m_rect.height != height )
+    {
+        DoMoveWindow(x, y, width, height);
+
+        wxSize newSize(width, height);
+        wxSizeEvent event(newSize, GetId());
+        event.SetEventObject(this);
+        GetEventHandler()->ProcessEvent(event);
+    }
+}
+
+void wxWindowDFB::DoSetClientSize(int width, int height)
+{
+    SetSize(width, height);
+}
+
+// ---------------------------------------------------------------------------
+// text metrics
+// ---------------------------------------------------------------------------
+
+int wxWindowDFB::GetCharHeight() const
+{
+    wxWindowDC dc((wxWindow*)this);
+    return dc.GetCharHeight();
+}
+
+int wxWindowDFB::GetCharWidth() const
+{
+    wxWindowDC dc((wxWindow*)this);
+    return dc.GetCharWidth();
+}
+
+void wxWindowDFB::GetTextExtent(const wxString& string,
+                             int *x, int *y,
+                             int *descent, int *externalLeading,
+                             const wxFont *theFont) const
+{
+    wxWindowDC dc((wxWindow*)this);
+    dc.GetTextExtent(string, x, y, descent, externalLeading, (wxFont*)theFont);
+}
+
+
+// ---------------------------------------------------------------------------
+// painting
+// ---------------------------------------------------------------------------
+
+void wxWindowDFB::Clear()
+{
+    wxClientDC dc((wxWindow *)this);
+    wxBrush brush(GetBackgroundColour(), wxSOLID);
+    dc.SetBackground(brush);
+    dc.Clear();
+}
+
+void wxWindowDFB::Refresh(bool eraseBack, const wxRect *rect)
+{
+    if ( !IsShown() || IsFrozen() )
+        return;
+
+    if ( rect )
+        DoRefreshRect(*rect, eraseBack);
+    else
+        DoRefreshWindow(eraseBack);
+}
+
+void wxWindowDFB::DoRefreshWindow(bool eraseBack)
+{
+    DoRefreshRect(wxRect(wxPoint(0, 0), GetSize()), eraseBack);
+}
+
+void wxWindowDFB::DoRefreshRect(const wxRect& rect, bool eraseBack)
+{
+    wxWindow *parent = GetParent();
+    wxCHECK_RET( parent, _T("no parent") );
+
+    // convert the refresh rectangle to parent's coordinates and
+    // recursively refresh the parent:
+    wxRect r(rect);
+    r.Offset(GetPosition());
+    r.Offset(parent->GetClientAreaOrigin());
+
+    parent->DoRefreshRect(r, eraseBack);
+}
+
+void wxWindowDFB::Update()
+{
+    if ( !IsShown() || IsFrozen() )
+        return;
+
+    GetParent()->Update();
+}
+
+void wxWindowDFB::Freeze()
+{
+    m_frozenness++;
+}
+
+void wxWindowDFB::Thaw()
+{
+    wxASSERT_MSG( IsFrozen(), _T("Thaw() without matching Freeze()") );
+
+    if ( --m_frozenness == 0 )
+    {
+        if ( IsShown() )
+            Refresh();
+    }
+}
+
+void wxWindowDFB::PaintWindow(const wxRect& rect, bool eraseBackground)
+{
+    if ( IsFrozen() )
+        return; // don't paint anything if the window is frozen
+
+    wxLogTrace(TRACE_PAINT,
+               _T("%p ('%s'): paiting region [x=%i,y=%i,w=%i,h=%i]"),
+               this, GetName().c_str(),
+               rect.x, rect.y, rect.width, rect.height);
+
+    m_updateRegion = rect;
+
+    // FIXME_DFB: don't waste time rendering the area if it's fully covered
+    //            by some children, go directly to rendering the children
+
+#if wxUSE_CARET
+    // must hide caret temporarily, otherwise we'd get rendering artifacts
+    wxCaret *caret = GetCaret();
+    if ( caret )
+        caret->Hide();
+#endif // wxUSE_CARET
+
+    if ( eraseBackground )
+    {
+        wxWindowDC dc((wxWindow*)this);
+        wxEraseEvent eventEr(m_windowId, &dc);
+        eventEr.SetEventObject(this);
+        GetEventHandler()->ProcessEvent(eventEr);
+    }
+
+    wxNcPaintEvent eventNc(GetId());
+    eventNc.SetEventObject(this);
+    GetEventHandler()->ProcessEvent(eventNc);
+
+    wxPaintEvent eventPt(GetId());
+    eventPt.SetEventObject(this);
+    GetEventHandler()->ProcessEvent(eventPt);
+
+#if wxUSE_CARET
+    if ( caret )
+        caret->Show();
+#endif // wxUSE_CARET
+
+    wxPoint origin = GetClientAreaOrigin();
+    wxWindowList& children = GetChildren();
+    for ( wxWindowList::iterator i = children.begin();
+          i != children.end(); ++i )
+    {
+        wxWindow *child = *i;
+
+        // compute child's area to repaint
+        wxRect childrect(child->GetRect());
+        childrect.Offset(origin);
+        childrect.Intersect(rect);
+        if ( childrect.IsEmpty() )
+            continue;
+
+        // and repaint it:
+        wxPoint childpos(child->GetPosition());
+        childrect.Offset(-childpos.x, -childpos.y);
+        childrect.Offset(-origin.x, -origin.y);
+        child->PaintWindow(childrect, eraseBackground);
+    }
+
+    m_updateRegion.Clear();
+}
+
+
+// ---------------------------------------------------------------------------
+// events handling
+// ---------------------------------------------------------------------------
+
+#define KEY(dfb, wx)                                                \
+    case dfb:                                                       \
+          wxLogTrace(TRACE_EVENTS,                                  \
+                     _T("key " #dfb " mapped to " #wx));            \
+          return wx
+
+// returns translated keycode, i.e. the one for KEYUP/KEYDOWN where 'a'..'z' is
+// translated to 'A'..'Z'
+static long GetTranslatedKeyCode(DFBInputDeviceKeyIdentifier key_id)
+{
+    switch ( key_id )
+    {
+        KEY(DIKI_UNKNOWN,           0);
+
+        KEY(DIKI_A,                 'A');
+        KEY(DIKI_B,                 'B');
+        KEY(DIKI_C,                 'C');
+        KEY(DIKI_D,                 'D');
+        KEY(DIKI_E,                 'E');
+        KEY(DIKI_F,                 'F');
+        KEY(DIKI_G,                 'G');
+        KEY(DIKI_H,                 'H');
+        KEY(DIKI_I,                 'I');
+        KEY(DIKI_J,                 'J');
+        KEY(DIKI_K,                 'K');
+        KEY(DIKI_L,                 'L');
+        KEY(DIKI_M,                 'M');
+        KEY(DIKI_N,                 'N');
+        KEY(DIKI_O,                 'O');
+        KEY(DIKI_P,                 'P');
+        KEY(DIKI_Q,                 'Q');
+        KEY(DIKI_R,                 'R');
+        KEY(DIKI_S,                 'S');
+        KEY(DIKI_T,                 'T');
+        KEY(DIKI_U,                 'U');
+        KEY(DIKI_V,                 'V');
+        KEY(DIKI_W,                 'W');
+        KEY(DIKI_X,                 'X');
+        KEY(DIKI_Y,                 'Y');
+        KEY(DIKI_Z,                 'Z');
+
+        KEY(DIKI_0,                 '0');
+        KEY(DIKI_1,                 '1');
+        KEY(DIKI_2,                 '2');
+        KEY(DIKI_3,                 '3');
+        KEY(DIKI_4,                 '4');
+        KEY(DIKI_5,                 '5');
+        KEY(DIKI_6,                 '6');
+        KEY(DIKI_7,                 '7');
+        KEY(DIKI_8,                 '8');
+        KEY(DIKI_9,                 '9');
+
+        KEY(DIKI_F1,                WXK_F1);
+        KEY(DIKI_F2,                WXK_F2);
+        KEY(DIKI_F3,                WXK_F3);
+        KEY(DIKI_F4,                WXK_F4);
+        KEY(DIKI_F5,                WXK_F5);
+        KEY(DIKI_F6,                WXK_F6);
+        KEY(DIKI_F7,                WXK_F7);
+        KEY(DIKI_F8,                WXK_F8);
+        KEY(DIKI_F9,                WXK_F9);
+        KEY(DIKI_F10,               WXK_F10);
+        KEY(DIKI_F11,               WXK_F11);
+        KEY(DIKI_F12,               WXK_F12);
+
+        KEY(DIKI_SHIFT_L,           WXK_SHIFT);
+        KEY(DIKI_SHIFT_R,           WXK_SHIFT);
+        KEY(DIKI_CONTROL_L,         WXK_CONTROL);
+        KEY(DIKI_CONTROL_R,         WXK_CONTROL);
+        KEY(DIKI_ALT_L,             WXK_ALT);
+        KEY(DIKI_ALT_R,             WXK_ALT);
+        KEY(DIKI_META_L,            0);
+        KEY(DIKI_META_R,            0);
+        KEY(DIKI_SUPER_L,           0);
+        KEY(DIKI_SUPER_R,           0);
+        KEY(DIKI_HYPER_L,           0);
+        KEY(DIKI_HYPER_R,           0);
+
+        KEY(DIKI_CAPS_LOCK,         0);
+        KEY(DIKI_NUM_LOCK,          WXK_NUMLOCK);
+        KEY(DIKI_SCROLL_LOCK,       0);
+
+        KEY(DIKI_ESCAPE,            WXK_ESCAPE);
+        KEY(DIKI_LEFT,              WXK_LEFT);
+        KEY(DIKI_RIGHT,             WXK_RIGHT);
+        KEY(DIKI_UP,                WXK_UP);
+        KEY(DIKI_DOWN,              WXK_DOWN);
+        KEY(DIKI_TAB,               WXK_TAB);
+        KEY(DIKI_ENTER,             WXK_RETURN);
+        KEY(DIKI_SPACE,             WXK_SPACE);
+        KEY(DIKI_BACKSPACE,         WXK_BACK);
+        KEY(DIKI_INSERT,            WXK_INSERT);
+        KEY(DIKI_DELETE,            WXK_DELETE);
+        KEY(DIKI_HOME,              WXK_HOME);
+        KEY(DIKI_END,               WXK_END);
+        KEY(DIKI_PAGE_UP,           WXK_PAGEUP);
+        KEY(DIKI_PAGE_DOWN,         WXK_PAGEDOWN);
+        KEY(DIKI_PRINT,             WXK_PRINT);
+        KEY(DIKI_PAUSE,             WXK_PAUSE);
+
+        KEY(DIKI_QUOTE_LEFT,        '`');
+        KEY(DIKI_MINUS_SIGN,        '-');
+        KEY(DIKI_EQUALS_SIGN,       '=');
+        KEY(DIKI_BRACKET_LEFT,      '[');
+        KEY(DIKI_BRACKET_RIGHT,     ']');
+        KEY(DIKI_BACKSLASH,         '\\');
+        KEY(DIKI_SEMICOLON,         ';');
+        KEY(DIKI_QUOTE_RIGHT,       '\'');
+        KEY(DIKI_COMMA,             ',');
+        KEY(DIKI_PERIOD,            '.');
+        KEY(DIKI_SLASH,             '/');
+
+        KEY(DIKI_LESS_SIGN,         '<');
+
+        KEY(DIKI_KP_DIV,            WXK_NUMPAD_DIVIDE);
+        KEY(DIKI_KP_MULT,           WXK_NUMPAD_MULTIPLY);
+        KEY(DIKI_KP_MINUS,          WXK_NUMPAD_SUBTRACT);
+        KEY(DIKI_KP_PLUS,           WXK_NUMPAD_ADD);
+        KEY(DIKI_KP_ENTER,          WXK_NUMPAD_ENTER);
+        KEY(DIKI_KP_SPACE,          WXK_NUMPAD_SPACE);
+        KEY(DIKI_KP_TAB,            WXK_NUMPAD_TAB);
+        KEY(DIKI_KP_F1,             WXK_NUMPAD_F1);
+        KEY(DIKI_KP_F2,             WXK_NUMPAD_F2);
+        KEY(DIKI_KP_F3,             WXK_NUMPAD_F3);
+        KEY(DIKI_KP_F4,             WXK_NUMPAD_F4);
+        KEY(DIKI_KP_EQUAL,          WXK_NUMPAD_EQUAL);
+        KEY(DIKI_KP_SEPARATOR,      WXK_NUMPAD_SEPARATOR);
+
+        KEY(DIKI_KP_DECIMAL,        WXK_NUMPAD_DECIMAL);
+        KEY(DIKI_KP_0,              WXK_NUMPAD0);
+        KEY(DIKI_KP_1,              WXK_NUMPAD1);
+        KEY(DIKI_KP_2,              WXK_NUMPAD2);
+        KEY(DIKI_KP_3,              WXK_NUMPAD3);
+        KEY(DIKI_KP_4,              WXK_NUMPAD4);
+        KEY(DIKI_KP_5,              WXK_NUMPAD5);
+        KEY(DIKI_KP_6,              WXK_NUMPAD6);
+        KEY(DIKI_KP_7,              WXK_NUMPAD7);
+        KEY(DIKI_KP_8,              WXK_NUMPAD8);
+        KEY(DIKI_KP_9,              WXK_NUMPAD9);
+
+        case DIKI_KEYDEF_END:
+        case DIKI_NUMBER_OF_KEYS:
+            wxFAIL_MSG( _T("invalid key_id value") );
+            return 0;
+    }
+
+    return 0; // silence compiler warnings
+}
+
+// returns untranslated keycode, i.e. for EVT_CHAR, where characters are left in
+// the form they were entered (lowercase, diacritics etc.)
+static long GetUntraslatedKeyCode(DFBInputDeviceKeyIdentifier key_id,
+                                  DFBInputDeviceKeySymbol key_symbol)
+{
+    switch ( DFB_KEY_TYPE(key_symbol) )
+    {
+        case DIKT_UNICODE:
+#if wxUSE_UNICODE
+            return key_symbol;
+#else
+            if ( key_symbol < 128 )
+                return key_symbol;
+            else
+            {
+#if wxUSE_WCHAR_T
+                wchar_t chr = key_symbol;
+                wxCharBuffer buf(wxConvUI->cWC2MB(&chr, 1, NULL));
+                if ( buf )
+                    return *buf; // may be 0 if failed
+                else
+#endif // wxUSE_WCHAR_T
+                    return 0;
+            }
+#endif
+
+        default:
+            return GetTranslatedKeyCode(key_id);
+    }
+}
+
+#undef KEY
+
+void wxWindowDFB::HandleKeyEvent(const wxDFBWindowEvent& event_)
+{
+    if ( !IsEnabled() )
+        return;
+
+    const DFBWindowEvent& e = event_;
+
+    wxLogTrace(TRACE_EVENTS,
+               _T("handling key %s event for window %p ('%s')"),
+               e.type == DWET_KEYUP ? _T("up") : _T("down"),
+               this, GetName().c_str());
+
+    // fill in wxKeyEvent fields:
+    wxKeyEvent event;
+    event.SetEventObject(this);
+    event.SetTimestamp(wxDFB_EVENT_TIMESTAMP(e));
+    event.m_rawCode = e.key_code;
+    event.m_keyCode = GetTranslatedKeyCode(e.key_id);
+    event.m_scanCode = 0; // not used by wx at all
+#if wxUSE_UNICODE
+    event.m_uniChar = e.key_symbol;
+#endif
+    event.m_shiftDown = ( e.modifiers & DIMM_SHIFT ) != 0;
+    event.m_controlDown = ( e.modifiers & DIMM_CONTROL ) != 0;
+    event.m_altDown = ( e.modifiers & DIMM_ALT ) != 0;
+    event.m_metaDown = ( e.modifiers & DIMM_META ) != 0;
+
+    // translate coordinates from TLW-relative to this window-relative:
+    event.m_x = e.x;
+    event.m_y = e.y;
+    GetTLW()->ClientToScreen(&event.m_x, &event.m_y);
+    this->ScreenToClient(&event.m_x, &event.m_y);
+
+    if ( e.type == DWET_KEYUP )
+    {
+        event.SetEventType(wxEVT_KEY_UP);
+        GetEventHandler()->ProcessEvent(event);
+    }
+    else
+    {
+        bool isTab = (event.m_keyCode == WXK_TAB);
+
+        event.SetEventType(wxEVT_KEY_DOWN);
+
+        if ( GetEventHandler()->ProcessEvent(event) )
+            return;
+
+        // only send wxEVT_CHAR event if not processed yet:
+        event.m_keyCode = GetUntraslatedKeyCode(e.key_id, e.key_symbol);
+        if ( event.m_keyCode != 0 )
+        {
+            event.SetEventType(wxEVT_CHAR);
+            if ( GetEventHandler()->ProcessEvent(event) )
+                return;
+        }
+
+        // Synthetize navigation key event, but do it only if the TAB key
+        // wasn't handled yet:
+        if ( isTab && GetParent() && GetParent()->HasFlag(wxTAB_TRAVERSAL) )
+        {
+            wxNavigationKeyEvent navEvent;
+            navEvent.SetEventObject(GetParent());
+            // Shift-TAB goes in reverse direction:
+            navEvent.SetDirection(!event.m_shiftDown);
+            // Ctrl-TAB changes the (parent) window, i.e. switch notebook page:
+            navEvent.SetWindowChange(event.m_controlDown);
+            navEvent.SetCurrentFocus(wxStaticCast(this, wxWindow));
+            GetParent()->GetEventHandler()->ProcessEvent(navEvent);
+        }
+    }
+}
+
+// ---------------------------------------------------------------------------
+// idle events processing
+// ---------------------------------------------------------------------------
+
+void wxWindowDFB::OnInternalIdle()
+{
+    if (wxUpdateUIEvent::CanUpdate(this))
+        UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
+}
+
+
+// Find the wxWindow at the current mouse position, returning the mouse
+// position.
+wxWindow* wxFindWindowAtPointer(wxPoint& pt)
+{
+    return wxFindWindowAtPoint(pt = wxGetMousePosition());
+}
+
+wxWindow* wxFindWindowAtPoint(const wxPoint& pt)
+{
+    wxFAIL_MSG( _T("wxFindWindowAtPoint not implemented") );
+    return NULL;
+}
index a62dbdc55fe9164cadbf405388ae0849d271323c..c0b7f7a02cdcf3d381dee5cecd94e55f67e0878b 100644 (file)
@@ -71,6 +71,8 @@
     IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowGTK)
 #elif defined(__WXMGL__)
     IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowMGL)
+#elif defined(__WXDFB__)
+    IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowDFB)
 #elif defined(__WXX11__)
     IMPLEMENT_DYNAMIC_CLASS(wxWindow, wxWindowX11)
 #elif defined(__WXPM__)