diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/add_window.c | 148 | ||||
-rw-r--r-- | src/add_window.h | 2 | ||||
-rw-r--r-- | src/cursor.c | 8 | ||||
-rw-r--r-- | src/events.c | 82 | ||||
-rw-r--r-- | src/iconmgr.c | 26 | ||||
-rw-r--r-- | src/iconmgr.h | 2 | ||||
-rw-r--r-- | src/icons.c | 10 | ||||
-rw-r--r-- | src/icons.h | 6 | ||||
-rw-r--r-- | src/list.c | 12 | ||||
-rw-r--r-- | src/list.h | 4 | ||||
-rw-r--r-- | src/menus.c | 220 | ||||
-rw-r--r-- | src/parse.c | 36 | ||||
-rw-r--r-- | src/parse.h | 4 | ||||
-rw-r--r-- | src/resize.c | 56 | ||||
-rw-r--r-- | src/screen.h | 2 | ||||
-rw-r--r-- | src/session.c | 24 | ||||
-rw-r--r-- | src/session.h | 2 | ||||
-rw-r--r-- | src/twm.c | 36 | ||||
-rw-r--r-- | src/twm.h | 6 | ||||
-rw-r--r-- | src/util.c | 68 | ||||
-rw-r--r-- | src/util.h | 14 |
21 files changed, 384 insertions, 384 deletions
diff --git a/src/add_window.c b/src/add_window.c index 690354a..8cf23c5 100644 --- a/src/add_window.c +++ b/src/add_window.c @@ -94,13 +94,13 @@ static void CreateWindowTitlebarButtons ( TwmWindow *tmp_win ); char NoName[] = "Untitled"; /* name if no name is specified */ -/** - * map gravity to (x,y) offset signs for adding to x and y when window is +/** + * map gravity to (x,y) offset signs for adding to x and y when window is * mapped to get proper placement. * * \param tmp window from which to get gravity * \param xp,yp return values - * + * */ void GetGravityOffsets (TwmWindow *tmp, int *xp, int *yp) @@ -120,7 +120,7 @@ GetGravityOffsets (TwmWindow *tmp, int *xp, int *yp) { 1, 1 }, /* SouthEastGravity */ { 0, 0 }, /* StaticGravity */ }; - register int g = ((tmp->hints.flags & PWinGravity) + register int g = ((tmp->hints.flags & PWinGravity) ? tmp->hints.win_gravity : NorthWestGravity); if (g < ForgetGravity || g > StaticGravity) { @@ -134,7 +134,7 @@ GetGravityOffsets (TwmWindow *tmp, int *xp, int *yp) -/** +/** * add a new window to the twm list. * * \return pointer to the TwmWindow structure @@ -212,7 +212,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) tmp_win->widthEverChangedByUser = width_ever_changed_by_user; tmp_win->heightEverChangedByUser = height_ever_changed_by_user; - + if (width_ever_changed_by_user) tmp_win->attr.width = saved_width; @@ -256,7 +256,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) } } - if (tmp_win->wmhints && (tmp_win->wmhints->flags & WindowGroupHint)) + if (tmp_win->wmhints && (tmp_win->wmhints->flags & WindowGroupHint)) tmp_win->group = tmp_win->wmhints->window_group; else tmp_win->group = tmp_win->w/* NULL */; @@ -277,19 +277,19 @@ AddWindow(Window w, int iconm, IconMgr *iconp) tmp_win->full_name = strdup(tmp_win->name); namelen = strlen (tmp_win->name); - tmp_win->highlight = Scr->Highlight && - (!(short)(long) LookInList(Scr->NoHighlight, tmp_win->full_name, + tmp_win->highlight = Scr->Highlight && + (!(short)(long) LookInList(Scr->NoHighlight, tmp_win->full_name, &tmp_win->class)); tmp_win->stackmode = Scr->StackMode && - (!(short)(long) LookInList(Scr->NoStackModeL, tmp_win->full_name, + (!(short)(long) LookInList(Scr->NoStackModeL, tmp_win->full_name, &tmp_win->class)); - tmp_win->titlehighlight = Scr->TitleHighlight && - (!(short)(long) LookInList(Scr->NoTitleHighlight, tmp_win->full_name, + tmp_win->titlehighlight = Scr->TitleHighlight && + (!(short)(long) LookInList(Scr->NoTitleHighlight, tmp_win->full_name, &tmp_win->class)); - tmp_win->auto_raise = (short)(long) LookInList(Scr->AutoRaise, + tmp_win->auto_raise = (short)(long) LookInList(Scr->AutoRaise, tmp_win->full_name, &tmp_win->class); if (tmp_win->auto_raise) Scr->NumAutoRaises++; @@ -300,7 +300,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) !(short)(long) LookInList(Scr->DontIconify, tmp_win->full_name, &tmp_win->class); } - tmp_win->iconify_by_unmapping |= + tmp_win->iconify_by_unmapping |= (short)(long) LookInList(Scr->IconifyByUn, tmp_win->full_name, &tmp_win->class); @@ -324,7 +324,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) * since it is coming from the screen list */ if (HasShape) { - if (!LookInList (Scr->DontSqueezeTitleL, tmp_win->full_name, + if (!LookInList (Scr->DontSqueezeTitleL, tmp_win->full_name, &tmp_win->class)) { tmp_win->squeeze_info = (SqueezeInfo *) LookInList (Scr->SqueezeTitleL, tmp_win->full_name, @@ -387,19 +387,19 @@ AddWindow(Window w, int iconm, IconMgr *iconp) /* * Don't bother user if: - * + * * o the window is a transient, or - * + * * o a USPosition was requested, or - * + * * o a PPosition was requested and UsePPosition is ON or * NON_ZERO if the window is at other than (0,0) */ ask_user = TRUE; - if (tmp_win->transient || + if (tmp_win->transient || (tmp_win->hints.flags & USPosition) || ((tmp_win->hints.flags & PPosition) && Scr->UsePPosition && - (Scr->UsePPosition == PPOS_ON || + (Scr->UsePPosition == PPOS_ON || tmp_win->attr.x != 0 || tmp_win->attr.y != 0))) ask_user = FALSE; @@ -423,7 +423,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) { Bool firsttime = True; - /* better wait until all the mouse buttons have been + /* better wait until all the mouse buttons have been * released. */ while (TRUE) @@ -433,7 +433,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) XGrabServer(dpy); JunkMask = 0; - if (!XQueryPointer (dpy, Scr->Root, &JunkRoot, + if (!XQueryPointer (dpy, Scr->Root, &JunkRoot, &JunkChild, &JunkX, &JunkY, &AddingX, &AddingY, &JunkMask)) JunkMask = 0; @@ -462,7 +462,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) */ if (JunkMask != 0) continue; - /* + /* * this will cause a warp to the indicated root */ stat = XGrabPointer(dpy, Scr->Root, False, @@ -478,7 +478,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) width = (SIZE_HINDENT + MyFont_TextWidth (&Scr->SizeFont, tmp_win->name, namelen)); height = Scr->SizeFont.height + SIZE_VINDENT * 2; - + XResizeWindow (dpy, Scr->SizeWindow, width + SIZE_HINDENT, height); XMapRaised(dpy, Scr->SizeWindow); InstallRootColormap(); @@ -493,16 +493,16 @@ AddWindow(Window w, int iconm, IconMgr *iconp) AddingW = tmp_win->attr.width + bw2; AddingH = tmp_win->attr.height + tmp_win->title_height + bw2; - + if (Scr->DontMoveOff) { /* - * Make sure the initial outline comes up on the screen. + * Make sure the initial outline comes up on the screen. */ if (AddingX < 0) AddingX = 0; if (AddingX > Scr->MyDisplayWidth - AddingW) AddingX = Scr->MyDisplayWidth - AddingW; - + if (AddingY < 0) AddingY = 0; if (AddingY > Scr->MyDisplayHeight - AddingH) @@ -523,29 +523,29 @@ AddWindow(Window w, int iconm, IconMgr *iconp) if (Event.type == ButtonPress) break; } - + if (event.type == ButtonPress) { AddingX = event.xbutton.x_root; AddingY = event.xbutton.y_root; - + /* DontMoveOff prohibits user form off-screen placement */ - if (Scr->DontMoveOff) + if (Scr->DontMoveOff) { int AddingR, AddingB; - + AddingR = AddingX + AddingW; AddingB = AddingY + AddingH; - + if (AddingX < 0) AddingX = 0; if (AddingR > Scr->MyDisplayWidth) AddingX = Scr->MyDisplayWidth - AddingW; - + if (AddingY < 0) AddingY = 0; if (AddingB > Scr->MyDisplayHeight) AddingY = Scr->MyDisplayHeight - AddingH; - + } break; } @@ -563,7 +563,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) AddingR = AddingX + AddingW; AddingB = AddingY + AddingH; - + if (AddingX < 0) AddingX = 0; if (AddingR > Scr->MyDisplayWidth) @@ -594,7 +594,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) if (0/*Scr->AutoRelativeResize*/) { int dx = (tmp_win->attr.width / 4); int dy = (tmp_win->attr.height / 4); - + #define HALF_AVE_CURSOR_SIZE 8 /* so that it is visible */ if (dx < HALF_AVE_CURSOR_SIZE) dx = HALF_AVE_CURSOR_SIZE; if (dy < HALF_AVE_CURSOR_SIZE) dy = HALF_AVE_CURSOR_SIZE; @@ -640,7 +640,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) /* * XXX - if we are going to do a loop, we ought to consider - * using multiple GXxor lines so that we don't need to + * using multiple GXxor lines so that we don't need to * grab the server. */ XQueryPointer(dpy, Scr->Root, &JunkRoot, &JunkChild, @@ -655,7 +655,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) } } - } + } else if (event.xbutton.button == Button3) { int maxw = Scr->MyDisplayWidth - AddingX - bw2; @@ -698,7 +698,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) #ifdef DEBUG - fprintf(stderr, " position window %d, %d %dx%d\n", + fprintf(stderr, " position window %d, %d %dx%d\n", tmp_win->attr.x, tmp_win->attr.y, tmp_win->attr.width, @@ -737,9 +737,9 @@ AddWindow(Window w, int iconm, IconMgr *iconp) /* * Make sure the client window still exists. We don't want to leave an - * orphan frame window if it doesn't. Since we now have the server - * grabbed, the window can't disappear later without having been - * reparented, so we'll get a DestroyNotify for it. We won't have + * orphan frame window if it doesn't. Since we now have the server + * grabbed, the window can't disappear later without having been + * reparented, so we'll get a DestroyNotify for it. We won't have * gotten one for anything up to here, however. */ if (XGetGeometry(dpy, tmp_win->w, &JunkRoot, &JunkX, &JunkY, @@ -798,7 +798,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) attributes.background_pixmap = None; attributes.border_pixel = tmp_win->border; attributes.cursor = Scr->FrameCursor; - attributes.event_mask = (SubstructureRedirectMask | + attributes.event_mask = (SubstructureRedirectMask | ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask); if (tmp_win->attr.save_under) { @@ -807,14 +807,14 @@ AddWindow(Window w, int iconm, IconMgr *iconp) } tmp_win->frame = XCreateWindow (dpy, Scr->Root, tmp_win->frame_x, - tmp_win->frame_y, + tmp_win->frame_y, (unsigned int) tmp_win->frame_width, (unsigned int) tmp_win->frame_height, (unsigned int) tmp_win->frame_bw, Scr->d_depth, (unsigned int) CopyFromParent, Scr->d_visual, valuemask, &attributes); - + if (tmp_win->title_height) { valuemask = (CWEventMask | CWBorderPixel | CWBackPixel); @@ -822,10 +822,10 @@ AddWindow(Window w, int iconm, IconMgr *iconp) ButtonReleaseMask | ExposureMask); attributes.border_pixel = tmp_win->border; attributes.background_pixel = tmp_win->title.back; - tmp_win->title_w = XCreateWindow (dpy, tmp_win->frame, + tmp_win->title_w = XCreateWindow (dpy, tmp_win->frame, -tmp_win->frame_bw, -tmp_win->frame_bw, - (unsigned int) tmp_win->attr.width, + (unsigned int) tmp_win->attr.width, (unsigned int) Scr->TitleHeight, (unsigned int) tmp_win->frame_bw, Scr->d_depth, @@ -840,8 +840,8 @@ AddWindow(Window w, int iconm, IconMgr *iconp) if (tmp_win->highlight) { - tmp_win->gray = XCreatePixmapFromBitmapData(dpy, Scr->Root, - gray_bits, gray_width, gray_height, + tmp_win->gray = XCreatePixmapFromBitmapData(dpy, Scr->Root, + gray_bits, gray_width, gray_height, tmp_win->border_tile.fore, tmp_win->border_tile.back, Scr->d_depth); @@ -850,7 +850,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) else tmp_win->gray = None; - + if (tmp_win->title_w) { CreateWindowTitlebarButtons (tmp_win); ComputeTitleLocation (tmp_win); @@ -868,7 +868,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) if (HasShape) XShapeSelectInput (dpy, tmp_win->w, ShapeNotifyMask); - + if (tmp_win->title_w) { XMapWindow (dpy, tmp_win->title_w); } @@ -887,7 +887,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) if (!tmp_win->iconmgr) XAddToSaveSet(dpy, tmp_win->w); - + XReparentWindow(dpy, tmp_win->w, tmp_win->frame, 0, tmp_win->title_height); /* * Reparenting generates an UnmapNotify event, followed by a MapNotify. @@ -901,7 +901,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) tmp_win->frame_width, tmp_win->frame_height, -1, True); /* wait until the window is iconified and the icon window is mapped - * before creating the icon window + * before creating the icon window */ tmp_win->icon_w = (Window) 0; @@ -940,7 +940,7 @@ AddWindow(Window w, int iconm, IconMgr *iconp) XUngrabServer(dpy); /* if we were in the middle of a menu activated function, regrab - * the pointer + * the pointer */ if (RootFunction) ReGrab(); @@ -967,7 +967,7 @@ MappedNotOverride(Window w) /** - * attach default bindings so that naive users don't get messed up if they + * attach default bindings so that naive users don't get messed up if they * provide a minimal twmrc. */ static void do_add_binding (int button, int context, int modifier, int func) @@ -1023,9 +1023,9 @@ GrabButtons(TwmWindow *tmp_win) /* twm used to do this grab on the application main window, * tmp_win->w . This was not ICCCM complient and was changed. */ - XGrabButton(dpy, i, j, tmp_win->frame, + XGrabButton(dpy, i, j, tmp_win->frame, True, ButtonPressMask | ButtonReleaseMask, - GrabModeAsync, GrabModeAsync, None, + GrabModeAsync, GrabModeAsync, None, Scr->FrameCursor); } } @@ -1113,12 +1113,12 @@ static Window CreateHighlightWindow (TwmWindow *tmp_win) * Pixmaps { TitleHighlight "hline2" } * * (or whatever the horizontal line bitmap is named) in the startup - * file. If all else fails, use the foreground color to look like a + * file. If all else fails, use the foreground color to look like a * solid line. */ if (!Scr->hilitePm) { - Scr->hilitePm = XCreateBitmapFromData (dpy, tmp_win->title_w, - gray_bits, gray_width, + Scr->hilitePm = XCreateBitmapFromData (dpy, tmp_win->title_w, + gray_bits, gray_width, gray_height); Scr->hilite_pm_width = gray_width; Scr->hilite_pm_height = gray_height; @@ -1134,7 +1134,7 @@ static Window CreateHighlightWindow (TwmWindow *tmp_win) (GCForeground|GCBackground|GCGraphicsExposures), &gcv); if (gc) { - XCopyPlane (dpy, Scr->hilitePm, pm, gc, 0, 0, + XCopyPlane (dpy, Scr->hilitePm, pm, gc, 0, 0, Scr->hilite_pm_width, Scr->hilite_pm_height, 0, 0, 1); XFreeGC (dpy, gc); @@ -1181,11 +1181,11 @@ void ComputeCommonTitleOffsets () void ComputeWindowTitleOffsets (TwmWindow *tmp_win, int width, Bool squeeze) { tmp_win->highlightx = (Scr->TBInfo.titlex + tmp_win->name_width); - if (tmp_win->hilite_w || Scr->TBInfo.nright > 0) + if (tmp_win->hilite_w || Scr->TBInfo.nright > 0) tmp_win->highlightx += Scr->TitlePadding; tmp_win->rightx = width - Scr->TBInfo.rightoff; if (squeeze && tmp_win->squeeze_info) { - int rx = (tmp_win->highlightx + + int rx = (tmp_win->highlightx + (tmp_win->hilite_w ? Scr->TBInfo.width * 2 : 0) + (Scr->TBInfo.nright > 0 ? Scr->TitlePadding : 0) + @@ -1197,8 +1197,8 @@ void ComputeWindowTitleOffsets (TwmWindow *tmp_win, int width, Bool squeeze) /** - * calculate the position of the title window. We need to take the frame_bw - * into account since we want (0,0) of the title window to line up with (0,0) + * calculate the position of the title window. We need to take the frame_bw + * into account since we want (0,0) of the title window to line up with (0,0) * of the frame window. */ void ComputeTitleLocation (register TwmWindow *tmp) @@ -1289,7 +1289,7 @@ static void CreateWindowTitlebarButtons (TwmWindow *tmp_win) if (nb > 0) { tmp_win->titlebuttons = (TBWindow *) malloc (nb * sizeof(TBWindow)); if (!tmp_win->titlebuttons) { - fprintf (stderr, "%s: unable to allocate %d titlebuttons\n", + fprintf (stderr, "%s: unable to allocate %d titlebuttons\n", ProgramName, nb); } else { TBWindow *tbw; @@ -1318,7 +1318,7 @@ static void CreateWindowTitlebarButtons (TwmWindow *tmp_win) } } - tmp_win->hilite_w = (tmp_win->titlehighlight + tmp_win->hilite_w = (tmp_win->titlehighlight ? CreateHighlightWindow (tmp_win) : None); XMapSubwindows(dpy, tmp_win->title_w); @@ -1437,7 +1437,7 @@ CreateColormapWindow(Window w, Bool creating_parent, Bool property_window) return (cwin); } -void +void FetchWmColormapWindows (TwmWindow *tmp) { register int i, j; @@ -1449,14 +1449,14 @@ FetchWmColormapWindows (TwmWindow *tmp) number_cmap_windows = 0; - if (/* SUPPRESS 560 */(previously_installed = + if (/* SUPPRESS 560 */(previously_installed = (Scr->cmapInfo.cmaps == &tmp->cmaps && tmp->cmaps.number_cwins))) { cwins = tmp->cmaps.cwins; for (i = 0; i < tmp->cmaps.number_cwins; i++) cwins[i]->colormap->state = 0; } - if (XGetWMColormapWindows (dpy, tmp->w, &cmap_windows, + if (XGetWMColormapWindows (dpy, tmp->w, &cmap_windows, &number_cmap_windows) && number_cmap_windows > 0) { @@ -1472,7 +1472,7 @@ FetchWmColormapWindows (TwmWindow *tmp) (Window *) malloc (sizeof(Window) * (number_cmap_windows + 1)); if (!new_cmap_windows) { - fprintf (stderr, + fprintf (stderr, "%s: unable to allocate %d element colormap window array\n", ProgramName, number_cmap_windows+1); goto done; @@ -1548,9 +1548,9 @@ FetchWmColormapWindows (TwmWindow *tmp) tmp->cmaps.cwins = cwins; tmp->cmaps.number_cwins = number_cmap_windows; if (number_cmap_windows > 1) - tmp->cmaps.scoreboard = + tmp->cmaps.scoreboard = (char *) calloc(1, ColormapsScoreboardLength(&tmp->cmaps)); - + if (previously_installed) InstallWindowColormaps(PropertyNotify, (TwmWindow *) NULL); @@ -1583,7 +1583,7 @@ void GetWindowSizeHints (TwmWindow *tmp) NorthEastGravity, NorthWestGravity }; int right = tmp->attr.x + tmp->attr.width + 2 * tmp->old_bw; int bottom = tmp->attr.y + tmp->attr.height + 2 * tmp->old_bw; - tmp->hints.win_gravity = + tmp->hints.win_gravity = gravs[((Scr->MyDisplayHeight - bottom < tmp->title_height) ? 0 : 2) | ((Scr->MyDisplayWidth - right < tmp->title_height) ? 0 : 1)]; tmp->hints.flags |= PWinGravity; diff --git a/src/add_window.h b/src/add_window.h index 9b883cb..aba9874 100644 --- a/src/add_window.h +++ b/src/add_window.h @@ -77,7 +77,7 @@ extern void GrabButtons ( TwmWindow *tmp_win ); extern void GrabKeys ( TwmWindow *tmp_win ); extern int MappedNotOverride ( Window w ); extern void SetHighlightPixmap ( char *filename ); -extern int AddingX; +extern int AddingX; extern int AddingY; extern int AddingW; extern int AddingH; diff --git a/src/cursor.c b/src/cursor.c index 83c827e..5bfc4f9 100644 --- a/src/cursor.c +++ b/src/cursor.c @@ -1,5 +1,5 @@ /* - * + * Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its @@ -122,7 +122,7 @@ static struct _CursorName { {"xterm", XC_xterm, None}, }; -void +void NewFontCursor (Cursor *cp, char *str) { int i; @@ -138,7 +138,7 @@ NewFontCursor (Cursor *cp, char *str) return; } } - fprintf (stderr, "%s: unable to find font cursor \"%s\"\n", + fprintf (stderr, "%s: unable to find font cursor \"%s\"\n", ProgramName, str); } @@ -161,7 +161,7 @@ NewBitmapCursor(Cursor *cp, char *source, char *mask) XGetGeometry(dpy, mpm, &JunkRoot, &mx, &my, &mw, &mh, &JunkBW,&JunkDepth); if (sw != mw || sh != mh) { - fprintf (stderr, + fprintf (stderr, "%s: cursor bitmaps \"%s\" and \"%s\" not the same size\n", ProgramName, source, mask); return; diff --git a/src/events.c b/src/events.c index 87d1ac7..2239e6f 100644 --- a/src/events.c +++ b/src/events.c @@ -83,8 +83,8 @@ XEvent ButtonEvent; /* button press event */ XEvent Event; /* the current event */ TwmWindow *Tmp_win; /* the current twm window */ -/** Used in HandleEnterNotify to remove border highlight from a window - * that has not recieved a LeaveNotify event because of a pointer grab +/** Used in HandleEnterNotify to remove border highlight from a window + * that has not recieved a LeaveNotify event because of a pointer grab */ TwmWindow *UnHighLight_win = NULL; @@ -535,7 +535,7 @@ HandleVisibilityNotify() cwin = (ColormapWindow *) context_data; else return; - + /* * when Saber complains about retreiving an <int> from an <unsigned int> * just type "touch vevent->state" and "cont" @@ -598,7 +598,7 @@ HandleKeyPress() (key->cont == Context || key->cont == C_NAME)) { /* weed out the functions that don't make sense to execute - * from a key press + * from a key press */ if (key->func == F_RESIZE) return; @@ -683,7 +683,7 @@ HandleKeyPress() -static void +static void free_window_names (TwmWindow *tmp, Bool nukefull, Bool nukename, Bool nukeicon) { /* @@ -701,7 +701,7 @@ free_window_names (TwmWindow *tmp, Bool nukefull, Bool nukename, Bool nukeicon) -void +void free_cwins (TwmWindow *tmp) { int i; @@ -748,7 +748,7 @@ HandlePropertyNotify() switch (Event.xproperty.state) { case PropertyNewValue: - if (XGetRGBColormaps (dpy, Scr->Root, &maps, &nmaps, + if (XGetRGBColormaps (dpy, Scr->Root, &maps, &nmaps, Event.xproperty.atom)) { /* if got one, then replace any existing entry */ InsertRGBColormap (Event.xproperty.atom, maps, nmaps, True); @@ -788,7 +788,7 @@ HandlePropertyNotify() /* * if the icon name is NoName, set the name of the icon to be - * the same as the window + * the same as the window */ if (Tmp_win->icon_name == NoName) { Tmp_win->icon_name = Tmp_win->name; @@ -889,7 +889,7 @@ HandlePropertyNotify() if (Tmp_win->icon_w && !Tmp_win->forced && Tmp_win->wmhints && (Tmp_win->wmhints->flags & IconPixmapHint)) { if (!XGetGeometry (dpy, Tmp_win->wmhints->icon_pixmap, &JunkRoot, - &JunkX, &JunkY, (unsigned int *)&Tmp_win->icon_width, + &JunkX, &JunkY, (unsigned int *)&Tmp_win->icon_width, (unsigned int *)&Tmp_win->icon_height, &JunkBW, &JunkDepth)) { return; } @@ -1060,12 +1060,12 @@ HandleExpose() height = Scr->DefaultFont.height+2; for (i = 0; i < InfoLines; i++) { - MyFont_DrawString(dpy, Scr->InfoWindow, &Scr->DefaultFont, - Scr->NormalGC, 5, (i*height) + Scr->DefaultFont.y, Info[i], + MyFont_DrawString(dpy, Scr->InfoWindow, &Scr->DefaultFont, + Scr->NormalGC, 5, (i*height) + Scr->DefaultFont.y, Info[i], strlen(Info[i])); } flush_expose (Event.xany.window); - } + } else if (Tmp_win != NULL) { if (Event.xany.window == Tmp_win->title_w) @@ -1074,7 +1074,7 @@ HandleExpose() &Scr->TitleBarFont); MyFont_DrawString (dpy, Tmp_win->title_w, &Scr->TitleBarFont, - Scr->NormalGC, Scr->TBInfo.titlex, Scr->TitleBarFont.y, + Scr->NormalGC, Scr->TBInfo.titlex, Scr->TitleBarFont.y, Tmp_win->name, strlen(Tmp_win->name)); flush_expose (Event.xany.window); } @@ -1129,7 +1129,7 @@ HandleExpose() flush_expose (Event.xany.window); return; } - } + } } } @@ -1152,7 +1152,7 @@ static void remove_window_from_ring (TwmWindow *tmp) */ if (prev) prev->ring.next = next; if (next) next->ring.prev = prev; - if (Scr->Ring == tmp) + if (Scr->Ring == tmp) Scr->Ring = (next != tmp ? next : (TwmWindow *) NULL); if (!Scr->Ring || Scr->RingLeader == tmp) Scr->RingLeader = Scr->Ring; @@ -1215,7 +1215,7 @@ HandleDestroyNotify() /* * TwmWindows contain the following pointers - * + * * 1. full_name * 2. name * 3. icon_name @@ -1319,7 +1319,7 @@ HandleMapRequest() (state == NormalState || state == IconicState))) state = Tmp_win->wmhints->initial_state; - switch (state) + switch (state) { case DontCareState: case NormalState: @@ -1427,8 +1427,8 @@ HandleUnmapNotify() * The program may have unmapped the client window, from either * NormalState or IconicState. Handle the transition to WithdrawnState. * - * We need to reparent the window back to the root (so that twm exiting - * won't cause it to get mapped) and then throw away all state (pretend + * We need to reparent the window back to the root (so that twm exiting + * won't cause it to get mapped) and then throw away all state (pretend * that we've received a DestroyNotify). */ @@ -1436,12 +1436,12 @@ HandleUnmapNotify() if (XTranslateCoordinates (dpy, Event.xunmap.window, Tmp_win->attr.root, 0, 0, &dstx, &dsty, &dumwin)) { XEvent ev; - Bool reparented = XCheckTypedWindowEvent (dpy, Event.xunmap.window, + Bool reparented = XCheckTypedWindowEvent (dpy, Event.xunmap.window, ReparentNotify, &ev); SetMapStateProp (Tmp_win, WithdrawnState); if (reparented) { if (Tmp_win->old_bw) XSetWindowBorderWidth (dpy, - Event.xunmap.window, + Event.xunmap.window, Tmp_win->old_bw); if (Tmp_win->wmhints && (Tmp_win->wmhints->flags & IconWindowHint)) XUnmapWindow (dpy, Tmp_win->wmhints->icon_window); @@ -1542,7 +1542,7 @@ HandleButtonRelease() xl = ConstMoveX; } } - + if (Scr->DontMoveOff && MoveFunction != F_FORCEMOVE) { xr = xl + w; @@ -1674,7 +1674,7 @@ HandleButtonRelease() * \param menu menu to pop up * \param w invoking window, or None */ -static void +static void do_menu (MenuRoot *menu, Window w) { int x = Event.xbutton.x_root; @@ -1800,7 +1800,7 @@ HandleButtonPress() { Tmp_win = Tmp_win->list->iconmgr->twm_win; XTranslateCoordinates(dpy, Event.xany.window, Tmp_win->w, - Event.xbutton.x, Event.xbutton.y, + Event.xbutton.x, Event.xbutton.y, &JunkX, &JunkY, &JunkChild); Event.xbutton.x = JunkX; @@ -1812,7 +1812,7 @@ HandleButtonPress() { Context = C_TITLE; } - else if (Event.xany.window == Tmp_win->w) + else if (Event.xany.window == Tmp_win->w) { printf("ERROR! ERROR! ERROR! YOU SHOULD NOT BE HERE!!!\n"); Context = C_WINDOW; @@ -1821,7 +1821,7 @@ HandleButtonPress() { Context = C_ICON; } - else if (Event.xany.window == Tmp_win->frame) + else if (Event.xany.window == Tmp_win->frame) { /* since we now place a button grab on the frame instead * of the window, (see GrabButtons() in add_window.c), we @@ -1865,8 +1865,8 @@ HandleButtonPress() XPointer context_data; XTranslateCoordinates(dpy, Scr->Root, Scr->Root, - Event.xbutton.x, - Event.xbutton.y, + Event.xbutton.x, + Event.xbutton.y, &JunkX, &JunkY, &Event.xany.window); if (Event.xany.window == 0 || @@ -1881,8 +1881,8 @@ HandleButtonPress() Tmp_win = (TwmWindow *) context_data; XTranslateCoordinates(dpy, Scr->Root, Event.xany.window, - Event.xbutton.x, - Event.xbutton.y, + Event.xbutton.x, + Event.xbutton.y, &JunkX, &JunkY, &JunkChild); Event.xbutton.x = JunkX; @@ -1902,7 +1902,7 @@ HandleButtonPress() ButtonEvent = Event; ButtonWindow = Tmp_win; - /* if we get to here, we have to execute a function or pop up a + /* if we get to here, we have to execute a function or pop up a * menu */ modifier = (Event.xbutton.state & mods_used); @@ -1990,7 +1990,7 @@ HandleEnterNotify() HENScanArgs scanArgs; XEvent dummy; XPointer context_data; - + /* * Save the id of the window entered. This will be used to remove * border highlight on entering the next application window. @@ -2025,7 +2025,7 @@ HandleEnterNotify() (void) XCheckIfEvent(dpy, &dummy, HENQueueScanner, (char *) &scanArgs); /* - * if entering root window, restore twm default colormap so that + * if entering root window, restore twm default colormap so that * titlebars are legible */ if (ewp->window == Scr->Root) { @@ -2053,7 +2053,7 @@ HandleEnterNotify() XUnmapWindow(dpy, Scr->Focus->hilite_w); /* - * If entering the frame or the icon manager, then do + * If entering the frame or the icon manager, then do * "window activation things": * * 1. turn on highlight window (if any) @@ -2289,7 +2289,7 @@ HandleConfigureRequest() * to configuration requests for windows which have never been mapped. */ if (!Tmp_win || Tmp_win->icon_w == cre->window) { - xwcm = cre->value_mask & + xwcm = cre->value_mask & (CWX | CWY | CWWidth | CWHeight | CWBorderWidth); xwc.x = cre->x; xwc.y = cre->y; @@ -2310,7 +2310,7 @@ HandleConfigureRequest() xwc.sibling = (otherwin != NULL) ? otherwin->frame : cre->above; xwc.stack_mode = cre->detail; - XConfigureWindow (dpy, Tmp_win->frame, + XConfigureWindow (dpy, Tmp_win->frame, cre->value_mask & (CWSibling | CWStackMode), &xwc); } @@ -2328,8 +2328,8 @@ HandleConfigureRequest() * This means that we need to adjust for the additional title height as * well as for any border width changes that we decide to allow. The * current window gravity is to be used in computing the adjustments, just - * as when initially locating the window. Note that if we do decide to - * allow border width changes, we will need to send the synthetic + * as when initially locating the window. Note that if we do decide to + * allow border width changes, we will need to send the synthetic * ConfigureNotify event. */ GetGravityOffsets (Tmp_win, &gravx, &gravy); @@ -2367,7 +2367,7 @@ HandleConfigureRequest() /* * SetupWindow (x,y) are the location of the upper-left outer corner and * are passed directly to XMoveResizeWindow (frame). The (width,height) - * are the inner size of the frame. The inner width is the same as the + * are the inner size of the frame. The inner width is the same as the * requested client window width; the inner height is the same as the * requested client window height plus any title bar slop. */ @@ -2505,7 +2505,7 @@ InstallWindowColormaps (int type, TwmWindow *tmp) (*cwins)->colormap->state &= ~CM_INSTALLABLE; Scr->cmapInfo.cmaps = &tmp->cmaps; break; - + case PropertyNotify: case VisibilityNotify: case ColormapNotify: @@ -2624,7 +2624,7 @@ UninstallRootColormap() if (Scr->cmapInfo.root_pushes) Scr->cmapInfo.root_pushes--; - + if (!Scr->cmapInfo.root_pushes) { /* * If we have subsequent Enter or Leave Notify events, diff --git a/src/iconmgr.c b/src/iconmgr.c index e0fea0a..b4827ad 100644 --- a/src/iconmgr.c +++ b/src/iconmgr.c @@ -1,5 +1,5 @@ /* - * + * Copyright 1989,1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its @@ -78,7 +78,7 @@ void CreateIconManagers() (unsigned int *) &p->width, (unsigned int *)&p->height); if (mask & XNegative) - JunkX = Scr->MyDisplayWidth - p->width - + JunkX = Scr->MyDisplayWidth - p->width - (2 * Scr->BorderWidth) + JunkX; if (mask & YNegative) @@ -235,7 +235,7 @@ void MoveIconManager(int dir) new_row = 0; if (new_col >= ip->cur_columns) new_col = 0; - + /* Now let's go through the list to see if there is an entry with this * new position */ @@ -251,8 +251,8 @@ void MoveIconManager(int dir) if (!got_it) { - fprintf (stderr, - "%s: unable to find window (%d, %d) in icon manager\n", + fprintf (stderr, + "%s: unable to find window (%d, %d) in icon manager\n", ProgramName, new_row, new_col); return; } @@ -280,7 +280,7 @@ void MoveIconManager(int dir) /** * jump from one icon manager to another, possibly even on another screen * \param dir one of the following: - * - F_NEXTICONMGR - go to the next icon manager + * - F_NEXTICONMGR - go to the next icon manager * - F_PREVICONMGR - go to the previous one */ @@ -397,7 +397,7 @@ WList *AddIconManager(TwmWindow *tmp_win) tmp->me = ip->count; tmp->x = -1; tmp->y = -1; - + valuemask = (CWBackPixel | CWBorderPixel | CWEventMask | CWCursor); attributes.background_pixel = tmp->back; attributes.border_pixel = tmp->back; @@ -405,8 +405,8 @@ WList *AddIconManager(TwmWindow *tmp_win) ButtonReleaseMask | ExposureMask | EnterWindowMask | LeaveWindowMask); attributes.cursor = Scr->IconMgrCursor; - tmp->w = XCreateWindow (dpy, ip->w, 0, 0, (unsigned int) 1, - (unsigned int) h, (unsigned int) 0, + tmp->w = XCreateWindow (dpy, ip->w, 0, 0, (unsigned int) 1, + (unsigned int) h, (unsigned int) 0, CopyFromParent, (unsigned int) CopyFromParent, (Visual *) CopyFromParent, valuemask, &attributes); @@ -457,7 +457,7 @@ void InsertInIconManager(IconMgr *ip, WList *tmp, TwmWindow *tmp_win) { WList *tmp1; int added; - int (*compar)(const char *, const char *) + int (*compar)(const char *, const char *) = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1); added = FALSE; @@ -525,7 +525,7 @@ void RemoveIconManager(TwmWindow *tmp_win) ip = tmp->iconmgr; RemoveFromIconManager(ip, tmp); - + XDeleteContext(dpy, tmp->icon, TwmContext); XDeleteContext(dpy, tmp->icon, ScreenContext); XDestroyWindow(dpy, tmp->icon); @@ -587,7 +587,7 @@ void SortIconManager(IconMgr *ip) { WList *tmp1, *tmp2; int done; - int (*compar)(const char *, const char *) + int (*compar)(const char *, const char *) = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1); if (ip == NULL) @@ -617,7 +617,7 @@ void SortIconManager(IconMgr *ip) } /** - * pack the icon manager windows following + * pack the icon manager windows following * an addition or deletion * * \param ip a pointer to the icon manager struture diff --git a/src/iconmgr.h b/src/iconmgr.h index 8e8e515..400c44e 100644 --- a/src/iconmgr.h +++ b/src/iconmgr.h @@ -1,5 +1,5 @@ /* - * + * Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its diff --git a/src/icons.c b/src/icons.c index d026f4a..6ba8066 100644 --- a/src/icons.c +++ b/src/icons.c @@ -1,5 +1,5 @@ /* - * + * Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its @@ -348,7 +348,7 @@ CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y) tmp_win->forced = FALSE; tmp_win->icon_not_ours = FALSE; - /* now go through the steps to get an icon window, if ForceIcon is + /* now go through the steps to get an icon window, if ForceIcon is * set, then no matter what else is defined, the bitmap from the * .twmrc file is used */ @@ -396,7 +396,7 @@ CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y) if (pm == None && tmp_win->wmhints && tmp_win->wmhints->flags & IconPixmapHint) { - + XGetGeometry(dpy, tmp_win->wmhints->icon_pixmap, &JunkRoot, &JunkX, &JunkY, (unsigned int *)&tmp_win->icon_width, (unsigned int *)&tmp_win->icon_height, &JunkBW, &JunkDepth); @@ -409,7 +409,7 @@ CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y) 0,0, tmp_win->icon_width, tmp_win->icon_height, 0, 0, 1 ); } - /* if we still haven't got an icon, let's look in the Icon list + /* if we still haven't got an icon, let's look in the Icon list * if ForceIcon is not set */ if (pm == None && !Scr->ForceIcon) @@ -548,7 +548,7 @@ CreateIconWindow(TwmWindow *tmp_win, int def_x, int def_y) &attributes); } - /* I need to figure out where to put the icon window now, because + /* I need to figure out where to put the icon window now, because * getting here means that I am going to make the icon visible */ if (tmp_win->wmhints && diff --git a/src/icons.h b/src/icons.h index c2fcfb3..6767459 100644 --- a/src/icons.h +++ b/src/icons.h @@ -1,5 +1,5 @@ /* - * + * Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its @@ -52,11 +52,11 @@ typedef struct IconEntry }IconEntry; extern int roundUp ( int v, int multiple ); -extern void PlaceIcon ( TwmWindow *tmp_win, int def_x, int def_y, +extern void PlaceIcon ( TwmWindow *tmp_win, int def_x, int def_y, int *final_x, int *final_y ); extern void IconUp ( TwmWindow *tmp_win ); extern void IconDown ( TwmWindow *tmp_win ); -extern void AddIconRegion ( char *geom, int grav1, int grav2, +extern void AddIconRegion ( char *geom, int grav1, int grav2, int stepx, int stepy ); extern void CreateIconWindow ( TwmWindow *tmp_win, int def_x, int def_y ); @@ -75,13 +75,13 @@ struct name_list_struct /** * add a window name to the appropriate list. * - * If the list does not use the ptr value, a non-null value + * If the list does not use the ptr value, a non-null value * should be placed in it. LookInList returns this ptr value - * and procedures calling LookInList will check for a non-null + * and procedures calling LookInList will check for a non-null * return value as an indication of success. * * \param list the address of the pointer to the head of a list - * \param name a pointer to the name of the window + * \param name a pointer to the name of the window * \param ptr pointer to list dependent data */ void @@ -104,12 +104,12 @@ AddToList(name_list **list_head, char *name, char *ptr) nptr->name = name; nptr->ptr = (ptr == NULL) ? (char *)TRUE : ptr; *list_head = nptr; -} +} /** * look through a list for a window name, or class * - * \return the ptr field of the list structure or NULL if the name + * \return the ptr field of the list structure or NULL if the name * or class was not found in the list * * \param list a pointer to the head of a list @@ -158,7 +158,7 @@ LookInNameList(name_list *list_head, char *name) * \param class a pointer to the class to look for * \param[out] ptr fill in the list value if the name was found */ -int GetColorFromList(name_list *list_head, char *name, XClassHint *class, +int GetColorFromList(name_list *list_head, char *name, XClassHint *class, Pixel *ptr) { int save; @@ -70,9 +70,9 @@ typedef struct name_list_struct name_list; extern void AddToList ( name_list **list_head, char *name, char *ptr ); extern void FreeList ( name_list **list ); -extern int GetColorFromList ( name_list *list_head, char *name, +extern int GetColorFromList ( name_list *list_head, char *name, XClassHint *class, Pixel *ptr ); -extern char * LookInList ( name_list *list_head, char *name, +extern char * LookInList ( name_list *list_head, char *name, XClassHint *class ); extern char * LookInNameList ( name_list *list_head, char *name ); diff --git a/src/menus.c b/src/menus.c index 4dd4da9..eb8f0e8 100644 --- a/src/menus.c +++ b/src/menus.c @@ -98,7 +98,7 @@ int ConstMoveXL; int ConstMoveXR; int ConstMoveYT; int ConstMoveYB; - + /* Globals used to keep track of whether the mouse has moved during a resize function. */ int ResizeOrigX; @@ -166,7 +166,7 @@ InitMenus() * \param win_name the window name (if any) * \param action the action string associated with the function (if any) */ -Bool AddFuncKey (char *name, int cont, int mods, int func, char *win_name, +Bool AddFuncKey (char *name, int cont, int mods, int func, char *win_name, char *action) { FuncKey *tmp; @@ -213,7 +213,7 @@ Bool AddFuncKey (char *name, int cont, int mods, int func, char *win_name, -int CreateTitleButton (char *name, int func, char *action, MenuRoot *menuroot, +int CreateTitleButton (char *name, int func, char *action, MenuRoot *menuroot, Bool rightside, Bool append) { TitleButton *tb = (TitleButton *) malloc (sizeof(TitleButton)); @@ -242,7 +242,7 @@ int CreateTitleButton (char *name, int func, char *action, MenuRoot *menuroot, /* * Cases for list: - * + * * 1. empty list, prepend left put at head of list * 2. append left, prepend right put in between left and right * 3. append right put at tail of list @@ -279,8 +279,8 @@ int CreateTitleButton (char *name, int func, char *action, MenuRoot *menuroot, /** - * Do all the necessary stuff to load in a titlebar button. If we can't find - * the button, then put in a question; if we can't find the question mark, + * Do all the necessary stuff to load in a titlebar button. If we can't find + * the button, then put in a question; if we can't find the question mark, * something is wrong and we are probably going to be in trouble later on. */ void InitTitlebarButtons () @@ -399,7 +399,7 @@ PaintEntry(MenuRoot *mr, MenuItem *mi, int exposure) else gc = Scr->MenuGC; - MyFont_DrawString(dpy, mr->w, &Scr->MenuFont, gc, + MyFont_DrawString(dpy, mr->w, &Scr->MenuFont, gc, mi->x, text_y, mi->item, mi->strlen); } @@ -444,7 +444,7 @@ PaintEntry(MenuRoot *mr, MenuItem *mi, int exposure) text_y, mi->item, mi->strlen); } } - + void PaintMenu(MenuRoot *mr, XEvent *e) @@ -511,7 +511,7 @@ UpdateMenu() if (Event.type != MotionNotify) continue; - + if (!ActiveMenu) continue; @@ -554,7 +554,7 @@ UpdateMenu() done = TRUE; /* if we weren't on the active entry, let's turn the old - * active one off + * active one off */ if (!done && ActiveItem->func != F_TITLE) { @@ -564,7 +564,7 @@ UpdateMenu() } /* if we weren't on the active item, change the active item and turn - * it on + * it on */ if (!done) { @@ -577,16 +577,16 @@ UpdateMenu() } /* now check to see if we were over the arrow of a pull right entry */ - if (ActiveItem && ActiveItem->func == F_MENU && + if (ActiveItem && ActiveItem->func == F_MENU && ((ActiveMenu->width - x) < (ActiveMenu->width >> 1))) { MenuRoot *save = ActiveMenu; - int savex = MenuOrigins[MenuDepth - 1].x; + int savex = MenuOrigins[MenuDepth - 1].x; int savey = MenuOrigins[MenuDepth - 1].y; if (MenuDepth < MAXMENUDEPTH) { - PopUpMenu (ActiveItem->sub, - (savex + (ActiveMenu->width >> 1)), + PopUpMenu (ActiveItem->sub, + (savex + (ActiveMenu->width >> 1)), (savey + ActiveItem->item_num * Scr->EntryHeight) /*(savey + ActiveItem->item_num * Scr->EntryHeight + (Scr->EntryHeight >> 1))*/, False); @@ -676,7 +676,7 @@ NewMenuRoot(char *name) * \param back background color string */ MenuItem * -AddToMenu(MenuRoot *menu, char *item, char *action, MenuRoot *sub, int func, +AddToMenu(MenuRoot *menu, char *item, char *action, MenuRoot *sub, int func, char *fore, char *back) { MenuItem *tmp; @@ -810,10 +810,10 @@ MakeMenu(MenuRoot *mr) attributes.save_under = True; } mr->shadow = XCreateWindow (dpy, Scr->Root, 0, 0, - (unsigned int) mr->width, + (unsigned int) mr->width, (unsigned int) mr->height, (unsigned int)0, - CopyFromParent, + CopyFromParent, (unsigned int) CopyFromParent, (Visual *) CopyFromParent, valuemask, &attributes); @@ -954,14 +954,14 @@ MakeMenu(MenuRoot *mr) * \param x,y location of upper left of menu * \param center whether or not to center horizontally over position */ -Bool +Bool PopUpMenu (MenuRoot *menu, int x, int y, Bool center) { int WindowNameCount; TwmWindow **WindowNames; TwmWindow *tmp_win2,*tmp_win3; int i; - int (*compar)(const char *, const char *) = + int (*compar)(const char *, const char *) = (Scr->CaseSensitive ? strcmp : XmuCompareISOLatin1); if (!menu) return False; @@ -982,7 +982,7 @@ PopUpMenu (MenuRoot *menu, int x, int y, Bool center) menu->width = 0; menu->mapped = NEVER_MAPPED; AddToMenu(menu, "TWM Windows", NULLSTR, NULL, F_TITLE,NULLSTR,NULLSTR); - + for(tmp_win = Scr->TwmRoot.next , WindowNameCount=0; tmp_win != NULL; tmp_win = tmp_win->next) @@ -1137,14 +1137,14 @@ FindMenuRoot(char *name) -static Bool +static Bool belongs_to_twm_window (TwmWindow *t, Window w) { if (!t) return False; if (w == t->frame || w == t->title_w || w == t->hilite_w || w == t->icon_w || w == t->icon_bm_w) return True; - + if (t && t->titlebuttons) { register TBWindow *tbw; register int nb = Scr->TBInfo.nleft + Scr->TBInfo.nright; @@ -1157,7 +1157,7 @@ belongs_to_twm_window (TwmWindow *t, Window w) -void +void resizeFromCenter(Window w, TwmWindow *tmp_win) { int lastx, lasty, bw2; @@ -1177,11 +1177,11 @@ resizeFromCenter(Window w, TwmWindow *tmp_win) height = Scr->SizeFont.height + SIZE_VINDENT * 2; #endif XGetGeometry(dpy, w, &JunkRoot, &origDragX, &origDragY, - (unsigned int *)&DragWidth, (unsigned int *)&DragHeight, + (unsigned int *)&DragWidth, (unsigned int *)&DragHeight, &JunkBW, &JunkDepth); XWarpPointer(dpy, None, w, - 0, 0, 0, 0, DragWidth/2, DragHeight/2); - XQueryPointer (dpy, Scr->Root, &JunkRoot, + 0, 0, 0, 0, DragWidth/2, DragHeight/2); + XQueryPointer (dpy, Scr->Root, &JunkRoot, &JunkChild, &JunkX, &JunkY, &AddingX, &AddingY, &JunkMask); #if 0 @@ -1207,7 +1207,7 @@ resizeFromCenter(Window w, TwmWindow *tmp_win) { XMaskEvent(dpy, ButtonPressMask | PointerMotionMask, &event); - + if (event.type == MotionNotify) { /* discard any extra motion events before a release */ while(XCheckMaskEvent(dpy, @@ -1215,38 +1215,38 @@ resizeFromCenter(Window w, TwmWindow *tmp_win) if (event.type == ButtonPress) break; } - + if (event.type == ButtonPress) { MenuEndResize(tmp_win); XMoveResizeWindow(dpy, w, AddingX, AddingY, AddingW, AddingH); break; } - + /* if (!DispatchEvent ()) continue; */ if (event.type != MotionNotify) { continue; } - + /* * XXX - if we are going to do a loop, we ought to consider - * using multiple GXxor lines so that we don't need to + * using multiple GXxor lines so that we don't need to * grab the server. */ XQueryPointer(dpy, Scr->Root, &JunkRoot, &JunkChild, &JunkX, &JunkY, &AddingX, &AddingY, &JunkMask); - + if (lastx != AddingX || lasty != AddingY) { MenuDoResize(AddingX, AddingY, tmp_win); - + lastx = AddingX; lasty = AddingY; } - + } -} +} @@ -1254,32 +1254,32 @@ resizeFromCenter(Window w, TwmWindow *tmp_win) * execute a twm root function. * * \param func the function to execute - * \param action the menu action to execute + * \param action the menu action to execute * \param w the window to execute this function on * \param tmp_win the twm window structure * \param event the event that caused the function * \param context the context in which the button was pressed * \param pulldown flag indicating execution from pull down menu * - * \return TRUE if should continue with remaining actions, + * \return TRUE if should continue with remaining actions, * else FALSE to abort */ int -WarpThere(TwmWindow *t) +WarpThere(TwmWindow *t) { if (Scr->WarpUnmapped || t->mapped) { if (!t->mapped) DeIconify (t); if (!Scr->NoRaiseWarp) XRaiseWindow (dpy, t->frame); - WarpToWindow (t); - return 1; - } + WarpToWindow (t); + return 1; + } return 0; } int -ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, +ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, XEvent *eventp, int context, int pulldown) { static Time last_time = 0; @@ -1390,7 +1390,7 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, SortIconManager((IconMgr *) NULL); else if (tmp_win->iconmgr) SortIconManager(tmp_win->iconmgrp); - else + else Bell(XkbBI_Info,0,tmp_win->w); Scr->SortIconMgr = save_sort; @@ -1445,39 +1445,39 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, PopDownMenu(); if (pulldown) - XWarpPointer(dpy, None, Scr->Root, + XWarpPointer(dpy, None, Scr->Root, 0, 0, 0, 0, eventp->xbutton.x_root, eventp->xbutton.y_root); if (w != tmp_win->icon_w) { /* can't resize icons */ if ((Context == C_FRAME || Context == C_WINDOW || Context == C_TITLE) - && fromMenu) + && fromMenu) resizeFromCenter(w, tmp_win); else { /* * see if this is being done from the titlebar */ - fromtitlebar = + fromtitlebar = belongs_to_twm_window (tmp_win, eventp->xbutton.window); - + /* Save pointer position so we can tell if it was moved or not during the resize. */ ResizeOrigX = eventp->xbutton.x_root; ResizeOrigY = eventp->xbutton.y_root; - + StartResize (eventp, tmp_win, fromtitlebar); - + do { XMaskEvent(dpy, ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask | ButtonMotionMask, &Event); - + if (fromtitlebar && Event.type == ButtonPress) { fromtitlebar = False; continue; } - + if (Event.type == MotionNotify) { /* discard any extra motion events before a release */ while @@ -1486,13 +1486,13 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, if (Event.type == ButtonRelease) break; } - + if (!DispatchEvent ()) continue; - + } while (!(Event.type == ButtonRelease || Cancel)); return TRUE; } - } + } break; @@ -1518,7 +1518,7 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, MoveFunction = func; if (pulldown) - XWarpPointer(dpy, None, Scr->Root, + XWarpPointer(dpy, None, Scr->Root, 0, 0, 0, 0, eventp->xbutton.x_root, eventp->xbutton.y_root); EventHandler[EnterNotify] = HandleUnknown; @@ -1544,8 +1544,8 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, else if (w != tmp_win->icon_w) { XTranslateCoordinates(dpy, w, tmp_win->frame, - eventp->xbutton.x, - eventp->xbutton.y, + eventp->xbutton.x, + eventp->xbutton.y, &DragX, &DragY, &JunkChild); w = tmp_win->frame; @@ -1566,7 +1566,7 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, * only do the constrained move if timer is set; need to check it * in case of stupid or wicked fast servers */ - if (ConstrainedMoveTime && + if (ConstrainedMoveTime && (eventp->xbutton.time - last_time) < ConstrainedMoveTime) { int width, height; @@ -1625,15 +1625,15 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, if (menuFromFrameOrWindowOrTitlebar) { /* warp the pointer to the middle of the window */ - XWarpPointer(dpy, None, Scr->Root, 0, 0, 0, 0, - origDragX + DragWidth / 2, + XWarpPointer(dpy, None, Scr->Root, 0, 0, 0, 0, + origDragX + DragWidth / 2, origDragY + DragHeight / 2); XFlush(dpy); } - + while (TRUE) { - long releaseEvent = menuFromFrameOrWindowOrTitlebar ? + long releaseEvent = menuFromFrameOrWindowOrTitlebar ? ButtonPress : ButtonRelease; long movementMask = menuFromFrameOrWindowOrTitlebar ? PointerMotionMask : ButtonMotionMask; @@ -1646,7 +1646,7 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, /* throw away enter and leave events until release */ if (Event.xany.type == EnterNotify || - Event.xany.type == LeaveNotify) continue; + Event.xany.type == LeaveNotify) continue; if (Event.type == MotionNotify) { /* discard any extra motion events before a logical release */ @@ -1693,7 +1693,7 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, CurrentDragY != origDragY))) tmp_win->icon_moved = TRUE; if (!Scr->OpaqueMove && menuFromFrameOrWindowOrTitlebar) - XMoveWindow(dpy, DragWindow, + XMoveWindow(dpy, DragWindow, Event.xbutton.x_root - DragWidth / 2, Event.xbutton.y_root - DragHeight / 2); break; @@ -1774,7 +1774,7 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, XMoveWindow(dpy, DragWindow, xl, yt); else MoveOutline(eventp->xmotion.root, xl, yt, w, h, - tmp_win->frame_bw, + tmp_win->frame_bw, moving_icon ? 0 : tmp_win->title_height); } } @@ -1788,7 +1788,7 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, else { xl = eventp->xmotion.x_root - (DragWidth / 2); yt = eventp->xmotion.y_root - (DragHeight / 2); - } + } w = DragWidth + 2 * JunkBW; h = DragHeight + 2 * JunkBW; @@ -1834,7 +1834,7 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, if ((mroot = FindMenuRoot(action)) == NULL) { - fprintf (stderr, "%s: couldn't find function \"%s\"\n", + fprintf (stderr, "%s: couldn't find function \"%s\"\n", ProgramName, action); return TRUE; } @@ -1882,13 +1882,13 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, XConfigureWindow (dpy, w, CWStackMode, &xwc); } break; - + case F_RAISE: if (DeferExecution(context, func, Scr->SelectCursor)) return TRUE; /* check to make sure raise is not from the WindowFunction */ - if (w == tmp_win->icon_w && Context != C_ROOT) + if (w == tmp_win->icon_w && Context != C_ROOT) XRaiseWindow(dpy, tmp_win->icon_w); else XRaiseWindow(dpy, tmp_win->frame); @@ -2007,12 +2007,12 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, if (count > 0) XStoreBytes (dpy, buff, count); close(fd); } else { - fprintf (stderr, - "%s: unable to open cut file \"%s\"\n", + fprintf (stderr, + "%s: unable to open cut file \"%s\"\n", ProgramName, tmp); } if (ptr != tmp) free (ptr); - } + } } else { XFree(ptr); } @@ -2089,23 +2089,23 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, len = strlen(action); for (t = Scr->TwmRoot.next; t != NULL; t = t->next) { - if (!strncmp(action, t->name, len)) + if (!strncmp(action, t->name, len)) if (WarpThere(t)) break; } if (!t) { for (t = Scr->TwmRoot.next; t != NULL; t = t->next) { - if (!strncmp(action, t->class.res_name, len)) + if (!strncmp(action, t->class.res_name, len)) if (WarpThere(t)) break; } if (!t) { for (t = Scr->TwmRoot.next; t != NULL; t = t->next) { - if (!strncmp(action, t->class.res_class, len)) + if (!strncmp(action, t->class.res_class, len)) if (WarpThere(t)) break; } } } - if (!t) + if (!t) Bell(XkbBI_MinorError,0,None); } break; @@ -2145,7 +2145,7 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, } } break; - + case F_WARPRING: switch (action[0]) { case 'n': @@ -2173,7 +2173,7 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, } else { - fprintf (stderr, "%s: unable to open file \"%s\"\n", + fprintf (stderr, "%s: unable to open file \"%s\"\n", ProgramName, ptr); } if (ptr != action) free(ptr); @@ -2243,7 +2243,7 @@ ExecuteFunction(int func, char *action, Window w, TwmWindow *tmp_win, /** - * defer the execution of a function to the next button press if the context + * defer the execution of a function to the next button press if the context * is C_ROOT * * \param context the context in which the mouse button was pressed @@ -2265,7 +2265,7 @@ DeferExecution(int context, int func, Cursor cursor) return (TRUE); } - + return (FALSE); } @@ -2286,7 +2286,7 @@ ReGrab() /** - * checks each function in the list to see if it is one that needs + * checks each function in the list to see if it is one that needs * to be deferred. * * \param root the menu root to check @@ -2335,7 +2335,7 @@ NeedToDefer(MenuRoot *root) * execute the string by /bin/sh * \param s the string containing the command */ -static int +static int System (char *s) { int pid, status; @@ -2465,7 +2465,7 @@ DeIconify(TwmWindow *tmp_win) Zoom(t->icon_w, t->frame); else Zoom(tmp_win->icon_w, t->frame); - + XMapWindow(dpy, t->w); t->mapped = TRUE; if (Scr->NoRaiseDeicon) @@ -2473,7 +2473,7 @@ DeIconify(TwmWindow *tmp_win) else XMapRaised(dpy, t->frame); SetMapStateProp(t, NormalState); - + if (t->icon_w) { XUnmapWindow(dpy, t->icon_w); IconDown (t); @@ -2483,7 +2483,7 @@ DeIconify(TwmWindow *tmp_win) t->icon_on = FALSE; } } - + XSync (dpy, 0); } @@ -2524,7 +2524,7 @@ Iconify(TwmWindow *tmp_win, int def_x, int def_y) else Zoom(t->frame, tmp_win->icon_w); } - + /* * Prevent the receipt of an UnmapNotify, since that would * cause a transition to the Withdrawn state. @@ -2548,8 +2548,8 @@ Iconify(TwmWindow *tmp_win, int def_x, int def_y) t->icon = TRUE; t->icon_on = FALSE; } - } - + } + if (iconify) Zoom(tmp_win->frame, tmp_win->icon_w); @@ -2581,7 +2581,7 @@ Iconify(TwmWindow *tmp_win, int def_x, int def_y) -static void +static void Identify (TwmWindow *t) { int i, n, twidth, width, height; @@ -2627,7 +2627,7 @@ Identify (TwmWindow *t) width = 1; for (i = 0; i < n; i++) { - twidth = MyFont_TextWidth(&Scr->DefaultFont, Info[i], + twidth = MyFont_TextWidth(&Scr->DefaultFont, Info[i], strlen(Info[i])); if (twidth > width) width = twidth; @@ -2639,9 +2639,9 @@ Identify (TwmWindow *t) &dummy, &dummy, &udummy)) { px -= (width / 2); py -= (height / 3); - if (px + width + BW2 >= Scr->MyDisplayWidth) + if (px + width + BW2 >= Scr->MyDisplayWidth) px = Scr->MyDisplayWidth - width - BW2; - if (py + height + BW2 >= Scr->MyDisplayHeight) + if (py + height + BW2 >= Scr->MyDisplayHeight) py = Scr->MyDisplayHeight - height - BW2; if (px < 0) px = 0; if (py < 0) py = 0; @@ -2649,7 +2649,7 @@ Identify (TwmWindow *t) px = py = 0; } XMoveResizeWindow(dpy, Scr->InfoWindow, px, py, width, height); - XMapRaised(dpy, Scr->InfoWindow); + XMapRaised(dpy, Scr->InfoWindow); InfoLines = n; } @@ -2658,18 +2658,18 @@ void SetMapStateProp(TwmWindow *tmp_win, int state) { unsigned long data[2]; /* "suggested" by ICCCM version 1 */ - + data[0] = (unsigned long) state; - data[1] = (unsigned long) (tmp_win->iconify_by_unmapping ? None : + data[1] = (unsigned long) (tmp_win->iconify_by_unmapping ? None : tmp_win->icon_w); - XChangeProperty (dpy, tmp_win->w, _XA_WM_STATE, _XA_WM_STATE, 32, + XChangeProperty (dpy, tmp_win->w, _XA_WM_STATE, _XA_WM_STATE, 32, PropModeReplace, (unsigned char *) data, 2); } -Bool +Bool GetWMState (Window w, int *statep, Window *iwp) { Atom actual_type; @@ -2705,7 +2705,7 @@ WarpToScreen (int n, int inc) while (!newscr) { /* wrap around */ - if (n < 0) + if (n < 0) n = NumScreens - 1; else if (n >= NumScreens) n = 0; @@ -2716,7 +2716,7 @@ WarpToScreen (int n, int inc) n += inc; continue; } - fprintf (stderr, "%s: unable to warp to unmanaged screen %d\n", + fprintf (stderr, "%s: unable to warp to unmanaged screen %d\n", ProgramName, n); Bell(XkbBI_MinorError,0,None); return; @@ -2750,7 +2750,7 @@ BumpWindowColormap (TwmWindow *tmp, int inc) if (inc && tmp->cmaps.number_cwins > 0) { cwins = (ColormapWindow **) malloc(sizeof(ColormapWindow *)* tmp->cmaps.number_cwins); - if (cwins) { + if (cwins) { if ((previously_installed = /* SUPPRESS 560 */(Scr->cmapInfo.cmaps == &tmp->cmaps && tmp->cmaps.number_cwins))) { @@ -2772,7 +2772,7 @@ BumpWindowColormap (TwmWindow *tmp, int inc) tmp->cmaps.cwins = cwins; if (tmp->cmaps.number_cwins > 1) - bzero (tmp->cmaps.scoreboard, + bzero (tmp->cmaps.scoreboard, ColormapsScoreboardLength(&tmp->cmaps)); if (previously_installed) @@ -2802,11 +2802,11 @@ SetBorder (TwmWindow *tmp, Bool onoroff) if (tmp->highlight) { if (onoroff) { XSetWindowBorder (dpy, tmp->frame, tmp->border); - if (tmp->title_w) + if (tmp->title_w) XSetWindowBorder (dpy, tmp->title_w, tmp->border); } else { XSetWindowBorderPixmap (dpy, tmp->frame, tmp->gray); - if (tmp->title_w) + if (tmp->title_w) XSetWindowBorderPixmap (dpy, tmp->title_w, tmp->gray); } } @@ -2838,14 +2838,14 @@ DestroyMenu (MenuRoot *menu) * warping routines */ -void +void WarpAlongRing (XButtonEvent *ev, Bool forward) { TwmWindow *r, *head; if (Scr->RingLeader) head = Scr->RingLeader; - else if (!(head = Scr->Ring)) + else if (!(head = Scr->Ring)) return; if (forward) { @@ -2874,9 +2874,9 @@ WarpAlongRing (XButtonEvent *ev, Bool forward) p->ring.cursor_valid = True; p->ring.curs_x = ev->x_root - t->frame_x; p->ring.curs_y = ev->y_root - t->frame_y; - if (p->ring.curs_x < -p->frame_bw || + if (p->ring.curs_x < -p->frame_bw || p->ring.curs_x >= p->frame_width + p->frame_bw || - p->ring.curs_y < -p->frame_bw || + p->ring.curs_y < -p->frame_bw || p->ring.curs_y >= p->frame_height + p->frame_bw) { /* somehow out of window */ p->ring.curs_x = p->frame_width / 2; @@ -2888,7 +2888,7 @@ WarpAlongRing (XButtonEvent *ev, Bool forward) -void +void WarpToWindow (TwmWindow *t) { int x, y; @@ -2918,7 +2918,7 @@ WarpToWindow (TwmWindow *t) * data[0] message atom * data[1] time stamp */ -static void +static void send_clientmessage (Window w, Atom a, Time timestamp) { XClientMessageEvent ev; diff --git a/src/parse.c b/src/parse.c index dd79092..26f5ebd 100644 --- a/src/parse.c +++ b/src/parse.c @@ -67,7 +67,7 @@ in this Software without prior written authorization from The Open Group. #include "util.h" #include "gram.h" #include "parse.h" -#include <X11/Xatom.h> +#include <X11/Xatom.h> #include <X11/extensions/sync.h> #ifndef SYSTEM_INIT_FILE @@ -384,7 +384,7 @@ typedef struct _TwmKeyword { * in lowercase and only contain the letters a-z). It is fed to a binary * search to parse keywords. */ -static TwmKeyword keytable[] = { +static TwmKeyword keytable[] = { { "all", ALL, 0 }, { "autoraise", AUTO_RAISE, 0 }, { "autorelativeresize", KEYWORD, kw0_AutoRelativeResize }, @@ -729,7 +729,7 @@ int do_string_keyword (int keyword, char *s) { switch (keyword) { case kws_UsePPosition: - { + { int ppos = ParseUsePPosition (s); if (ppos < 0) { twmrc_error_prefix(); @@ -771,7 +771,7 @@ int do_string_keyword (int keyword, char *s) case kws_MaxWindowSize: JunkMask = XParseGeometry (s, &JunkX, &JunkY, &JunkWidth, &JunkHeight); - if ((JunkMask & (WidthValue | HeightValue)) != + if ((JunkMask & (WidthValue | HeightValue)) != (WidthValue | HeightValue)) { twmrc_error_prefix(); fprintf (stderr, "bad MaxWindowSize \"%s\"\n", s); @@ -944,29 +944,29 @@ int do_color_keyword (int keyword, int colormode, char *s) */ void put_pixel_on_root(Pixel pixel) -{ +{ int i, addPixel = 1; - Atom pixelAtom, retAtom; + Atom pixelAtom, retAtom; int retFormat; - unsigned long nPixels, retAfter; + unsigned long nPixels, retAfter; unsigned char*retProp; Pixel *pixelProp; - pixelAtom = XInternAtom(dpy, "_MIT_PRIORITY_COLORS", True); - XGetWindowProperty(dpy, Scr->Root, pixelAtom, 0, 8192, - False, XA_CARDINAL, &retAtom, - &retFormat, &nPixels, &retAfter, + pixelAtom = XInternAtom(dpy, "_MIT_PRIORITY_COLORS", True); + XGetWindowProperty(dpy, Scr->Root, pixelAtom, 0, 8192, + False, XA_CARDINAL, &retAtom, + &retFormat, &nPixels, &retAfter, &retProp); pixelProp = (Pixel *) retProp; - for (i=0; i< nPixels; i++) + for (i=0; i< nPixels; i++) if (pixel == pixelProp[i]) addPixel = 0; - if (addPixel) + if (addPixel) XChangeProperty (dpy, Scr->Root, _XA_MIT_PRIORITY_COLORS, - XA_CARDINAL, 32, PropModeAppend, - (unsigned char *)&pixel, 1); -} + XA_CARDINAL, 32, PropModeAppend, + (unsigned char *)&pixel, 1); +} /** * save a color from a string in the twmrc file. @@ -1005,7 +1005,7 @@ do_var_savecolor(int key) * traverse the var save color list placeing the pixels * in the root window property. */ -void +void assign_var_savecolor() { Cptr cp = chead; @@ -1053,7 +1053,7 @@ assign_var_savecolor() } } -static int +static int ParseUsePPosition (char *s) { XmuCopyISOLatin1Lowered (s, s); diff --git a/src/parse.h b/src/parse.h index 35ef932..977a3e9 100644 --- a/src/parse.h +++ b/src/parse.h @@ -67,7 +67,7 @@ extern void assign_var_savecolor ( void ); extern int do_single_keyword ( int keyword ); extern int do_string_keyword ( int keyword, char *s ); extern int do_number_keyword ( int keyword, int num ); -extern name_list **do_colorlist_keyword ( int keyword, int colormode, +extern name_list **do_colorlist_keyword ( int keyword, int colormode, char *s ); extern int do_color_keyword ( int keyword, int colormode, char *s ); void put_pixel_on_root ( Pixel pixel ); @@ -78,7 +78,7 @@ extern int ParseTwmrc ( char *filename ); extern int parse_keyword ( char *s, int *nump ); extern void TwmOutput ( int c ); extern void twmUnput ( int c ); -extern void do_squeeze_entry ( name_list **list, char *name, int justify, +extern void do_squeeze_entry ( name_list **list, char *name, int justify, int num, int denom ); diff --git a/src/resize.c b/src/resize.c index cd7550f..4ca5eea 100644 --- a/src/resize.c +++ b/src/resize.c @@ -92,7 +92,7 @@ static int last_width; static int last_height; -static void +static void do_auto_clamp (TwmWindow *tmp_win, XEvent *evp) { Window junkRoot; @@ -115,9 +115,9 @@ do_auto_clamp (TwmWindow *tmp_win, XEvent *evp) } h = ((x - dragx) / (dragWidth < 3 ? 1 : (dragWidth / 3))); - v = ((y - dragy - tmp_win->title_height) / + v = ((y - dragy - tmp_win->title_height) / (dragHeight < 3 ? 1 : (dragHeight / 3))); - + if (h <= 0) { clampLeft = 1; clampDX = (x - dragx); @@ -172,7 +172,7 @@ StartResize(XEvent *evp, TwmWindow *tmp_win, Bool fromtitlebar) Scr->SizeStringOffset = SIZE_HINDENT; XResizeWindow (dpy, Scr->SizeWindow, - Scr->SizeStringWidth + SIZE_HINDENT * 2, + Scr->SizeStringWidth + SIZE_HINDENT * 2, Scr->SizeFont.height + SIZE_VINDENT * 2); XMapRaised(dpy, Scr->SizeWindow); InstallRootColormap(); @@ -206,12 +206,12 @@ MenuStartResize(TwmWindow *tmp_win, int x, int y, int w, int h) last_height = 0; Scr->SizeStringOffset = SIZE_HINDENT; XResizeWindow (dpy, Scr->SizeWindow, - Scr->SizeStringWidth + SIZE_HINDENT * 2, + Scr->SizeStringWidth + SIZE_HINDENT * 2, Scr->SizeFont.height + SIZE_VINDENT * 2); XMapRaised(dpy, Scr->SizeWindow); DisplaySize(tmp_win, origWidth, origHeight); MoveOutline (Scr->Root, dragx - tmp_win->frame_bw, - dragy - tmp_win->frame_bw, + dragy - tmp_win->frame_bw, dragWidth + 2 * tmp_win->frame_bw, dragHeight + 2 * tmp_win->frame_bw, tmp_win->frame_bw, tmp_win->title_height); @@ -353,7 +353,7 @@ MenuDoResize(int x_root, int y_root, TwmWindow *tmp_win) /** - * move the rubberband around. This is called for each motion event when + * move the rubberband around. This is called for each motion event when * we are resizing * * \param x_root the X corrdinate in the root window @@ -513,7 +513,7 @@ DisplaySize(TwmWindow *tmp_win, int width, int height) (void) snprintf (str, sizeof(str), " %4d x %-4d ", dwidth, dheight); XRaiseWindow(dpy, Scr->SizeWindow); MyFont_ChangeGC(Scr->DefaultC.fore, Scr->DefaultC.back, &Scr->SizeFont); - MyFont_DrawImageString (dpy, Scr->SizeWindow, &Scr->SizeFont, + MyFont_DrawImageString (dpy, Scr->SizeWindow, &Scr->SizeFont, Scr->NormalGC, Scr->SizeStringOffset, Scr->SizeFont.ascent + SIZE_VINDENT, str, 13); @@ -598,7 +598,7 @@ AddEndResize(TwmWindow *tmp_win) } /** - * adjust the given width and height to account for the constraints imposed + * adjust the given width and height to account for the constraints imposed * by size hints. * * The general algorithm, especially the aspect ratio stuff, is @@ -686,9 +686,9 @@ ConstrainSize (TwmWindow *tmp_win, int *widthp, int *heightp) * * minAspectX * dheight > minAspectY * dwidth * maxAspectX * dheight < maxAspectY * dwidth - * + * */ - + if (tmp_win->hints.flags & PAspect) { if (minAspectX * dheight > minAspectY * dwidth) @@ -728,16 +728,16 @@ ConstrainSize (TwmWindow *tmp_win, int *widthp, int *heightp) /** - * set window sizes, this was called from either AddWindow, EndResize, or + * set window sizes, this was called from either AddWindow, EndResize, or * HandleConfigureNotify. * * Special Considerations: - * This routine will check to make sure the window is not completely off the + * This routine will check to make sure the window is not completely off the * display, if it is, it'll bring some of it back on. * - * The tmp_win->frame_XXX variables should NOT be updated with the values of - * x,y,w,h prior to calling this routine, since the new values are compared - * against the old to see whether a synthetic ConfigureNotify event should be + * The tmp_win->frame_XXX variables should NOT be updated with the values of + * x,y,w,h prior to calling this routine, since the new values are compared + * against the old to see whether a synthetic ConfigureNotify event should be * sent. (It should be sent if the window was moved but not resized.) * * \param tmp_win the TwmWindow pointer @@ -826,7 +826,7 @@ void SetupFrame (TwmWindow *tmp_win, int x, int y, int w, int h, int bw, Bool se tmp_win->title_y = xwc.y = -bw; xwcm |= (CWX | CWY | CWBorderWidth); } - + XConfigureWindow(dpy, tmp_win->title_w, xwcm, &xwc); } @@ -842,7 +842,7 @@ void SetupFrame (TwmWindow *tmp_win, int x, int y, int w, int h, int bw, Bool se XMoveResizeWindow (dpy, tmp_win->w, 0, tmp_win->title_height, w, h - tmp_win->title_height); - /* + /* * fix up frame and assign size/location values in tmp_win */ frame_mask = 0; @@ -902,7 +902,7 @@ void SetupFrame (TwmWindow *tmp_win, int x, int y, int w, int h, int bw, Bool se /** - * zooms window to full height of screen or to full height and width of screen. + * zooms window to full height of screen or to full height and width of screen. * (Toggles so that it can undo the zoom - even when switching between fullzoom * and vertical zoom.) * @@ -1083,7 +1083,7 @@ SetFrameShape (TwmWindow *tmp) /* * Squeezed Title: - * + * * tmp->title_x * 0 | * tmp->title_y ........+--------------+......... -+,- tmp->frame_bw @@ -1099,10 +1099,10 @@ SetFrameShape (TwmWindow *tmp) * | | | | * | +---------------------------+ | * +-------------------------------+ - * - * + * + * * Unsqueezed Title: - * + * * tmp->title_x * | 0 * tmp->title_y +-------------------------------+ -+,tmp->frame_bw @@ -1118,11 +1118,11 @@ SetFrameShape (TwmWindow *tmp) * | | | | * | +---------------------------+ | * +-------------------------------+ - * - * - * + * + * + * * Dimensions and Positions: - * + * * frame orgin (0, 0) * frame upper left border (-tmp->frame_bw, -tmp->frame_bw) * frame size w/o border tmp->frame_width , tmp->frame_height @@ -1132,7 +1132,7 @@ SetFrameShape (TwmWindow *tmp) * title origin w/o border (tmp->title_x, tmp->title_y) * client origin (0, Scr->TitleHeight + tmp->frame_bw) * client size tmp->attr.width , tmp->attr.height - * + * * When shaping, need to remember that the width and height of rectangles * are really deltax and deltay to lower right handle corner, so they need * to have -1 subtracted from would normally be the actual extents. diff --git a/src/screen.h b/src/screen.h index db40be1..2798137 100644 --- a/src/screen.h +++ b/src/screen.h @@ -1,5 +1,5 @@ /* - * + * Copyright 1989, 1998 The Open Group Permission to use, copy, modify, distribute, and sell this software and its diff --git a/src/session.c b/src/session.c index 485eaf3..fd91942 100644 --- a/src/session.c +++ b/src/session.c @@ -113,7 +113,7 @@ Window window; if (prop) XFree (prop); } - + return client_id; } @@ -355,7 +355,7 @@ char *windowRole; if (!write_counted_string (configFile, theWindow->name)) return 0; } - + wm_command = NULL; wm_command_count = 0; XGetCommand (dpy, theWindow->w, &wm_command, &wm_command_count); @@ -450,11 +450,11 @@ ReadWinConfigEntry (FILE *configFile, unsigned short version, goto give_up; if (!read_counted_string (configFile, &entry->wm_name)) goto give_up; - + if (!read_byte (configFile, &byte)) goto give_up; entry->wm_command_count = byte; - + if (entry->wm_command_count == 0) entry->wm_command = NULL; else @@ -534,7 +534,7 @@ give_up: } if (entry->wm_command) free ((char *) entry->wm_command); - + free ((char *) entry); *pentry = NULL; @@ -749,13 +749,13 @@ int *pFd; else return (NULL); #endif -#else +#else char tempFile[PATH_MAX]; char *ptr; snprintf (tempFile, sizeof(tempFile), "%s/%sXXXXXX", path, prefix); ptr = (char *)malloc(strlen(tempFile) + 1); - if (ptr != NULL) + if (ptr != NULL) { strcpy(ptr, tempFile); *pFd = mkstemp(ptr); @@ -809,14 +809,14 @@ SmPointer clientData; prop2.vals = &prop2val; prop2val.value = (SmPointer) userId; prop2val.length = strlen (userId); - + prop3.name = SmRestartStyleHint; prop3.type = SmCARD8; prop3.num_vals = 1; prop3.vals = &prop3val; prop3val.value = (SmPointer) &hint; prop3val.length = 1; - + props[0] = &prop1; props[1] = &prop2; props[2] = &prop3; @@ -842,8 +842,8 @@ SmPointer clientData; #else if ((filename = unique_filename (path, ".twm", &fd)) == NULL) goto bad; - - if (!(configFile = fdopen(fd, "wb"))) + + if (!(configFile = fdopen(fd, "wb"))) goto bad; #endif @@ -878,7 +878,7 @@ SmPointer clientData; } } } - + prop1.name = SmRestartCommand; prop1.type = SmLISTofARRAY8; diff --git a/src/session.h b/src/session.h index 21f951a..e8c2c1c 100644 --- a/src/session.h +++ b/src/session.h @@ -48,7 +48,7 @@ extern int write_byte ( FILE *file, unsigned char b ); extern int write_counted_string ( FILE *file, char *string ); extern int write_short ( FILE *file, short s ); extern int write_ushort ( FILE *file, unsigned short s ); - + extern SmcConn smcConn; #endif @@ -199,7 +199,7 @@ Bool IsPrintScreen(Screen *s) return True; } } - XFree(pscreens); + XFree(pscreens); } return False; } @@ -293,7 +293,7 @@ main(int argc, char *argv[]) #define newhandler(sig) \ if (signal (sig, SIG_IGN) != SIG_IGN) (void) signal (sig, sigHandler) - + newhandler (SIGINT); newhandler (SIGHUP); newhandler (SIGQUIT); @@ -327,7 +327,7 @@ main(int argc, char *argv[]) appContext = XtCreateApplicationContext (); si = XtAppAddSignal(appContext, Done, NULL); - + if (!(dpy = XtOpenDisplay (appContext, display_name, "twm", "twm", NULL, 0, &zero, NULL))) { fprintf (stderr, "%s: unable to open display \"%s\"\n", @@ -336,7 +336,7 @@ main(int argc, char *argv[]) } if (fcntl(ConnectionNumber(dpy), F_SETFD, 1) == -1) { - fprintf (stderr, + fprintf (stderr, "%s: unable to mark display connection as close-on-exec\n", ProgramName); exit (1); @@ -402,7 +402,7 @@ main(int argc, char *argv[]) RedirectError = FALSE; XSetErrorHandler(CatchRedirectError); XSelectInput(dpy, RootWindow (dpy, scrnum), - ColormapChangeMask | EnterWindowMask | PropertyChangeMask | + ColormapChangeMask | EnterWindowMask | PropertyChangeMask | SubstructureRedirectMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask); XSync(dpy, 0); @@ -422,7 +422,7 @@ main(int argc, char *argv[]) numManaged ++; /* Note: ScreenInfo struct is calloc'ed to initialize to zero. */ - Scr = ScreenList[scrnum] = + Scr = ScreenList[scrnum] = (ScreenInfo *) calloc(1, sizeof(ScreenInfo)); if (Scr == NULL) { @@ -483,7 +483,7 @@ main(int argc, char *argv[]) Scr->cmapInfo.root_pushes = 0; InstallWindowColormaps(0, &Scr->TwmRoot); - Scr->StdCmapInfo.head = Scr->StdCmapInfo.tail = + Scr->StdCmapInfo.head = Scr->StdCmapInfo.tail = Scr->StdCmapInfo.mru = NULL; Scr->StdCmapInfo.mruindex = 0; LocateStandardColormaps(); @@ -504,7 +504,7 @@ main(int argc, char *argv[]) if (DisplayCells(dpy, scrnum) < 3) Scr->Monochrome = MONOCHROME; - else if (DefaultVisual(dpy, scrnum)->class == GrayScale) + else if (DefaultVisual(dpy, scrnum)->class == GrayScale) Scr->Monochrome = GRAYSCALE; else Scr->Monochrome = COLOR; @@ -628,16 +628,16 @@ main(int argc, char *argv[]) } } - + attributes.border_pixel = Scr->DefaultC.fore; attributes.background_pixel = Scr->DefaultC.back; attributes.event_mask = (ExposureMask | ButtonPressMask | KeyPressMask | ButtonReleaseMask); attributes.backing_store = NotUseful; attributes.cursor = XCreateFontCursor (dpy, XC_hand2); - valuemask = (CWBorderPixel | CWBackPixel | CWEventMask | + valuemask = (CWBorderPixel | CWBackPixel | CWEventMask | CWBackingStore | CWCursor); - Scr->InfoWindow = XCreateWindow (dpy, Scr->Root, 0, 0, + Scr->InfoWindow = XCreateWindow (dpy, Scr->Root, 0, 0, (unsigned int) 5, (unsigned int) 5, (unsigned int) BW, 0, (unsigned int) CopyFromParent, @@ -648,7 +648,7 @@ main(int argc, char *argv[]) " 8888 x 8888 ", 13); valuemask = (CWBorderPixel | CWBackPixel | CWBitGravity); attributes.bit_gravity = NorthWestGravity; - Scr->SizeWindow = XCreateWindow (dpy, Scr->Root, 0, 0, + Scr->SizeWindow = XCreateWindow (dpy, Scr->Root, 0, 0, (unsigned int) Scr->SizeStringWidth, (unsigned int) (Scr->SizeFont.height + SIZE_VINDENT*2), @@ -850,7 +850,7 @@ RestoreWithdrawnLocation (TwmWindow *tmp) unsigned int bw, mask; XWindowChanges xwc; - if (XGetGeometry (dpy, tmp->w, &JunkRoot, &xwc.x, &xwc.y, + if (XGetGeometry (dpy, tmp->w, &JunkRoot, &xwc.x, &xwc.y, &JunkWidth, &JunkHeight, &bw, &JunkDepth)) { GetGravityOffsets (tmp, &gravx, &gravy); @@ -891,7 +891,7 @@ RestoreWithdrawnLocation (TwmWindow *tmp) } -void +void Reborder (Time time) { TwmWindow *tmp; /* temp twm window structure */ @@ -917,7 +917,7 @@ Reborder (Time time) SetFocus ((TwmWindow*)NULL, time); } -static SIGNAL_T +static SIGNAL_T sigHandler(int sig) { XtNoticeSignal(si); @@ -930,7 +930,7 @@ sigHandler(int sig) void Done(XtPointer client_data, XtSignalId *si) { - if (dpy) + if (dpy) { Reborder(CurrentTime); XCloseDisplay(dpy); @@ -948,7 +948,7 @@ Done(XtPointer client_data, XtSignalId *si) Bool ErrorOccurred = False; XErrorEvent LastErrorEvent; -static int +static int TwmErrorHandler(Display *dpy, XErrorEvent *event) { LastErrorEvent = *event; @@ -963,7 +963,7 @@ TwmErrorHandler(Display *dpy, XErrorEvent *event) } -static int +static int CatchRedirectError(Display *dpy, XErrorEvent *event) { RedirectError = TRUE; @@ -193,7 +193,7 @@ typedef struct _SqueezeInfo { * ICCCM property. */ typedef struct TwmColormap -{ +{ Colormap c; /* Colormap id */ int state; /* install(ability) state */ unsigned long install_req; /* request number which installed it */ @@ -224,7 +224,7 @@ typedef struct Colormaps ((cm)->number_cwins - 1) / 2) /* for each window that is on the display, one of these structures - * is allocated and linked into a list + * is allocated and linked into a list */ typedef struct TwmWindow { @@ -410,7 +410,7 @@ extern Bool GetWMState ( Window w, int *statep, Window *iwp ); extern void twmrc_error_prefix ( void ); extern int yyparse ( void ); -extern int yylex ( void ); +extern int yylex ( void ); extern void yyerror ( char *s ); extern int doinput ( char *buf, int size ); extern void RemoveDQuote ( char *str ); @@ -68,20 +68,20 @@ in this Software without prior written authorization from The Open Group. #include <X11/Xmu/Drawing.h> #include <X11/Xmu/CharSet.h> -static Pixmap CreateXLogoPixmap ( unsigned int *widthp, +static Pixmap CreateXLogoPixmap ( unsigned int *widthp, unsigned int *heightp ); -static Pixmap CreateResizePixmap ( unsigned int *widthp, +static Pixmap CreateResizePixmap ( unsigned int *widthp, unsigned int *heightp ); -static Pixmap CreateDotPixmap ( unsigned int *widthp, +static Pixmap CreateDotPixmap ( unsigned int *widthp, unsigned int *heightp ); -static Pixmap CreateQuestionPixmap ( unsigned int *widthp, +static Pixmap CreateQuestionPixmap ( unsigned int *widthp, unsigned int *heightp ); -static Pixmap CreateMenuPixmap ( unsigned int *widthp, +static Pixmap CreateMenuPixmap ( unsigned int *widthp, unsigned int *heightp ); int HotX, HotY; -/** +/** * move a window outline * * \param root window we are outlining @@ -106,7 +106,7 @@ void MoveOutline(Window root, int x, int y, int width, int height, int bw, int t if (x == lastx && y == lasty && width == lastWidth && height == lastHeight && lastBW == bw && th == lastTH) return; - + r = outline; #define DRAWIT() \ @@ -239,7 +239,7 @@ Zoom(Window wf, Window wt) int y = fy + (int) ((dy * i) / z); unsigned width = (unsigned) (((long) fw) + (dw * i) / z); unsigned height = (unsigned) (((long) fh) + (dh * i) / z); - + XDrawRectangle (dpy, Scr->Root, Scr->DrawGC, x, y, width, height); } @@ -248,7 +248,7 @@ Zoom(Window wf, Window wt) } /** - * expand the tilde character to HOME if it is the first + * expand the tilde character to HOME if it is the first * character of the filename * * \return a pointer to the new name @@ -264,7 +264,7 @@ ExpandFilename(char *name) newname = (char *) malloc (HomeLen + strlen(name) + 2); if (!newname) { - fprintf (stderr, + fprintf (stderr, "%s: unable to allocate %ld bytes to expand filename %s/%s\n", ProgramName, HomeLen + (unsigned long)strlen(name) + 2, Home, &name[1]); @@ -299,7 +299,7 @@ GetUnknownIcon(char *name) * \param[out] widthp pointer to width of bitmap * \param[out] heightp pointer to height of bitmap */ -Pixmap +Pixmap FindBitmap (char *name, unsigned *widthp, unsigned *heightp) { char *bigname; @@ -326,7 +326,7 @@ FindBitmap (char *name, unsigned *widthp, unsigned *heightp) { TBPM_MENU, CreateMenuPixmap }, { TBPM_QUESTION, CreateQuestionPixmap }, }; - + for (i = 0; i < (sizeof pmtab)/(sizeof pmtab[0]); i++) { if (XmuCompareISOLatin1 (pmtab[i].name, name) == 0) return (*pmtab[i].proc) (widthp, heightp); @@ -370,14 +370,14 @@ FindBitmap (char *name, unsigned *widthp, unsigned *heightp) } if (bigname != name) free (bigname); if (pm == None) { - fprintf (stderr, "%s: unable to find bitmap \"%s\"\n", + fprintf (stderr, "%s: unable to find bitmap \"%s\"\n", ProgramName, name); } return pm; } -Pixmap +Pixmap GetBitmap (char *name) { return FindBitmap (name, &JunkWidth, &JunkHeight); @@ -428,7 +428,7 @@ RemoveRGBColormap (Atom a) StdCmap *sc, *prev; prev = NULL; - for (sc = Scr->StdCmapInfo.head; sc; sc = sc->next) { + for (sc = Scr->StdCmapInfo.head; sc; sc = sc->next) { if (sc->atom == a) break; prev = sc; } @@ -490,7 +490,7 @@ GetColor(int kind, Pixel *what, char *name) stat = XParseColor (dpy, cmap, name, &color); if (!stat) { - fprintf (stderr, "%s: invalid color name \"%s\"\n", + fprintf (stderr, "%s: invalid color name \"%s\"\n", ProgramName, name); return; } @@ -532,7 +532,7 @@ GetColor(int kind, Pixel *what, char *name) stdcmap->blue_max + 0.5) * stdcmap->blue_mult)); } else { - fprintf (stderr, "%s: unable to allocate color \"%s\"\n", + fprintf (stderr, "%s: unable to allocate color \"%s\"\n", ProgramName, name); return; } @@ -557,7 +557,7 @@ GetColorValue(int kind, XColor *what, char *name) if (!XLookupColor (dpy, cmap, name, what, &junkcolor)) { - fprintf (stderr, "%s: invalid color name \"%s\"\n", + fprintf (stderr, "%s: invalid color name \"%s\"\n", ProgramName, name); } else @@ -566,7 +566,7 @@ GetColorValue(int kind, XColor *what, char *name) } } -/* +/* * The following functions are sensible to 'use_fontset'. * When 'use_fontset' is True, * - XFontSet-related internationalized functions are used @@ -665,7 +665,7 @@ MyFont_TextWidth(MyFont *font, char *string, int len) } void -MyFont_DrawImageString(Display *dpy, Drawable d, MyFont *font, GC gc, +MyFont_DrawImageString(Display *dpy, Drawable d, MyFont *font, GC gc, int x, int y, char *string, int len) { if (use_fontset) { @@ -676,7 +676,7 @@ MyFont_DrawImageString(Display *dpy, Drawable d, MyFont *font, GC gc, } void -MyFont_DrawString(Display *dpy, Drawable d, MyFont *font, GC gc, +MyFont_DrawString(Display *dpy, Drawable d, MyFont *font, GC gc, int x, int y, char *string, int len) { if (use_fontset) { @@ -687,7 +687,7 @@ MyFont_DrawString(Display *dpy, Drawable d, MyFont *font, GC gc, } void -MyFont_ChangeGC(unsigned long fix_fore, unsigned long fix_back, +MyFont_ChangeGC(unsigned long fix_fore, unsigned long fix_back, MyFont *fix_font) { Gcv.foreground = fix_fore; @@ -703,9 +703,9 @@ MyFont_ChangeGC(unsigned long fix_fore, unsigned long fix_back, /* * The following functions are internationalized substitutions * for XFetchName and XGetIconName using XGetWMName and - * XGetWMIconName. + * XGetWMIconName. * - * Please note that the third arguments have to be freed using free(), + * Please note that the third arguments have to be freed using free(), * not XFree(). */ Status @@ -715,7 +715,7 @@ I18N_FetchName(Display *dpy, Window w, char **winname) XTextProperty text_prop; char **list; int num; - + status = XGetWMName(dpy, w, &text_prop); if (!status || !text_prop.value || !text_prop.nitems) { *winname = NULL; @@ -723,7 +723,7 @@ I18N_FetchName(Display *dpy, Window w, char **winname) } status = XmbTextPropertyToTextList(dpy, &text_prop, &list, &num); if (status < Success || !num || !*list) { - *winname = NULL; + *winname = NULL; return 0; } XFree(text_prop.value); @@ -739,7 +739,7 @@ I18N_GetIconName(Display *dpy, Window w, char **iconname) XTextProperty text_prop; char **list; int num; - + status = XGetWMIconName(dpy, w, &text_prop); if (!status || !text_prop.value || !text_prop.nitems) return 0; status = XmbTextPropertyToTextList(dpy, &text_prop, &list, &num); @@ -771,7 +771,7 @@ SetFocus (TwmWindow *tmp_win, Time time) XSetInputFocus (dpy, w, RevertToPointerRoot, time); } -static Pixmap +static Pixmap CreateXLogoPixmap (unsigned *widthp, unsigned *heightp) { int h = Scr->TBInfo.width - Scr->TBInfo.border * 2; @@ -806,7 +806,7 @@ CreateXLogoPixmap (unsigned *widthp, unsigned *heightp) } -static Pixmap +static Pixmap CreateResizePixmap (unsigned *widthp, unsigned *heightp) { int h = Scr->TBInfo.width - Scr->TBInfo.border * 2; @@ -833,7 +833,7 @@ CreateResizePixmap (unsigned *widthp, unsigned *heightp) XSetLineAttributes (dpy, gc, lw, LineSolid, CapButt, JoinMiter); /* - * draw the resize button, + * draw the resize button, */ w = (h * 2) / 3; points[0].x = w; @@ -861,7 +861,7 @@ CreateResizePixmap (unsigned *widthp, unsigned *heightp) } -static Pixmap +static Pixmap CreateDotPixmap (unsigned *widthp, unsigned *heightp) { int h = Scr->TBInfo.width - Scr->TBInfo.border * 2; @@ -892,7 +892,7 @@ CreateDotPixmap (unsigned *widthp, unsigned *heightp) static char questionmark_bits[] = { 0x38, 0x7c, 0x64, 0x30, 0x18, 0x00, 0x18, 0x18}; -static Pixmap +static Pixmap CreateQuestionPixmap (unsigned *widthp, unsigned *heightp) { *widthp = questionmark_width; @@ -910,14 +910,14 @@ CreateQuestionPixmap (unsigned *widthp, unsigned *heightp) } -static Pixmap +static Pixmap CreateMenuPixmap (unsigned *widthp, unsigned *heightp) { return CreateMenuIcon (Scr->TBInfo.width - Scr->TBInfo.border * 2, widthp,heightp); } -Pixmap +Pixmap CreateMenuIcon (int height, unsigned *widthp, unsigned *heightp) { int h, w; @@ -61,15 +61,15 @@ in this Software without prior written authorization from The Open Group. #ifndef _UTIL_ #define _UTIL_ -extern void MoveOutline ( Window root, int x, int y, int width, int height, +extern void MoveOutline ( Window root, int x, int y, int width, int height, int bw, int th ); extern void Zoom ( Window wf, Window wt ); extern char * ExpandFilename ( char *name ); extern void GetUnknownIcon ( char *name ); -extern Pixmap FindBitmap ( char *name, unsigned int *widthp, +extern Pixmap FindBitmap ( char *name, unsigned int *widthp, unsigned int *heightp ); extern Pixmap GetBitmap ( char *name ); -extern void InsertRGBColormap ( Atom a, XStandardColormap *maps, int nmaps, +extern void InsertRGBColormap ( Atom a, XStandardColormap *maps, int nmaps, Bool replace ); extern void RemoveRGBColormap ( Atom a ); extern void LocateStandardColormaps ( void ); @@ -77,12 +77,12 @@ extern void GetColor ( int kind, Pixel *what, char *name ); extern void GetColorValue ( int kind, XColor *what, char *name ); extern void GetFont ( MyFont *font ); extern int MyFont_TextWidth( MyFont *font, char *string, int len); -extern void MyFont_DrawImageString( Display *dpy, Drawable d, MyFont *font, - GC gc, int x, int y, char * string, +extern void MyFont_DrawImageString( Display *dpy, Drawable d, MyFont *font, + GC gc, int x, int y, char * string, int len); -extern void MyFont_DrawString( Display *dpy, Drawable d, MyFont *font, +extern void MyFont_DrawString( Display *dpy, Drawable d, MyFont *font, GC gc, int x, int y, char * string, int len); -extern void MyFont_ChangeGC( unsigned long fix_fore, unsigned long fix_back, +extern void MyFont_ChangeGC( unsigned long fix_fore, unsigned long fix_back, MyFont *fix_font); extern Status I18N_FetchName( Display *dpy, Window win, char **winname); extern Status I18N_GetIconName( Display *dpy, Window win, char **iconname); |