From 6df6698c69dc5346679bb263ff259577cd400e59 Mon Sep 17 00:00:00 2001
From: Frederic Koehler <f.koehler427@gmail.com>
Date: Thu, 9 Aug 2012 17:11:11 -0400
Subject: [PATCH] dtwm: Cleanup some implicit definitions

Mostly this is adding appropriate #includes and declarations,
but for WmImage.c we also change from using the proper name
for XmeGetMask, rather than the identical but renamed
version _DtGetMask which is not exported in any header.
---
 cde/programs/dtwm/Callback.c     | 1 +
 cde/programs/dtwm/DataBaseLoad.h | 1 +
 cde/programs/dtwm/Print.c        | 1 +
 cde/programs/dtwm/WmBackdrop.c   | 3 +++
 cde/programs/dtwm/WmEvent.c      | 2 ++
 cde/programs/dtwm/WmFP.c         | 1 +
 cde/programs/dtwm/WmFeedback.c   | 2 +-
 cde/programs/dtwm/WmHelp.c       | 3 +++
 cde/programs/dtwm/WmICCC.h       | 3 +++
 cde/programs/dtwm/WmIPC.c        | 4 ++++
 cde/programs/dtwm/WmIconBox.h    | 8 ++++++++
 cde/programs/dtwm/WmImage.c      | 2 +-
 cde/programs/dtwm/WmInitWs.c     | 4 ++++
 cde/programs/dtwm/WmOL.c         | 2 ++
 cde/programs/dtwm/WmOL.h         | 3 +++
 cde/programs/dtwm/WmParse.c      | 1 +
 cde/programs/dtwm/WmPresence.c   | 2 ++
 cde/programs/dtwm/WmProperty.h   | 4 ++++
 cde/programs/dtwm/WmResParse.c   | 3 +++
 cde/programs/dtwm/WmResParse.h   | 6 +++---
 cde/programs/dtwm/WmResource.h   | 1 +
 cde/programs/dtwm/WmWinState.c   | 1 +
 cde/programs/dtwm/WmWrkspace.c   | 2 ++
 cde/programs/dtwm/WmWrkspace.h   | 1 +
 24 files changed, 56 insertions(+), 5 deletions(-)

diff --git a/cde/programs/dtwm/Callback.c b/cde/programs/dtwm/Callback.c
index f7259af..3ea47a4 100644
--- a/cde/programs/dtwm/Callback.c
+++ b/cde/programs/dtwm/Callback.c
@@ -58,6 +58,7 @@
 #include <Xm/Form.h>
 #include <Xm/ToggleBG.h>
 #include <Xm/AtomMgr.h>
+#include <Xm/TextF.h>
 
 #include <X11/Xatom.h>
 #include <X11/keysym.h>
diff --git a/cde/programs/dtwm/DataBaseLoad.h b/cde/programs/dtwm/DataBaseLoad.h
index 698a7c4..346cbfc 100644
--- a/cde/programs/dtwm/DataBaseLoad.h
+++ b/cde/programs/dtwm/DataBaseLoad.h
@@ -484,6 +484,7 @@ struct _AnimationItem
 extern Boolean FrontPanelReadDatabases (void);
 extern void InitParse(char *, ElementValue **);
 extern void InitializeControlFields( ElementValue *element_values, char *);
+extern void InitializeSubpanelFields (ElementValue * element_values);
 extern void _WriteControlElementValues(ElementValue *);
 extern void WriteControlComponentFile(ControlData *);
 extern void WriteSubpanelComponentFile(SubpanelData *);
diff --git a/cde/programs/dtwm/Print.c b/cde/programs/dtwm/Print.c
index 32155cc..79cbc50 100644
--- a/cde/programs/dtwm/Print.c
+++ b/cde/programs/dtwm/Print.c
@@ -42,6 +42,7 @@
 #include <Dt/DbReader.h>            /* required for DtDbPathId type */
 #include <Dt/WsmM.h>
 #include <Dt/IconFile.h>
+#include <Dt/Dt.h>
 #include "DataBaseLoad.h"
 #include "Parse.h"
 
diff --git a/cde/programs/dtwm/WmBackdrop.c b/cde/programs/dtwm/WmBackdrop.c
index 0ee6501..f2783a5 100644
--- a/cde/programs/dtwm/WmBackdrop.c
+++ b/cde/programs/dtwm/WmBackdrop.c
@@ -45,6 +45,8 @@ static char rcsid[] = ""
 #define DTWM_NEED_BACKBITS
 #include "WmIBitmap.h"
 #include "WmBackdrop.h"
