]> cvs.zerfleddert.de Git - micropolis/blobdiff - src/tk/tkwm.c
Fixes for compilation with gcc 15
[micropolis] / src / tk / tkwm.c
index af974be7bcfdb95a9c4526d03b8b983988d04dda..81c6b9568f3b7869668b774079886a43310c06b2 100644 (file)
@@ -238,9 +238,10 @@ static void                UpdateSizeHints _ANSI_ARGS_((TkWindow *winPtr));
  *--------------------------------------------------------------
  */
 
-void
-TkWmNewWindow(winPtr)
-    TkWindow *winPtr;          /* Newly-created top-level window. */
+void 
+TkWmNewWindow (
+    TkWindow *winPtr           /* Newly-created top-level window. */
+)
 {
     register WmInfo *wmPtr;
 
@@ -330,10 +331,11 @@ TkWmNewWindow(winPtr)
  *--------------------------------------------------------------
  */
 
-int
-TkWmMapWindow(winPtr)
-    TkWindow *winPtr;          /* Top-level window that's about to
+int 
+TkWmMapWindow (
+    TkWindow *winPtr           /* Top-level window that's about to
                                 * be mapped. */
+)
 {
     register WmInfo *wmPtr = winPtr->wmInfoPtr;
 #ifndef X11R3
@@ -349,36 +351,35 @@ TkWmMapWindow(winPtr)
     if (wmPtr->hints.initial_state == NormalState) {
        winPtr->flags |= TK_MAPPED;
     }
-    if (!(wmPtr->flags & WM_NEVER_MAPPED)) {
-       return 1;
-    }
-    wmPtr->flags &= ~WM_NEVER_MAPPED;
+    if (wmPtr->flags & WM_NEVER_MAPPED) {
+        wmPtr->flags &= ~WM_NEVER_MAPPED;
 
-    /*
-     * This is the first time this window has ever been mapped.
-     * Store all the window-manager-related information for the
-     * window.
-     */
+        /*
+         * This is the first time this window has ever been mapped.
+         * Store all the window-manager-related information for the
+         * window.
+         */
 
 #ifndef X11R3
-    if (wmPtr->titleUid == NULL) {
-       wmPtr->titleUid = winPtr->nameUid;
-    }
-    if (XStringListToTextProperty(&wmPtr->titleUid, 1, &textProp)  != 0) {
-       XSetWMName(winPtr->display, winPtr->window, &textProp);
-       XFree((char *) textProp.value);
-    }
+        if (wmPtr->titleUid == NULL) {
+            wmPtr->titleUid = winPtr->nameUid;
+        }
+        if (XStringListToTextProperty(&wmPtr->titleUid, 1, &textProp)  != 0) {
+            XSetWMName(winPtr->display, winPtr->window, &textProp);
+            XFree((char *) textProp.value);
+        }
 #endif
 
-    TkWmSetClass(winPtr);
-    TkWmSetWmProtocols(winPtr);
+        TkWmSetClass(winPtr);
+        TkWmSetWmProtocols(winPtr);
 
-    if (wmPtr->iconName != NULL) {
-       XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
-    }
+        if (wmPtr->iconName != NULL) {
+            XSetIconName(winPtr->display, winPtr->window, wmPtr->iconName);
+        }
 
-    if (wmPtr->master != None) {
-       XSetTransientForHint(winPtr->display, winPtr->window, wmPtr->master);
+        if (wmPtr->master != None) {
+            XSetTransientForHint(winPtr->display, winPtr->window, wmPtr->master);
+        }
     }
 
     wmPtr->flags |= WM_UPDATE_SIZE_HINTS;
@@ -408,9 +409,10 @@ TkWmMapWindow(winPtr)
  *--------------------------------------------------------------
  */
 
-void
-TkWmDeadWindow(winPtr)
-    TkWindow *winPtr;          /* Newly-created top-level window. */
+void 
+TkWmDeadWindow (
+    TkWindow *winPtr           /* Newly-created top-level window. */
+)
 {
     register WmInfo *wmPtr = winPtr->wmInfoPtr;
 
@@ -468,9 +470,10 @@ TkWmDeadWindow(winPtr)
  *--------------------------------------------------------------
  */
 
-void
-TkWmSetClass(winPtr)
-    TkWindow *winPtr;          /* Newly-created top-level window. */
+void 
+TkWmSetClass (
+    TkWindow *winPtr           /* Newly-created top-level window. */
+)
 {
     if (winPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
        return;
@@ -507,13 +510,14 @@ TkWmSetClass(winPtr)
  */
 
        /* ARGSUSED */
-int
-Tk_WmCmd(clientData, interp, argc, argv)
-    ClientData clientData;     /* Main window associated with
+int 
+Tk_WmCmd (
+    ClientData clientData,     /* Main window associated with
                                 * interpreter. */
-    Tcl_Interp *interp;                /* Current interpreter. */
-    int argc;                  /* Number of arguments. */
-    char **argv;               /* Argument strings. */
+    Tcl_Interp *interp,                /* Current interpreter. */
+    int argc,                  /* Number of arguments. */
+    char **argv                /* Argument strings. */
+)
 {
     Tk_Window tkwin = (Tk_Window) clientData;
     TkWindow *winPtr;
@@ -1217,17 +1221,19 @@ Tk_WmCmd(clientData, interp, argc, argv)
  *----------------------------------------------------------------------
  */
 
-void
-Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc)
-    Tk_Window tkwin;           /* Token for window.  New window mgr info
+void 
+Tk_SetGrid (
+    Tk_Window tkwin,           /* Token for window.  New window mgr info
                                 * will be posted for the top-level window
                                 * associated with this window. */
-    int reqWidth;              /* Width (in grid units) corresponding to
+    int reqWidth,              /* Width (in grid units) corresponding to
                                 * the requested geometry for tkwin. */
-    int reqHeight;             /* Height (in grid units) corresponding to
+    int reqHeight,             /* Height (in grid units) corresponding to
                                 * the requested geometry for tkwin. */
-    int widthInc, heightInc;   /* Pixel increments corresponding to a
+    int widthInc,
+    int heightInc      /* Pixel increments corresponding to a
                                 * change of one grid unit. */
+)
 {
     TkWindow *winPtr = (TkWindow *) tkwin;
     register WmInfo *wmPtr;
@@ -1300,10 +1306,11 @@ Tk_SetGrid(tkwin, reqWidth, reqHeight, widthInc, heightInc)
  *----------------------------------------------------------------------
  */
 
-static void
-TopLevelEventProc(clientData, eventPtr)
-    ClientData clientData;             /* Window for which event occurred. */
-    XEvent *eventPtr;                  /* Event that just happened. */
+static void 
+TopLevelEventProc (
+    ClientData clientData,             /* Window for which event occurred. */
+    XEvent *eventPtr                   /* Event that just happened. */
+)
 {
     register TkWindow *winPtr = (TkWindow *) clientData;
 
@@ -1620,10 +1627,11 @@ TopLevelEventProc(clientData, eventPtr)
  */
 
        /* ARGSUSED */
-static void
-TopLevelReqProc(dummy, tkwin)
-    ClientData dummy;                  /* Not used. */
-    Tk_Window tkwin;                   /* Information about window. */
+static void 
+TopLevelReqProc (
+    ClientData dummy,                  /* Not used. */
+    Tk_Window tkwin                    /* Information about window. */
+)
 {
     TkWindow *winPtr = (TkWindow *) tkwin;
     WmInfo *wmPtr;
@@ -1662,9 +1670,10 @@ TopLevelReqProc(dummy, tkwin)
  *----------------------------------------------------------------------
  */
 
-static void
-UpdateGeometryInfo(clientData)
-    ClientData clientData;             /* Pointer to the window's record. */
+static void 
+UpdateGeometryInfo (
+    ClientData clientData              /* Pointer to the window's record. */
+)
 {
     register TkWindow *winPtr = (TkWindow *) clientData;
     register WmInfo *wmPtr = winPtr->wmInfoPtr;
@@ -1794,9 +1803,8 @@ UpdateGeometryInfo(clientData)
  *--------------------------------------------------------------
  */
 
-static void
-UpdateSizeHints(winPtr)
-    TkWindow *winPtr;
+static void 
+UpdateSizeHints (TkWindow *winPtr)
 {
     register WmInfo *wmPtr = winPtr->wmInfoPtr;
     XSizeHints *hintsPtr;
@@ -1910,9 +1918,8 @@ UpdateSizeHints(winPtr)
  *--------------------------------------------------------------
  */
 
-static void
-UpdateHints(winPtr)
-    TkWindow *winPtr;
+static void 
+UpdateHints (TkWindow *winPtr)
 {
     WmInfo *wmPtr = winPtr->wmInfoPtr;
 
@@ -1941,13 +1948,14 @@ UpdateHints(winPtr)
  *--------------------------------------------------------------
  */
 
-static int
-ParseGeometry(interp, string, winPtr)
-    Tcl_Interp *interp;                /* Used for error reporting. */
-    char *string;      /* String containing new geometry.  Has the
+static int 
+ParseGeometry (
+    Tcl_Interp *interp,                /* Used for error reporting. */
+    char *string,      /* String containing new geometry.  Has the
                                 * standard form "=wxh+x+y". */
-    TkWindow *winPtr;          /* Pointer to top-level window whose
+    TkWindow *winPtr           /* Pointer to top-level window whose
                                 * geometry is to be changed. */
+)
 {
     register WmInfo *wmPtr = winPtr->wmInfoPtr;
     int x, y, width, height, flags;
@@ -2066,11 +2074,12 @@ ParseGeometry(interp, string, winPtr)
  *----------------------------------------------------------------------
  */
 
-void
-Tk_GetRootCoords(tkwin, xPtr, yPtr)
-    Tk_Window tkwin;           /* Token for window. */
-    int *xPtr;                 /* Where to store x-displacement of (0,0). */
-    int *yPtr;                 /* Where to store y-displacement of (0,0). */
+void 
+Tk_GetRootCoords (
+    Tk_Window tkwin,           /* Token for window. */
+    int *xPtr,                 /* Where to store x-displacement of (0,0). */
+    int *yPtr                  /* Where to store y-displacement of (0,0). */
+)
 {
     int x, y;
     register TkWindow *winPtr = (TkWindow *) tkwin;
@@ -2112,9 +2121,10 @@ Tk_GetRootCoords(tkwin, xPtr, yPtr)
  *--------------------------------------------------------------
  */
 
-void
-TkWmSetWmProtocols(winPtr)
-    TkWindow *winPtr;          /* Newly-created top-level window. */
+void 
+TkWmSetWmProtocols (
+    TkWindow *winPtr           /* Newly-created top-level window. */
+)
 {
     if (winPtr->wmInfoPtr->flags & WM_NEVER_MAPPED) {
        return;
@@ -2177,10 +2187,8 @@ TkWmSetWmProtocols(winPtr)
  *     
  *
  */
-void
-TkWmProtocolEventProc(winPtr, eventPtr)
-TkWindow *winPtr; 
-XEvent *eventPtr;
+void 
+TkWmProtocolEventProc (TkWindow *winPtr, XEvent *eventPtr)
 {
     if ((Atom)(eventPtr->xclient.data.l)[0] ==
        Tk_InternAtom((Tk_Window) winPtr, "WM_DELETE_WINDOW")) {
@@ -2221,12 +2229,8 @@ XEvent *eventPtr;
  * Kind of artificial, But makes it easier to merge into new
  * versions of Stock Tk.
  */
-int
-WmProtocolCmd(interp, CmdPtr, argc, argv)
-Tcl_Interp *interp;
-char **CmdPtr;
-int argc;
-char **argv;
+int 
+WmProtocolCmd (Tcl_Interp *interp, char **CmdPtr, int argc, char **argv)
 {
 #define Cmd (*CmdPtr)
 
@@ -2302,11 +2306,13 @@ char **argv;
  *----------------------------------------------------------------------
  */
 
-Tk_Window
-Tk_CoordsToWindow(rootX, rootY, tkwin)
-    int rootX, rootY;          /* Coordinates of point in root window. */
-    Tk_Window tkwin;           /* Token for any window in application;
+Tk_Window 
+Tk_CoordsToWindow (
+    int rootX,
+    int rootY,         /* Coordinates of point in root window. */
+    Tk_Window tkwin            /* Token for any window in application;
                                 * used to identify the application. */
+)
 {
     Window rootChild, dummy3, dummy4;
     int i, dummy1, dummy2;
Impressum, Datenschutz