Introduce <Xm/XmPrivate.h>
authorMarcin Cieslak <saper@saper.info>
Thu, 30 Aug 2012 23:17:46 +0000 (01:17 +0200)
committerJon Trulson <jon@radscan.com>
Fri, 31 Aug 2012 01:43:11 +0000 (19:43 -0600)
We need ANSI C prototypes of certain Motif
functions that are not published in the official
header files.

<Xm/XmPrivate.h> header file contains
the prototypes extracted from the Motif source.

To re-create <Xm/XmPrivate.h>:

1) Make sure you have sources of libXm
(lib/Xm directory of the Motif distribution)
accessible via imports/motif/lib/Xm

2) rm include/Xm/XmPrivate.h

3) make includes

cde/include/Imakefile
cde/include/Xm/Imakefile [new file with mode: 0644]
cde/include/Xm/XmPrivate.h [new file with mode: 0644]
cde/include/Xm/extractprototype.awk [new file with mode: 0644]

index 174309c5a0d1794f4cdf8b2708eaa529dd95b25a..d6fe5b9d6c7233ea61a44ac9b4d73dab6b7dce85 100644 (file)
@@ -1,7 +1,11 @@
 XCOMM $TOG: Imakefile /main/4 1997/07/09 10:03:24 samborn $
 #define PassCDebugFlags /**/
+#define IHaveSubdirs
 
 HEADERS = hpversion.h EUSCompat.h
+SUBDIRS = Xm
+
+MakeSubdirs($(SUBDIRS))
 
 all::
 