+#include "WmError.h"
+#include "WmProperty.h"
 #include <X11/Core.h>
 #include <X11/StringDefs.h>
 #include <X11/Intrinsic.h>
@@ -54,6 +56,7 @@ static char rcsid[] = ""
 #include <Dt/DtP.h>
 #include <Dt/WsmM.h>
 #include <Xm/Xm.h>
+#include <Xm/AtomMgr.h>
 #include <errno.h>
 #include <signal.h>
 #include <stdio.h>
diff --git a/cde/programs/dtwm/WmEvent.c b/cde/programs/dtwm/WmEvent.c
index 40a8ab8..f643503 100644
--- a/cde/programs/dtwm/WmEvent.c
+++ b/cde/programs/dtwm/WmEvent.c
@@ -48,8 +48,10 @@ static char rcsid[] = "$XConsortium: WmEvent.c /main/7 1996/11/20 15:27:47 rswis
  * include extern functions
  */
 #include "WmEvent.h"
+#include "WmError.h"
 #ifdef WSM
 #include "WmBackdrop.h"
+#include "WmWrkspace.h"
 #endif /* WSM */
 #include "WmCDInfo.h"
 #include "WmCDecor.h"
diff --git a/cde/programs/dtwm/WmFP.c b/cde/programs/dtwm/WmFP.c
index 2df7679..48a8108 100644
--- a/cde/programs/dtwm/WmFP.c
+++ b/cde/programs/dtwm/WmFP.c
@@ -67,6 +67,7 @@
 #include "UI.h"
 
 #include "WmPanelP.h"
+#include "WmManage.h"
 
 #include <pwd.h>
 #include <fcntl.h>
diff --git a/cde/programs/dtwm/WmFeedback.c b/cde/programs/dtwm/WmFeedback.c
index 1aeac4b..6413b4f 100644
--- a/cde/programs/dtwm/WmFeedback.c
+++ b/cde/programs/dtwm/WmFeedback.c
@@ -43,7 +43,7 @@ static char rcsid[] = "$XConsortium: WmFeedback.c /main/6 1996/10/23 17:20:55 rs
 
 #define MWM_NEED_TIME16
 #include "WmBitmap.h"
-
+#include "WmError.h"
 #include <Xm/Xm.h>
 #include <X11/Shell.h>
 #include <Xm/Label.h>
diff --git a/cde/programs/dtwm/WmHelp.c b/cde/programs/dtwm/WmHelp.c
index 8e80b06..f37d2ec 100644
--- a/cde/programs/dtwm/WmHelp.c
+++ b/cde/programs/dtwm/WmHelp.c
@@ -44,7 +44,10 @@ static char rcsid[] = ""
  
 #include "WmGlobal.h"
 #include "WmError.h"
+#include "WmFunction.h"
 #include "WmHelp.h"
+#include "WmCDecor.h"
+#include "WmResParse.h"
 #ifdef PANELIST
 #include "WmPanelP.h"
 #endif /* PANELIST */
diff --git a/cde/programs/dtwm/WmICCC.h b/cde/programs/dtwm/WmICCC.h
index 2e02c7b..a55ac36 100644
--- a/cde/programs/dtwm/WmICCC.h
+++ b/cde/programs/dtwm/WmICCC.h
@@ -31,6 +31,8 @@
 /*
  * (c) Copyright 1987, 1988, 1989, 1990 HEWLETT-PACKARD COMPANY */
 
+#ifndef _Dt_WmICCC_h_
+#define _Dt_WmICCC_h_
 /*
  * Included Files:
  */
@@ -143,3 +145,4 @@ typedef struct _PropWMState
 
 /* PropWMState state field value: */
 #define WithdrawnSTATE		0
+#endif /* _Dt_WmICCC_h_ */
diff --git a/cde/programs/dtwm/WmIPC.c b/cde/programs/dtwm/WmIPC.c
index 0a7a8f1..331f43b 100644
--- a/cde/programs/dtwm/WmIPC.c
+++ b/cde/programs/dtwm/WmIPC.c
@@ -38,7 +38,9 @@ static char rcsid[] = ""
  * Included Files:
  */
 #include "WmGlobal.h"
+#include "WmProtocol.h"
 #include <Xm/XmAll.h>
+#include <Dt/Dt.h>
 #include <Dt/DtP.h>
 #include <Dt/Action.h>
 #include <Dt/WsmM.h>
@@ -51,6 +53,8 @@ static char rcsid[] = ""
 #include "WmFunction.h"
 #include "WmWrkspace.h"
 #include "WmIPC.h"
