From 3fa056ab78be920eacac56e51864fe7a45d1a31a Mon Sep 17 00:00:00 2001 From: Jouk Jansen Date: Tue, 7 Mar 2000 09:00:27 +0000 Subject: [PATCH] Committing in . VMS/GTK compile support Modified Files: wxWindows/descrip.mms wxWindows/setup.h_vms wxWindows/samples/minimal/descrip.mms wxWindows/src/common/descrip.mms wxWindows/src/common/resource.cpp wxWindows/src/generic/descrip.mms wxWindows/src/gtk/dcclient.cpp wxWindows/src/gtk/filedlg.cpp wxWindows/src/gtk/fontdlg.cpp wxWindows/src/gtk/listbox.cpp wxWindows/src/gtk/tbargtk.cpp wxWindows/src/gtk/win_gtk.c wxWindows/src/unix/descrip.mms wxWindows/src/unix/fontenum.cpp Added Files: wxWindows/lib/vms_gtk.opt wxWindows/src/gtk/wx_gtk_vmsjackets.c ---------------------------------------------------------------------- git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6492 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- descrip.mms | 53 +++++++++++++++++++++++++----------- lib/vms_gtk.opt | 11 ++++++++ samples/minimal/descrip.mms | 19 ++++++++++++- setup.h_vms | 2 +- src/common/descrip.mms | 9 ++++++ src/common/resource.cpp | 4 ++- src/generic/descrip.mms | 20 +++++++++++--- src/gtk/dcclient.cpp | 5 ++-- src/gtk/filedlg.cpp | 4 +++ src/gtk/fontdlg.cpp | 5 ++++ src/gtk/listbox.cpp | 7 ++++- src/gtk/tbargtk.cpp | 3 ++ src/gtk/win_gtk.c | 4 +++ src/gtk/wx_gtk_vmsjackets.c | 40 +++++++++++++++++++++++++++ src/gtk1/dcclient.cpp | 5 ++-- src/gtk1/filedlg.cpp | 4 +++ src/gtk1/fontdlg.cpp | 5 ++++ src/gtk1/listbox.cpp | 7 ++++- src/gtk1/tbargtk.cpp | 3 ++ src/gtk1/win_gtk.c | 4 +++ src/gtk1/wx_gtk_vmsjackets.c | 40 +++++++++++++++++++++++++++ src/unix/descrip.mms | 8 ++++++ src/unix/fontenum.cpp | 7 +++++ 23 files changed, 240 insertions(+), 29 deletions(-) create mode 100644 lib/vms_gtk.opt create mode 100644 src/gtk/wx_gtk_vmsjackets.c create mode 100644 src/gtk1/wx_gtk_vmsjackets.c diff --git a/descrip.mms b/descrip.mms index 199fc4d4f1..a6bee006c6 100644 --- a/descrip.mms +++ b/descrip.mms @@ -13,35 +13,56 @@ define/job/trans=(concealed) wx_root "''wx_fuldir'" set def [.wxwindows] -all : setup.h +all : + make gtk + purge [...] + delete [...]*.obj; + make motif + purge [...] + delete [...]*.obj; + +gtk : setup.h + set default [.src.generic] + $(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1) + set default [-.common] + $(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1) + set default [-.unix] + $(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1) + set default [-.gtk] + $(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1) + set default [--.samples.minimal] + $(MMS)$(MMSQUALIFIERS)/macro=(__WXGTK__=1) + +motif : setup.h set default [.src.generic] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [-.common] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [-.unix] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [-.motif] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [--.demos.bombs] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [--.samples.caret] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [-.checklst] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [-.config] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [-.controls] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [-.dialogs] - $(MMS)$(MMSQUALIFIERS) - set default [-.image] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) +# set default [-.image] +# $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [-.menu] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [-.minimal] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) set default [--.utils.dialoged.src] - $(MMS)$(MMSQUALIFIERS) + $(MMS)$(MMSQUALIFIERS)/macro=(__WXMOTIF__=1) + set default [--] setup.h : setup.h_vms copy setup.h_vms setup.h diff --git a/lib/vms_gtk.opt b/lib/vms_gtk.opt new file mode 100644 index 0000000000..f23fe6c193 --- /dev/null +++ b/lib/vms_gtk.opt @@ -0,0 +1,11 @@ +wx_root:[wxwindows.lib]libwx_gtk.olb/lib +sys$library:libjpeg.olb/lib +sys$library:libpng.olb/lib +sys$library:libz.olb/lib +sys$library:libtiff.olb/lib +X11:libxpm.olb/lib +sys$common:[mozilla]libgtk.so/share +sys$common:[mozilla]libgdk.so/share +sys$common:[mozilla]libglib.so/share +sys$common:[mozilla]vms_jackets.so/share +sys$library:decw$xlibshr.exe/share diff --git a/samples/minimal/descrip.mms b/samples/minimal/descrip.mms index d7e86d2e6a..c6d8de7863 100644 --- a/samples/minimal/descrip.mms +++ b/samples/minimal/descrip.mms @@ -11,8 +11,12 @@ .ifdef __WXMOTIF__ CXX_DEFINE = /define=(__WXMOTIF__=1) .else +.ifdef __WXGTK__ +CXX_DEFINE = /define=(__WXGTK__=1) +.else CXX_DEFINE = .endif +.endif .suffixes : .cpp @@ -20,11 +24,24 @@ CXX_DEFINE = cxx $(CXXFLAGS)$(CXX_DEFINE) $(MMS$TARGET_NAME).cpp all : +.ifdef __WXMOTIF__ $(MMS)$(MMSQUALIFIERS) minimal.exe +.else +.ifdef __WXGTK__ + $(MMS)$(MMSQUALIFIERS) minimal_gtk.exe +.endif +.endif -minimal.exe : minimal.obj .ifdef __WXMOTIF__ +minimal.exe : minimal.obj cxxlink minimal,[--.lib]vms/opt +.else +.ifdef __WXGTK__ +minimal_gtk.exe : minimal.obj + ass link.lis sys$output + cxxlink/exec=minimal_gtk.exe minimal,[--.lib]vms_gtk/opt + deass sys$output +.endif .endif minimal.obj : minimal.cpp diff --git a/setup.h_vms b/setup.h_vms index 0c4d7e852f..db5e934a30 100644 --- a/setup.h_vms +++ b/setup.h_vms @@ -68,7 +68,7 @@ #undef YYTEXT_POINTER /* Define this if your version of GTK+ is greater than 1.2 */ -#undef __WXGTK12__ +#define __WXGTK12__ 1 /* Define this if your version of GTK+ is greater than 1.3 */ #undef __WXGTK13__ diff --git a/src/common/descrip.mms b/src/common/descrip.mms index 00060a8061..d312a20810 100644 --- a/src/common/descrip.mms +++ b/src/common/descrip.mms @@ -12,8 +12,12 @@ .ifdef __WXMOTIF__ CXX_DEFINE = /define=(__WXMOTIF__=1) .else +.ifdef __WXGTK__ +CXX_DEFINE = /define=(__WXGTK__=1) +.else CXX_DEFINE = .endif +.endif YACC=bison/yacc @@ -231,6 +235,11 @@ all : $(SOURCES) .ifdef __WXMOTIF__ library [--.lib]libwx_motif.olb $(OBJECTS) library [--.lib]libwx_motif.olb $(OBJECTS1) +.else +.ifdef __WXGTK__ + library [--.lib]libwx_gtk.olb $(OBJECTS) + library [--.lib]libwx_gtk.olb $(OBJECTS1) +.endif .endif parser.obj : parser.c lexer.c diff --git a/src/common/resource.cpp b/src/common/resource.cpp index b162f9abcc..27305db69a 100644 --- a/src/common/resource.cpp +++ b/src/common/resource.cpp @@ -2477,7 +2477,9 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table return wxBitmap(name, bitmapType); } } - return wxNullBitmap; +#ifndef __WXGTK__ + return wxNullBitmap; +#endif } else { diff --git a/src/generic/descrip.mms b/src/generic/descrip.mms index 0b2b86e7e2..aa0b2f263c 100644 --- a/src/generic/descrip.mms +++ b/src/generic/descrip.mms @@ -11,8 +11,12 @@ .ifdef __WXMOTIF__ CXX_DEFINE = /define=(__WXMOTIF__=1) .else +.ifdef __WXGTK__ +CXX_DEFINE = /define=(__WXGTK__=1) +.else CXX_DEFINE = .endif +.endif .suffixes : .cpp @@ -38,7 +42,6 @@ OBJECTS = \ listctrl.obj,\ logg.obj,\ msgdlgg.obj,\ - notebook.obj,\ numdlgg.obj,\ panelg.obj,\ plot.obj,\ @@ -51,7 +54,6 @@ OBJECTS = \ sashwin.obj,\ scrolwin.obj,\ splitter.obj,\ - statline.obj,\ statusbr.obj,\ tbarsmpl.obj,\ tabg.obj,\ @@ -101,11 +103,21 @@ SOURCES = \ treectrl.cpp,\ wizard.cpp +.ifdef __WXMOTIF__ +OBJECTS0=,statline.obj,\ + notebook.obj +.else +OBJECTS0= +.endif all : $(SOURCES) - $(MMS)$(MMSQUALIFIERS) $(OBJECTS) + $(MMS)$(MMSQUALIFIERS) $(OBJECTS)$(OBJECTS0) .ifdef __WXMOTIF__ - library/crea [--.lib]libwx_motif.olb $(OBJECTS) + library/crea [--.lib]libwx_motif.olb $(OBJECTS)$(OBJECTS0) +.else +.ifdef __WXGTK__ + library/crea [--.lib]libwx_gtk.olb $(OBJECTS) +.endif .endif busyinfo.obj : busyinfo.cpp diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index 6817a326bf..1dbaf55b39 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -1452,13 +1452,14 @@ void wxWindowDC::SetPen( const wxPen &pen ) { for (int i = 0; i < req_nb_dash; i++) real_req_dash[i] = req_dash[i] * width; - gdk_gc_set_dashes( m_penGC, 0, real_req_dash, req_nb_dash ); + gdk_gc_set_dashes( m_penGC, 0, (gint8*) real_req_dash, + req_nb_dash ); delete[] real_req_dash; } else { // No Memory. We use non-scaled dash pattern... - gdk_gc_set_dashes( m_penGC, 0, (char*)req_dash, req_nb_dash ); + gdk_gc_set_dashes( m_penGC, 0, (gint8*)req_dash, req_nb_dash ); } } #endif diff --git a/src/gtk/filedlg.cpp b/src/gtk/filedlg.cpp index c1c2c6f3e8..558746b221 100644 --- a/src/gtk/filedlg.cpp +++ b/src/gtk/filedlg.cpp @@ -16,6 +16,10 @@ #include "wx/intl.h" #include "wx/generic/msgdlgg.h" + +#ifdef __VMS__ +#define gtk_file_selection_hide_fileop_buttons gtk_file_selection_hide_fileop_ +#endif #include //----------------------------------------------------------------------------- diff --git a/src/gtk/fontdlg.cpp b/src/gtk/fontdlg.cpp index 0cd7791011..1298601a79 100644 --- a/src/gtk/fontdlg.cpp +++ b/src/gtk/fontdlg.cpp @@ -17,6 +17,11 @@ #include "wx/debug.h" #include "wx/msgdlg.h" +#ifdef __VMS__ +#define gtk_font_selection_dialog_get_type gtk_font_selection_dialog_get_t +#define gtk_font_selection_dialog_get_font gtk_font_selection_dialog_get_f +#define gtk_font_selection_dialog_get_font_name gtk_font_selection_dialog_getnf +#endif #include //----------------------------------------------------------------------------- diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index c140ad2ddf..4f29dfdb2b 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -26,7 +26,12 @@ #include "wx/tooltip.h" #endif -#include +#ifdef __VMS__ +#define gtk_scrolled_window_add_with_viewport gtk_scrolled_window_add_with_vi +#define gtk_container_set_focus_vadjustment gtk_container_set_focus_vadjust +#define gtk_scrolled_window_get_vadjustment gtk_scrolled_window_get_vadjust +#endif +# include #include #include diff --git a/src/gtk/tbargtk.cpp b/src/gtk/tbargtk.cpp index de64297fd4..6e58b78a54 100644 --- a/src/gtk/tbargtk.cpp +++ b/src/gtk/tbargtk.cpp @@ -26,6 +26,9 @@ #include "wx/frame.h" +#ifdef __VMS__ +#define gtk_pixmap_set_build_insensitive gtk_pixmap_set_build_insensitiv +#endif #include "glib.h" #include "gdk/gdk.h" #include "gtk/gtk.h" diff --git a/src/gtk/win_gtk.c b/src/gtk/win_gtk.c index 44f804dc2d..f97158acf9 100644 --- a/src/gtk/win_gtk.c +++ b/src/gtk/win_gtk.c @@ -10,6 +10,10 @@ /////////////////////////////////////////////////////////////////////////// */ #include "wx/gtk/win_gtk.h" +#ifdef __VMS +#define gtk_widget_get_child_requisition gtk_widget_get_child_requisitio +#define gtk_marshal_NONE__POINTER_POINTER gtk_marshal_NONE__POINTER_POINT +#endif #include "gtk/gtksignal.h" #include "gtk/gtkprivate.h" #include "gdk/gdkx.h" diff --git a/src/gtk/wx_gtk_vmsjackets.c b/src/gtk/wx_gtk_vmsjackets.c new file mode 100644 index 0000000000..e19cafb723 --- /dev/null +++ b/src/gtk/wx_gtk_vmsjackets.c @@ -0,0 +1,40 @@ +#include + +void GDK_BEEP (void) +{ + gdk_beep(); +} + +GdkBitmap* GDK_BITMAP_CREATE_FROM_DATA (GdkWindow *window, + const gchar *data, + gint width, + gint height) +{ + return gdk_bitmap_create_from_data (window, + data, + width, + height); +} + +void GDK_BITMAP_UNREF (GdkBitmap *pixmap) +{ + gdk_bitmap_unref (pixmap); +} + +gint GDK_CHAR_HEIGHT (GdkFont *font, + gchar character) +{ + return gdk_char_height (font, + character); +} + +GdkColormap* GDK_COLORMAP_GET_SYSTEM (void) +{ + return gdk_colormap_get_system(); +} + +GdkVisual* GDK_COLORMAP_GET_VISUAL (GdkColormap *colormap) +{ + return gdk_colormap_get_visual (colormap); +} + diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index 6817a326bf..1dbaf55b39 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -1452,13 +1452,14 @@ void wxWindowDC::SetPen( const wxPen &pen ) { for (int i = 0; i < req_nb_dash; i++) real_req_dash[i] = req_dash[i] * width; - gdk_gc_set_dashes( m_penGC, 0, real_req_dash, req_nb_dash ); + gdk_gc_set_dashes( m_penGC, 0, (gint8*) real_req_dash, + req_nb_dash ); delete[] real_req_dash; } else { // No Memory. We use non-scaled dash pattern... - gdk_gc_set_dashes( m_penGC, 0, (char*)req_dash, req_nb_dash ); + gdk_gc_set_dashes( m_penGC, 0, (gint8*)req_dash, req_nb_dash ); } } #endif diff --git a/src/gtk1/filedlg.cpp b/src/gtk1/filedlg.cpp index c1c2c6f3e8..558746b221 100644 --- a/src/gtk1/filedlg.cpp +++ b/src/gtk1/filedlg.cpp @@ -16,6 +16,10 @@ #include "wx/intl.h" #include "wx/generic/msgdlgg.h" + +#ifdef __VMS__ +#define gtk_file_selection_hide_fileop_buttons gtk_file_selection_hide_fileop_ +#endif #include //----------------------------------------------------------------------------- diff --git a/src/gtk1/fontdlg.cpp b/src/gtk1/fontdlg.cpp index 0cd7791011..1298601a79 100644 --- a/src/gtk1/fontdlg.cpp +++ b/src/gtk1/fontdlg.cpp @@ -17,6 +17,11 @@ #include "wx/debug.h" #include "wx/msgdlg.h" +#ifdef __VMS__ +#define gtk_font_selection_dialog_get_type gtk_font_selection_dialog_get_t +#define gtk_font_selection_dialog_get_font gtk_font_selection_dialog_get_f +#define gtk_font_selection_dialog_get_font_name gtk_font_selection_dialog_getnf +#endif #include //----------------------------------------------------------------------------- diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index c140ad2ddf..4f29dfdb2b 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -26,7 +26,12 @@ #include "wx/tooltip.h" #endif -#include +#ifdef __VMS__ +#define gtk_scrolled_window_add_with_viewport gtk_scrolled_window_add_with_vi +#define gtk_container_set_focus_vadjustment gtk_container_set_focus_vadjust +#define gtk_scrolled_window_get_vadjustment gtk_scrolled_window_get_vadjust +#endif +# include #include #include diff --git a/src/gtk1/tbargtk.cpp b/src/gtk1/tbargtk.cpp index de64297fd4..6e58b78a54 100644 --- a/src/gtk1/tbargtk.cpp +++ b/src/gtk1/tbargtk.cpp @@ -26,6 +26,9 @@ #include "wx/frame.h" +#ifdef __VMS__ +#define gtk_pixmap_set_build_insensitive gtk_pixmap_set_build_insensitiv +#endif #include "glib.h" #include "gdk/gdk.h" #include "gtk/gtk.h" diff --git a/src/gtk1/win_gtk.c b/src/gtk1/win_gtk.c index 44f804dc2d..f97158acf9 100644 --- a/src/gtk1/win_gtk.c +++ b/src/gtk1/win_gtk.c @@ -10,6 +10,10 @@ /////////////////////////////////////////////////////////////////////////// */ #include "wx/gtk/win_gtk.h" +#ifdef __VMS +#define gtk_widget_get_child_requisition gtk_widget_get_child_requisitio +#define gtk_marshal_NONE__POINTER_POINTER gtk_marshal_NONE__POINTER_POINT +#endif #include "gtk/gtksignal.h" #include "gtk/gtkprivate.h" #include "gdk/gdkx.h" diff --git a/src/gtk1/wx_gtk_vmsjackets.c b/src/gtk1/wx_gtk_vmsjackets.c new file mode 100644 index 0000000000..e19cafb723 --- /dev/null +++ b/src/gtk1/wx_gtk_vmsjackets.c @@ -0,0 +1,40 @@ +#include + +void GDK_BEEP (void) +{ + gdk_beep(); +} + +GdkBitmap* GDK_BITMAP_CREATE_FROM_DATA (GdkWindow *window, + const gchar *data, + gint width, + gint height) +{ + return gdk_bitmap_create_from_data (window, + data, + width, + height); +} + +void GDK_BITMAP_UNREF (GdkBitmap *pixmap) +{ + gdk_bitmap_unref (pixmap); +} + +gint GDK_CHAR_HEIGHT (GdkFont *font, + gchar character) +{ + return gdk_char_height (font, + character); +} + +GdkColormap* GDK_COLORMAP_GET_SYSTEM (void) +{ + return gdk_colormap_get_system(); +} + +GdkVisual* GDK_COLORMAP_GET_VISUAL (GdkColormap *colormap) +{ + return gdk_colormap_get_visual (colormap); +} + diff --git a/src/unix/descrip.mms b/src/unix/descrip.mms index 4a08ab7d43..338d2e82f0 100644 --- a/src/unix/descrip.mms +++ b/src/unix/descrip.mms @@ -11,8 +11,12 @@ .ifdef __WXMOTIF__ CXX_DEFINE = /define=(__WXMOTIF__=1) .else +.ifdef __WXGTK__ +CXX_DEFINE = /define=(__WXGTK__=1) +.else CXX_DEFINE = .endif +.endif .suffixes : .cpp @@ -45,6 +49,10 @@ all : $(SOURCES) $(MMS)$(MMSQUALIFIERS) $(OBJECTS) .ifdef __WXMOTIF__ library [--.lib]libwx_motif.olb $(OBJECTS) +.else +.ifdef __WXGTK__ + library [--.lib]libwx_gtk.olb $(OBJECTS) +.endif .endif dialup.obj : dialup.cpp diff --git a/src/unix/fontenum.cpp b/src/unix/fontenum.cpp index a1d374896e..a9960f0709 100644 --- a/src/unix/fontenum.cpp +++ b/src/unix/fontenum.cpp @@ -30,7 +30,14 @@ #include "wx/fontenum.h" #include "wx/fontutil.h" +#ifdef __VMS__ // Xlib.h for VMS is not (yet) compatible with C++ + // The resulting warnings are switched off here +#pragma message disable nosimpint +#endif #include +#ifdef __VMS__ +#pragma message enable nosimpint +#endif // ---------------------------------------------------------------------------- // private functions -- 2.45.2