diff --git a/cde/include/Xm/Imakefile b/cde/include/Xm/Imakefile
new file mode 100644 (file)
index 0000000..b1b15ce
--- /dev/null
@@ -0,0 +1,23 @@
+XCOMM
+XCOMM  Generate XmPrivate.h containing ANSI C 
+XCOMM  function prototypes extracted from the private
+XCOMM  include headers files 
+XCOMM  
+XCOMM  libXm source from Motif (lib/Xm subdirectory)
+XCOMM  needs to be available in ../../imports/motif/lib/Xm
+XCOMM
+
+HEADERS = XmPrivate.h
+ALLHEADERS = *.h
+
+includes:: $(HEADERS)
+
+BuildIncludes($(HEADERS),Xm,..)
+
+XmPrivate.h: extractprototype.awk
+       awk -f extractprototype.awk $(MLIBSRC)/Xm/$(ALLHEADERS) > $@
+
+depend::
+
+clean::
+
diff --git a/cde/include/Xm/XmPrivate.h b/cde/include/Xm/XmPrivate.h
new file mode 100644 (file)
index 0000000..65cb9a5
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ *
+ * PRIVATE MOTIF FUNCTIONS
+ * Declarations extracted from Open Motif header files
+ *
+ */
+
+#include <Xm/TextStrSoP.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+/* Extracted from BaseClassI.h */
+extern void _XmPushWidgetExtData( 
+                        Widget widget,
+                        XmWidgetExtData data,
+#if NeedWidePrototypes
+                        unsigned int extType) ;
+#else
+                        unsigned char extType) ;
+#endif /* NeedWidePrototypes */
+extern void _XmPopWidgetExtData( 
+                        Widget widget,
+                        XmWidgetExtData *dataRtn,
+#if NeedWidePrototypes
+                        unsigned int extType) ;
+#else
+                        unsigned char extType) ;
+#endif /* NeedWidePrototypes */
+/* Extracted from MenuStateI.h */
+extern void _XmSetInDragMode( 
+                        Widget widget,
+#if NeedWidePrototypes
+                        int mode) ;
+#else
+                        Boolean mode) ;
+#endif /* NeedWidePrototypes */
+/* Extracted from MenuUtilI.h */
+extern int _XmGrabPointer( 
+                        Widget widget,
+                        int owner_events,
+                        unsigned int event_mask,
+                        int pointer_mode,
+                        int keyboard_mode,
+                        Window confine_to,
+                        Cursor cursor,
+                        Time time) ;
+/* Extracted from SyntheticI.h */
+extern void _XmExtGetValuesHook( 
+                        Widget w,
+                        ArgList args,
+                        Cardinal *num_args) ;
+extern void _XmGadgetImportSecondaryArgs( 
+                        Widget w,
+                        ArgList args,
+                        Cardinal *num_args) ;
+/* Extracted from TextStrSoI.h */
+extern char  * _XmStringSourceGetString(XmTextWidget tw,
+                                       XmTextPosition from,
+                                       XmTextPosition to,
+#if NeedWidePrototypes
+                                       int want_wchar);
+#else
+                                        Boolean want_wchar);
+#endif /* NeedWidePrototypes */
+/* Extracted from TravActI.h */
+extern void _XmEnterGadget( 
+                        Widget wid,
+                        XEvent *event,
+                        String *params,
+                        Cardinal *num_params) ;
+extern void _XmLeaveGadget( 
+                        Widget wid,
+                        XEvent *event,
+                        String *params,
+                        Cardinal *num_params) ;
+extern void _XmFocusInGadget( 
+                        Widget wid,
+                        XEvent *event,
+                        String *params,
+                        Cardinal *num_params) ;
+extern void _XmFocusOutGadget( 
+                        Widget wid,
+                        XEvent *event,
+                        String *params,
+                        Cardinal *num_params) ;
+/* Extracted from TraversalI.h */
+extern Boolean _XmFocusIsHere( 
+                        Widget w) ;
+extern Boolean _XmShellIsExclusive( 
+                        Widget wid) ;
+/* Extracted from UniqueEvnI.h */
+extern Boolean _XmIsEventUnique(XEvent *event) ;
+/* Extracted from VendorSI.h */
+extern void _XmAddGrab( 
+                        Widget wid,
+#if NeedWidePrototypes
+                        int exclusive,
+                        int spring_loaded) ;
+#else
+                        Boolean exclusive,
+                        Boolean spring_loaded) ;
+#endif /* NeedWidePrototypes */
+extern void _XmRemoveGrab( 
+                        Widget wid) ;
+/* Extracted from XmI.h */
+extern void _XmSocorro( 
+                        Widget w,
+                        XEvent *event,
+                        String *params,
+                        Cardinal *num_params) ;
+extern void _XmClearShadowType( 
+                        Widget w,
+#if NeedWidePrototypes
+                        int old_width,
+                        int old_height,
+                        int old_shadow_thickness,
+                        int old_highlight_thickness) ;
+#else
+                        Dimension old_width,
+                        Dimension old_height,
+                        Dimension old_shadow_thickness,
+                        Dimension old_highlight_thickness) ;
+#endif /* NeedWidePrototypes */
+#ifdef __cplusplus
+}
+#endif
+/*************************************************************
+ * END OF EXTRACTED DATA
+ *************************************************************/
diff --git a/cde/include/Xm/extractprototype.awk b/cde/include/Xm/extractprototype.awk
new file mode 100644 (file)
index 0000000..b3b23ca
--- /dev/null
@@ -0,0 +1,57 @@
+BEGIN { 
+       curfile = FILENAME;
+       s = ""; for (i = 0; i < 60; i++) s = s "*";
+       printf("/*\n *\n * PRIVATE MOTIF FUNCTIONS\n");
+       printf(" * Declarations extracted from Open Motif header files\n *\n */\n\n", s); 
+       printf("#include <Xm/TextStrSoP.h>\n");
+       printf("#ifdef __cplusplus\nextern \"C\" {\n#endif\n");
+}
+END {
+       printf("#ifdef __cplusplus\n}\n#endif\n");
+       printf("/*%s\n * END OF EXTRACTED DATA\n *%s/\n", s, s);
+}
+function proto() {
+        if ($0 ~ /extern/) {
+               pattern = 0;
+               do { 
+                       line = $0;
+                       if (line ~ /#if/) {
+                               pattern = 1;
+                       }       
+                       if (curfile != FILENAME) {
+                               n = FILENAME;
+                               sub(/.*\//, "", n);
+                               printf("/* Extracted from %s */\n", n);
+                               curfile = FILENAME;
+                       }
+                       print line;
+                       getline;
+                       if ( pattern == 0) {
+                               terminate = (line ~ /;/);
+                       } else {
+                               terminate = (line ~ /^#.*endif/);
+                       }
+               } while (!terminate);
+       }
+}
+/_XmClearShadowType/ { proto(); }
+/_XmShellIsExclusive/ { proto(); }
+/_XmGrabKeyboard/ { proto(); }
+/_XmFocusIsHere/ { proto(); }
+/_XmAddGrab/ { proto(); }
+/_XmGrabPointer/ { proto(); }
+/_XmRemoveGrab/ { proto(); }
+/_XmEnterGadget/ { proto(); }
+/_XmLeaveGadget/ { proto(); }
+/_XmPushWidgetExtData/ { proto(); }
+/_XmPopWidgetExtData/ { proto(); }
+/_XmGadgetImportSecondaryArgs/ { proto(); }
+/_XmExtImportArgs/ { proto(); }
+/_XmExtGetValuesHook/ { proto(); }
+/_XmSocorro/ { proto(); }
+/_XmFocusInGadget/ { proto(); }
+/_XmFocusOutGadget/ { proto(); }
+/_XmIsEventUnique/ { proto(); }
+/_XmSetInDragMode/ { proto(); }
+/_XmStringSourceGetString/ { proto(); }
+/_XmShellIsExclusive/ { proto(); }