+#include "WmXSMP.h"
+#include "WmPanelP.h"
 #include "DataBaseLoad.h"
 
 
diff --git a/cde/programs/dtwm/WmIconBox.h b/cde/programs/dtwm/WmIconBox.h
index 37d22a6..0f83b1a 100644
--- a/cde/programs/dtwm/WmIconBox.h
+++ b/cde/programs/dtwm/WmIconBox.h
@@ -43,6 +43,7 @@ extern void CheckIconBoxResize (ClientData *pCD, unsigned int changedValues,
 extern Boolean CheckIconBoxSize (IconBoxData *pIBD);
 extern void DeleteIconFromBox (IconBoxData *pIBD, ClientData *pCD);
 extern void DeleteIconInfo (IconBoxData *pIBD, ClientData *pCD);
+extern void DestroyIconBox (WmWorkspaceData *pWS);
 extern Boolean ExpandVirtualSpace (IconBoxData *pIBD, int newWidth, 
 				   int newHeight);
 extern Boolean ExtendIconList (IconBoxData *pIBD, int incr);
@@ -60,6 +61,13 @@ extern void IconScrollVisibleCallback (Widget w, caddr_t client_data,
 #endif
 extern void IconActivateCallback (Widget w, caddr_t client_data, 
 				  XmAnyCallbackStruct *call_data);
+#ifdef PANELIST
+extern void IconBoxPopUp (WmWorkspaceData *pWS, Boolean up);
+extern Boolean IconBoxShowing (WmWorkspaceData *pWS);
+#else /* PANELIST */
+extern void IconBoxPopUp (WmWorkspaceData *pWS, ControlWindowStruct *pCW, Boolean up);
+extern Boolean IconBoxShowing (WmWorkspaceData *pWS, ControlWindowStruct *pCW);
+#endif /* PANELIST */
 extern Boolean IconVisible (ClientData *pCD);
 extern IconInfo *InsertIconInfo (IconBoxData *pIBD, ClientData *pCD, 
 				 Widget theWidget);
diff --git a/cde/programs/dtwm/WmImage.c b/cde/programs/dtwm/WmImage.c
index bd97079..29f7221 100644
--- a/cde/programs/dtwm/WmImage.c
+++ b/cde/programs/dtwm/WmImage.c
@@ -255,7 +255,7 @@ Pixmap MakeNamedIconPixmap (ClientData *pCD, String iconName)
        }
        else
        {
-	   mask = _DtGetMask (XtScreen(PSD_FOR_CLIENT(pCD)->screenTopLevelW1), 
+	   mask = XmeGetMask (XtScreen(PSD_FOR_CLIENT(pCD)->screenTopLevelW1), 
 			(sIconFileName == NULL) ? iconName : sIconFileName);
 	   if (mask == XmUNSPECIFIED_PIXMAP) 
 	   {
diff --git a/cde/programs/dtwm/WmInitWs.c b/cde/programs/dtwm/WmInitWs.c
index 2f77f9a..d040cce 100644
--- a/cde/programs/dtwm/WmInitWs.c
+++ b/cde/programs/dtwm/WmInitWs.c
@@ -59,6 +59,7 @@ static char rcsid[] = "$TOG: WmInitWs.c /main/18 1999/09/20 15:18:22 mgreess $"
 #include <X11/Xos.h>
 #include <X11/cursorfont.h>
 #include <Xm/Xm.h>
+#include <Xm/AtomMgr.h>
 #include <X11/Shell.h>
 #include <X11/Core.h>
 #include <X11/keysym.h>
@@ -78,6 +79,7 @@ typedef struct
 #ifdef WSM
 #include <Dt/GetDispRes.h>
 #include <Dt/SessionP.h>
+#include <Dt/SessionM.h>
 #include <Dt/DtP.h>
 #include <Dt/Message.h>
 #include <Dt/WsmM.h>
@@ -2677,6 +2679,8 @@ VirtKeys4DIN(
   if(    !prop_existed    )
     {
       bindingsString = NULL ;
+      /* FIXME: this is an unexported openmotif procedure */
+      extern void _XmVirtKeysLoadFallbackBindings(Display *dsp, String *binding);
       _XmVirtKeysLoadFallbackBindings( dsp, &bindingsString) ;
       XtFree( bindingsString) ;
 
diff --git a/cde/programs/dtwm/WmOL.c b/cde/programs/dtwm/WmOL.c
index 5708a2a..f40fe77 100644
--- a/cde/programs/dtwm/WmOL.c
+++ b/cde/programs/dtwm/WmOL.c
@@ -37,6 +37,8 @@ static char rcsid[] = "$XConsortium: WmOL.c /main/4 1995/11/01 11:45:08 rswiston
  */
 #include "WmGlobal.h"
 #include "WmOL.h"
+#include "WmProperty.h"
+#include <Xm/AtomMgr.h>
 
 #define ValidPropertyList(pcd) ((pcd)->paInitialProperties != NULL)
 
diff --git a/cde/programs/dtwm/WmOL.h b/cde/programs/dtwm/WmOL.h
index 8936c11..e3af6e2 100644
--- a/cde/programs/dtwm/WmOL.h
+++ b/cde/programs/dtwm/WmOL.h
@@ -122,6 +122,9 @@ extern Boolean HasOpenLookHints( ClientData *pCD );
 extern OLWinAttr * GetOLWinAttr( ClientData *pCD );
 extern Boolean GetOLDecorFlags(ClientData *pCD, Atom property,
 	unsigned long *pDecor);
+extern void InitOLCompat(void);
+extern void ProcessOLDecoration(ClientData *pCD);
+
 
 
 /*
diff --git a/cde/programs/dtwm/WmParse.c b/cde/programs/dtwm/WmParse.c
index 6b76c2b..21ec751 100644
--- a/cde/programs/dtwm/WmParse.c
+++ b/cde/programs/dtwm/WmParse.c
@@ -66,6 +66,7 @@ static char rcsid[] = "$XConsortium: WmParse.c /main/5 1996/10/30 11:36:06 drk $
 #ifdef MULTIBYTE
 #include <stdlib.h>
 #endif /* MULTIBYTE */
+#include <ctype.h>
 
 /*
  * Internal routines
diff --git a/cde/programs/dtwm/WmPresence.c b/cde/programs/dtwm/WmPresence.c
index ece105b..c1b2f84 100644
--- a/cde/programs/dtwm/WmPresence.c
+++ b/cde/programs/dtwm/WmPresence.c
@@ -38,6 +38,7 @@ static char rcsid[] = "$XConsortium: WmPresence.c /main/7 1996/10/23 17:24:56 rs
 #include "WmGlobal.h"
 #include "WmResNames.h"
 #include "WmHelp.h"
+#include "WmError.h"
 
 #include <X11/Core.h>
 #include <X11/StringDefs.h>
@@ -47,6 +48,7 @@ static char rcsid[] = "$XConsortium: WmPresence.c /main/7 1996/10/23 17:24:56 rs
 #include <Xm/Xm.h>
 #include <Xm/Form.h>
 #include <Xm/PushBG.h>
+#include <Xm/PushB.h>
 #include <Xm/LabelG.h>
 #include <Xm/List.h>
 #include <Xm/SeparatoG.h>
diff --git a/cde/programs/dtwm/WmProperty.h b/cde/programs/dtwm/WmProperty.h
index 2569005..b86af32 100644
--- a/cde/programs/dtwm/WmProperty.h
+++ b/cde/programs/dtwm/WmProperty.h
@@ -30,6 +30,7 @@
 /*   $XConsortium: WmProperty.h /main/4 1995/11/01 11:48:54 rswiston $ */
 /*
  * (c) Copyright 1987, 1988, 1989, 1990 HEWLETT-PACKARD COMPANY */
+#include "WmICCC.h"
 
 extern SizeHints * GetNormalHints (ClientData *pCD);
 extern void ProcessWmProtocols (ClientData *pCD);
@@ -38,6 +39,9 @@ extern void SetMwmInfo (Window propWindow, long flags, Window wmWindow);
 #ifdef WSM
 void SetMwmSaveSessionInfo (Window wmWindow);
 #endif /* WSM */
+extern void GetDtWmRequest (WmScreenData *pSD, char **pszReq, Boolean *pmore);
+extern void GetDtSessionHints (WmScreenData *pSD, int sNum);
+
 extern PropWMState * GetWMState (Window window);
 extern void SetWMState (Window window, int state, Window icon);
 extern PropMwmHints * GetMwmHints (ClientData *pCD);
diff --git a/cde/programs/dtwm/WmResParse.c b/cde/programs/dtwm/WmResParse.c
index a0630a0..717f6fc 100644
--- a/cde/programs/dtwm/WmResParse.c
+++ b/cde/programs/dtwm/WmResParse.c
@@ -7315,6 +7315,9 @@ void ProcessMotifBindings (void)
     XDeleteProperty (DISPLAY, RootWindow (DISPLAY, 0),
 		XInternAtom (DISPLAY, "_MOTIF_DEFAULT_BINDINGS", False));
 
+    /* FIXME: unexported openmotif procedures */
+    extern Boolean _XmVirtKeysLoadFileBindings(Display *dsp, String *binding);
+    extern void _XmVirtKeysLoadFallbackBindings(Display *dsp, String *binding);
     if (_XmVirtKeysLoadFileBindings (fileName, &bindings) == True) {
 	XChangeProperty (DISPLAY, RootWindow(DISPLAY, 0),
 		XInternAtom (DISPLAY, "_MOTIF_BINDINGS", False),
diff --git a/cde/programs/dtwm/WmResParse.h b/cde/programs/dtwm/WmResParse.h
index 60e266f..4060308 100644
--- a/cde/programs/dtwm/WmResParse.h
+++ b/cde/programs/dtwm/WmResParse.h
@@ -48,9 +48,9 @@ extern Boolean         FindDtSessionMatch(int commandArgc,
 					   WmScreenData *pSD, 
 					   char **pWorkSpaceList,
 					   char *clientMachine);
-extern void            WmDtGetHelprgs(char *args, 
-				       unsigned char** volume, 
-				       unsigned char** topic, 
+extern void            WmDtGetHelpArgs(char *args, 
+				       unsigned char* volume, 
+				       unsigned char* topic, 
 				       int *argsCount);
 extern void GetActionIndex (int tableSize, int *actionIndex);
 extern void            GetFunctionTableValues (int *execIndex, int *nopIndex,
diff --git a/cde/programs/dtwm/WmResource.h b/cde/programs/dtwm/WmResource.h
index 2bd4d95..2271830 100644
--- a/cde/programs/dtwm/WmResource.h
+++ b/cde/programs/dtwm/WmResource.h
@@ -46,6 +46,7 @@ extern void SetStdGlobalResourceValues (void);
 extern void ProcessScreenListResource (void);
 extern void ProcessAppearanceResources (WmScreenData *pSD);
 extern void ProcessGlobalScreenResources (void);
+extern void ProcessPresenceResources (WmScreenData *pSD);
 extern void ProcessScreenResources (WmScreenData *pSD, unsigned char *screenName);
 #ifdef WSM
 extern void ProcessWorkspaceList (WmScreenData *pSD);
diff --git a/cde/programs/dtwm/WmWinState.c b/cde/programs/dtwm/WmWinState.c
index 94040a5..9e63a4b 100644
--- a/cde/programs/dtwm/WmWinState.c
+++ b/cde/programs/dtwm/WmWinState.c
@@ -42,6 +42,7 @@ static char rcsid[] = "$XConsortium: WmWinState.c /main/6 1996/06/20 09:39:39 rs
 #include "WmGlobal.h"
 #include "WmICCC.h"
 #include "WmProtocol.h"
+#include "WmIPC.h"
 
 
 /*
diff --git a/cde/programs/dtwm/WmWrkspace.c b/cde/programs/dtwm/WmWrkspace.c
index 8ded58f..ae3d0f2 100644
--- a/cde/programs/dtwm/WmWrkspace.c
+++ b/cde/programs/dtwm/WmWrkspace.c
@@ -42,9 +42,11 @@ static char rcsid[] = "$XConsortium: WmWrkspace.c /main/7 1996/10/23 17:26:33 rs
 #include "WmHelp.h"
 #include "WmResNames.h"
 #include "WmIPlace.h"
+#include "WmInitWs.h"
 #include <X11/Xutil.h>
 #include "WmICCC.h"
 #include <Xm/Xm.h>
+#include <Xm/AtomMgr.h>
 #include <Dt/DtP.h>
 #include <Dt/WsmM.h>
 #include <stdio.h>
diff --git a/cde/programs/dtwm/WmWrkspace.h b/cde/programs/dtwm/WmWrkspace.h
index 9df7edf..15328a2 100644
--- a/cde/programs/dtwm/WmWrkspace.h
+++ b/cde/programs/dtwm/WmWrkspace.h
@@ -39,6 +39,7 @@ static char rcsid[] = ""
 
 extern void ChangeToWorkspace( 
                         WmWorkspaceData *pNewWS) ;
+extern void ChangeWorkspaceTitle( WmWorkspaceData *pWS, char * pchTitle);
 extern Boolean DuplicateWorkspaceName (
 			WmScreenData *pSD, 
 			unsigned char *name, 
-- 
1.7.11.2

