From 6184558583df419ff7830abaf16e7ec40ac00b32 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 15 Dec 2007 15:48:29 +0000 Subject: [PATCH] wxMotif should use wxX11 wxPalette instead of duplicating it git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- Makefile.in | 184 ++++++++++--------- build/bakefiles/files.bkl | 4 +- include/wx/motif/palette.h | 73 -------- include/wx/palette.h | 9 +- src/motif/palette.cpp | 363 ------------------------------------- 5 files changed, 100 insertions(+), 533 deletions(-) delete mode 100644 include/wx/motif/palette.h delete mode 100644 src/motif/palette.cpp diff --git a/Makefile.in b/Makefile.in index 900183a320..2eedb2fb09 100644 --- a/Makefile.in +++ b/Makefile.in @@ -608,6 +608,7 @@ ALL_PORTS_BASE_HEADERS = \ wx/palmos/apptrait.h \ wx/palmos/chkconf.h \ wx/palmos/mimetype.h \ + wx/palmos/missing.h \ wx/palmos/stdpaths.h \ wx/msdos/mimetype.h \ wx/fs_inet.h \ @@ -763,6 +764,7 @@ ALL_BASE_SOURCES = \ src/palmos/dir.cpp \ src/palmos/prefconf.cpp \ src/palmos/snglinst.cpp \ + src/palmos/stdall.c \ src/palmos/thread.cpp \ src/palmos/utils.cpp \ src/palmos/utilsexc.cpp \ @@ -2105,6 +2107,7 @@ COND_TOOLKIT_MOTIF_LOWLEVEL_HDR = \ wx/unix/utilsx11.h \ wx/x11/bitmap.h \ wx/x11/brush.h \ + wx/x11/palette.h \ wx/x11/pen.h \ wx/x11/region.h @COND_TOOLKIT_MOTIF@LOWLEVEL_HDR = $(COND_TOOLKIT_MOTIF_LOWLEVEL_HDR) @@ -2575,7 +2578,6 @@ COND_TOOLKIT_MOTIF_GUI_HDR = \ wx/motif/menuitem.h \ wx/motif/minifram.h \ wx/motif/msgdlg.h \ - wx/motif/palette.h \ wx/motif/popupwin.h \ wx/motif/print.h \ wx/motif/private.h \ @@ -4256,6 +4258,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS = \ monodll_displayx11.o \ monodll_bitmap.o \ monodll_brush.o \ + monodll_palette.o \ monodll_pen.o \ monodll_region.o \ monodll_utilsx.o @@ -4722,7 +4725,6 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS = \ monodll_menuitem.o \ monodll_minifram.o \ monodll_msgdlg.o \ - monodll_palette.o \ monodll_popupwin.o \ monodll_radiobox.o \ monodll_radiobut.o \ @@ -5124,6 +5126,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_1 = \ monodll_displayx11.o \ monodll_bitmap.o \ monodll_brush.o \ + monodll_palette.o \ monodll_pen.o \ monodll_region.o \ monodll_utilsx.o @@ -6151,6 +6154,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_2 = \ monolib_displayx11.o \ monolib_bitmap.o \ monolib_brush.o \ + monolib_palette.o \ monolib_pen.o \ monolib_region.o \ monolib_utilsx.o @@ -6617,7 +6621,6 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS_1 = \ monolib_menuitem.o \ monolib_minifram.o \ monolib_msgdlg.o \ - monolib_palette.o \ monolib_popupwin.o \ monolib_radiobox.o \ monolib_radiobut.o \ @@ -7020,6 +7023,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_3 = \ monolib_displayx11.o \ monolib_bitmap.o \ monolib_brush.o \ + monolib_palette.o \ monolib_pen.o \ monolib_region.o \ monolib_utilsx.o @@ -8325,6 +8329,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_4 = \ coredll_displayx11.o \ coredll_bitmap.o \ coredll_brush.o \ + coredll_palette.o \ coredll_pen.o \ coredll_region.o \ coredll_utilsx.o @@ -8791,7 +8796,6 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS_2 = \ coredll_menuitem.o \ coredll_minifram.o \ coredll_msgdlg.o \ - coredll_palette.o \ coredll_popupwin.o \ coredll_radiobox.o \ coredll_radiobut.o \ @@ -9194,6 +9198,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_5 = \ coredll_displayx11.o \ coredll_bitmap.o \ coredll_brush.o \ + coredll_palette.o \ coredll_pen.o \ coredll_region.o \ coredll_utilsx.o @@ -9824,6 +9829,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_6 = \ corelib_displayx11.o \ corelib_bitmap.o \ corelib_brush.o \ + corelib_palette.o \ corelib_pen.o \ corelib_region.o \ corelib_utilsx.o @@ -10290,7 +10296,6 @@ COND_TOOLKIT_MOTIF___GUI_SRC_OBJECTS_3 = \ corelib_menuitem.o \ corelib_minifram.o \ corelib_msgdlg.o \ - corelib_palette.o \ corelib_popupwin.o \ corelib_radiobox.o \ corelib_radiobut.o \ @@ -10693,6 +10698,7 @@ COND_TOOLKIT_MOTIF___LOWLEVEL_SRC_OBJECTS_7 = \ corelib_displayx11.o \ corelib_bitmap.o \ corelib_brush.o \ + corelib_palette.o \ corelib_pen.o \ corelib_region.o \ corelib_utilsx.o @@ -15844,6 +15850,27 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monodll_data.o: $(srcdir)/src/os2/data.cpp $(MONODLL_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/os2/data.cpp +@COND_TOOLKIT_MOTIF_USE_GUI_1@monodll_palette.o: $(srcdir)/src/x11/palette.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/x11/palette.cpp + +@COND_TOOLKIT_X11_USE_GUI_1@monodll_palette.o: $(srcdir)/src/x11/palette.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/x11/palette.cpp + +@COND_TOOLKIT_MSW_USE_GUI_1@monodll_palette.o: $(srcdir)/src/msw/palette.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/palette.cpp + +@COND_TOOLKIT_WINCE_USE_GUI_1@monodll_palette.o: $(srcdir)/src/msw/palette.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/palette.cpp + +@COND_TOOLKIT_MGL_USE_GUI_1@monodll_palette.o: $(srcdir)/src/mgl/palette.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_MGL_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/palette.cpp + +@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monodll_palette.o: $(srcdir)/src/mac/carbon/palette.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mac/carbon/palette.cpp + +@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monodll_palette.o: $(srcdir)/src/os2/palette.cpp $(MONODLL_ODEP) +@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/os2/palette.cpp + @COND_TOOLKIT_MOTIF_USE_GUI_1@monodll_utilsx.o: $(srcdir)/src/x11/utilsx.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/x11/utilsx.cpp @@ -15943,27 +15970,6 @@ monodll_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONODLL_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1@monodll_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(MONODLL_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp -@COND_TOOLKIT_MSW_USE_GUI_1@monodll_palette.o: $(srcdir)/src/msw/palette.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/palette.cpp - -@COND_TOOLKIT_WINCE_USE_GUI_1@monodll_palette.o: $(srcdir)/src/msw/palette.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/palette.cpp - -@COND_TOOLKIT_X11_USE_GUI_1@monodll_palette.o: $(srcdir)/src/x11/palette.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/x11/palette.cpp - -@COND_TOOLKIT_MGL_USE_GUI_1@monodll_palette.o: $(srcdir)/src/mgl/palette.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_MGL_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mgl/palette.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monodll_palette.o: $(srcdir)/src/motif/palette.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/motif/palette.cpp - -@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monodll_palette.o: $(srcdir)/src/mac/carbon/palette.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/mac/carbon/palette.cpp - -@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monodll_palette.o: $(srcdir)/src/os2/palette.cpp $(MONODLL_ODEP) -@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/os2/palette.cpp - @COND_TOOLKIT_MSW_USE_GUI_1@monodll_printdlg.o: $(srcdir)/src/msw/printdlg.cpp $(MONODLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONODLL_CXXFLAGS) $(srcdir)/src/msw/printdlg.cpp @@ -20326,6 +20332,27 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monolib_data.o: $(srcdir)/src/os2/data.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/os2/data.cpp +@COND_TOOLKIT_MOTIF_USE_GUI_1@monolib_palette.o: $(srcdir)/src/x11/palette.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/x11/palette.cpp + +@COND_TOOLKIT_X11_USE_GUI_1@monolib_palette.o: $(srcdir)/src/x11/palette.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/x11/palette.cpp + +@COND_TOOLKIT_MSW_USE_GUI_1@monolib_palette.o: $(srcdir)/src/msw/palette.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/palette.cpp + +@COND_TOOLKIT_WINCE_USE_GUI_1@monolib_palette.o: $(srcdir)/src/msw/palette.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/palette.cpp + +@COND_TOOLKIT_MGL_USE_GUI_1@monolib_palette.o: $(srcdir)/src/mgl/palette.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_MGL_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/palette.cpp + +@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monolib_palette.o: $(srcdir)/src/mac/carbon/palette.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mac/carbon/palette.cpp + +@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monolib_palette.o: $(srcdir)/src/os2/palette.cpp $(MONOLIB_ODEP) +@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/os2/palette.cpp + @COND_TOOLKIT_MOTIF_USE_GUI_1@monolib_utilsx.o: $(srcdir)/src/x11/utilsx.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/x11/utilsx.cpp @@ -20425,27 +20452,6 @@ monolib_sound_sdl.o: $(srcdir)/src/unix/sound_sdl.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1@monolib_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp -@COND_TOOLKIT_MSW_USE_GUI_1@monolib_palette.o: $(srcdir)/src/msw/palette.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/palette.cpp - -@COND_TOOLKIT_WINCE_USE_GUI_1@monolib_palette.o: $(srcdir)/src/msw/palette.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/palette.cpp - -@COND_TOOLKIT_X11_USE_GUI_1@monolib_palette.o: $(srcdir)/src/x11/palette.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/x11/palette.cpp - -@COND_TOOLKIT_MGL_USE_GUI_1@monolib_palette.o: $(srcdir)/src/mgl/palette.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_MGL_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mgl/palette.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@monolib_palette.o: $(srcdir)/src/motif/palette.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/motif/palette.cpp - -@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@monolib_palette.o: $(srcdir)/src/mac/carbon/palette.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/mac/carbon/palette.cpp - -@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@monolib_palette.o: $(srcdir)/src/os2/palette.cpp $(MONOLIB_ODEP) -@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/os2/palette.cpp - @COND_TOOLKIT_MSW_USE_GUI_1@monolib_printdlg.o: $(srcdir)/src/msw/printdlg.cpp $(MONOLIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(MONOLIB_CXXFLAGS) $(srcdir)/src/msw/printdlg.cpp @@ -25363,6 +25369,27 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@coredll_data.o: $(srcdir)/src/os2/data.cpp $(COREDLL_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/os2/data.cpp +@COND_TOOLKIT_MOTIF_USE_GUI_1@coredll_palette.o: $(srcdir)/src/x11/palette.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/x11/palette.cpp + +@COND_TOOLKIT_X11_USE_GUI_1@coredll_palette.o: $(srcdir)/src/x11/palette.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/x11/palette.cpp + +@COND_TOOLKIT_MSW_USE_GUI_1@coredll_palette.o: $(srcdir)/src/msw/palette.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/palette.cpp + +@COND_TOOLKIT_WINCE_USE_GUI_1@coredll_palette.o: $(srcdir)/src/msw/palette.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/palette.cpp + +@COND_TOOLKIT_MGL_USE_GUI_1@coredll_palette.o: $(srcdir)/src/mgl/palette.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_MGL_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/palette.cpp + +@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@coredll_palette.o: $(srcdir)/src/mac/carbon/palette.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mac/carbon/palette.cpp + +@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@coredll_palette.o: $(srcdir)/src/os2/palette.cpp $(COREDLL_ODEP) +@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/os2/palette.cpp + @COND_TOOLKIT_MOTIF_USE_GUI_1@coredll_utilsx.o: $(srcdir)/src/x11/utilsx.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/x11/utilsx.cpp @@ -25462,27 +25489,6 @@ coredll_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(COREDLL_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1@coredll_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(COREDLL_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp -@COND_TOOLKIT_MSW_USE_GUI_1@coredll_palette.o: $(srcdir)/src/msw/palette.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/palette.cpp - -@COND_TOOLKIT_WINCE_USE_GUI_1@coredll_palette.o: $(srcdir)/src/msw/palette.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/palette.cpp - -@COND_TOOLKIT_X11_USE_GUI_1@coredll_palette.o: $(srcdir)/src/x11/palette.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/x11/palette.cpp - -@COND_TOOLKIT_MGL_USE_GUI_1@coredll_palette.o: $(srcdir)/src/mgl/palette.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_MGL_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mgl/palette.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@coredll_palette.o: $(srcdir)/src/motif/palette.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/motif/palette.cpp - -@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@coredll_palette.o: $(srcdir)/src/mac/carbon/palette.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/mac/carbon/palette.cpp - -@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@coredll_palette.o: $(srcdir)/src/os2/palette.cpp $(COREDLL_ODEP) -@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/os2/palette.cpp - @COND_TOOLKIT_MSW_USE_GUI_1@coredll_printdlg.o: $(srcdir)/src/msw/printdlg.cpp $(COREDLL_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(COREDLL_CXXFLAGS) $(srcdir)/src/msw/printdlg.cpp @@ -28441,6 +28447,27 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@corelib_data.o: $(srcdir)/src/os2/data.cpp $(CORELIB_ODEP) @COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/os2/data.cpp +@COND_TOOLKIT_MOTIF_USE_GUI_1@corelib_palette.o: $(srcdir)/src/x11/palette.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/x11/palette.cpp + +@COND_TOOLKIT_X11_USE_GUI_1@corelib_palette.o: $(srcdir)/src/x11/palette.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/x11/palette.cpp + +@COND_TOOLKIT_MSW_USE_GUI_1@corelib_palette.o: $(srcdir)/src/msw/palette.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/palette.cpp + +@COND_TOOLKIT_WINCE_USE_GUI_1@corelib_palette.o: $(srcdir)/src/msw/palette.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/palette.cpp + +@COND_TOOLKIT_MGL_USE_GUI_1@corelib_palette.o: $(srcdir)/src/mgl/palette.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_MGL_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/palette.cpp + +@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@corelib_palette.o: $(srcdir)/src/mac/carbon/palette.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mac/carbon/palette.cpp + +@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@corelib_palette.o: $(srcdir)/src/os2/palette.cpp $(CORELIB_ODEP) +@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/os2/palette.cpp + @COND_TOOLKIT_MOTIF_USE_GUI_1@corelib_utilsx.o: $(srcdir)/src/x11/utilsx.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MOTIF_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/x11/utilsx.cpp @@ -28540,27 +28567,6 @@ corelib_win32.o: $(srcdir)/src/univ/themes/win32.cpp $(CORELIB_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1@corelib_oleutils.o: $(srcdir)/src/msw/ole/oleutils.cpp $(CORELIB_ODEP) @COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/ole/oleutils.cpp -@COND_TOOLKIT_MSW_USE_GUI_1@corelib_palette.o: $(srcdir)/src/msw/palette.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/palette.cpp - -@COND_TOOLKIT_WINCE_USE_GUI_1@corelib_palette.o: $(srcdir)/src/msw/palette.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_WINCE_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/palette.cpp - -@COND_TOOLKIT_X11_USE_GUI_1@corelib_palette.o: $(srcdir)/src/x11/palette.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_X11_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/x11/palette.cpp - -@COND_TOOLKIT_MGL_USE_GUI_1@corelib_palette.o: $(srcdir)/src/mgl/palette.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_MGL_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mgl/palette.cpp - -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@corelib_palette.o: $(srcdir)/src/motif/palette.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_MOTIF_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/motif/palette.cpp - -@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@corelib_palette.o: $(srcdir)/src/mac/carbon/palette.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_MAC_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/mac/carbon/palette.cpp - -@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@corelib_palette.o: $(srcdir)/src/os2/palette.cpp $(CORELIB_ODEP) -@COND_TOOLKIT_PM_USE_GUI_1_WXUNIV_0@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/os2/palette.cpp - @COND_TOOLKIT_MSW_USE_GUI_1@corelib_printdlg.o: $(srcdir)/src/msw/printdlg.cpp $(CORELIB_ODEP) @COND_TOOLKIT_MSW_USE_GUI_1@ $(CXXC) -c -o $@ $(CORELIB_CXXFLAGS) $(srcdir)/src/msw/printdlg.cpp diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl index 1a0c333936..84e0783c3e 100644 --- a/build/bakefiles/files.bkl +++ b/build/bakefiles/files.bkl @@ -1319,6 +1319,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! $(XWIN_LOWLEVEL_SRC) src/x11/bitmap.cpp src/x11/brush.cpp + src/x11/palette.cpp src/x11/pen.cpp src/x11/region.cpp src/x11/utilsx.cpp @@ -1327,6 +1328,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! $(XWIN_LOWLEVEL_HDR) wx/x11/bitmap.h wx/x11/brush.h + wx/x11/palette.h wx/x11/pen.h wx/x11/region.h @@ -1366,7 +1368,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! src/motif/menuitem.cpp src/motif/minifram.cpp src/motif/msgdlg.cpp - src/motif/palette.cpp src/motif/popupwin.cpp src/motif/radiobox.cpp src/motif/radiobut.cpp @@ -1453,7 +1454,6 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file! wx/motif/menuitem.h wx/motif/minifram.h wx/motif/msgdlg.h - wx/motif/palette.h wx/motif/popupwin.h wx/motif/print.h wx/motif/private.h diff --git a/include/wx/motif/palette.h b/include/wx/motif/palette.h deleted file mode 100644 index 644e066af9..0000000000 --- a/include/wx/motif/palette.h +++ /dev/null @@ -1,73 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: wx/motif/palette.h -// Purpose: wxPalette class -// Author: Julian Smart -// Modified by: -// Created: 17/09/98 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -#ifndef _WX_PALETTE_H_ -#define _WX_PALETTE_H_ - -#include "wx/gdiobj.h" -#include "wx/list.h" - -class WXDLLIMPEXP_FWD_CORE wxPalette; - -// Palette for one display -class wxXPalette : public wxObject -{ - DECLARE_DYNAMIC_CLASS(wxXPalette) - -public: - wxXPalette(); - - WXDisplay* m_display; - int m_pix_array_n; - unsigned long* m_pix_array; - WXColormap m_cmap; - bool m_destroyable; -}; - -class WXDLLEXPORT wxPaletteRefData: public wxGDIRefData -{ - friend class WXDLLIMPEXP_FWD_CORE wxPalette; -public: - wxPaletteRefData(); - virtual ~wxPaletteRefData(); - -protected: - wxList m_palettes; -}; - -#define M_PALETTEDATA ((wxPaletteRefData *)m_refData) - -class WXDLLEXPORT wxPalette: public wxPaletteBase -{ - DECLARE_DYNAMIC_CLASS(wxPalette) - -public: - wxPalette(); - - wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); - virtual ~wxPalette(); - bool Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue); - int GetPixel(unsigned char red, unsigned char green, unsigned char blue) const; - bool GetRGB(int pixel, unsigned char *red, unsigned char *green, unsigned char *blue) const; - - virtual bool Ok() const { return IsOk(); } - virtual bool IsOk() const { return (m_refData != NULL) ; } - - // Motif-specific - WXColormap GetXColormap(WXDisplay* display = NULL) const; - bool TransferBitmap(void *data, int depth, int size); - bool TransferBitmap8(unsigned char *data, unsigned long size, void *dest, unsigned int bpp); - unsigned long *GetXPixArray(WXDisplay* display, int *pix_array_n); - void PutXColormap(WXDisplay* display, WXColormap cmap, bool destroyable); -}; - -#endif -// _WX_PALETTE_H_ diff --git a/include/wx/palette.h b/include/wx/palette.h index 15be24fe3f..8f2e85363d 100644 --- a/include/wx/palette.h +++ b/include/wx/palette.h @@ -34,12 +34,10 @@ public: #include "wx/palmos/palette.h" #elif defined(__WXMSW__) #include "wx/msw/palette.h" -#elif defined(__WXMOTIF__) - #include "wx/motif/palette.h" +#elif defined(__WXX11__) || defined(__WXMOTIF__) + #include "wx/x11/palette.h" #elif defined(__WXGTK__) || defined(__WXCOCOA__) #include "wx/generic/paletteg.h" -#elif defined(__WXX11__) - #include "wx/x11/palette.h" #elif defined(__WXMGL__) #include "wx/mgl/palette.h" #elif defined(__WXMAC__) @@ -50,5 +48,4 @@ public: #endif // wxUSE_PALETTE -#endif - // _WX_PALETTE_H_BASE_ +#endif // _WX_PALETTE_H_BASE_ diff --git a/src/motif/palette.cpp b/src/motif/palette.cpp deleted file mode 100644 index 378172ff5b..0000000000 --- a/src/motif/palette.cpp +++ /dev/null @@ -1,363 +0,0 @@ -///////////////////////////////////////////////////////////////////////////// -// Name: src/motif/palette.cpp -// Purpose: wxPalette -// Author: Julian Smart -// Modified by: -// Created: 17/09/98 -// RCS-ID: $Id$ -// Copyright: (c) Julian Smart -// Licence: wxWindows licence -///////////////////////////////////////////////////////////////////////////// - -/* - * Colour map - * - * When constructed with the default constructor, we start from - * the wxApp::GetMainColormap, allocating additional read-only cells - * in Create(). The cells are freed on the next call to Create() - * or when the destructor is called. - */ - -/* Wolfram Gloger -I have implemented basic colormap support for the X11 versions of -wxWidgets, notably wxPalette::Create(). The way I did it is to -allocate additional read-only color cells in the default colormap. In -general you will get arbitrary pixel values assigned to these new -cells and therefore I added a method wxPalette::TransferBitmap() -which maps the pixel values 0..n to the real ones obtained with -Create(). This is only implemented for the popular case of 8-bit -depth. - -Allocating read-write color cells would involve installing a private -X11 colormap for a particular window, and AFAIK this is not -recommended; only the window manager should do this... Also, it is -not the functionality that wxPalette::Create() aims to provide. - */ - -// For compilers that support precompilation, includes "wx.h". -#include "wx/wxprec.h" - -#include "wx/palette.h" - -#ifndef WX_PRECOMP - #include "wx/app.h" - #include "wx/utils.h" - #include "wx/window.h" -#endif - -#ifdef __VMS__ -#pragma message disable nosimpint -#endif -#include -#ifdef __VMS__ -#pragma message enable nosimpint -#endif -#include "wx/motif/private.h" - -IMPLEMENT_DYNAMIC_CLASS(wxPalette, wxGDIObject) -IMPLEMENT_DYNAMIC_CLASS(wxXPalette, wxObject) - -/* -* Palette -* -*/ - -wxXPalette::wxXPalette() -{ - m_cmap = (WXColormap) 0; - m_pix_array_n = 0; - m_pix_array = (unsigned long*) 0; - m_display = (WXDisplay*) 0; - m_destroyable = false; -} - -wxPaletteRefData::wxPaletteRefData() -{ -} - -wxPaletteRefData::~wxPaletteRefData() -{ - Display *display = (Display*) NULL; - - wxList::compatibility_iterator node, next; - - for (node = m_palettes.GetFirst(); node; node = next) { - wxXPalette *c = (wxXPalette *)node->GetData(); - unsigned long *pix_array = c->m_pix_array; - Colormap cmap = (Colormap) c->m_cmap; - bool destroyable = c->m_destroyable; - int pix_array_n = c->m_pix_array_n; - display = (Display*) c->m_display; - - if (pix_array_n > 0) - { - // XFreeColors(display, cmap, pix_array, pix_array_n, 0); - // Be careful not to free '0' pixels... - int i, j; - for(i=j=0; i i) XFreeColors(display, cmap, &pix_array[i], j-i, 0); - while(jGetNext(); - m_palettes.Erase(node); - delete c; - } -} - -wxPalette::wxPalette() -{ -} - -wxPalette::wxPalette(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) -{ - Create(n, red, green, blue); -} - -wxPalette::~wxPalette() -{ -} - -bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *green, const unsigned char *blue) -{ - UnRef(); - - if (!n) { - return false; - } - - m_refData = new wxPaletteRefData; - - XColor xcol; - Display* display = (Display*) wxGetDisplay(); - - unsigned long *pix_array; - Colormap cmap; - int pix_array_n; - - cmap = (Colormap) wxTheApp->GetMainColormap(display); - - pix_array = new unsigned long[n]; - if (!pix_array) - return false; - - pix_array_n = n; - xcol.flags = DoRed | DoGreen | DoBlue; - for(int i = 0; i < n; i++) { - xcol.red = (unsigned short)(red[i] << 8); - xcol.green = (unsigned short)(green[i] << 8); - xcol.blue = (unsigned short)(blue[i] << 8); - pix_array[i] = (XAllocColor(display, cmap, &xcol) == 0) ? 0 : xcol.pixel; - } - - wxXPalette *c = new wxXPalette; - - c->m_pix_array_n = pix_array_n; - c->m_pix_array = pix_array; - c->m_cmap = (WXColormap) cmap; - c->m_display = (WXDisplay*) display; - c->m_destroyable = false; - M_PALETTEDATA->m_palettes.Append(c); - - return true; -} - -int wxPalette::GetPixel(unsigned char WXUNUSED(red), - unsigned char WXUNUSED(green), - unsigned char WXUNUSED(blue)) const -{ - if ( !m_refData ) - return wxNOT_FOUND; - - // TODO - return wxNOT_FOUND; -} - -bool wxPalette::GetRGB(int index, unsigned char *WXUNUSED(red), unsigned char *WXUNUSED(green), unsigned char *WXUNUSED(blue)) const -{ - if ( !m_refData ) - return false; - - if (index < 0 || index > 255) - return false; - - // TODO - return false; -} - -WXColormap wxPalette::GetXColormap(WXDisplay* display) const -{ - if (!M_PALETTEDATA || (M_PALETTEDATA->m_palettes.GetCount() == 0)) - return wxTheApp->GetMainColormap(display); - - wxList::compatibility_iterator node = M_PALETTEDATA->m_palettes.GetFirst(); - if (!display && node) - { - wxXPalette* p = (wxXPalette*) node->GetData(); - return p->m_cmap; - } - while (node) - { - wxXPalette* p = (wxXPalette*) node->GetData(); - if (p->m_display == display) - return p->m_cmap; - - node = node->GetNext(); - } - - /* Make a new one: */ - wxXPalette *c = new wxXPalette; - wxXPalette *first = - (wxXPalette *)M_PALETTEDATA->m_palettes.GetFirst()->GetData(); - XColor xcol; - int pix_array_n = first->m_pix_array_n; - - c->m_pix_array_n = pix_array_n; - c->m_pix_array = new unsigned long[pix_array_n]; - c->m_display = display; - c->m_cmap = wxTheApp->GetMainColormap(display); - c->m_destroyable = false; - - xcol.flags = DoRed | DoGreen | DoBlue; - int i; - for (i = 0; i < pix_array_n; i++) - { - xcol.pixel = first->m_pix_array[i]; - XQueryColor((Display*) first->m_display, - (Colormap) first->m_cmap, &xcol); - c->m_pix_array[i] = - (XAllocColor((Display*) display, (Colormap) c->m_cmap, &xcol) == 0) - ? 0 : xcol.pixel; - } - - // wxPalette* nonConstThis = (wxPalette*) this; - - M_PALETTEDATA->m_palettes.Append(c); - - return c->m_cmap; -} - -bool wxPalette::TransferBitmap(void *data, int depth, int size) -{ - switch(depth) { - case 8: - { - unsigned char *uptr = (unsigned char *)data; - int pix_array_n; - unsigned long *pix_array = GetXPixArray((Display*) wxGetDisplay(), &pix_array_n); - while(size-- > 0) - { - if((int)*uptr < pix_array_n) - *uptr = (unsigned char)pix_array[*uptr]; - uptr++; - } - - return true; - } - default: - return false; - } -} - -bool wxPalette::TransferBitmap8(unsigned char *data, unsigned long sz, - void *dest, unsigned int bpp) -{ - int pix_array_n; - unsigned long *pix_array = GetXPixArray((Display*) wxGetDisplay(), &pix_array_n); - switch(bpp) { - case 8: { - unsigned char *dptr = (unsigned char *)dest; - while(sz-- > 0) { - if((int)*data < pix_array_n) - *dptr = (unsigned char)pix_array[*data]; - data++; - dptr++; - } - break; - } - case 16: { - unsigned short *dptr = (unsigned short *)dest; - while(sz-- > 0) { - if((int)*data < pix_array_n) - *dptr = (unsigned short)pix_array[*data]; - data++; - dptr++; - } - break; - } - case 24: { - struct rgb24 { unsigned char r, g, b; } *dptr = (struct rgb24 *)dest; - while(sz-- > 0) { - if((int)*data < pix_array_n) { - dptr->r = (unsigned char)(pix_array[*data] & 0xFF); - dptr->g = (unsigned char)((pix_array[*data] >> 8) & 0xFF); - dptr->b = (unsigned char)((pix_array[*data] >> 16) & 0xFF); - } - data++; - dptr++; - } - break; - } - case 32: { - unsigned long *dptr = (unsigned long *)dest; - while(sz-- > 0) { - if((int)*data < pix_array_n) - *dptr = pix_array[*data]; - data++; - dptr++; - } - break; - } - default: - return false; - } - return true; -} - -unsigned long *wxPalette::GetXPixArray(WXDisplay *display, int *n) -{ - if (!M_PALETTEDATA) - return (unsigned long*) 0; - wxList::compatibility_iterator node; - - for (node = M_PALETTEDATA->m_palettes.GetFirst(); node; - node = node->GetNext()) - { - wxXPalette *c = (wxXPalette *)node->GetData(); - if (c->m_display == display) - { - if (n) - *n = c->m_pix_array_n; - return c->m_pix_array; - } - } - - /* Not found; call GetXColormap, which will create it, then this again */ - if (GetXColormap(display)) - return GetXPixArray(display, n); - else - return (unsigned long*) 0; -} - -void wxPalette::PutXColormap(WXDisplay* display, WXColormap cm, bool dp) -{ - UnRef(); - - m_refData = new wxPaletteRefData; - - wxXPalette *c = new wxXPalette; - - c->m_pix_array_n = 0; - c->m_pix_array = (unsigned long*) NULL; - c->m_display = display; - c->m_cmap = cm; - c->m_destroyable = dp; - - M_PALETTEDATA->m_palettes.Append(c); -} -- 2.45.2