Skip to content

Instantly share code, notes, and snippets.

@knokmki612
Created March 26, 2016 05:07
Show Gist options
  • Save knokmki612/c708950eddf5e129f0fc to your computer and use it in GitHub Desktop.
Save knokmki612/c708950eddf5e129f0fc to your computer and use it in GitHub Desktop.
diff -uprN twm-1.0.9/configure twm-1.0.9-ohki-patch/configure
--- twm-1.0.9/configure 2015-04-17 14:36:43.000000000 +0900
+++ twm-1.0.9-ohki-patch/configure 2016-03-07 18:07:10.000000000 +0900
@@ -11087,12 +11087,12 @@ if test -n "$TWM_CFLAGS"; then
pkg_cv_TWM_CFLAGS="$TWM_CFLAGS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xext xt xmu ice sm xproto >= 7.0.17\""; } >&5
- ($PKG_CONFIG --exists --print-errors "x11 xext xt xmu ice sm xproto >= 7.0.17") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xext xt xmu ice sm xproto >= 7.0.17 xrandr >= 1.1.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "x11 xext xt xmu ice sm xproto >= 7.0.17 xrandr >= 1.1.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_TWM_CFLAGS=`$PKG_CONFIG --cflags "x11 xext xt xmu ice sm xproto >= 7.0.17" 2>/dev/null`
+ pkg_cv_TWM_CFLAGS=`$PKG_CONFIG --cflags "x11 xext xt xmu ice sm xproto >= 7.0.17 xrandr >= 1.1.0" 2>/dev/null`
else
pkg_failed=yes
fi
@@ -11103,12 +11103,12 @@ if test -n "$TWM_LIBS"; then
pkg_cv_TWM_LIBS="$TWM_LIBS"
elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \
- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xext xt xmu ice sm xproto >= 7.0.17\""; } >&5
- ($PKG_CONFIG --exists --print-errors "x11 xext xt xmu ice sm xproto >= 7.0.17") 2>&5
+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xext xt xmu ice sm xproto >= 7.0.17 xrandr >= 1.1.0\""; } >&5
+ ($PKG_CONFIG --exists --print-errors "x11 xext xt xmu ice sm xproto >= 7.0.17 xrandr >= 1.1.0") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- pkg_cv_TWM_LIBS=`$PKG_CONFIG --libs "x11 xext xt xmu ice sm xproto >= 7.0.17" 2>/dev/null`
+ pkg_cv_TWM_LIBS=`$PKG_CONFIG --libs "x11 xext xt xmu ice sm xproto >= 7.0.17 xrandr >= 1.1.0" 2>/dev/null`
else
pkg_failed=yes
fi
@@ -11126,14 +11126,14 @@ else
_pkg_short_errors_supported=no
fi
if test $_pkg_short_errors_supported = yes; then
- TWM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11 xext xt xmu ice sm xproto >= 7.0.17" 2>&1`
+ TWM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "x11 xext xt xmu ice sm xproto >= 7.0.17 xrandr >= 1.1.0" 2>&1`
else
- TWM_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11 xext xt xmu ice sm xproto >= 7.0.17" 2>&1`
+ TWM_PKG_ERRORS=`$PKG_CONFIG --print-errors "x11 xext xt xmu ice sm xproto >= 7.0.17 xrandr >= 1.1.0" 2>&1`
fi
# Put the nasty error message in config.log where it belongs
echo "$TWM_PKG_ERRORS" >&5
- as_fn_error $? "Package requirements (x11 xext xt xmu ice sm xproto >= 7.0.17) were not met:
+ as_fn_error $? "Package requirements (x11 xext xt xmu ice sm xproto >= 7.0.17 xrandr >= 1.1.0) were not met:
$TWM_PKG_ERRORS
diff -uprN twm-1.0.9/configure.ac twm-1.0.9-ohki-patch/configure.ac
--- twm-1.0.9/configure.ac 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/configure.ac 2016-03-07 18:07:07.000000000 +0900
@@ -49,7 +49,7 @@ AC_PROG_LEX
AC_CHECK_FUNCS([mkstemp])
# Checks for pkg-config packages
-PKG_CHECK_MODULES(TWM, x11 xext xt xmu ice sm xproto >= 7.0.17)
+PKG_CHECK_MODULES(TWM, x11 xext xt xmu ice sm xproto >= 7.0.17 xrandr >= 1.1.0)
AC_CONFIG_FILES([Makefile
src/Makefile
diff -uprN twm-1.0.9/man/twm.man twm-1.0.9-ohki-patch/man/twm.man
--- twm-1.0.9/man/twm.man 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/man/twm.man 2016-03-07 14:04:29.000000000 +0900
@@ -551,6 +551,9 @@ This variable specifies a geometry in wh
give the maximum size for a given window. This is typically used to
restrict windows to the size of the screen. The default width is 32767 -
screen width. The default height is 32767 - screen height.
+.IP "\fBMenuAtLeft\fP" 8
+When this variable is set,
+pull-down menus including cascated ones will be placed at the left side.
.IP "\fBMenuBackground\fP \fIstring\fP" 8
This variable specifies the background color used for menus,
and can only be specified inside of a
@@ -562,6 +565,9 @@ inside of a
.IP "\fBMenuBorderWidth\fP \fIpixels\fP" 8
This variable specifies the width in pixels of the border surrounding
menu windows. The default is 2.
+.IP "\fBMenuBottomUp\fP" 8
+equivalent to set variables both \fBMenuAtLeft\fP and \fBMenuUpward\fP.
+(OBSOLETE!)
.IP "\fBMenuFont\fP \fIstring\fP" 8
This variable specifies the font to use when displaying menus. The default
is "variable".
@@ -569,6 +575,12 @@ is "variable".
This variable specifies the foreground color used for menus,
and can only be specified inside of a
\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. The default is "black".
+.IP "\fBMenuRuns\fP \fIstring\fP" 8
+This variable specifies the direction of menus displayed,
+"t2b" means top to bottom (downward (default)),
+"b2t" bottom to top (upward),
+"r2l" right to left (leftward),
+"l2r" left to right (rightward), respectively.
.IP "\fBMenuShadowColor\fP \fIstring\fP" 8
This variable specifies the color of the shadow behind pull-down menus
and can only be specified inside of a
@@ -583,6 +595,11 @@ This variable specifies the foreground c
menus and
can only be specified inside of a
\fBColor\fP or \fBMonochrome\fP list. The default is "black".
+.IP "\fBMenuUpward\fP" 8
+When this variable is set,
+pull-down menus including cascated ones will be extended upward and
+menu items appear in reverse order.
+(OBSOLETE!)
.IP "\fBMonochrome\fP { \fIcolors\fP }" 8
This variable specifies a list of color assignments that should be made if
the screen has a depth of 1. See the description of \fBColors\fP.
@@ -756,6 +773,7 @@ for \fBright\fP. For example:
"emacs" right 0 0
}
.EE
+The window name "*" works as a wildcard.
The \fBDontSqueezeTitle\fP list can be used to turn off squeezing on
certain titles.
.IP "\fBStartIconified\fP [{ \fIwin-list\fP }] " 8
@@ -764,6 +782,15 @@ icons until explicitly deiconified by th
is given, only those windows will be started iconic. This is useful for
programs that do not support an \fI-iconic\fP command line option or
resource.
+.IP "\fBTitleAtBottom\fP [{ \fIwin-list\fP }] " 8
+.IP "\fBTitleAtLeft\fP [{ \fIwin-list\fP }] " 8
+.IP "\fBTitleAtRight\fP [{ \fIwin-list\fP }] " 8
+.IP "\fBTitleAtTop\fP [{ \fIwin-list\fP }] " 8
+These variables indicates the position of the title bar of client windows.
+If the optional \fIwin-list\fP is given, only those windows will
+have the title bar at the specified position.
+You can override the position of the title bar at runtime
+with \fBf.titlepos\fP function.
.IP "\fBTitleBackground\fP \fIstring\fP [{ \fIwin-list\fP }]" 8
This variable specifies the background color used in titlebars,
and may only be specified inside of a
@@ -811,6 +838,14 @@ older toolkits.
This variable indicates that the pointer should be warped into windows when
they are deiconified. If the optional \fIwin-list\fP is given, the pointer
will only be warped when those windows are deiconified.
+.IP "\fBWarpCursorPos\fP \fInumber\fP or \fIstring\fP" 8
+This variable specifies the position of the pointer when windows are
+deiconified.
+1 (or NW) means upper left (NorthWest), 2 (or W) means middle left (West),
+3 (or SW) means lower left (SouthWest), 4 (or S) means middle bottom (South),
+5 (or SE) means lower right (SouthEast), 6 (or E) means middle right (East),
+7 (or NE) means upper right (NorthEast), 8 (or N) means middle top (North).
+The pointer is located middle of the window by default.
.IP "\fBWindowRing\fP { \fIwin-list\fP }" 8
This variable specifies a list of windows along which the \fBf.warpring\fP
function cycles.
@@ -1134,6 +1169,20 @@ See the variable \fBSortIconManager\fP.
.IP "\fBf.title\fP" 8
This function provides a centered, unselectable item in a menu definition. It
should not be used in any other context.
+.IP "\fBf.titlepos\fP \fIstring\fP" 8
+This function specifies the position of the title bar of clients windows
+at runtime.
+If \fIstring\fP is "top", "left", "bottom" or "right",
+every clients invoked after this function will have its title bar
+at the specified position regardless of the setting of `.twmrc' .
+If \fIstring\fP is not "top", "left", "bottom" nor "right",
+the setting of `.twmrc' becomes effective again.
+If this function is invoked from title context,
+the titlebar of that window is repositioned.
+.IP "\fBf.titlesqz\fP \fIstring\fP" 8
+When this function is invoked from title context,
+the justification style of squeezed title bar is changed.
+A \fIstring\fP must be one of "left", "center", "right" or "none"
.IP "\fBf.topzoom\fP" 8
This variable is similar to the \fBf.bottomzoom\fP function except that
the selected window is only resized to the top half of the display.
diff -uprN twm-1.0.9/src/add_window.c twm-1.0.9-ohki-patch/src/add_window.c
--- twm-1.0.9/src/add_window.c 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/add_window.c 2016-03-07 13:55:01.000000000 +0900
@@ -331,8 +331,12 @@ AddWindow(Window w, int iconm, IconMgr *
&tmp_win->class);
if (!tmp_win->squeeze_info) {
static SqueezeInfo default_squeeze = { J_LEFT, 0, 0 };
- if (Scr->SqueezeTitle)
- tmp_win->squeeze_info = &default_squeeze;
+ if (Scr->SqueezeTitle) {
+ tmp_win->squeeze_info = (SqueezeInfo *)
+ LookInList (Scr->SqueezeTitleL, "*", NULL);
+ if (!tmp_win->squeeze_info)
+ tmp_win->squeeze_info = &default_squeeze;
+ }
}
}
}
@@ -358,6 +362,27 @@ AddWindow(Window w, int iconm, IconMgr *
if (tmp_win->transient && !Scr->DecorateTransients)
tmp_win->title_height = 0;
+ tmp_win->title_pixmap = None;
+ /* find specified title bar position */
+ if (tmp_win->title_height > 0) {
+ if (Scr->TitlePosDynamic != -1)
+ tmp_win->title_pos = Scr->TitlePosDynamic;
+ else if (LookInList(Scr->TitlePosTopL,
+ tmp_win->full_name, &tmp_win->class))
+ tmp_win->title_pos = TP_TOP;
+ else if (LookInList(Scr->TitlePosLeftL,
+ tmp_win->full_name, &tmp_win->class))
+ tmp_win->title_pos = TP_LEFT;
+ else if (LookInList(Scr->TitlePosBottomL,
+ tmp_win->full_name, &tmp_win->class))
+ tmp_win->title_pos = TP_BOTTOM;
+ else if (LookInList(Scr->TitlePosRightL,
+ tmp_win->full_name, &tmp_win->class))
+ tmp_win->title_pos = TP_RIGHT;
+ else
+ tmp_win->title_pos = Scr->TitlePos;
+ } else
+ tmp_win->title_pos = TP_TOP;
if (LookInList(Scr->StartIconified, tmp_win->full_name, &tmp_win->class))
{
if (!tmp_win->wmhints)
@@ -490,9 +515,14 @@ AddWindow(Window w, int iconm, IconMgr *
SIZE_HINDENT,
SIZE_VINDENT + Scr->SizeFont.ascent,
tmp_win->name, namelen);
-
+ if (tmp_win->title_pos == TP_TOP ||
+ tmp_win->title_pos == TP_BOTTOM) {
AddingW = tmp_win->attr.width + bw2;
AddingH = tmp_win->attr.height + tmp_win->title_height + bw2;
+ } else {
+ AddingW = tmp_win->attr.width + tmp_win->title_height + bw2;
+ AddingH = tmp_win->attr.height + bw2;
+ }
if (Scr->DontMoveOff) {
/*
@@ -502,7 +532,7 @@ AddWindow(Window w, int iconm, IconMgr *
AddingX = 0;
if (AddingX > Scr->MyDisplayWidth - AddingW)
AddingX = Scr->MyDisplayWidth - AddingW;
-
+
if (AddingY < 0)
AddingY = 0;
if (AddingY > Scr->MyDisplayHeight - AddingH)
@@ -510,7 +540,8 @@ AddWindow(Window w, int iconm, IconMgr *
}
MoveOutline(Scr->Root, AddingX, AddingY, AddingW, AddingH,
- tmp_win->frame_bw, tmp_win->title_height);
+ tmp_win->frame_bw, tmp_win->title_height,
+ tmp_win->title_pos);
while (TRUE)
{
@@ -552,7 +583,7 @@ AddWindow(Window w, int iconm, IconMgr *
if (event.type != MotionNotify) {
continue;
- }
+ }
XQueryPointer(dpy, Scr->Root, &JunkRoot, &JunkChild,
&JunkX, &JunkY, &AddingX, &AddingY, &JunkMask);
@@ -576,7 +607,8 @@ AddWindow(Window w, int iconm, IconMgr *
}
MoveOutline(Scr->Root, AddingX, AddingY, AddingW, AddingH,
- tmp_win->frame_bw, tmp_win->title_height);
+ tmp_win->frame_bw, tmp_win->title_height,
+ tmp_win->title_pos);
}
@@ -599,8 +631,14 @@ AddWindow(Window w, int iconm, IconMgr *
if (dx < HALF_AVE_CURSOR_SIZE) dx = HALF_AVE_CURSOR_SIZE;
if (dy < HALF_AVE_CURSOR_SIZE) dy = HALF_AVE_CURSOR_SIZE;
#undef HALF_AVE_CURSOR_SIZE
+ if (tmp_win->title_pos == TP_TOP ||
+ tmp_win->title_pos == TP_BOTTOM ) {
dx += (tmp_win->frame_bw + 1);
dy += (bw2 + tmp_win->title_height + 1);
+ } else {
+ dx += (bw2 + tmp_win->title_height + 1);
+ dy += (tmp_win->frame_bw + 1);
+ }
if (AddingX + dx >= Scr->MyDisplayWidth)
dx = Scr->MyDisplayWidth - AddingX - 1;
if (AddingY + dy >= Scr->MyDisplayHeight)
@@ -678,22 +716,32 @@ AddWindow(Window w, int iconm, IconMgr *
XMaskEvent(dpy, ButtonReleaseMask, &event);
}
- MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0);
+ MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0, 0);
XUnmapWindow(dpy, Scr->SizeWindow);
UninstallRootColormap();
XUngrabPointer(dpy, CurrentTime);
+ if (tmp_win->title_pos == TP_TOP ||
+ tmp_win->title_pos == TP_BOTTOM) {
tmp_win->attr.x = AddingX;
- tmp_win->attr.y = AddingY + tmp_win->title_height;
+ tmp_win->attr.y = AddingY;
+ if (tmp_win->title_pos == TP_TOP)
+ tmp_win->attr.y += tmp_win->title_height;
tmp_win->attr.width = AddingW - bw2;
tmp_win->attr.height = AddingH - tmp_win->title_height - bw2;
+ } else {
+ tmp_win->attr.x = AddingX;
+ if (tmp_win->title_pos == TP_LEFT)
+ tmp_win->attr.x += tmp_win->title_height;
+ tmp_win->attr.y = AddingY;
+ tmp_win->attr.width = AddingW - tmp_win->title_height - bw2;
+ tmp_win->attr.height = AddingH - bw2;
+ }
XUngrabServer(dpy);
}
}
} else { /* put it where asked, mod title bar */
- /* if the gravity is towards the top, move it by the title height */
- if (gravy < 0) tmp_win->attr.y -= gravy * tmp_win->title_height;
}
@@ -787,12 +835,21 @@ AddWindow(Window w, int iconm, IconMgr *
/* create windows */
-
+ if (tmp_win->title_pos == TP_TOP || tmp_win->title_pos == TP_BOTTOM) {
tmp_win->frame_x = tmp_win->attr.x + tmp_win->old_bw - tmp_win->frame_bw;
- tmp_win->frame_y = tmp_win->attr.y - tmp_win->title_height +
- tmp_win->old_bw - tmp_win->frame_bw;
+ tmp_win->frame_y = tmp_win->attr.y + tmp_win->old_bw - tmp_win->frame_bw;
+ if (tmp_win->title_pos == TP_TOP)
+ tmp_win->frame_y -= tmp_win->title_height;
tmp_win->frame_width = tmp_win->attr.width;
tmp_win->frame_height = tmp_win->attr.height + tmp_win->title_height;
+ } else {
+ tmp_win->frame_x = tmp_win->attr.x + tmp_win->old_bw - tmp_win->frame_bw;
+ if (tmp_win->title_pos == TP_LEFT)
+ tmp_win->frame_x -= tmp_win->title_height;
+ tmp_win->frame_y = tmp_win->attr.y + tmp_win->old_bw - tmp_win->frame_bw;
+ tmp_win->frame_width = tmp_win->attr.width + tmp_win->title_height;
+ tmp_win->frame_height = tmp_win->attr.height;
+ }
valuemask = CWBackPixmap | CWBorderPixel | CWCursor | CWEventMask;
attributes.background_pixmap = None;
@@ -825,7 +882,11 @@ AddWindow(Window w, int iconm, IconMgr *
tmp_win->title_w = XCreateWindow (dpy, tmp_win->frame,
-tmp_win->frame_bw,
-tmp_win->frame_bw,
+ (tmp_win->title_pos == TP_LEFT || tmp_win->title_pos == TP_RIGHT)?
+ (unsigned int) Scr->TitleHeight :
(unsigned int) tmp_win->attr.width,
+ (tmp_win->title_pos == TP_LEFT || tmp_win->title_pos == TP_RIGHT)?
+ (unsigned int) tmp_win->attr.height :
(unsigned int) Scr->TitleHeight,
(unsigned int) tmp_win->frame_bw,
Scr->d_depth,
@@ -887,8 +948,19 @@ AddWindow(Window w, int iconm, IconMgr *
if (!tmp_win->iconmgr)
XAddToSaveSet(dpy, tmp_win->w);
-
+
+ switch (tmp_win->title_pos) {
+ case TP_TOP:
XReparentWindow(dpy, tmp_win->w, tmp_win->frame, 0, tmp_win->title_height);
+ break;
+ case TP_BOTTOM:
+ case TP_RIGHT:
+ XReparentWindow(dpy, tmp_win->w, tmp_win->frame, 0, 0);
+ break;
+ case TP_LEFT:
+ XReparentWindow(dpy, tmp_win->w, tmp_win->frame, tmp_win->title_height, 0);
+ break;
+ }
/*
* Reparenting generates an UnmapNotify event, followed by a MapNotify.
* Set the map state to FALSE to prevent a transition back to
@@ -1150,12 +1222,18 @@ static Window CreateHighlightWindow (Twm
valuemask = CWBackPixel;
attributes.background_pixel = tmp_win->title.fore;
}
-
+ if (tmp_win->title_pos == TP_TOP || tmp_win->title_pos == TP_BOTTOM)
w = XCreateWindow (dpy, tmp_win->title_w, 0, Scr->FramePadding,
(unsigned int) Scr->TBInfo.width, (unsigned int) h,
(unsigned int) 0,
Scr->d_depth, (unsigned int) CopyFromParent,
Scr->d_visual, valuemask, &attributes);
+ else
+ w = XCreateWindow (dpy, tmp_win->title_w, Scr->FramePadding, 0,
+ (unsigned int) h, (unsigned int) Scr->TBInfo.width,
+ (unsigned int) 0,
+ Scr->d_depth, (unsigned int) CopyFromParent,
+ Scr->d_visual, valuemask, &attributes);
if (pm) XFreePixmap (dpy, pm);
return w;
}
@@ -1212,6 +1290,9 @@ void ComputeTitleLocation (register TwmW
int maxwidth = tmp->frame_width;
int tw = tmp->title_width;
+ if (tmp->title_pos == TP_LEFT || tmp->title_pos == TP_RIGHT) {
+ maxwidth = tmp->attr.height;
+ }
/*
* figure label base from squeeze info (justification fraction)
*/
@@ -1246,8 +1327,15 @@ void ComputeTitleLocation (register TwmW
basex = maxwidth - tw + 1;
if (basex < 0) basex = 0;
+ if (tmp->title_pos == TP_LEFT || tmp->title_pos == TP_RIGHT)
+ tmp->title_y = basex - tmp->frame_bw;
+ else
tmp->title_x = basex - tmp->frame_bw;
}
+ if (tmp->title_pos == TP_BOTTOM)
+ tmp->title_y += tmp->attr.height + tmp->frame_bw;
+ else if (tmp->title_pos == TP_RIGHT)
+ tmp->title_x += tmp->attr.width + tmp->frame_bw;
}
@@ -1270,7 +1358,10 @@ static void CreateWindowTitlebarButtons
* create the title bar windows; let the event handler deal with painting
* so that we don't have to spend two pixmaps (or deal with hashing)
*/
- ComputeWindowTitleOffsets (tmp_win, tmp_win->attr.width, False);
+ ComputeWindowTitleOffsets (tmp_win,
+ (tmp_win->title_pos == TP_TOP || tmp_win->title_pos == TP_BOTTOM)?
+ tmp_win->attr.width : tmp_win->attr.height,
+ False);
leftx = y = Scr->TBInfo.leftx;
rightx = tmp_win->rightx;
@@ -1302,13 +1393,20 @@ static void CreateWindowTitlebarButtons
if (tb->rightside) {
x = rightx;
rightx += boxwidth;
+ if (tmp_win->title_pos == TP_LEFT ||
+ tmp_win->title_pos == TP_RIGHT)
+ attributes.win_gravity = SouthWestGravity;
+ else
attributes.win_gravity = NorthEastGravity;
} else {
x = leftx;
leftx += boxwidth;
attributes.win_gravity = NorthWestGravity;
}
- tbw->window = XCreateWindow (dpy, tmp_win->title_w, x, y, h, h,
+ tbw->window = XCreateWindow (dpy, tmp_win->title_w,
+ (tmp_win->title_pos == TP_TOP || tmp_win->title_pos == TP_BOTTOM)? x : y,
+ (tmp_win->title_pos == TP_TOP || tmp_win->title_pos == TP_BOTTOM)? y : x,
+ h, h,
(unsigned int) Scr->TBInfo.border,
0, (unsigned int) CopyFromParent,
(Visual *) CopyFromParent,
diff -uprN twm-1.0.9/src/deftwmrc.c twm-1.0.9-ohki-patch/src/deftwmrc.c
--- twm-1.0.9/src/deftwmrc.c 2015-04-17 14:37:03.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/deftwmrc.c 2016-03-07 13:25:04.000000000 +0900
@@ -1,4 +1,4 @@
-/*
+/*
* This file is generated automatically from the default
* twm bindings file system.twmrc by the twm Makefile.
*/
diff -uprN twm-1.0.9/src/events.c twm-1.0.9-ohki-patch/src/events.c
--- twm-1.0.9/src/events.c 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/events.c 2016-03-07 13:25:04.000000000 +0900
@@ -170,6 +170,8 @@ InitEvents(void)
EventHandler[VisibilityNotify] = HandleVisibilityNotify;
if (HasShape)
EventHandler[ShapeEventBase+ShapeNotify] = HandleShapeNotify;
+ if (HasRandr)
+ EventHandler[RandrEventBase+RRScreenChangeNotify] = HandleRandrNotify;
}
@@ -1074,6 +1076,13 @@ HandleExpose(void)
MyFont_ChangeGC(Tmp_win->title.fore, Tmp_win->title.back,
&Scr->TitleBarFont);
+ if (Tmp_win->title_pos == TP_LEFT || Tmp_win->title_pos == TP_RIGHT)
+ MyFont_DrawString_Rotated (dpy, Tmp_win->title_w,
+ &Scr->TitleBarFont,
+ Scr->NormalGC, Scr->TBInfo.titlex,
+ Scr->TitleHeight - Scr->TitleBarFont.height,
+ Tmp_win->name, strlen(Tmp_win->name), &Tmp_win->title_pixmap);
+ else
MyFont_DrawString (dpy, Tmp_win->title_w, &Scr->TitleBarFont,
Scr->NormalGC, Scr->TBInfo.titlex, Scr->TitleBarFont.y,
Tmp_win->name, strlen(Tmp_win->name));
@@ -1230,6 +1239,7 @@ HandleDestroyNotify(void)
* 11. window ring
*/
if (Tmp_win->gray) XFreePixmap (dpy, Tmp_win->gray);
+ if (Tmp_win->title_pixmap) XFreePixmap(dpy, Tmp_win->title_pixmap);
XDestroyWindow(dpy, Tmp_win->frame);
if (Tmp_win->icon_w && !Tmp_win->icon_not_ours) {
@@ -1510,7 +1520,7 @@ HandleButtonRelease(void)
if (DragWindow != None)
{
- MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0);
+ MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0, 0);
if (XFindContext(dpy, DragWindow, TwmContext, &context_data) == 0)
Tmp_win = (TwmWindow *) context_data;
@@ -1733,7 +1743,7 @@ HandleButtonPress(void)
if (Scr->OpaqueMove && DragWindow != None) {
XMoveWindow (dpy, DragWindow, origDragX, origDragY);
} else {
- MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0);
+ MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0, 0);
}
}
XUnmapWindow(dpy, Scr->SizeWindow);
@@ -1804,8 +1814,14 @@ HandleButtonPress(void)
Event.xbutton.x, Event.xbutton.y,
&JunkX, &JunkY, &JunkChild);
+ if (Tmp_win->title_pos == TP_TOP ||
+ Tmp_win->title_pos == TP_BOTTOM) {
Event.xbutton.x = JunkX;
Event.xbutton.y = JunkY - Tmp_win->title_height;
+ } else {
+ Event.xbutton.x = JunkX - Tmp_win->title_height;
+ Event.xbutton.y = JunkY;
+ }
Event.xany.window = Tmp_win->w;
Context = C_WINDOW;
}
@@ -1833,6 +1849,9 @@ HandleButtonPress(void)
*/
if (Event.xbutton.subwindow == Tmp_win->w) {
Event.xbutton.window = Tmp_win->w;
+ if (Tmp_win->title_pos == TP_LEFT)
+ Event.xbutton.x -= Tmp_win->title_height;
+ if (Tmp_win->title_pos == TP_TOP)
Event.xbutton.y -= Tmp_win->title_height;
/*****
Event.xbutton.x -= Tmp_win->frame_bw;
@@ -2075,7 +2094,8 @@ HandleEnterNotify(void)
if (Tmp_win->title_w && Scr->TitleFocus && /* 4 */
Tmp_win->wmhints && Tmp_win->wmhints->input)
SetFocus (Tmp_win, ewp->time);
- if (Scr->NoTitlebar && Scr->TitleFocus && /*4a */
+ if ((Scr->NoTitlebar || Scr->NoTitle != NULL) &&
+ Scr->TitleFocus && /*4a */
Tmp_win->wmhints && Tmp_win->wmhints->input)
SetFocus (Tmp_win, ewp->time);
if (Tmp_win->protocols & DoesWmTakeFocus) /* 5 */
@@ -2084,10 +2104,14 @@ HandleEnterNotify(void)
} else if (ewp->window == Tmp_win->w) {
/*
* If we are entering the application window, install
- * its colormap(s).
+ * its colormap(s), unless it is icon stack.
*/
- if (!scanArgs.leaves || scanArgs.inferior)
+ if ((!scanArgs.leaves || scanArgs.inferior) &&
+ Scr->iconmgr.twm_win != Tmp_win) {
InstallWindowColormaps(EnterNotify, Tmp_win);
+ SetFocus (Tmp_win, ewp->time); /* XXX */
+ Scr->Focus = Tmp_win;
+ }
}
} /* end if Tmp_win->mapped */
if (Tmp_win->wmhints != NULL &&
@@ -2341,7 +2365,13 @@ HandleConfigureRequest(void)
x += gravx * bwdelta; /* change default values only */
y += gravy * bwdelta; /* ditto */
bw = cre->border_width;
- if (Tmp_win->title_height) height += bwdelta;
+ if (Tmp_win->title_height) {
+ if (Tmp_win->title_pos == TP_TOP ||
+ Tmp_win->title_pos == TP_BOTTOM)
+ height += bwdelta;
+ else
+ width += bwdelta;
+ }
x += (gravx < 0) ? bwdelta : -bwdelta;
y += (gravy < 0) ? bwdelta : -bwdelta;
}
@@ -2349,16 +2379,24 @@ HandleConfigureRequest(void)
}
if (cre->value_mask & CWX) { /* override even if border change */
- x = cre->x - bw;
+ if (Tmp_win->title_pos == TP_LEFT || Tmp_win->title_pos == TP_RIGHT)
+ x = cre->x - ((gravx < 0) ? 0 : Tmp_win->title_height) - bw;
}
if (cre->value_mask & CWY) {
+ if (Tmp_win->title_pos == TP_TOP || Tmp_win->title_pos == TP_BOTTOM)
y = cre->y - ((gravy < 0) ? 0 : Tmp_win->title_height) - bw;
}
if (cre->value_mask & CWWidth) {
+ if (Tmp_win->title_pos == TP_LEFT || Tmp_win->title_pos == TP_RIGHT)
+ width = cre->width + Tmp_win->title_height;
+ else
width = cre->width;
}
if (cre->value_mask & CWHeight) {
+ if (Tmp_win->title_pos == TP_LEFT || Tmp_win->title_pos == TP_RIGHT)
+ height = cre->height;
+ else
height = cre->height + Tmp_win->title_height;
}
@@ -2376,6 +2414,37 @@ HandleConfigureRequest(void)
}
+/***********************************************************************
+ *
+ * Procedure:
+ * RRScreenChangeNotify - Randr Screen Change event handler
+ *
+ ***********************************************************************
+ */
+void
+HandleRandrNotify ()
+{
+ XRRScreenChangeNotifyEvent *rrev = (XRRScreenChangeNotifyEvent *) &Event;
+ extern ScreenInfo **ScreenList;
+ extern int NumScreens;
+ int i;
+ ScreenInfo *scp;
+
+ for (i = 0; i< NumScreens; i++) {
+ if (ScreenList[i]->Root == rrev->root) {
+ if (ScreenList[i]->MyDisplayWidth != rrev->width) {
+ /* swap MaxWindowWidth/Height */
+ int tmp = ScreenList[i]->MaxWindowWidth;
+ ScreenList[i]->MaxWindowWidth = ScreenList[i]->MaxWindowHeight;
+ ScreenList[i]->MaxWindowHeight = tmp;
+ }
+ ScreenList[i]->MyDisplayWidth = rrev->width;
+ ScreenList[i]->MyDisplayHeight = rrev->height;
+ break;
+ }
+ }
+}
+
/**
* shape notification event handler
@@ -2688,4 +2757,3 @@ dumpevent (XEvent *e)
}
}
#endif /* TRACE */
-
diff -uprN twm-1.0.9/src/events.h twm-1.0.9-ohki-patch/src/events.h
--- twm-1.0.9/src/events.h 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/events.h 2016-03-07 13:25:04.000000000 +0900
@@ -97,6 +97,7 @@ extern void HandleEnterNotify ( void );
extern void HandleLeaveNotify ( void );
extern void HandleConfigureRequest ( void );
extern void HandleShapeNotify ( void );
+extern void HandleRandrNotify ( void );
extern void HandleUnknown ( void );
extern int Transient ( Window w, Window *propw );
extern ScreenInfo * FindScreenInfo ( Window w );
diff -uprN twm-1.0.9/src/gram.c twm-1.0.9-ohki-patch/src/gram.c
--- twm-1.0.9/src/gram.c 2015-04-17 14:37:03.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/gram.c 2016-03-07 17:40:34.000000000 +0900
@@ -1,14 +1,13 @@
-/* A Bison parser, made by GNU Bison 2.3. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
-/* Skeleton implementation for Bison's Yacc-like parsers in C
+/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,9 +15,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -47,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "2.3"
+#define YYBISON_VERSION "3.0.4"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -55,90 +52,171 @@
/* Pure parsers. */
#define YYPURE 0
-/* Using locations. */
-#define YYLSP_NEEDED 0
+/* Push parsers. */
+#define YYPUSH 0
+/* Pull parsers. */
+#define YYPULL 1
-/* Tokens. */
+
+
+/* Copy the first part of user declarations. */
+#line 67 "gram.y" /* yacc.c:339 */
+
+#include <stdio.h>
+#include <ctype.h>
+#include "twm.h"
+#include "menus.h"
+#include "list.h"
+#include "util.h"
+#include "screen.h"
+#include "parse.h"
+#include "add_window.h"
+#include "icons.h"
+#include <X11/Xos.h>
+#include <X11/Xmu/CharSet.h>
+
+static char *Action = "";
+static char *Name = "";
+static MenuRoot *root, *pull = NULL;
+
+static MenuRoot *GetRoot ( const char *name, const char *fore, const char *back );
+static void GotButton ( int butt, int func );
+static void GotKey ( char *key, int func );
+static void GotTitleButton ( char *bitmapname, int func, Bool rightside );
+static Bool CheckWarpScreenArg ( char *s );
+static Bool CheckWarpRingArg ( char *s );
+static Bool CheckColormapArg ( char *s );
+static void RemoveDQuote ( char *str );
+
+static int nsew ( char *s);
+
+static char *ptr;
+static name_list **list;
+static int cont = 0;
+static int color;
+int mods = 0;
+unsigned int mods_used = (ShiftMask | ControlMask | Mod1Mask);
+
+extern int yylineno;
+static void yyerror ( const char *s );
+
+
+#line 107 "y.tab.c" /* yacc.c:339 */
+
+# ifndef YY_NULLPTR
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
+# endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* In a future release of Bison, this section will be replaced
+ by #include "y.tab.h". */
+#ifndef YY_YY_Y_TAB_H_INCLUDED
+# define YY_YY_Y_TAB_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int yydebug;
+#endif
+
+/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- LB = 258,
- RB = 259,
- LP = 260,
- RP = 261,
- MENUS = 262,
- MENU = 263,
- BUTTON = 264,
- DEFAULT_FUNCTION = 265,
- PLUS = 266,
- MINUS = 267,
- ALL = 268,
- OR = 269,
- CURSORS = 270,
- PIXMAPS = 271,
- ICONS = 272,
- COLOR = 273,
- SAVECOLOR = 274,
- MONOCHROME = 275,
- FUNCTION = 276,
- ICONMGR_SHOW = 277,
- ICONMGR = 278,
- WINDOW_FUNCTION = 279,
- ZOOM = 280,
- ICONMGRS = 281,
- ICONMGR_GEOMETRY = 282,
- ICONMGR_NOSHOW = 283,
- MAKE_TITLE = 284,
- GRAYSCALE = 285,
- ICONIFY_BY_UNMAPPING = 286,
- DONT_ICONIFY_BY_UNMAPPING = 287,
- NO_TITLE = 288,
- AUTO_RAISE = 289,
- NO_HILITE = 290,
- ICON_REGION = 291,
- META = 292,
- SHIFT = 293,
- LOCK = 294,
- CONTROL = 295,
- WINDOW = 296,
- TITLE = 297,
- ICON = 298,
- ROOT = 299,
- FRAME = 300,
- COLON = 301,
- EQUALS = 302,
- SQUEEZE_TITLE = 303,
- DONT_SQUEEZE_TITLE = 304,
- START_ICONIFIED = 305,
- NO_TITLE_HILITE = 306,
- TITLE_HILITE = 307,
- MOVE = 308,
- RESIZE = 309,
- WAIT = 310,
- SELECT = 311,
- KILL = 312,
- LEFT_TITLEBUTTON = 313,
- RIGHT_TITLEBUTTON = 314,
- NUMBER = 315,
- KEYWORD = 316,
- NKEYWORD = 317,
- CKEYWORD = 318,
- CLKEYWORD = 319,
- FKEYWORD = 320,
- FSKEYWORD = 321,
- SKEYWORD = 322,
- DKEYWORD = 323,
- JKEYWORD = 324,
- WINDOW_RING = 325,
- WARP_CURSOR = 326,
- ERRORTOKEN = 327,
- NO_STACKMODE = 328,
- STRING = 329
- };
+ enum yytokentype
+ {
+ LB = 258,
+ RB = 259,
+ LP = 260,
+ RP = 261,
+ MENUS = 262,
+ MENU = 263,
+ BUTTON = 264,
+ DEFAULT_FUNCTION = 265,
+ PLUS = 266,
+ MINUS = 267,
+ ALL = 268,
+ OR = 269,
+ CURSORS = 270,
+ PIXMAPS = 271,
+ ICONS = 272,
+ COLOR = 273,
+ SAVECOLOR = 274,
+ MONOCHROME = 275,
+ FUNCTION = 276,
+ ICONMGR_SHOW = 277,
+ ICONMGR = 278,
+ WINDOW_FUNCTION = 279,
+ ZOOM = 280,
+ ICONMGRS = 281,
+ ICONMGR_GEOMETRY = 282,
+ ICONMGR_NOSHOW = 283,
+ MAKE_TITLE = 284,
+ GRAYSCALE = 285,
+ ICONIFY_BY_UNMAPPING = 286,
+ DONT_ICONIFY_BY_UNMAPPING = 287,
+ NO_TITLE = 288,
+ AUTO_RAISE = 289,
+ NO_HILITE = 290,
+ ICON_REGION = 291,
+ META = 292,
+ SHIFT = 293,
+ LOCK = 294,
+ CONTROL = 295,
+ WINDOW = 296,
+ TITLE = 297,
+ ICON = 298,
+ ROOT = 299,
+ FRAME = 300,
+ COLON = 301,
+ EQUALS = 302,
+ SQUEEZE_TITLE = 303,
+ DONT_SQUEEZE_TITLE = 304,
+ START_ICONIFIED = 305,
+ NO_TITLE_HILITE = 306,
+ TITLE_HILITE = 307,
+ MOVE = 308,
+ RESIZE = 309,
+ WAIT = 310,
+ SELECT = 311,
+ KILL = 312,
+ LEFT_TITLEBUTTON = 313,
+ RIGHT_TITLEBUTTON = 314,
+ NUMBER = 315,
+ KEYWORD = 316,
+ NKEYWORD = 317,
+ CKEYWORD = 318,
+ CLKEYWORD = 319,
+ FKEYWORD = 320,
+ FSKEYWORD = 321,
+ SKEYWORD = 322,
+ DKEYWORD = 323,
+ JKEYWORD = 324,
+ WINDOW_RING = 325,
+ WARP_CURSOR = 326,
+ ERRORTOKEN = 327,
+ NO_STACKMODE = 328,
+ WARP_CURSOR_POS = 329,
+ STRING = 330,
+ TITLE_AT_TOP = 331,
+ TITLE_AT_BOTTOM = 332,
+ TITLE_AT_LEFT = 333,
+ TITLE_AT_RIGHT = 334,
+ MENU_RUNS = 335
+ };
#endif
/* Tokens. */
#define LB 258
@@ -212,92 +290,42 @@
#define WARP_CURSOR 326
#define ERRORTOKEN 327
#define NO_STACKMODE 328
-#define STRING 329
-
-
-
-
-/* Copy the first part of user declarations. */
-#line 67 "gram.y"
-
-#include <stdio.h>
-#include <ctype.h>
-#include "twm.h"
-#include "menus.h"
-#include "list.h"
-#include "util.h"
-#include "screen.h"
-#include "parse.h"
-#include "add_window.h"
-#include "icons.h"
-#include <X11/Xos.h>
-#include <X11/Xmu/CharSet.h>
+#define WARP_CURSOR_POS 329
+#define STRING 330
+#define TITLE_AT_TOP 331
+#define TITLE_AT_BOTTOM 332
+#define TITLE_AT_LEFT 333
+#define TITLE_AT_RIGHT 334
+#define MENU_RUNS 335
-static char *Action = "";
-static char *Name = "";
-static MenuRoot *root, *pull = NULL;
-
-static MenuRoot *GetRoot ( const char *name, const char *fore, const char *back );
-static void GotButton ( int butt, int func );
-static void GotKey ( char *key, int func );
-static void GotTitleButton ( char *bitmapname, int func, Bool rightside );
-static Bool CheckWarpScreenArg ( char *s );
-static Bool CheckWarpRingArg ( char *s );
-static Bool CheckColormapArg ( char *s );
-static void RemoveDQuote ( char *str );
-
-static char *ptr;
-static name_list **list;
-static int cont = 0;
-static int color;
-int mods = 0;
-unsigned int mods_used = (ShiftMask | ControlMask | Mod1Mask);
-
-extern int yylineno;
-static void yyerror ( const char *s );
+/* Value type. */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+union YYSTYPE
+{
+#line 109 "gram.y" /* yacc.c:355 */
+ int num;
+ char *ptr;
-/* Enabling traces. */
-#ifndef YYDEBUG
-# define YYDEBUG 0
-#endif
+#line 312 "y.tab.c" /* yacc.c:355 */
+};
-/* Enabling verbose error messages. */
-#ifdef YYERROR_VERBOSE
-# undef YYERROR_VERBOSE
-# define YYERROR_VERBOSE 1
-#else
-# define YYERROR_VERBOSE 0
+typedef union YYSTYPE YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
#endif
-/* Enabling the token table. */
-#ifndef YYTOKEN_TABLE
-# define YYTOKEN_TABLE 0
-#endif
-#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-#line 107 "gram.y"
-{
- int num;
- char *ptr;
-}
-/* Line 187 of yacc.c. */
-#line 288 "gram.c"
- YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
-# define YYSTYPE_IS_TRIVIAL 1
-#endif
+extern YYSTYPE yylval;
+int yyparse (void);
+#endif /* !YY_YY_Y_TAB_H_INCLUDED */
/* Copy the second part of user declarations. */
-
-/* Line 216 of yacc.c. */
-#line 301 "gram.c"
+#line 329 "y.tab.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -311,11 +339,8 @@ typedef unsigned char yytype_uint8;
#ifdef YYTYPE_INT8
typedef YYTYPE_INT8 yytype_int8;
-#elif (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-typedef signed char yytype_int8;
#else
-typedef short int yytype_int8;
+typedef signed char yytype_int8;
#endif
#ifdef YYTYPE_UINT16
@@ -335,8 +360,7 @@ typedef short int yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# elif ! defined YYSIZE_T
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
@@ -347,42 +371,71 @@ typedef short int yytype_int16;
#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
#ifndef YY_
-# if YYENABLE_NLS
+# if defined YYENABLE_NLS && YYENABLE_NLS
# if ENABLE_NLS
# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-# define YY_(msgid) dgettext ("bison-runtime", msgid)
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
# endif
# endif
# ifndef YY_
-# define YY_(msgid) msgid
+# define YY_(Msgid) Msgid
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__ \
+ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
+ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+# define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
# endif
#endif
/* Suppress unused-variable warnings by "using" E. */
#if ! defined lint || defined __GNUC__
-# define YYUSE(e) ((void) (e))
+# define YYUSE(E) ((void) (E))
#else
-# define YYUSE(e) /* empty */
+# define YYUSE(E) /* empty */
#endif
-/* Identity function, used to suppress warnings about constant conditions. */
-#ifndef lint
-# define YYID(n) (n)
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+ _Pragma ("GCC diagnostic pop")
#else
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static int
-YYID (int i)
-#else
-static int
-YYID (i)
- int i;
+# define YY_INITIAL_VALUE(Value) Value
#endif
-{
- return i;
-}
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
+
#if ! defined yyoverflow || YYERROR_VERBOSE
/* The parser invokes alloca or malloc; define the necessary symbols. */
@@ -400,11 +453,11 @@ YYID (i)
# define alloca _alloca
# else
# define YYSTACK_ALLOC alloca
-# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# endif
@@ -412,8 +465,8 @@ YYID (i)
# endif
# ifdef YYSTACK_ALLOC
- /* Pacify GCC's `empty if-body' warning. */
-# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+ /* Pacify GCC's 'empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
# ifndef YYSTACK_ALLOC_MAXIMUM
/* The OS might guarantee only one guard page at the bottom of the stack,
and a page size can be as small as 4096 bytes. So we cannot safely
@@ -427,25 +480,23 @@ YYID (i)
# ifndef YYSTACK_ALLOC_MAXIMUM
# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
# endif
-# if (defined __cplusplus && ! defined _STDLIB_H \
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
&& ! ((defined YYMALLOC || defined malloc) \
- && (defined YYFREE || defined free)))
+ && (defined YYFREE || defined free)))
# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-# ifndef _STDLIB_H
-# define _STDLIB_H 1
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
# endif
# endif
# ifndef YYMALLOC
# define YYMALLOC malloc
-# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined malloc && ! defined EXIT_SUCCESS
void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
# ifndef YYFREE
# define YYFREE free
-# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# if ! defined free && ! defined EXIT_SUCCESS
void free (void *); /* INFRINGES ON USER NAME SPACE */
# endif
# endif
@@ -455,14 +506,14 @@ void free (void *); /* INFRINGES ON USER
#if (! defined yyoverflow \
&& (! defined __cplusplus \
- || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss;
- YYSTYPE yyvs;
- };
+ yytype_int16 yyss_alloc;
+ YYSTYPE yyvs_alloc;
+};
/* The size of the maximum gap between one aligned stack and the next. */
# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
@@ -473,64 +524,70 @@ union yyalloc
((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ YYSTACK_GAP_MAXIMUM)
-/* Copy COUNT objects from FROM to TO. The source and destination do
- not overlap. */
-# ifndef YYCOPY
-# if defined __GNUC__ && 1 < __GNUC__
-# define YYCOPY(To, From, Count) \
- __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
-# else
-# define YYCOPY(To, From, Count) \
- do \
- { \
- YYSIZE_T yyi; \
- for (yyi = 0; yyi < (Count); yyi++) \
- (To)[yyi] = (From)[yyi]; \
- } \
- while (YYID (0))
-# endif
-# endif
+# define YYCOPY_NEEDED 1
/* Relocate STACK from its old location to the new one. The
local variables YYSIZE and YYSTACKSIZE give the old and new number of
elements in the stack, and YYPTR gives the new location of the
stack. Advance YYPTR to a properly aligned location for the next
stack. */
-# define YYSTACK_RELOCATE(Stack) \
- do \
- { \
- YYSIZE_T yynewbytes; \
- YYCOPY (&yyptr->Stack, Stack, yysize); \
- Stack = &yyptr->Stack; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
- } \
- while (YYID (0))
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
#endif
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(Dst, Src, Count) \
+ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+# else
+# define YYCOPY(Dst, Src, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (Dst)[yyi] = (Src)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
/* YYFINAL -- State number of the termination state. */
#define YYFINAL 3
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 339
+#define YYLAST 326
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 75
+#define YYNTOKENS 81
/* YYNNTS -- Number of nonterminals. */
-#define YYNNTS 76
+#define YYNNTS 81
/* YYNRULES -- Number of rules. */
-#define YYNRULES 193
-/* YYNRULES -- Number of states. */
-#define YYNSTATES 285
+#define YYNRULES 209
+/* YYNSTATES -- Number of states. */
+#define YYNSTATES 303
-/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+ by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 329
+#define YYMAXUTOK 335
-#define YYTRANSLATE(YYX) \
+#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, without out-of-bounds checking. */
static const yytype_uint8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -565,122 +622,39 @@ static const yytype_uint8 yytranslate[]
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80
};
#if YYDEBUG
-/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
- YYRHS. */
-static const yytype_uint16 yyprhs[] =
-{
- 0, 0, 3, 5, 6, 9, 11, 13, 15, 17,
- 19, 26, 30, 33, 36, 38, 41, 44, 45, 49,
- 51, 56, 61, 64, 67, 70, 73, 74, 78, 79,
- 83, 85, 86, 90, 91, 95, 96, 100, 102, 103,
- 107, 109, 110, 114, 116, 117, 121, 123, 124, 128,
- 129, 133, 134, 138, 139, 149, 150, 155, 156, 161,
- 162, 166, 167, 171, 172, 176, 179, 180, 184, 187,
- 190, 191, 195, 197, 198, 202, 204, 207, 210, 217,
- 224, 225, 228, 230, 232, 234, 236, 239, 241, 242,
- 245, 247, 249, 251, 253, 255, 257, 259, 261, 263,
- 264, 267, 269, 271, 273, 275, 277, 279, 281, 283,
- 285, 287, 291, 292, 295, 298, 302, 303, 306, 310,
- 313, 317, 320, 324, 327, 331, 334, 338, 341, 345,
- 348, 352, 355, 359, 362, 366, 369, 373, 376, 380,
- 383, 387, 388, 391, 394, 395, 400, 403, 407, 408,
- 411, 413, 415, 419, 420, 423, 426, 428, 429, 435,
- 437, 438, 442, 443, 449, 453, 454, 457, 461, 466,
- 470, 471, 474, 476, 480, 481, 484, 487, 491, 492,
- 495, 497, 501, 502, 505, 508, 516, 518, 521, 523,
- 526, 529, 532, 534
-};
-
-/* YYRHS -- A `-1'-separated list of the rules' RHS. */
-static const yytype_int16 yyrhs[] =
-{
- 76, 0, -1, 77, -1, -1, 77, 78, -1, 1,
- -1, 100, -1, 101, -1, 102, -1, 127, -1, 36,
- 149, 68, 68, 150, 150, -1, 27, 149, 150, -1,
- 27, 149, -1, 25, 150, -1, 25, -1, 16, 111,
- -1, 15, 114, -1, -1, 31, 79, 134, -1, 31,
- -1, 58, 149, 47, 146, -1, 59, 149, 47, 146,
- -1, 148, 149, -1, 148, 146, -1, 149, 104, -1,
- 148, 103, -1, -1, 32, 80, 134, -1, -1, 28,
- 81, 134, -1, 28, -1, -1, 26, 82, 131, -1,
- -1, 22, 83, 134, -1, -1, 51, 84, 134, -1,
- 51, -1, -1, 35, 85, 134, -1, 35, -1, -1,
- 73, 86, 134, -1, 73, -1, -1, 33, 87, 134,
- -1, 33, -1, -1, 29, 88, 134, -1, -1, 50,
- 89, 134, -1, -1, 34, 90, 134, -1, -1, 8,
- 149, 5, 149, 46, 149, 6, 91, 143, -1, -1,
- 8, 149, 92, 143, -1, -1, 21, 149, 93, 140,
- -1, -1, 17, 94, 137, -1, -1, 18, 95, 117,
- -1, -1, 30, 96, 117, -1, 19, 121, -1, -1,
- 20, 97, 117, -1, 10, 146, -1, 24, 146, -1,
- -1, 71, 98, 134, -1, 71, -1, -1, 70, 99,
- 134, -1, 61, -1, 67, 149, -1, 62, 150, -1,
- 47, 105, 46, 107, 46, 146, -1, 47, 105, 46,
- 109, 46, 146, -1, -1, 105, 106, -1, 37, -1,
- 38, -1, 39, -1, 40, -1, 37, 150, -1, 14,
- -1, -1, 107, 108, -1, 41, -1, 42, -1, 43,
- -1, 44, -1, 45, -1, 23, -1, 37, -1, 13,
- -1, 14, -1, -1, 109, 110, -1, 41, -1, 42,
- -1, 43, -1, 44, -1, 45, -1, 23, -1, 37,
- -1, 13, -1, 14, -1, 149, -1, 3, 112, 4,
- -1, -1, 112, 113, -1, 52, 149, -1, 3, 115,
- 4, -1, -1, 115, 116, -1, 45, 149, 149, -1,
- 45, 149, -1, 42, 149, 149, -1, 42, 149, -1,
- 43, 149, 149, -1, 43, 149, -1, 23, 149, 149,
- -1, 23, 149, -1, 9, 149, 149, -1, 9, 149,
- -1, 53, 149, 149, -1, 53, 149, -1, 54, 149,
- 149, -1, 54, 149, -1, 55, 149, 149, -1, 55,
- 149, -1, 8, 149, 149, -1, 8, 149, -1, 56,
- 149, 149, -1, 56, 149, -1, 57, 149, 149, -1,
- 57, 149, -1, 3, 118, 4, -1, -1, 118, 119,
- -1, 64, 149, -1, -1, 64, 149, 120, 124, -1,
- 63, 149, -1, 3, 122, 4, -1, -1, 122, 123,
- -1, 149, -1, 64, -1, 3, 125, 4, -1, -1,
- 125, 126, -1, 149, 149, -1, 48, -1, -1, 48,
- 128, 3, 130, 4, -1, 49, -1, -1, 49, 129,
- 134, -1, -1, 130, 149, 69, 147, 150, -1, 3,
- 132, 4, -1, -1, 132, 133, -1, 149, 149, 150,
- -1, 149, 149, 149, 150, -1, 3, 135, 4, -1,
- -1, 135, 136, -1, 149, -1, 3, 138, 4, -1,
- -1, 138, 139, -1, 149, 149, -1, 3, 141, 4,
- -1, -1, 141, 142, -1, 146, -1, 3, 144, 4,
- -1, -1, 144, 145, -1, 149, 146, -1, 149, 5,
- 149, 46, 149, 6, 146, -1, 65, -1, 66, 149,
- -1, 150, -1, 11, 150, -1, 12, 150, -1, 9,
- 150, -1, 74, -1, 60, -1
-};
-
-/* YYRLINE[YYN] -- source line where rule number YYN was defined. */
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 136, 136, 139, 140, 143, 144, 145, 146, 147,
- 148, 150, 156, 159, 165, 167, 168, 169, 169, 171,
- 173, 176, 179, 183, 199, 200, 201, 201, 203, 203,
- 205, 206, 206, 208, 208, 210, 210, 212, 214, 214,
- 216, 218, 218, 220, 222, 222, 224, 226, 226, 228,
- 228, 230, 230, 232, 232, 235, 235, 237, 237, 239,
- 239, 241, 241, 243, 243, 245, 247, 247, 249, 265,
- 273, 273, 275, 277, 277, 282, 292, 302, 314, 317,
- 320, 321, 324, 325, 326, 327, 328, 338, 341, 342,
- 345, 346, 347, 348, 349, 350, 351, 352, 353, 356,
- 357, 360, 361, 362, 363, 364, 365, 366, 367, 368,
- 369, 373, 376, 377, 380, 384, 387, 388, 391, 393,
- 395, 397, 399, 401, 403, 405, 407, 409, 411, 413,
- 415, 417, 419, 421, 423, 425, 427, 429, 431, 433,
- 437, 441, 442, 445, 454, 454, 465, 476, 479, 480,
- 483, 484, 487, 490, 491, 494, 499, 502, 502, 507,
- 508, 508, 512, 513, 521, 524, 525, 528, 533, 541,
- 544, 545, 548, 553, 556, 557, 560, 563, 566, 567,
- 570, 576, 579, 580, 583, 588, 596, 597, 638, 639,
- 640, 643, 655, 660
+ 0, 142, 142, 145, 146, 149, 150, 151, 152, 153,
+ 154, 155, 166, 168, 174, 177, 183, 185, 186, 187,
+ 187, 189, 191, 194, 197, 201, 217, 218, 219, 219,
+ 221, 221, 223, 224, 224, 226, 226, 228, 228, 230,
+ 232, 232, 234, 236, 236, 238, 240, 240, 242, 244,
+ 244, 246, 246, 248, 248, 250, 250, 253, 253, 255,
+ 255, 257, 257, 259, 259, 261, 261, 263, 265, 265,
+ 267, 283, 291, 291, 293, 295, 298, 301, 301, 306,
+ 316, 326, 338, 341, 344, 345, 348, 349, 350, 351,
+ 352, 362, 365, 366, 369, 370, 371, 372, 373, 374,
+ 375, 376, 377, 380, 381, 384, 385, 386, 387, 388,
+ 389, 390, 391, 392, 393, 397, 400, 401, 404, 408,
+ 411, 412, 415, 417, 419, 421, 423, 425, 427, 429,
+ 431, 433, 435, 437, 439, 441, 443, 445, 447, 449,
+ 451, 453, 455, 457, 461, 465, 466, 469, 478, 478,
+ 489, 500, 503, 504, 507, 508, 511, 514, 515, 518,
+ 523, 526, 526, 531, 532, 532, 536, 539, 539, 544,
+ 547, 547, 552, 555, 555, 560, 563, 563, 570, 571,
+ 579, 582, 583, 586, 591, 599, 602, 603, 606, 611,
+ 614, 615, 618, 621, 624, 625, 628, 634, 637, 638,
+ 641, 646, 654, 655, 696, 697, 698, 701, 713, 718
};
#endif
-#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+#if YYDEBUG || YYERROR_VERBOSE || 0
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
@@ -698,26 +672,28 @@ static const char *const yytname[] =
"KILL", "LEFT_TITLEBUTTON", "RIGHT_TITLEBUTTON", "NUMBER", "KEYWORD",
"NKEYWORD", "CKEYWORD", "CLKEYWORD", "FKEYWORD", "FSKEYWORD", "SKEYWORD",
"DKEYWORD", "JKEYWORD", "WINDOW_RING", "WARP_CURSOR", "ERRORTOKEN",
- "NO_STACKMODE", "STRING", "$accept", "twmrc", "stmts", "stmt", "@1",
- "@2", "@3", "@4", "@5", "@6", "@7", "@8", "@9", "@10", "@11", "@12",
- "@13", "@14", "@15", "@16", "@17", "@18", "@19", "@20", "@21", "noarg",
- "sarg", "narg", "full", "fullkey", "keys", "key", "contexts", "context",
+ "NO_STACKMODE", "WARP_CURSOR_POS", "STRING", "TITLE_AT_TOP",
+ "TITLE_AT_BOTTOM", "TITLE_AT_LEFT", "TITLE_AT_RIGHT", "MENU_RUNS",
+ "$accept", "twmrc", "stmts", "stmt", "$@1", "$@2", "$@3", "$@4", "$@5",
+ "$@6", "$@7", "$@8", "$@9", "$@10", "$@11", "$@12", "$@13", "$@14",
+ "$@15", "$@16", "$@17", "$@18", "$@19", "$@20", "$@21", "noarg", "sarg",
+ "narg", "full", "fullkey", "keys", "key", "contexts", "context",
"contextkeys", "contextkey", "pixmap_list", "pixmap_entries",
"pixmap_entry", "cursor_list", "cursor_entries", "cursor_entry",
- "color_list", "color_entries", "color_entry", "@22", "save_color_list",
+ "color_list", "color_entries", "color_entry", "$@22", "save_color_list",
"s_color_entries", "s_color_entry", "win_color_list",
- "win_color_entries", "win_color_entry", "squeeze", "@23", "@24",
- "win_sqz_entries", "iconm_list", "iconm_entries", "iconm_entry",
- "win_list", "win_entries", "win_entry", "icon_list", "icon_entries",
- "icon_entry", "function", "function_entries", "function_entry", "menu",
- "menu_entries", "menu_entry", "action", "signed_number", "button",
- "string", "number", 0
+ "win_color_entries", "win_color_entry", "squeeze", "$@23", "$@24",
+ "titlepos", "$@25", "$@26", "$@27", "$@28", "win_sqz_entries",
+ "iconm_list", "iconm_entries", "iconm_entry", "win_list", "win_entries",
+ "win_entry", "icon_list", "icon_entries", "icon_entry", "function",
+ "function_entries", "function_entry", "menu", "menu_entries",
+ "menu_entry", "action", "signed_number", "button", "string", "number", YY_NULLPTR
};
#endif
# ifdef YYPRINT
-/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
- token YYLEX-NUM. */
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+ (internal) symbol number NUM (which must be that of a token). */
static const yytype_uint16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
@@ -727,363 +703,325 @@ static const yytype_uint16 yytoknum[] =
295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
- 325, 326, 327, 328, 329
+ 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
+ 335
};
# endif
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
-{
- 0, 75, 76, 77, 77, 78, 78, 78, 78, 78,
- 78, 78, 78, 78, 78, 78, 78, 79, 78, 78,
- 78, 78, 78, 78, 78, 78, 80, 78, 81, 78,
- 78, 82, 78, 83, 78, 84, 78, 78, 85, 78,
- 78, 86, 78, 78, 87, 78, 78, 88, 78, 89,
- 78, 90, 78, 91, 78, 92, 78, 93, 78, 94,
- 78, 95, 78, 96, 78, 78, 97, 78, 78, 78,
- 98, 78, 78, 99, 78, 100, 101, 102, 103, 104,
- 105, 105, 106, 106, 106, 106, 106, 106, 107, 107,
- 108, 108, 108, 108, 108, 108, 108, 108, 108, 109,
- 109, 110, 110, 110, 110, 110, 110, 110, 110, 110,
- 110, 111, 112, 112, 113, 114, 115, 115, 116, 116,
- 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
- 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
- 117, 118, 118, 119, 120, 119, 119, 121, 122, 122,
- 123, 123, 124, 125, 125, 126, 127, 128, 127, 127,
- 129, 127, 130, 130, 131, 132, 132, 133, 133, 134,
- 135, 135, 136, 137, 138, 138, 139, 140, 141, 141,
- 142, 143, 144, 144, 145, 145, 146, 146, 147, 147,
- 147, 148, 149, 150
-};
+#define YYPACT_NINF -138
-/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-138)))
+
+#define YYTABLE_NINF -177
+
+#define yytable_value_is_error(Yytable_value) \
+ 0
+
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+static const yytype_int16 yypact[] =
{
- 0, 2, 1, 0, 2, 1, 1, 1, 1, 1,
- 6, 3, 2, 2, 1, 2, 2, 0, 3, 1,
- 4, 4, 2, 2, 2, 2, 0, 3, 0, 3,
- 1, 0, 3, 0, 3, 0, 3, 1, 0, 3,
- 1, 0, 3, 1, 0, 3, 1, 0, 3, 0,
- 3, 0, 3, 0, 9, 0, 4, 0, 4, 0,
- 3, 0, 3, 0, 3, 2, 0, 3, 2, 2,
- 0, 3, 1, 0, 3, 1, 2, 2, 6, 6,
- 0, 2, 1, 1, 1, 1, 2, 1, 0, 2,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 0,
- 2, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 3, 0, 2, 2, 3, 0, 2, 3, 2,
- 3, 2, 3, 2, 3, 2, 3, 2, 3, 2,
- 3, 2, 3, 2, 3, 2, 3, 2, 3, 2,
- 3, 0, 2, 2, 0, 4, 2, 3, 0, 2,
- 1, 1, 3, 0, 2, 2, 1, 0, 5, 1,
- 0, 3, 0, 5, 3, 0, 2, 3, 4, 3,
- 0, 2, 1, 3, 0, 2, 2, 3, 0, 2,
- 1, 3, 0, 2, 2, 7, 1, 2, 1, 2,
- 2, 2, 1, 1
+ -138, 12, 62, -138, -138, -58, -42, -50, 16, 21,
+ -138, -138, 24, -138, -58, -138, -50, -42, -138, -58,
+ 35, -138, -138, 37, -138, 40, -138, 47, -58, 48,
+ 49, -138, 51, -58, -58, -138, -42, -58, -138, 54,
+ 56, -49, -138, 58, 63, 66, 71, -58, -138, -138,
+ -138, -138, -138, -138, 96, -10, 60, -138, -138, -138,
+ -58, -138, -138, -138, -138, -138, 82, 100, -138, -138,
+ 100, -138, 106, -138, -138, 112, -42, 106, 106, 100,
+ 106, 106, 106, 106, 106, -34, 113, 106, 106, 106,
+ 70, 72, -138, -138, 106, 106, 106, -138, -138, 106,
+ 106, 106, 106, -138, -138, -138, -138, -138, -138, -138,
+ -58, 115, -138, 243, 6, -138, -138, -138, -138, 0,
+ -138, 119, -138, -138, -138, -138, -138, -138, -138, -138,
+ -138, -138, -138, -138, -138, 57, -138, -138, -138, -138,
+ -50, -50, -138, -138, -138, -138, -138, -138, -138, 7,
+ 188, 80, -138, -138, -138, -58, -58, -58, -58, -58,
+ -58, -58, -58, -58, -58, -58, -138, -138, -58, -138,
+ -2, 44, -138, -138, -138, -138, -138, -138, 1, 26,
+ -42, 27, -138, -138, -138, -42, -138, -138, -138, -138,
+ -138, -138, -58, 29, -58, -58, -58, -58, -58, -58,
+ -58, -58, -58, -58, -58, -138, -138, -138, -58, -138,
+ -58, -58, -138, 2, -138, -138, -138, -138, -138, -58,
+ -42, -138, 61, -138, 230, 195, 125, -138, -138, 34,
+ -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
+ -138, -138, -138, 131, -138, -138, -138, -49, -138, -4,
+ -138, -138, -138, -138, -138, -138, -138, -138, -138, -50,
+ -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
+ -50, -138, -138, -138, -58, -138, 141, -42, -138, -42,
+ -42, -42, -138, -138, -138, 115, 99, -138, -138, -138,
+ -138, -138, -138, -138, -58, 31, 140, -138, -138, -58,
+ -50, -138, -138
};
-/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
- STATE-NUM when YYTABLE doesn't specify something else to do. Zero
- means the default is an error. */
+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE does not specify something else to do. Zero
+ means the default is an error. */
static const yytype_uint8 yydefact[] =
{
3, 0, 0, 1, 5, 0, 0, 0, 0, 0,
- 59, 61, 0, 66, 0, 33, 0, 14, 31, 0,
- 30, 47, 63, 19, 26, 46, 51, 40, 0, 156,
- 159, 49, 37, 0, 0, 75, 0, 0, 73, 72,
- 43, 192, 4, 6, 7, 8, 9, 0, 0, 55,
- 193, 191, 186, 0, 68, 116, 16, 112, 15, 0,
- 0, 148, 65, 0, 57, 0, 69, 13, 0, 12,
+ 61, 63, 0, 68, 0, 35, 0, 16, 33, 0,
+ 32, 49, 65, 21, 28, 48, 53, 42, 0, 160,
+ 163, 51, 39, 0, 0, 79, 0, 0, 77, 74,
+ 45, 0, 208, 166, 172, 169, 175, 0, 4, 6,
+ 7, 8, 9, 10, 0, 0, 57, 209, 207, 202,
+ 0, 70, 120, 18, 116, 17, 0, 0, 152, 67,
+ 0, 59, 0, 71, 15, 0, 14, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 77, 76, 0, 0, 0,
- 80, 25, 23, 22, 80, 24, 0, 0, 187, 0,
- 0, 174, 60, 141, 62, 0, 67, 0, 170, 34,
- 165, 32, 11, 29, 48, 64, 18, 27, 45, 52,
- 39, 0, 162, 161, 50, 36, 0, 0, 74, 71,
- 42, 0, 0, 0, 182, 56, 115, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 117, 111,
- 0, 113, 0, 0, 147, 151, 149, 150, 178, 58,
- 0, 0, 0, 0, 20, 21, 87, 82, 83, 84,
- 85, 88, 81, 99, 0, 0, 135, 127, 125, 121,
- 123, 119, 129, 131, 133, 137, 139, 114, 173, 175,
- 0, 140, 0, 0, 142, 0, 169, 171, 172, 164,
- 166, 0, 0, 158, 0, 86, 0, 0, 0, 181,
- 183, 0, 134, 126, 124, 120, 122, 118, 128, 130,
- 132, 136, 138, 176, 146, 143, 177, 179, 180, 0,
- 10, 0, 97, 98, 95, 96, 90, 91, 92, 93,
- 94, 0, 89, 108, 109, 106, 107, 101, 102, 103,
- 104, 105, 0, 100, 110, 53, 0, 184, 0, 0,
- 167, 0, 0, 0, 188, 78, 79, 0, 0, 153,
- 145, 168, 189, 190, 163, 54, 0, 0, 0, 152,
- 154, 0, 0, 155, 185
-};
-
-/* YYDEFGOTO[NTERM-NUM]. */
-static const yytype_int16 yydefgoto[] =
-{
- -1, 1, 2, 42, 73, 74, 70, 68, 65, 82,
- 77, 89, 75, 71, 81, 76, 267, 97, 107, 59,
- 60, 72, 63, 88, 87, 43, 44, 45, 91, 95,
- 131, 172, 206, 242, 207, 253, 58, 100, 151, 56,
- 99, 148, 104, 153, 194, 258, 62, 105, 156, 270,
- 277, 280, 46, 79, 80, 163, 111, 161, 200, 109,
- 160, 197, 102, 152, 189, 159, 195, 227, 135, 175,
- 210, 54, 263, 47, 48, 51
+ 0, 0, 81, 80, 0, 0, 0, 76, 75, 0,
+ 0, 0, 0, 11, 84, 27, 25, 24, 84, 26,
+ 0, 0, 203, 0, 0, 190, 62, 145, 64, 0,
+ 69, 0, 186, 36, 181, 34, 13, 31, 50, 66,
+ 20, 29, 47, 54, 41, 0, 178, 165, 52, 38,
+ 0, 0, 78, 73, 44, 168, 174, 171, 177, 0,
+ 0, 0, 198, 58, 119, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 121, 115, 0, 117,
+ 0, 0, 151, 155, 153, 154, 194, 60, 0, 0,
+ 0, 0, 22, 23, 91, 86, 87, 88, 89, 92,
+ 85, 103, 0, 0, 139, 131, 129, 125, 127, 123,
+ 133, 135, 137, 141, 143, 118, 189, 191, 0, 144,
+ 0, 0, 146, 0, 185, 187, 188, 180, 182, 0,
+ 0, 162, 0, 90, 0, 0, 0, 197, 199, 0,
+ 138, 130, 128, 124, 126, 122, 132, 134, 136, 140,
+ 142, 192, 150, 147, 193, 195, 196, 0, 12, 0,
+ 101, 102, 99, 100, 94, 95, 96, 97, 98, 0,
+ 93, 112, 113, 110, 111, 105, 106, 107, 108, 109,
+ 0, 104, 114, 55, 0, 200, 0, 0, 183, 0,
+ 0, 0, 204, 82, 83, 0, 0, 157, 149, 184,
+ 205, 206, 179, 56, 0, 0, 0, 156, 158, 0,
+ 0, 159, 201
};
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
- STATE-NUM. */
-#define YYPACT_NINF -159
-static const yytype_int16 yypact[] =
+ /* YYPGOTO[NTERM-NUM]. */
+static const yytype_int16 yypgoto[] =
{
- -159, 15, 265, -159, -159, -56, -30, -25, 28, 30,
- -159, -159, 32, -159, -56, -159, -25, -30, -159, -56,
- 40, -159, -159, 41, -159, 42, -159, 44, -56, 46,
- 48, -159, 49, -56, -56, -159, -30, -56, -159, 58,
- 60, -159, -159, -159, -159, -159, -159, -28, 20, 61,
- -159, -159, -159, -56, -159, -159, -159, -159, -159, 65,
- 66, -159, -159, 66, -159, 76, -159, -159, 78, -30,
- 76, 76, 66, 76, 76, 76, 76, 76, -4, 83,
- 76, 76, 76, 43, 45, -159, -159, 76, 76, 76,
- -159, -159, -159, -159, -159, -159, -56, 85, -159, 107,
- 8, -159, -159, -159, -159, -2, -159, 86, -159, -159,
- -159, -159, -159, -159, -159, -159, -159, -159, -159, -159,
- -159, 27, -159, -159, -159, -159, -25, -25, -159, -159,
- -159, 59, 153, 55, -159, -159, -159, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -56, -159, -159,
- -56, -159, 0, 7, -159, -159, -159, -159, -159, -159,
- 1, 2, -30, 3, -159, -159, -159, -30, -159, -159,
- -159, -159, -159, -159, -56, 4, -56, -56, -56, -56,
- -56, -56, -56, -56, -56, -56, -56, -159, -159, -159,
- -56, -159, -56, -56, -159, 17, -159, -159, -159, -159,
- -159, -56, -30, -159, 33, -159, 80, 13, 98, -159,
- -159, 19, -159, -159, -159, -159, -159, -159, -159, -159,
- -159, -159, -159, -159, -159, 103, -159, -159, -159, -35,
- -159, 5, -159, -159, -159, -159, -159, -159, -159, -159,
- -159, -25, -159, -159, -159, -159, -159, -159, -159, -159,
- -159, -159, -25, -159, -159, -159, -56, -159, 104, -30,
- -159, -30, -30, -30, -159, -159, -159, 85, 62, -159,
- -159, -159, -159, -159, -159, -159, -56, 6, 106, -159,
- -159, -56, -25, -159, -159
+ -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
+ -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
+ -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
+ 39, -138, -138, -138, -138, -138, -138, -138, -138, -138,
+ -138, -138, -57, -138, -138, -138, -138, -138, -138, -138,
+ -138, -138, -138, -138, -138, -138, -138, -138, -138, -138,
+ -138, -138, -138, -138, 224, -138, -138, -138, -138, -138,
+ -138, -138, -138, -137, -138, -138, -13, -138, -138, -5,
+ -16
};
-/* YYPGOTO[NTERM-NUM]. */
-static const yytype_int16 yypgoto[] =
+ /* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int16 yydefgoto[] =
{
- -159, -159, -159, -159, -159, -159, -159, -159, -159, -159,
- -159, -159, -159, -159, -159, -159, -159, -159, -159, -159,
- -159, -159, -159, -159, -159, -159, -159, -159, -159, -159,
- 16, -159, -159, -159, -159, -159, -159, -159, -159, -159,
- -159, -159, -50, -159, -159, -159, -159, -159, -159, -159,
- -159, -159, -159, -159, -159, -159, -159, -159, -159, 130,
- -159, -159, -159, -159, -159, -159, -159, -159, -158, -159,
- -159, -13, -159, -159, -5, -16
+ -1, 1, 2, 48, 80, 81, 77, 75, 72, 89,
+ 84, 96, 82, 78, 88, 83, 285, 111, 121, 66,
+ 67, 79, 70, 95, 94, 49, 50, 51, 105, 109,
+ 149, 190, 224, 260, 225, 271, 65, 114, 169, 63,
+ 113, 166, 118, 171, 212, 276, 69, 119, 174, 288,
+ 295, 298, 52, 86, 87, 53, 99, 101, 100, 102,
+ 181, 125, 179, 218, 123, 178, 215, 116, 170, 207,
+ 177, 213, 245, 153, 193, 228, 61, 281, 54, 55,
+ 58
};
-/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If
- positive, shift that token. If negative, reduce the rule which
- number is the opposite. If zero, do what YYDEFACT says.
- If YYTABLE_NINF, syntax error. */
-#define YYTABLE_NINF -161
+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule whose
+ number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
- 49, 67, 154, 66, 188, 196, 199, 203, 209, 64,
- 279, 191, 149, 106, 69, 3, 261, 262, 41, 90,
- 85, 226, 115, 78, 256, 50, 243, 244, 83, 84,
- 50, 55, 86, 57, 92, 61, 245, 52, 53, 41,
- 52, 53, 93, -28, -17, -44, 41, -38, 98, -157,
- 246, -160, -35, 112, 247, 248, 249, 250, 251, 252,
- 150, -70, 155, -41, 121, 50, 96, 94, 101, 103,
- 192, 193, 41, 166, 41, 41, 41, 41, 41, 108,
- 41, 110, 52, 53, 52, 53, 122, 41, 134, 158,
- 126, 133, 127, 232, 233, 162, 167, 168, 169, 170,
- 157, 174, 231, 234, 255, 171, -144, 269, 276, 275,
- 132, 136, 282, 164, 165, 137, 138, 235, 0, 0,
- 0, 236, 237, 238, 239, 240, 241, 0, 0, 0,
- 139, 0, 176, 177, 178, 179, 180, 181, 182, 183,
- 184, 185, 186, 0, 0, 187, 202, 190, 0, 140,
- 141, 205, 142, 0, 0, 198, 201, 0, 204, 0,
- 143, 144, 145, 146, 147, 0, 0, 166, 0, 208,
- 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
- 221, 222, 228, 0, 0, 223, 230, 224, 225, 0,
- 167, 168, 169, 170, 0, 0, 229, 0, 257, 173,
- 113, 114, 254, 116, 117, 118, 119, 120, 0, 0,
- 123, 124, 125, 260, 0, 264, 0, 128, 129, 130,
- 0, 0, 0, 0, 259, 0, 0, 0, 265, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 266,
- 0, 0, 0, 271, 0, 272, 273, 274, 0, 0,
- 0, 268, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, -2, 4, 0, 0, 284,
- 0, 278, 281, 5, 6, 7, 283, 0, 0, 0,
- 8, 9, 10, 11, 12, 13, 14, 15, 0, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 29, 30, 31, 32, 0, 0, 0,
- 0, 0, 0, 33, 34, 0, 35, 36, 0, 0,
- 0, 0, 37, 0, 0, 38, 39, 0, 40, 41
+ 56, 74, 206, 73, 172, 214, 244, 279, 280, 71,
+ 167, 57, 3, 120, 76, 59, 60, 42, 57, 62,
+ 92, 184, 129, 85, 64, 98, 42, 68, 90, 91,
+ 217, 221, 93, 227, 135, 297, 97, 108, -30, 274,
+ -19, 106, 103, -46, 185, 186, 187, 188, 209, 107,
+ -40, -161, -164, 189, -37, 112, 57, -72, 168, -43,
+ 126, -167, -2, 4, 173, 110, -173, 59, 60, -170,
+ 5, 6, 7, 42, -176, 42, 42, 8, 9, 10,
+ 11, 12, 13, 14, 15, 115, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 59,
+ 60, 42, 42, 117, 42, 151, 42, 210, 211, 122,
+ 29, 30, 31, 32, 175, 124, 136, 140, 152, 141,
+ 33, 34, 176, 35, 36, 180, 192, 182, 183, 37,
+ 249, 273, 38, 39, -148, 40, 41, 42, 43, 44,
+ 45, 46, 47, 104, 287, 294, 300, 150, 293, 0,
+ 194, 195, 196, 197, 198, 199, 200, 201, 202, 203,
+ 204, 59, 60, 205, 220, 208, 0, 0, 0, 223,
+ 0, 42, 0, 216, 219, 0, 222, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 226, 229, 230,
+ 231, 232, 233, 234, 235, 236, 237, 238, 239, 240,
+ 246, 0, 184, 241, 248, 242, 243, 0, 261, 262,
+ 0, 0, 0, 0, 247, 0, 275, 0, 263, 0,
+ 272, 0, 0, 0, 0, 185, 186, 187, 188, 0,
+ 0, 278, 264, 282, 191, 0, 265, 266, 267, 268,
+ 269, 270, 277, 250, 251, 0, 283, 154, 0, 0,
+ 0, 155, 156, 252, 0, 0, 0, 284, 0, 0,
+ 0, 289, 0, 290, 291, 292, 157, 253, 0, 286,
+ 42, 254, 255, 256, 257, 258, 259, 0, 0, 0,
+ 0, 0, 0, 0, 0, 158, 159, 302, 160, 296,
+ 299, 0, 0, 0, 301, 0, 161, 162, 163, 164,
+ 165, 127, 128, 0, 130, 131, 132, 133, 134, 0,
+ 0, 137, 138, 139, 0, 0, 0, 0, 142, 143,
+ 144, 0, 0, 145, 146, 147, 148
};
static const yytype_int16 yycheck[] =
{
- 5, 17, 4, 16, 4, 4, 4, 4, 4, 14,
- 4, 4, 4, 63, 19, 0, 11, 12, 74, 47,
- 36, 4, 72, 28, 5, 60, 13, 14, 33, 34,
- 60, 3, 37, 3, 47, 3, 23, 65, 66, 74,
- 65, 66, 47, 3, 3, 3, 74, 3, 53, 3,
- 37, 3, 3, 69, 41, 42, 43, 44, 45, 46,
- 52, 3, 64, 3, 68, 60, 5, 47, 3, 3,
- 63, 64, 74, 14, 74, 74, 74, 74, 74, 3,
- 74, 3, 65, 66, 65, 66, 3, 74, 3, 3,
- 47, 96, 47, 13, 14, 68, 37, 38, 39, 40,
- 105, 46, 69, 23, 6, 46, 3, 3, 46, 267,
- 94, 4, 6, 126, 127, 8, 9, 37, -1, -1,
- -1, 41, 42, 43, 44, 45, 46, -1, -1, -1,
- 23, -1, 137, 138, 139, 140, 141, 142, 143, 144,
- 145, 146, 147, -1, -1, 150, 162, 152, -1, 42,
- 43, 167, 45, -1, -1, 160, 161, -1, 163, -1,
- 53, 54, 55, 56, 57, -1, -1, 14, -1, 174,
- 175, 176, 177, 178, 179, 180, 181, 182, 183, 184,
- 185, 186, 195, -1, -1, 190, 202, 192, 193, -1,
- 37, 38, 39, 40, -1, -1, 201, -1, 211, 46,
- 70, 71, 207, 73, 74, 75, 76, 77, -1, -1,
- 80, 81, 82, 229, -1, 231, -1, 87, 88, 89,
- -1, -1, -1, -1, 229, -1, -1, -1, 241, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 252,
- -1, -1, -1, 259, -1, 261, 262, 263, -1, -1,
- -1, 256, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 0, 1, -1, -1, 282,
- -1, 276, 277, 8, 9, 10, 281, -1, -1, -1,
- 15, 16, 17, 18, 19, 20, 21, 22, -1, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 48, 49, 50, 51, -1, -1, -1,
- -1, -1, -1, 58, 59, -1, 61, 62, -1, -1,
- -1, -1, 67, -1, -1, 70, 71, -1, 73, 74
+ 5, 17, 4, 16, 4, 4, 4, 11, 12, 14,
+ 4, 60, 0, 70, 19, 65, 66, 75, 60, 3,
+ 36, 14, 79, 28, 3, 41, 75, 3, 33, 34,
+ 4, 4, 37, 4, 68, 4, 41, 47, 3, 5,
+ 3, 54, 47, 3, 37, 38, 39, 40, 4, 54,
+ 3, 3, 3, 46, 3, 60, 60, 3, 52, 3,
+ 76, 3, 0, 1, 64, 5, 3, 65, 66, 3,
+ 8, 9, 10, 75, 3, 75, 75, 15, 16, 17,
+ 18, 19, 20, 21, 22, 3, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35, 36, 65,
+ 66, 75, 75, 3, 75, 110, 75, 63, 64, 3,
+ 48, 49, 50, 51, 119, 3, 3, 47, 3, 47,
+ 58, 59, 3, 61, 62, 68, 46, 140, 141, 67,
+ 69, 6, 70, 71, 3, 73, 74, 75, 76, 77,
+ 78, 79, 80, 47, 3, 46, 6, 108, 285, -1,
+ 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
+ 165, 65, 66, 168, 180, 170, -1, -1, -1, 185,
+ -1, 75, -1, 178, 179, -1, 181, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 192, 193, 194,
+ 195, 196, 197, 198, 199, 200, 201, 202, 203, 204,
+ 213, -1, 14, 208, 220, 210, 211, -1, 13, 14,
+ -1, -1, -1, -1, 219, -1, 229, -1, 23, -1,
+ 225, -1, -1, -1, -1, 37, 38, 39, 40, -1,
+ -1, 247, 37, 249, 46, -1, 41, 42, 43, 44,
+ 45, 46, 247, 13, 14, -1, 259, 4, -1, -1,
+ -1, 8, 9, 23, -1, -1, -1, 270, -1, -1,
+ -1, 277, -1, 279, 280, 281, 23, 37, -1, 274,
+ 75, 41, 42, 43, 44, 45, 46, -1, -1, -1,
+ -1, -1, -1, -1, -1, 42, 43, 300, 45, 294,
+ 295, -1, -1, -1, 299, -1, 53, 54, 55, 56,
+ 57, 77, 78, -1, 80, 81, 82, 83, 84, -1,
+ -1, 87, 88, 89, -1, -1, -1, -1, 94, 95,
+ 96, -1, -1, 99, 100, 101, 102
};
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
- symbol of state STATE-NUM. */
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
static const yytype_uint8 yystos[] =
{
- 0, 76, 77, 0, 1, 8, 9, 10, 15, 16,
+ 0, 82, 83, 0, 1, 8, 9, 10, 15, 16,
17, 18, 19, 20, 21, 22, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 48,
49, 50, 51, 58, 59, 61, 62, 67, 70, 71,
- 73, 74, 78, 100, 101, 102, 127, 148, 149, 149,
- 60, 150, 65, 66, 146, 3, 114, 3, 111, 94,
- 95, 3, 121, 97, 149, 83, 146, 150, 82, 149,
- 81, 88, 96, 79, 80, 87, 90, 85, 149, 128,
- 129, 89, 84, 149, 149, 150, 149, 99, 98, 86,
- 47, 103, 146, 149, 47, 104, 5, 92, 149, 115,
- 112, 3, 137, 3, 117, 122, 117, 93, 3, 134,
- 3, 131, 150, 134, 134, 117, 134, 134, 134, 134,
- 134, 68, 3, 134, 134, 134, 47, 47, 134, 134,
- 134, 105, 105, 149, 3, 143, 4, 8, 9, 23,
- 42, 43, 45, 53, 54, 55, 56, 57, 116, 4,
- 52, 113, 138, 118, 4, 64, 123, 149, 3, 140,
- 135, 132, 68, 130, 146, 146, 14, 37, 38, 39,
- 40, 46, 106, 46, 46, 144, 149, 149, 149, 149,
- 149, 149, 149, 149, 149, 149, 149, 149, 4, 139,
- 149, 4, 63, 64, 119, 141, 4, 136, 149, 4,
- 133, 149, 150, 4, 149, 150, 107, 109, 149, 4,
- 145, 149, 149, 149, 149, 149, 149, 149, 149, 149,
- 149, 149, 149, 149, 149, 149, 4, 142, 146, 149,
- 150, 69, 13, 14, 23, 37, 41, 42, 43, 44,
- 45, 46, 108, 13, 14, 23, 37, 41, 42, 43,
- 44, 45, 46, 110, 149, 6, 5, 146, 120, 149,
- 150, 11, 12, 147, 150, 146, 146, 91, 149, 3,
- 124, 150, 150, 150, 150, 143, 46, 125, 149, 4,
- 126, 149, 6, 149, 146
+ 73, 74, 75, 76, 77, 78, 79, 80, 84, 106,
+ 107, 108, 133, 136, 159, 160, 160, 60, 161, 65,
+ 66, 157, 3, 120, 3, 117, 100, 101, 3, 127,
+ 103, 160, 89, 157, 161, 88, 160, 87, 94, 102,
+ 85, 86, 93, 96, 91, 160, 134, 135, 95, 90,
+ 160, 160, 161, 160, 105, 104, 92, 160, 161, 137,
+ 139, 138, 140, 160, 47, 109, 157, 160, 47, 110,
+ 5, 98, 160, 121, 118, 3, 148, 3, 123, 128,
+ 123, 99, 3, 145, 3, 142, 161, 145, 145, 123,
+ 145, 145, 145, 145, 145, 68, 3, 145, 145, 145,
+ 47, 47, 145, 145, 145, 145, 145, 145, 145, 111,
+ 111, 160, 3, 154, 4, 8, 9, 23, 42, 43,
+ 45, 53, 54, 55, 56, 57, 122, 4, 52, 119,
+ 149, 124, 4, 64, 129, 160, 3, 151, 146, 143,
+ 68, 141, 157, 157, 14, 37, 38, 39, 40, 46,
+ 112, 46, 46, 155, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 160, 160, 4, 150, 160, 4,
+ 63, 64, 125, 152, 4, 147, 160, 4, 144, 160,
+ 161, 4, 160, 161, 113, 115, 160, 4, 156, 160,
+ 160, 160, 160, 160, 160, 160, 160, 160, 160, 160,
+ 160, 160, 160, 160, 4, 153, 157, 160, 161, 69,
+ 13, 14, 23, 37, 41, 42, 43, 44, 45, 46,
+ 114, 13, 14, 23, 37, 41, 42, 43, 44, 45,
+ 46, 116, 160, 6, 5, 157, 126, 160, 161, 11,
+ 12, 158, 161, 157, 157, 97, 160, 3, 130, 161,
+ 161, 161, 161, 154, 46, 131, 160, 4, 132, 160,
+ 6, 160, 157
};
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const yytype_uint8 yyr1[] =
+{
+ 0, 81, 82, 83, 83, 84, 84, 84, 84, 84,
+ 84, 84, 84, 84, 84, 84, 84, 84, 84, 85,
+ 84, 84, 84, 84, 84, 84, 84, 84, 86, 84,
+ 87, 84, 84, 88, 84, 89, 84, 90, 84, 84,
+ 91, 84, 84, 92, 84, 84, 93, 84, 84, 94,
+ 84, 95, 84, 96, 84, 97, 84, 98, 84, 99,
+ 84, 100, 84, 101, 84, 102, 84, 84, 103, 84,
+ 84, 84, 104, 84, 84, 84, 84, 105, 84, 106,
+ 107, 108, 109, 110, 111, 111, 112, 112, 112, 112,
+ 112, 112, 113, 113, 114, 114, 114, 114, 114, 114,
+ 114, 114, 114, 115, 115, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 117, 118, 118, 119, 120,
+ 121, 121, 122, 122, 122, 122, 122, 122, 122, 122,
+ 122, 122, 122, 122, 122, 122, 122, 122, 122, 122,
+ 122, 122, 122, 122, 123, 124, 124, 125, 126, 125,
+ 125, 127, 128, 128, 129, 129, 130, 131, 131, 132,
+ 133, 134, 133, 133, 135, 133, 136, 137, 136, 136,
+ 138, 136, 136, 139, 136, 136, 140, 136, 141, 141,
+ 142, 143, 143, 144, 144, 145, 146, 146, 147, 148,
+ 149, 149, 150, 151, 152, 152, 153, 154, 155, 155,
+ 156, 156, 157, 157, 158, 158, 158, 159, 160, 161
+};
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
+ /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
+static const yytype_uint8 yyr2[] =
+{
+ 0, 2, 1, 0, 2, 1, 1, 1, 1, 1,
+ 1, 2, 6, 3, 2, 2, 1, 2, 2, 0,
+ 3, 1, 4, 4, 2, 2, 2, 2, 0, 3,
+ 0, 3, 1, 0, 3, 0, 3, 0, 3, 1,
+ 0, 3, 1, 0, 3, 1, 0, 3, 1, 0,
+ 3, 0, 3, 0, 3, 0, 9, 0, 4, 0,
+ 4, 0, 3, 0, 3, 0, 3, 2, 0, 3,
+ 2, 2, 0, 3, 1, 2, 2, 0, 3, 1,
+ 2, 2, 6, 6, 0, 2, 1, 1, 1, 1,
+ 2, 1, 0, 2, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 0, 2, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 3, 0, 2, 2, 3,
+ 0, 2, 3, 2, 3, 2, 3, 2, 3, 2,
+ 3, 2, 3, 2, 3, 2, 3, 2, 3, 2,
+ 3, 2, 3, 2, 3, 0, 2, 2, 0, 4,
+ 2, 3, 0, 2, 1, 1, 3, 0, 2, 2,
+ 1, 0, 5, 1, 0, 3, 1, 0, 3, 1,
+ 0, 3, 1, 0, 3, 1, 0, 3, 0, 5,
+ 3, 0, 2, 3, 4, 3, 0, 2, 1, 3,
+ 0, 2, 2, 3, 0, 2, 1, 3, 0, 2,
+ 2, 7, 1, 2, 1, 2, 2, 2, 1, 1
+};
-/* Like YYERROR except do call yyerror. This remains here temporarily
- to ease the transition to the new meaning of YYERROR, for GCC.
- Once GCC version 2 has supplanted version 1, this can go. */
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
-#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY && yylen == 1) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- yytoken = YYTRANSLATE (yychar); \
- YYPOPSTACK (1); \
- goto yybackup; \
- } \
- else \
- { \
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
yyerror (YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (YYID (0))
-
-
-#define YYTERROR 1
-#define YYERRCODE 256
-
-
-/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
- If N is 0, then set CURRENT to the empty location which ends
- the previous symbol: RHS[0] (always defined). */
-
-#define YYRHSLOC(Rhs, K) ((Rhs)[K])
-#ifndef YYLLOC_DEFAULT
-# define YYLLOC_DEFAULT(Current, Rhs, N) \
- do \
- if (YYID (N)) \
- { \
- (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \
- (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \
- (Current).last_line = YYRHSLOC (Rhs, N).last_line; \
- (Current).last_column = YYRHSLOC (Rhs, N).last_column; \
- } \
- else \
- { \
- (Current).first_line = (Current).last_line = \
- YYRHSLOC (Rhs, 0).last_line; \
- (Current).first_column = (Current).last_column = \
- YYRHSLOC (Rhs, 0).last_column; \
- } \
- while (YYID (0))
-#endif
-
+ YYERROR; \
+ } \
+while (0)
+
+/* Error token number */
+#define YYTERROR 1
+#define YYERRCODE 256
-/* YY_LOCATION_PRINT -- Print the location on the stream.
- This macro was not mandated originally: define only if we know
- we won't break user code: when these are the locations we know. */
-#ifndef YY_LOCATION_PRINT
-# if YYLTYPE_IS_TRIVIAL
-# define YY_LOCATION_PRINT(File, Loc) \
- fprintf (File, "%d.%d-%d.%d", \
- (Loc).first_line, (Loc).first_column, \
- (Loc).last_line, (Loc).last_column)
-# else
-# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
-# endif
-#endif
-
-
-/* YYLEX -- calling `yylex' with the right arguments. */
-
-#ifdef YYLEX_PARAM
-# define YYLEX yylex (YYLEX_PARAM)
-#else
-# define YYLEX yylex ()
-#endif
/* Enable debugging if requested. */
#if YYDEBUG
@@ -1093,54 +1031,46 @@ while (YYID (0))
# define YYFPRINTF fprintf
# endif
-# define YYDPRINTF(Args) \
-do { \
- if (yydebug) \
- YYFPRINTF Args; \
-} while (YYID (0))
-
-# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
-do { \
- if (yydebug) \
- { \
- YYFPRINTF (stderr, "%s ", Title); \
- yy_symbol_print (stderr, \
- Type, Value); \
- YYFPRINTF (stderr, "\n"); \
- } \
-} while (YYID (0))
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+/* This macro is provided for backward compatibility. */
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (0)
+
+
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT. |
+`----------------------------------------*/
+
static void
yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_value_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
-#endif
{
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
if (!yyvaluep)
return;
# ifdef YYPRINT
if (yytype < YYNTOKENS)
YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
-# else
- YYUSE (yyoutput);
# endif
- switch (yytype)
- {
- default:
- break;
- }
+ YYUSE (yytype);
}
@@ -1148,22 +1078,11 @@ yy_symbol_value_print (yyoutput, yytype,
| Print this symbol on YYOUTPUT. |
`--------------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep)
-#else
-static void
-yy_symbol_print (yyoutput, yytype, yyvaluep)
- FILE *yyoutput;
- int yytype;
- YYSTYPE const * const yyvaluep;
-#endif
{
- if (yytype < YYNTOKENS)
- YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
- else
- YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+ YYFPRINTF (yyoutput, "%s %s (",
+ yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
yy_symbol_value_print (yyoutput, yytype, yyvaluep);
YYFPRINTF (yyoutput, ")");
@@ -1174,66 +1093,54 @@ yy_symbol_print (yyoutput, yytype, yyval
| TOP (included). |
`------------------------------------------------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
-yy_stack_print (yytype_int16 *bottom, yytype_int16 *top)
-#else
-static void
-yy_stack_print (bottom, top)
- yytype_int16 *bottom;
- yytype_int16 *top;
-#endif
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
{
YYFPRINTF (stderr, "Stack now");
- for (; bottom <= top; ++bottom)
- YYFPRINTF (stderr, " %d", *bottom);
+ for (; yybottom <= yytop; yybottom++)
+ {
+ int yybot = *yybottom;
+ YYFPRINTF (stderr, " %d", yybot);
+ }
YYFPRINTF (stderr, "\n");
}
-# define YY_STACK_PRINT(Bottom, Top) \
-do { \
- if (yydebug) \
- yy_stack_print ((Bottom), (Top)); \
-} while (YYID (0))
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (0)
/*------------------------------------------------.
| Report that the YYRULE is going to be reduced. |
`------------------------------------------------*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-static void
-yy_reduce_print (YYSTYPE *yyvsp, int yyrule)
-#else
static void
-yy_reduce_print (yyvsp, yyrule)
- YYSTYPE *yyvsp;
- int yyrule;
-#endif
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule)
{
+ unsigned long int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
- unsigned long int yylno = yyrline[yyrule];
YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
- yyrule - 1, yylno);
+ yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
- fprintf (stderr, " $%d = ", yyi + 1);
- yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
- &(yyvsp[(yyi + 1) - (yynrhs)])
- );
- fprintf (stderr, "\n");
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr,
+ yystos[yyssp[yyi + 1 - yynrhs]],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ );
+ YYFPRINTF (stderr, "\n");
}
}
-# define YY_REDUCE_PRINT(Rule) \
-do { \
- if (yydebug) \
- yy_reduce_print (yyvsp, Rule); \
-} while (YYID (0))
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (yyssp, yyvsp, Rule); \
+} while (0)
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
@@ -1247,7 +1154,7 @@ int yydebug;
/* YYINITDEPTH -- initial size of the parser's stacks. */
-#ifndef YYINITDEPTH
+#ifndef YYINITDEPTH
# define YYINITDEPTH 200
#endif
@@ -1262,7 +1169,6 @@ int yydebug;
# define YYMAXDEPTH 10000
#endif
-
#if YYERROR_VERBOSE
@@ -1271,15 +1177,8 @@ int yydebug;
# define yystrlen strlen
# else
/* Return the length of YYSTR. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static YYSIZE_T
yystrlen (const char *yystr)
-#else
-static YYSIZE_T
-yystrlen (yystr)
- const char *yystr;
-#endif
{
YYSIZE_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
@@ -1295,16 +1194,8 @@ yystrlen (yystr)
# else
/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
YYDEST. */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static char *
yystpcpy (char *yydest, const char *yysrc)
-#else
-static char *
-yystpcpy (yydest, yysrc)
- char *yydest;
- const char *yysrc;
-#endif
{
char *yyd = yydest;
const char *yys = yysrc;
@@ -1334,27 +1225,27 @@ yytnamerr (char *yyres, const char *yyst
char const *yyp = yystr;
for (;;)
- switch (*++yyp)
- {
- case '\'':
- case ',':
- goto do_not_strip_quotes;
-
- case '\\':
- if (*++yyp != '\\')
- goto do_not_strip_quotes;
- /* Fall through. */
- default:
- if (yyres)
- yyres[yyn] = *yyp;
- yyn++;
- break;
-
- case '"':
- if (yyres)
- yyres[yyn] = '\0';
- return yyn;
- }
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
do_not_strip_quotes: ;
}
@@ -1365,211 +1256,209 @@ yytnamerr (char *yyres, const char *yyst
}
# endif
-/* Copy into YYRESULT an error message about the unexpected token
- YYCHAR while in state YYSTATE. Return the number of bytes copied,
- including the terminating null byte. If YYRESULT is null, do not
- copy anything; just return the number of bytes that would be
- copied. As a special case, return 0 if an ordinary "syntax error"
- message will do. Return YYSIZE_MAXIMUM if overflow occurs during
- size calculation. */
-static YYSIZE_T
-yysyntax_error (char *yyresult, int yystate, int yychar)
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
+
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+ yytype_int16 *yyssp, int yytoken)
{
- int yyn = yypact[yystate];
+ YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+ YYSIZE_T yysize = yysize0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = YY_NULLPTR;
+ /* Arguments of yyformat. */
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ /* Number of reported tokens (one for the "unexpected", one per
+ "expected"). */
+ int yycount = 0;
+
+ /* There are many possibilities here to consider:
+ - If this state is a consistent state with a default action, then
+ the only way this function was invoked is if the default action
+ is an error action. In that case, don't check for expected
+ tokens because there are none.
+ - The only way there can be no lookahead present (in yychar) is if
+ this state is a consistent state with a default action. Thus,
+ detecting the absence of a lookahead is sufficient to determine
+ that there is no unexpected or expected token to report. In that
+ case, just report a simple "syntax error".
+ - Don't assume there isn't a lookahead just because this state is a
+ consistent state with a default action. There might have been a
+ previous inconsistent state, consistent state with a non-default
+ action, or user semantic action that manipulated yychar.
+ - Of course, the expected token list depends on states to have
+ correct lookahead information, and it depends on the parser not
+ to perform extra reductions after fetching a lookahead from the
+ scanner and before detecting a syntax error. Thus, state merging
+ (from LALR or IELR) and default reductions corrupt the expected
+ token list. However, the list is correct for canonical LR with
+ one exception: it will still contain any token that will not be
+ accepted due to an error action in a later state.
+ */
+ if (yytoken != YYEMPTY)
+ {
+ int yyn = yypact[*yyssp];
+ yyarg[yycount++] = yytname[yytoken];
+ if (!yypact_value_is_default (yyn))
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ {
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
+ }
+ }
- if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
- return 0;
- else
+ switch (yycount)
{
- int yytype = YYTRANSLATE (yychar);
- YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
- YYSIZE_T yysize = yysize0;
- YYSIZE_T yysize1;
- int yysize_overflow = 0;
- enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
- char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- int yyx;
-
-# if 0
- /* This is so xgettext sees the translatable formats that are
- constructed on the fly. */
- YY_("syntax error, unexpected %s");
- YY_("syntax error, unexpected %s, expecting %s");
- YY_("syntax error, unexpected %s, expecting %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s");
- YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
-# endif
- char *yyfmt;
- char const *yyf;
- static char const yyunexpected[] = "syntax error, unexpected %s";
- static char const yyexpecting[] = ", expecting %s";
- static char const yyor[] = " or %s";
- char yyformat[sizeof yyunexpected
- + sizeof yyexpecting - 1
- + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
- * (sizeof yyor - 1))];
- char const *yyprefix = yyexpecting;
-
- /* Start YYX at -YYN if negative to avoid negative indexes in
- YYCHECK. */
- int yyxbegin = yyn < 0 ? -yyn : 0;
-
- /* Stay within bounds of both yycheck and yytname. */
- int yychecklim = YYLAST - yyn + 1;
- int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
- int yycount = 1;
-
- yyarg[0] = yytname[yytype];
- yyfmt = yystpcpy (yyformat, yyunexpected);
-
- for (yyx = yyxbegin; yyx < yyxend; ++yyx)
- if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
- {
- if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
- {
- yycount = 1;
- yysize = yysize0;
- yyformat[sizeof yyunexpected - 1] = '\0';
- break;
- }
- yyarg[yycount++] = yytname[yyx];
- yysize1 = yysize + yytnamerr (0, yytname[yyx]);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
- yyfmt = yystpcpy (yyfmt, yyprefix);
- yyprefix = yyor;
- }
-
- yyf = YY_(yyformat);
- yysize1 = yysize + yystrlen (yyf);
- yysize_overflow |= (yysize1 < yysize);
- yysize = yysize1;
-
- if (yysize_overflow)
- return YYSIZE_MAXIMUM;
+# define YYCASE_(N, S) \
+ case N: \
+ yyformat = S; \
+ break
+ YYCASE_(0, YY_("syntax error"));
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+ }
- if (yyresult)
- {
- /* Avoid sprintf, as that infringes on the user's name space.
- Don't have undefined behavior even if the translation
- produced a string with the wrong number of "%s"s. */
- char *yyp = yyresult;
- int yyi = 0;
- while ((*yyp = *yyf) != '\0')
- {
- if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
- {
- yyp += yytnamerr (yyp, yyarg[yyi++]);
- yyf += 2;
- }
- else
- {
- yyp++;
- yyf++;
- }
- }
- }
- return yysize;
+ {
+ YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+
+ if (*yymsg_alloc < yysize)
+ {
+ *yymsg_alloc = 2 * yysize;
+ if (! (yysize <= *yymsg_alloc
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+ return 1;
}
+
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ {
+ char *yyp = *yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyformat) != '\0')
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyformat += 2;
+ }
+ else
+ {
+ yyp++;
+ yyformat++;
+ }
+ }
+ return 0;
}
#endif /* YYERROR_VERBOSE */
-
/*-----------------------------------------------.
| Release the memory associated to this symbol. |
`-----------------------------------------------*/
-/*ARGSUSED*/
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
static void
yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep)
-#else
-static void
-yydestruct (yymsg, yytype, yyvaluep)
- const char *yymsg;
- int yytype;
- YYSTYPE *yyvaluep;
-#endif
{
YYUSE (yyvaluep);
-
if (!yymsg)
yymsg = "Deleting";
YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
- switch (yytype)
- {
-
- default:
- break;
- }
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-
-
-/* Prevent warnings from -Wmissing-prototypes. */
-#ifdef YYPARSE_PARAM
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void *YYPARSE_PARAM);
-#else
-int yyparse ();
-#endif
-#else /* ! YYPARSE_PARAM */
-#if defined __STDC__ || defined __cplusplus
-int yyparse (void);
-#else
-int yyparse ();
-#endif
-#endif /* ! YYPARSE_PARAM */
-/* The look-ahead symbol. */
+/* The lookahead symbol. */
int yychar;
-/* The semantic value of the look-ahead symbol. */
+/* The semantic value of the lookahead symbol. */
YYSTYPE yylval;
-
/* Number of syntax errors so far. */
int yynerrs;
-
/*----------.
| yyparse. |
`----------*/
-#ifdef YYPARSE_PARAM
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
-int
-yyparse (void *YYPARSE_PARAM)
-#else
-int
-yyparse (YYPARSE_PARAM)
- void *YYPARSE_PARAM;
-#endif
-#else /* ! YYPARSE_PARAM */
-#if (defined __STDC__ || defined __C99__FUNC__ \
- || defined __cplusplus || defined _MSC_VER)
int
yyparse (void)
-#else
-int
-yyparse ()
-
-#endif
-#endif
{
-
- int yystate;
+ int yystate;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+
+ /* The stacks and their tools:
+ 'yyss': related to states.
+ 'yyvs': related to semantic values.
+
+ Refer to the stacks through separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss;
+ yytype_int16 *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs;
+ YYSTYPE *yyvsp;
+
+ YYSIZE_T yystacksize;
+
int yyn;
int yyresult;
- /* Number of tokens to shift before error messages enabled. */
- int yyerrstatus;
- /* Look-ahead token as an internal (translated) token number. */
+ /* Lookahead token as an internal (translated) token number. */
int yytoken = 0;
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+
#if YYERROR_VERBOSE
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
@@ -1577,54 +1466,22 @@ yyparse ()
YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
#endif
- /* Three stacks and their tools:
- `yyss': related to states,
- `yyvs': related to semantic values,
- `yyls': related to locations.
-
- Refer to the stacks thru separate pointers, to allow yyoverflow
- to reallocate them elsewhere. */
-
- /* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss = yyssa;
- yytype_int16 *yyssp;
-
- /* The semantic value stack. */
- YYSTYPE yyvsa[YYINITDEPTH];
- YYSTYPE *yyvs = yyvsa;
- YYSTYPE *yyvsp;
-
-
-
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
- YYSIZE_T yystacksize = YYINITDEPTH;
-
- /* The variables used to return semantic value and location from the
- action routines. */
- YYSTYPE yyval;
-
-
/* The number of symbols on the RHS of the reduced rule.
Keep to zero when no symbol should be popped. */
int yylen = 0;
+ yyssp = yyss = yyssa;
+ yyvsp = yyvs = yyvsa;
+ yystacksize = YYINITDEPTH;
+
YYDPRINTF ((stderr, "Starting parse\n"));
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
- yychar = YYEMPTY; /* Cause a token to be read. */
-
- /* Initialize stack pointers.
- Waste one element of value and location stack
- so that they stay on the same level as the state stack.
- The wasted elements are never initialized. */
-
- yyssp = yyss;
- yyvsp = yyvs;
-
+ yychar = YYEMPTY; /* Cause a token to be read. */
goto yysetstate;
/*------------------------------------------------------------.
@@ -1645,25 +1502,23 @@ yyparse ()
#ifdef yyoverflow
{
- /* Give user a chance to reallocate the stack. Use copies of
- these so that the &'s don't force the real ones into
- memory. */
- YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
-
-
- /* Each stack pointer address is followed by the size of the
- data in use in that stack, in bytes. This used to be a
- conditional around just the two extra args, but that might
- be undefined if yyoverflow is a macro. */
- yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ yytype_int16 *yyss1 = yyss;
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow (YY_("memory exhausted"),
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+ &yystacksize);
- &yystacksize);
-
- yyss = yyss1;
- yyvs = yyvs1;
+ yyss = yyss1;
+ yyvs = yyvs1;
}
#else /* no yyoverflow */
# ifndef YYSTACK_RELOCATE
@@ -1671,23 +1526,22 @@ yyparse ()
# else
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
- goto yyexhaustedlab;
+ goto yyexhaustedlab;
yystacksize *= 2;
if (YYMAXDEPTH < yystacksize)
- yystacksize = YYMAXDEPTH;
+ yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
- union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
- if (! yyptr)
- goto yyexhaustedlab;
- YYSTACK_RELOCATE (yyss);
- YYSTACK_RELOCATE (yyvs);
-
+ yytype_int16 *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyexhaustedlab;
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# undef YYSTACK_RELOCATE
- if (yyss1 != yyssa)
- YYSTACK_FREE (yyss1);
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
}
# endif
#endif /* no yyoverflow */
@@ -1695,16 +1549,18 @@ yyparse ()
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
-
YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ (unsigned long int) yystacksize));
if (yyss + yystacksize - 1 <= yyssp)
- YYABORT;
+ YYABORT;
}
YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ if (yystate == YYFINAL)
+ YYACCEPT;
+
goto yybackup;
/*-----------.
@@ -1713,20 +1569,20 @@ yyparse ()
yybackup:
/* Do appropriate processing given the current state. Read a
- look-ahead token if we need one and don't already have one. */
+ lookahead token if we need one and don't already have one. */
- /* First try to decide what to do without reference to look-ahead token. */
+ /* First try to decide what to do without reference to lookahead token. */
yyn = yypact[yystate];
- if (yyn == YYPACT_NINF)
+ if (yypact_value_is_default (yyn))
goto yydefault;
- /* Not known => get a look-ahead token if don't already have one. */
+ /* Not known => get a lookahead token if don't already have one. */
- /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
if (yychar == YYEMPTY)
{
YYDPRINTF ((stderr, "Reading a token: "));
- yychar = YYLEX;
+ yychar = yylex ();
}
if (yychar <= YYEOF)
@@ -1748,29 +1604,27 @@ yybackup:
yyn = yytable[yyn];
if (yyn <= 0)
{
- if (yyn == 0 || yyn == YYTABLE_NINF)
- goto yyerrlab;
+ if (yytable_value_is_error (yyn))
+ goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
/* Count tokens shifted since error; after three, turn off error
status. */
if (yyerrstatus)
yyerrstatus--;
- /* Shift the look-ahead token. */
+ /* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
- /* Discard the shifted token unless it is eof. */
- if (yychar != YYEOF)
- yychar = YYEMPTY;
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
yystate = yyn;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
goto yynewstate;
@@ -1793,7 +1647,7 @@ yyreduce:
yylen = yyr2[yyn];
/* If YYLEN is nonzero, implement the default value of the action:
- `$$ = $1'.
+ '$$ = $1'.
Otherwise, the following line sets YYVAL to garbage.
This behavior is undocumented and Bison
@@ -1806,251 +1660,307 @@ yyreduce:
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 10:
-#line 149 "gram.y"
- { AddIconRegion((yyvsp[(2) - (6)].ptr), (yyvsp[(3) - (6)].num), (yyvsp[(4) - (6)].num), (yyvsp[(5) - (6)].num), (yyvsp[(6) - (6)].num)); }
+ case 11:
+#line 155 "gram.y" /* yacc.c:1646 */
+ { if (strcmp((yyvsp[0].ptr), "t2b")== 0)
+ Scr->MenuRuns = MenuRuns_T2B;
+ else if (strcmp((yyvsp[0].ptr), "b2t")== 0)
+ Scr->MenuRuns = MenuRuns_B2T;
+ else if (strcmp((yyvsp[0].ptr), "r2l")== 0)
+ Scr->MenuRuns = MenuRuns_R2L;
+ else if (strcmp((yyvsp[0].ptr), "l2r")== 0)
+ Scr->MenuRuns = MenuRuns_L2R;
+ else fprintf(stderr,
+ "MenuRuns \"{t2b|b2t|r2l|l2r}\"\n");
+ }
+#line 1677 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 12:
+#line 167 "gram.y" /* yacc.c:1646 */
+ { AddIconRegion((yyvsp[-4].ptr), (yyvsp[-3].num), (yyvsp[-2].num), (yyvsp[-1].num), (yyvsp[0].num)); }
+#line 1683 "y.tab.c" /* yacc.c:1646 */
break;
- case 11:
-#line 150 "gram.y"
+ case 13:
+#line 168 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
{
- Scr->iconmgr.geometry=(yyvsp[(2) - (3)].ptr);
- Scr->iconmgr.columns=(yyvsp[(3) - (3)].num);
+ Scr->iconmgr.geometry=(yyvsp[-1].ptr);
+ Scr->iconmgr.columns=(yyvsp[0].num);
}
}
+#line 1694 "y.tab.c" /* yacc.c:1646 */
break;
- case 12:
-#line 156 "gram.y"
+ case 14:
+#line 174 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
- Scr->iconmgr.geometry = (yyvsp[(2) - (2)].ptr);
+ Scr->iconmgr.geometry = (yyvsp[0].ptr);
}
+#line 1702 "y.tab.c" /* yacc.c:1646 */
break;
- case 13:
-#line 159 "gram.y"
+ case 15:
+#line 177 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
{
Scr->DoZoom = TRUE;
- Scr->ZoomCount = (yyvsp[(2) - (2)].num);
+ Scr->ZoomCount = (yyvsp[0].num);
}
}
+#line 1713 "y.tab.c" /* yacc.c:1646 */
break;
- case 14:
-#line 165 "gram.y"
+ case 16:
+#line 183 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
Scr->DoZoom = TRUE; }
+#line 1720 "y.tab.c" /* yacc.c:1646 */
break;
- case 15:
-#line 167 "gram.y"
+ case 17:
+#line 185 "gram.y" /* yacc.c:1646 */
{}
+#line 1726 "y.tab.c" /* yacc.c:1646 */
break;
- case 16:
-#line 168 "gram.y"
+ case 18:
+#line 186 "gram.y" /* yacc.c:1646 */
{}
+#line 1732 "y.tab.c" /* yacc.c:1646 */
break;
- case 17:
-#line 169 "gram.y"
+ case 19:
+#line 187 "gram.y" /* yacc.c:1646 */
{ list = &Scr->IconifyByUn; }
+#line 1738 "y.tab.c" /* yacc.c:1646 */
break;
- case 19:
-#line 171 "gram.y"
+ case 21:
+#line 189 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
Scr->IconifyByUnmapping = TRUE; }
+#line 1745 "y.tab.c" /* yacc.c:1646 */
break;
- case 20:
-#line 173 "gram.y"
+ case 22:
+#line 191 "gram.y" /* yacc.c:1646 */
{
- GotTitleButton ((yyvsp[(2) - (4)].ptr), (yyvsp[(4) - (4)].num), False);
+ GotTitleButton ((yyvsp[-2].ptr), (yyvsp[0].num), False);
}
+#line 1753 "y.tab.c" /* yacc.c:1646 */
break;
- case 21:
-#line 176 "gram.y"
+ case 23:
+#line 194 "gram.y" /* yacc.c:1646 */
{
- GotTitleButton ((yyvsp[(2) - (4)].ptr), (yyvsp[(4) - (4)].num), True);
+ GotTitleButton ((yyvsp[-2].ptr), (yyvsp[0].num), True);
}
+#line 1761 "y.tab.c" /* yacc.c:1646 */
break;
- case 22:
-#line 179 "gram.y"
- { root = GetRoot((yyvsp[(2) - (2)].ptr), NULLSTR, NULLSTR);
- Scr->Mouse[(yyvsp[(1) - (2)].num)][C_ROOT][0].func = F_MENU;
- Scr->Mouse[(yyvsp[(1) - (2)].num)][C_ROOT][0].menu = root;
+ case 24:
+#line 197 "gram.y" /* yacc.c:1646 */
+ { root = GetRoot((yyvsp[0].ptr), NULLSTR, NULLSTR);
+ Scr->Mouse[(yyvsp[-1].num)][C_ROOT][0].func = F_MENU;
+ Scr->Mouse[(yyvsp[-1].num)][C_ROOT][0].menu = root;
}
+#line 1770 "y.tab.c" /* yacc.c:1646 */
break;
- case 23:
-#line 183 "gram.y"
- { Scr->Mouse[(yyvsp[(1) - (2)].num)][C_ROOT][0].func = (yyvsp[(2) - (2)].num);
- if ((yyvsp[(2) - (2)].num) == F_MENU)
+ case 25:
+#line 201 "gram.y" /* yacc.c:1646 */
+ { Scr->Mouse[(yyvsp[-1].num)][C_ROOT][0].func = (yyvsp[0].num);
+ if ((yyvsp[0].num) == F_MENU)
{
pull->prev = NULL;
- Scr->Mouse[(yyvsp[(1) - (2)].num)][C_ROOT][0].menu = pull;
+ Scr->Mouse[(yyvsp[-1].num)][C_ROOT][0].menu = pull;
}
else
{
root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR);
- Scr->Mouse[(yyvsp[(1) - (2)].num)][C_ROOT][0].item =
+ Scr->Mouse[(yyvsp[-1].num)][C_ROOT][0].item =
AddToMenu(root,"x",Action,
- NULL,(yyvsp[(2) - (2)].num),NULLSTR,NULLSTR);
+ NULL,(yyvsp[0].num),NULLSTR,NULLSTR);
}
Action = "";
pull = NULL;
}
+#line 1791 "y.tab.c" /* yacc.c:1646 */
break;
- case 24:
-#line 199 "gram.y"
- { GotKey((yyvsp[(1) - (2)].ptr), (yyvsp[(2) - (2)].num)); }
+ case 26:
+#line 217 "gram.y" /* yacc.c:1646 */
+ { GotKey((yyvsp[-1].ptr), (yyvsp[0].num)); }
+#line 1797 "y.tab.c" /* yacc.c:1646 */
break;
- case 25:
-#line 200 "gram.y"
- { GotButton((yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].num)); }
+ case 27:
+#line 218 "gram.y" /* yacc.c:1646 */
+ { GotButton((yyvsp[-1].num), (yyvsp[0].num)); }
+#line 1803 "y.tab.c" /* yacc.c:1646 */
break;
- case 26:
-#line 201 "gram.y"
+ case 28:
+#line 219 "gram.y" /* yacc.c:1646 */
{ list = &Scr->DontIconify; }
+#line 1809 "y.tab.c" /* yacc.c:1646 */
break;
- case 28:
-#line 203 "gram.y"
+ case 30:
+#line 221 "gram.y" /* yacc.c:1646 */
{ list = &Scr->IconMgrNoShow; }
+#line 1815 "y.tab.c" /* yacc.c:1646 */
break;
- case 30:
-#line 205 "gram.y"
+ case 32:
+#line 223 "gram.y" /* yacc.c:1646 */
{ Scr->IconManagerDontShow = TRUE; }
+#line 1821 "y.tab.c" /* yacc.c:1646 */
break;
- case 31:
-#line 206 "gram.y"
+ case 33:
+#line 224 "gram.y" /* yacc.c:1646 */
{ list = &Scr->IconMgrs; }
+#line 1827 "y.tab.c" /* yacc.c:1646 */
break;
- case 33:
-#line 208 "gram.y"
+ case 35:
+#line 226 "gram.y" /* yacc.c:1646 */
{ list = &Scr->IconMgrShow; }
+#line 1833 "y.tab.c" /* yacc.c:1646 */
break;
- case 35:
-#line 210 "gram.y"
+ case 37:
+#line 228 "gram.y" /* yacc.c:1646 */
{ list = &Scr->NoTitleHighlight; }
+#line 1839 "y.tab.c" /* yacc.c:1646 */
break;
- case 37:
-#line 212 "gram.y"
+ case 39:
+#line 230 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
Scr->TitleHighlight = FALSE; }
+#line 1846 "y.tab.c" /* yacc.c:1646 */
break;
- case 38:
-#line 214 "gram.y"
+ case 40:
+#line 232 "gram.y" /* yacc.c:1646 */
{ list = &Scr->NoHighlight; }
+#line 1852 "y.tab.c" /* yacc.c:1646 */
break;
- case 40:
-#line 216 "gram.y"
+ case 42:
+#line 234 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
Scr->Highlight = FALSE; }
+#line 1859 "y.tab.c" /* yacc.c:1646 */
break;
- case 41:
-#line 218 "gram.y"
+ case 43:
+#line 236 "gram.y" /* yacc.c:1646 */
{ list = &Scr->NoStackModeL; }
+#line 1865 "y.tab.c" /* yacc.c:1646 */
break;
- case 43:
-#line 220 "gram.y"
+ case 45:
+#line 238 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
Scr->StackMode = FALSE; }
+#line 1872 "y.tab.c" /* yacc.c:1646 */
break;
- case 44:
-#line 222 "gram.y"
+ case 46:
+#line 240 "gram.y" /* yacc.c:1646 */
{ list = &Scr->NoTitle; }
+#line 1878 "y.tab.c" /* yacc.c:1646 */
break;
- case 46:
-#line 224 "gram.y"
+ case 48:
+#line 242 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
Scr->NoTitlebar = TRUE; }
+#line 1885 "y.tab.c" /* yacc.c:1646 */
break;
- case 47:
-#line 226 "gram.y"
+ case 49:
+#line 244 "gram.y" /* yacc.c:1646 */
{ list = &Scr->MakeTitle; }
+#line 1891 "y.tab.c" /* yacc.c:1646 */
break;
- case 49:
-#line 228 "gram.y"
+ case 51:
+#line 246 "gram.y" /* yacc.c:1646 */
{ list = &Scr->StartIconified; }
+#line 1897 "y.tab.c" /* yacc.c:1646 */
break;
- case 51:
-#line 230 "gram.y"
+ case 53:
+#line 248 "gram.y" /* yacc.c:1646 */
{ list = &Scr->AutoRaise; }
+#line 1903 "y.tab.c" /* yacc.c:1646 */
break;
- case 53:
-#line 232 "gram.y"
+ case 55:
+#line 250 "gram.y" /* yacc.c:1646 */
{
- root = GetRoot((yyvsp[(2) - (7)].ptr), (yyvsp[(4) - (7)].ptr), (yyvsp[(6) - (7)].ptr)); }
+ root = GetRoot((yyvsp[-5].ptr), (yyvsp[-3].ptr), (yyvsp[-1].ptr)); }
+#line 1910 "y.tab.c" /* yacc.c:1646 */
break;
- case 54:
-#line 234 "gram.y"
+ case 56:
+#line 252 "gram.y" /* yacc.c:1646 */
{ root->real_menu = TRUE;}
+#line 1916 "y.tab.c" /* yacc.c:1646 */
break;
- case 55:
-#line 235 "gram.y"
- { root = GetRoot((yyvsp[(2) - (2)].ptr), NULLSTR, NULLSTR); }
+ case 57:
+#line 253 "gram.y" /* yacc.c:1646 */
+ { root = GetRoot((yyvsp[0].ptr), NULLSTR, NULLSTR); }
+#line 1922 "y.tab.c" /* yacc.c:1646 */
break;
- case 56:
-#line 236 "gram.y"
+ case 58:
+#line 254 "gram.y" /* yacc.c:1646 */
{ root->real_menu = TRUE; }
+#line 1928 "y.tab.c" /* yacc.c:1646 */
break;
- case 57:
-#line 237 "gram.y"
- { root = GetRoot((yyvsp[(2) - (2)].ptr), NULLSTR, NULLSTR); }
+ case 59:
+#line 255 "gram.y" /* yacc.c:1646 */
+ { root = GetRoot((yyvsp[0].ptr), NULLSTR, NULLSTR); }
+#line 1934 "y.tab.c" /* yacc.c:1646 */
break;
- case 59:
-#line 239 "gram.y"
+ case 61:
+#line 257 "gram.y" /* yacc.c:1646 */
{ list = &Scr->IconNames; }
+#line 1940 "y.tab.c" /* yacc.c:1646 */
break;
- case 61:
-#line 241 "gram.y"
+ case 63:
+#line 259 "gram.y" /* yacc.c:1646 */
{ color = COLOR; }
+#line 1946 "y.tab.c" /* yacc.c:1646 */
break;
- case 63:
-#line 243 "gram.y"
+ case 65:
+#line 261 "gram.y" /* yacc.c:1646 */
{ color = GRAYSCALE; }
+#line 1952 "y.tab.c" /* yacc.c:1646 */
break;
- case 66:
-#line 247 "gram.y"
+ case 68:
+#line 265 "gram.y" /* yacc.c:1646 */
{ color = MONOCHROME; }
+#line 1958 "y.tab.c" /* yacc.c:1646 */
break;
- case 68:
-#line 249 "gram.y"
- { Scr->DefaultFunction.func = (yyvsp[(2) - (2)].num);
- if ((yyvsp[(2) - (2)].num) == F_MENU)
+ case 70:
+#line 267 "gram.y" /* yacc.c:1646 */
+ { Scr->DefaultFunction.func = (yyvsp[0].num);
+ if ((yyvsp[0].num) == F_MENU)
{
pull->prev = NULL;
Scr->DefaultFunction.menu = pull;
@@ -2060,524 +1970,684 @@ yyreduce:
root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR);
Scr->DefaultFunction.item =
AddToMenu(root,"x",Action,
- NULL,(yyvsp[(2) - (2)].num), NULLSTR, NULLSTR);
+ NULL,(yyvsp[0].num), NULLSTR, NULLSTR);
}
Action = "";
pull = NULL;
}
+#line 1979 "y.tab.c" /* yacc.c:1646 */
break;
- case 69:
-#line 265 "gram.y"
- { Scr->WindowFunction.func = (yyvsp[(2) - (2)].num);
+ case 71:
+#line 283 "gram.y" /* yacc.c:1646 */
+ { Scr->WindowFunction.func = (yyvsp[0].num);
root = GetRoot(TWM_ROOT,NULLSTR,NULLSTR);
Scr->WindowFunction.item =
AddToMenu(root,"x",Action,
- NULL,(yyvsp[(2) - (2)].num), NULLSTR, NULLSTR);
+ NULL,(yyvsp[0].num), NULLSTR, NULLSTR);
Action = "";
pull = NULL;
}
+#line 1992 "y.tab.c" /* yacc.c:1646 */
break;
- case 70:
-#line 273 "gram.y"
+ case 72:
+#line 291 "gram.y" /* yacc.c:1646 */
{ list = &Scr->WarpCursorL; }
+#line 1998 "y.tab.c" /* yacc.c:1646 */
break;
- case 72:
-#line 275 "gram.y"
+ case 74:
+#line 293 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
Scr->WarpCursor = TRUE; }
+#line 2005 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 75:
+#line 296 "gram.y" /* yacc.c:1646 */
+ { if (Scr->FirstTime)
+ Scr->WarpCursorPos = (yyvsp[0].num); }
+#line 2012 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 76:
+#line 299 "gram.y" /* yacc.c:1646 */
+ { if (Scr->FirstTime)
+ Scr->WarpCursorPos = nsew((yyvsp[0].ptr)); }
+#line 2019 "y.tab.c" /* yacc.c:1646 */
break;
- case 73:
-#line 277 "gram.y"
+ case 77:
+#line 301 "gram.y" /* yacc.c:1646 */
{ list = &Scr->WindowRingL; }
+#line 2025 "y.tab.c" /* yacc.c:1646 */
break;
- case 75:
-#line 282 "gram.y"
- { if (!do_single_keyword ((yyvsp[(1) - (1)].num))) {
+ case 79:
+#line 306 "gram.y" /* yacc.c:1646 */
+ { if (!do_single_keyword ((yyvsp[0].num))) {
twmrc_error_prefix();
fprintf (stderr,
"unknown singleton keyword %d\n",
- (yyvsp[(1) - (1)].num));
+ (yyvsp[0].num));
ParseError = 1;
}
}
+#line 2038 "y.tab.c" /* yacc.c:1646 */
break;
- case 76:
-#line 292 "gram.y"
- { if (!do_string_keyword ((yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].ptr))) {
+ case 80:
+#line 316 "gram.y" /* yacc.c:1646 */
+ { if (!do_string_keyword ((yyvsp[-1].num), (yyvsp[0].ptr))) {
twmrc_error_prefix();
fprintf (stderr,
"unknown string keyword %d (value \"%s\")\n",
- (yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].ptr));
+ (yyvsp[-1].num), (yyvsp[0].ptr));
ParseError = 1;
}
}
+#line 2051 "y.tab.c" /* yacc.c:1646 */
break;
- case 77:
-#line 302 "gram.y"
- { if (!do_number_keyword ((yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].num))) {
+ case 81:
+#line 326 "gram.y" /* yacc.c:1646 */
+ { if (!do_number_keyword ((yyvsp[-1].num), (yyvsp[0].num))) {
twmrc_error_prefix();
fprintf (stderr,
"unknown numeric keyword %d (value %d)\n",
- (yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].num));
+ (yyvsp[-1].num), (yyvsp[0].num));
ParseError = 1;
}
}
+#line 2064 "y.tab.c" /* yacc.c:1646 */
break;
- case 78:
-#line 314 "gram.y"
- { (yyval.num) = (yyvsp[(6) - (6)].num); }
+ case 82:
+#line 338 "gram.y" /* yacc.c:1646 */
+ { (yyval.num) = (yyvsp[0].num); }
+#line 2070 "y.tab.c" /* yacc.c:1646 */
break;
- case 79:
-#line 317 "gram.y"
- { (yyval.num) = (yyvsp[(6) - (6)].num); }
+ case 83:
+#line 341 "gram.y" /* yacc.c:1646 */
+ { (yyval.num) = (yyvsp[0].num); }
+#line 2076 "y.tab.c" /* yacc.c:1646 */
break;
- case 82:
-#line 324 "gram.y"
+ case 86:
+#line 348 "gram.y" /* yacc.c:1646 */
{ mods |= Mod1Mask; }
+#line 2082 "y.tab.c" /* yacc.c:1646 */
break;
- case 83:
-#line 325 "gram.y"
+ case 87:
+#line 349 "gram.y" /* yacc.c:1646 */
{ mods |= ShiftMask; }
+#line 2088 "y.tab.c" /* yacc.c:1646 */
break;
- case 84:
-#line 326 "gram.y"
+ case 88:
+#line 350 "gram.y" /* yacc.c:1646 */
{ mods |= LockMask; }
+#line 2094 "y.tab.c" /* yacc.c:1646 */
break;
- case 85:
-#line 327 "gram.y"
+ case 89:
+#line 351 "gram.y" /* yacc.c:1646 */
{ mods |= ControlMask; }
+#line 2100 "y.tab.c" /* yacc.c:1646 */
break;
- case 86:
-#line 328 "gram.y"
- { if ((yyvsp[(2) - (2)].num) < 1 || (yyvsp[(2) - (2)].num) > 5) {
+ case 90:
+#line 352 "gram.y" /* yacc.c:1646 */
+ { if ((yyvsp[0].num) < 1 || (yyvsp[0].num) > 5) {
twmrc_error_prefix();
fprintf (stderr,
"bad modifier number (%d), must be 1-5\n",
- (yyvsp[(2) - (2)].num));
+ (yyvsp[0].num));
ParseError = 1;
} else {
- mods |= (Mod1Mask << ((yyvsp[(2) - (2)].num) - 1));
+ mods |= (Mod1Mask << ((yyvsp[0].num) - 1));
}
}
+#line 2115 "y.tab.c" /* yacc.c:1646 */
break;
- case 87:
-#line 338 "gram.y"
+ case 91:
+#line 362 "gram.y" /* yacc.c:1646 */
{ }
+#line 2121 "y.tab.c" /* yacc.c:1646 */
break;
- case 90:
-#line 345 "gram.y"
+ case 94:
+#line 369 "gram.y" /* yacc.c:1646 */
{ cont |= C_WINDOW_BIT; }
+#line 2127 "y.tab.c" /* yacc.c:1646 */
break;
- case 91:
-#line 346 "gram.y"
+ case 95:
+#line 370 "gram.y" /* yacc.c:1646 */
{ cont |= C_TITLE_BIT; }
+#line 2133 "y.tab.c" /* yacc.c:1646 */
break;
- case 92:
-#line 347 "gram.y"
+ case 96:
+#line 371 "gram.y" /* yacc.c:1646 */
{ cont |= C_ICON_BIT; }
+#line 2139 "y.tab.c" /* yacc.c:1646 */
break;
- case 93:
-#line 348 "gram.y"
+ case 97:
+#line 372 "gram.y" /* yacc.c:1646 */
{ cont |= C_ROOT_BIT; }
+#line 2145 "y.tab.c" /* yacc.c:1646 */
break;
- case 94:
-#line 349 "gram.y"
+ case 98:
+#line 373 "gram.y" /* yacc.c:1646 */
{ cont |= C_FRAME_BIT; }
+#line 2151 "y.tab.c" /* yacc.c:1646 */
break;
- case 95:
-#line 350 "gram.y"
+ case 99:
+#line 374 "gram.y" /* yacc.c:1646 */
{ cont |= C_ICONMGR_BIT; }
+#line 2157 "y.tab.c" /* yacc.c:1646 */
break;
- case 96:
-#line 351 "gram.y"
+ case 100:
+#line 375 "gram.y" /* yacc.c:1646 */
{ cont |= C_ICONMGR_BIT; }
+#line 2163 "y.tab.c" /* yacc.c:1646 */
break;
- case 97:
-#line 352 "gram.y"
+ case 101:
+#line 376 "gram.y" /* yacc.c:1646 */
{ cont |= C_ALL_BITS; }
+#line 2169 "y.tab.c" /* yacc.c:1646 */
break;
- case 98:
-#line 353 "gram.y"
+ case 102:
+#line 377 "gram.y" /* yacc.c:1646 */
{ }
+#line 2175 "y.tab.c" /* yacc.c:1646 */
break;
- case 101:
-#line 360 "gram.y"
+ case 105:
+#line 384 "gram.y" /* yacc.c:1646 */
{ cont |= C_WINDOW_BIT; }
+#line 2181 "y.tab.c" /* yacc.c:1646 */
break;
- case 102:
-#line 361 "gram.y"
+ case 106:
+#line 385 "gram.y" /* yacc.c:1646 */
{ cont |= C_TITLE_BIT; }
+#line 2187 "y.tab.c" /* yacc.c:1646 */
break;
- case 103:
-#line 362 "gram.y"
+ case 107:
+#line 386 "gram.y" /* yacc.c:1646 */
{ cont |= C_ICON_BIT; }
+#line 2193 "y.tab.c" /* yacc.c:1646 */
break;
- case 104:
-#line 363 "gram.y"
+ case 108:
+#line 387 "gram.y" /* yacc.c:1646 */
{ cont |= C_ROOT_BIT; }
+#line 2199 "y.tab.c" /* yacc.c:1646 */
break;
- case 105:
-#line 364 "gram.y"
+ case 109:
+#line 388 "gram.y" /* yacc.c:1646 */
{ cont |= C_FRAME_BIT; }
+#line 2205 "y.tab.c" /* yacc.c:1646 */
break;
- case 106:
-#line 365 "gram.y"
+ case 110:
+#line 389 "gram.y" /* yacc.c:1646 */
{ cont |= C_ICONMGR_BIT; }
+#line 2211 "y.tab.c" /* yacc.c:1646 */
break;
- case 107:
-#line 366 "gram.y"
+ case 111:
+#line 390 "gram.y" /* yacc.c:1646 */
{ cont |= C_ICONMGR_BIT; }
+#line 2217 "y.tab.c" /* yacc.c:1646 */
break;
- case 108:
-#line 367 "gram.y"
+ case 112:
+#line 391 "gram.y" /* yacc.c:1646 */
{ cont |= C_ALL_BITS; }
+#line 2223 "y.tab.c" /* yacc.c:1646 */
break;
- case 109:
-#line 368 "gram.y"
+ case 113:
+#line 392 "gram.y" /* yacc.c:1646 */
{ }
- break;
-
- case 110:
-#line 369 "gram.y"
- { Name = (yyvsp[(1) - (1)].ptr); cont |= C_NAME_BIT; }
+#line 2229 "y.tab.c" /* yacc.c:1646 */
break;
case 114:
-#line 380 "gram.y"
- { SetHighlightPixmap ((yyvsp[(2) - (2)].ptr)); }
+#line 393 "gram.y" /* yacc.c:1646 */
+ { Name = (yyvsp[0].ptr); cont |= C_NAME_BIT; }
+#line 2235 "y.tab.c" /* yacc.c:1646 */
break;
case 118:
-#line 391 "gram.y"
- {
- NewBitmapCursor(&Scr->FrameCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); }
- break;
-
- case 119:
-#line 393 "gram.y"
- {
- NewFontCursor(&Scr->FrameCursor, (yyvsp[(2) - (2)].ptr)); }
- break;
-
- case 120:
-#line 395 "gram.y"
- {
- NewBitmapCursor(&Scr->TitleCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); }
- break;
-
- case 121:
-#line 397 "gram.y"
- {
- NewFontCursor(&Scr->TitleCursor, (yyvsp[(2) - (2)].ptr)); }
+#line 404 "gram.y" /* yacc.c:1646 */
+ { SetHighlightPixmap ((yyvsp[0].ptr)); }
+#line 2241 "y.tab.c" /* yacc.c:1646 */
break;
case 122:
-#line 399 "gram.y"
+#line 415 "gram.y" /* yacc.c:1646 */
{
- NewBitmapCursor(&Scr->IconCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); }
+ NewBitmapCursor(&Scr->FrameCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2248 "y.tab.c" /* yacc.c:1646 */
break;
case 123:
-#line 401 "gram.y"
+#line 417 "gram.y" /* yacc.c:1646 */
{
- NewFontCursor(&Scr->IconCursor, (yyvsp[(2) - (2)].ptr)); }
+ NewFontCursor(&Scr->FrameCursor, (yyvsp[0].ptr)); }
+#line 2255 "y.tab.c" /* yacc.c:1646 */
break;
case 124:
-#line 403 "gram.y"
+#line 419 "gram.y" /* yacc.c:1646 */
{
- NewBitmapCursor(&Scr->IconMgrCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); }
+ NewBitmapCursor(&Scr->TitleCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2262 "y.tab.c" /* yacc.c:1646 */
break;
case 125:
-#line 405 "gram.y"
+#line 421 "gram.y" /* yacc.c:1646 */
{
- NewFontCursor(&Scr->IconMgrCursor, (yyvsp[(2) - (2)].ptr)); }
+ NewFontCursor(&Scr->TitleCursor, (yyvsp[0].ptr)); }
+#line 2269 "y.tab.c" /* yacc.c:1646 */
break;
case 126:
-#line 407 "gram.y"
+#line 423 "gram.y" /* yacc.c:1646 */
{
- NewBitmapCursor(&Scr->ButtonCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); }
+ NewBitmapCursor(&Scr->IconCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2276 "y.tab.c" /* yacc.c:1646 */
break;
case 127:
-#line 409 "gram.y"
+#line 425 "gram.y" /* yacc.c:1646 */
{
- NewFontCursor(&Scr->ButtonCursor, (yyvsp[(2) - (2)].ptr)); }
+ NewFontCursor(&Scr->IconCursor, (yyvsp[0].ptr)); }
+#line 2283 "y.tab.c" /* yacc.c:1646 */
break;
case 128:
-#line 411 "gram.y"
+#line 427 "gram.y" /* yacc.c:1646 */
{
- NewBitmapCursor(&Scr->MoveCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); }
+ NewBitmapCursor(&Scr->IconMgrCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2290 "y.tab.c" /* yacc.c:1646 */
break;
case 129:
-#line 413 "gram.y"
+#line 429 "gram.y" /* yacc.c:1646 */
{
- NewFontCursor(&Scr->MoveCursor, (yyvsp[(2) - (2)].ptr)); }
+ NewFontCursor(&Scr->IconMgrCursor, (yyvsp[0].ptr)); }
+#line 2297 "y.tab.c" /* yacc.c:1646 */
break;
case 130:
-#line 415 "gram.y"
+#line 431 "gram.y" /* yacc.c:1646 */
{
- NewBitmapCursor(&Scr->ResizeCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); }
+ NewBitmapCursor(&Scr->ButtonCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2304 "y.tab.c" /* yacc.c:1646 */
break;
case 131:
-#line 417 "gram.y"
+#line 433 "gram.y" /* yacc.c:1646 */
{
- NewFontCursor(&Scr->ResizeCursor, (yyvsp[(2) - (2)].ptr)); }
+ NewFontCursor(&Scr->ButtonCursor, (yyvsp[0].ptr)); }
+#line 2311 "y.tab.c" /* yacc.c:1646 */
break;
case 132:
-#line 419 "gram.y"
+#line 435 "gram.y" /* yacc.c:1646 */
{
- NewBitmapCursor(&Scr->WaitCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); }
+ NewBitmapCursor(&Scr->MoveCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2318 "y.tab.c" /* yacc.c:1646 */
break;
case 133:
-#line 421 "gram.y"
+#line 437 "gram.y" /* yacc.c:1646 */
{
- NewFontCursor(&Scr->WaitCursor, (yyvsp[(2) - (2)].ptr)); }
+ NewFontCursor(&Scr->MoveCursor, (yyvsp[0].ptr)); }
+#line 2325 "y.tab.c" /* yacc.c:1646 */
break;
case 134:
-#line 423 "gram.y"
+#line 439 "gram.y" /* yacc.c:1646 */
{
- NewBitmapCursor(&Scr->MenuCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); }
+ NewBitmapCursor(&Scr->ResizeCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2332 "y.tab.c" /* yacc.c:1646 */
break;
case 135:
-#line 425 "gram.y"
+#line 441 "gram.y" /* yacc.c:1646 */
{
- NewFontCursor(&Scr->MenuCursor, (yyvsp[(2) - (2)].ptr)); }
+ NewFontCursor(&Scr->ResizeCursor, (yyvsp[0].ptr)); }
+#line 2339 "y.tab.c" /* yacc.c:1646 */
break;
case 136:
-#line 427 "gram.y"
+#line 443 "gram.y" /* yacc.c:1646 */
{
- NewBitmapCursor(&Scr->SelectCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); }
+ NewBitmapCursor(&Scr->WaitCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2346 "y.tab.c" /* yacc.c:1646 */
break;
case 137:
-#line 429 "gram.y"
+#line 445 "gram.y" /* yacc.c:1646 */
{
- NewFontCursor(&Scr->SelectCursor, (yyvsp[(2) - (2)].ptr)); }
+ NewFontCursor(&Scr->WaitCursor, (yyvsp[0].ptr)); }
+#line 2353 "y.tab.c" /* yacc.c:1646 */
break;
case 138:
-#line 431 "gram.y"
+#line 447 "gram.y" /* yacc.c:1646 */
{
- NewBitmapCursor(&Scr->DestroyCursor, (yyvsp[(2) - (3)].ptr), (yyvsp[(3) - (3)].ptr)); }
+ NewBitmapCursor(&Scr->MenuCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2360 "y.tab.c" /* yacc.c:1646 */
break;
case 139:
-#line 433 "gram.y"
+#line 449 "gram.y" /* yacc.c:1646 */
+ {
+ NewFontCursor(&Scr->MenuCursor, (yyvsp[0].ptr)); }
+#line 2367 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 140:
+#line 451 "gram.y" /* yacc.c:1646 */
+ {
+ NewBitmapCursor(&Scr->SelectCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2374 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 141:
+#line 453 "gram.y" /* yacc.c:1646 */
{
- NewFontCursor(&Scr->DestroyCursor, (yyvsp[(2) - (2)].ptr)); }
+ NewFontCursor(&Scr->SelectCursor, (yyvsp[0].ptr)); }
+#line 2381 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 142:
+#line 455 "gram.y" /* yacc.c:1646 */
+ {
+ NewBitmapCursor(&Scr->DestroyCursor, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2388 "y.tab.c" /* yacc.c:1646 */
break;
case 143:
-#line 445 "gram.y"
- { if (!do_colorlist_keyword ((yyvsp[(1) - (2)].num), color,
- (yyvsp[(2) - (2)].ptr))) {
+#line 457 "gram.y" /* yacc.c:1646 */
+ {
+ NewFontCursor(&Scr->DestroyCursor, (yyvsp[0].ptr)); }
+#line 2395 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 147:
+#line 469 "gram.y" /* yacc.c:1646 */
+ { if (!do_colorlist_keyword ((yyvsp[-1].num), color,
+ (yyvsp[0].ptr))) {
twmrc_error_prefix();
fprintf (stderr,
"unhandled list color keyword %d (string \"%s\")\n",
- (yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].ptr));
+ (yyvsp[-1].num), (yyvsp[0].ptr));
ParseError = 1;
}
}
+#line 2409 "y.tab.c" /* yacc.c:1646 */
break;
- case 144:
-#line 454 "gram.y"
- { list = do_colorlist_keyword((yyvsp[(1) - (2)].num),color,
- (yyvsp[(2) - (2)].ptr));
+ case 148:
+#line 478 "gram.y" /* yacc.c:1646 */
+ { list = do_colorlist_keyword((yyvsp[-1].num),color,
+ (yyvsp[0].ptr));
if (!list) {
twmrc_error_prefix();
fprintf (stderr,
"unhandled color list keyword %d (string \"%s\")\n",
- (yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].ptr));
+ (yyvsp[-1].num), (yyvsp[0].ptr));
ParseError = 1;
}
}
+#line 2424 "y.tab.c" /* yacc.c:1646 */
break;
- case 145:
-#line 464 "gram.y"
+ case 149:
+#line 488 "gram.y" /* yacc.c:1646 */
{ /* No action */; }
+#line 2430 "y.tab.c" /* yacc.c:1646 */
break;
- case 146:
-#line 465 "gram.y"
- { if (!do_color_keyword ((yyvsp[(1) - (2)].num), color,
- (yyvsp[(2) - (2)].ptr))) {
+ case 150:
+#line 489 "gram.y" /* yacc.c:1646 */
+ { if (!do_color_keyword ((yyvsp[-1].num), color,
+ (yyvsp[0].ptr))) {
twmrc_error_prefix();
fprintf (stderr,
"unhandled color keyword %d (string \"%s\")\n",
- (yyvsp[(1) - (2)].num), (yyvsp[(2) - (2)].ptr));
+ (yyvsp[-1].num), (yyvsp[0].ptr));
ParseError = 1;
}
}
+#line 2444 "y.tab.c" /* yacc.c:1646 */
break;
- case 150:
-#line 483 "gram.y"
- { do_string_savecolor(color, (yyvsp[(1) - (1)].ptr)); }
+ case 154:
+#line 507 "gram.y" /* yacc.c:1646 */
+ { do_string_savecolor(color, (yyvsp[0].ptr)); }
+#line 2450 "y.tab.c" /* yacc.c:1646 */
break;
- case 151:
-#line 484 "gram.y"
- { do_var_savecolor((yyvsp[(1) - (1)].num)); }
+ case 155:
+#line 508 "gram.y" /* yacc.c:1646 */
+ { do_var_savecolor((yyvsp[0].num)); }
+#line 2456 "y.tab.c" /* yacc.c:1646 */
break;
- case 155:
-#line 494 "gram.y"
+ case 159:
+#line 518 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime &&
color == Scr->Monochrome)
- AddToList(list, (yyvsp[(1) - (2)].ptr), (yyvsp[(2) - (2)].ptr)); }
+ AddToList(list, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2464 "y.tab.c" /* yacc.c:1646 */
break;
- case 156:
-#line 499 "gram.y"
+ case 160:
+#line 523 "gram.y" /* yacc.c:1646 */
{
if (HasShape) Scr->SqueezeTitle = TRUE;
}
+#line 2472 "y.tab.c" /* yacc.c:1646 */
break;
- case 157:
-#line 502 "gram.y"
+ case 161:
+#line 526 "gram.y" /* yacc.c:1646 */
{ list = &Scr->SqueezeTitleL;
if (HasShape && Scr->SqueezeTitle == -1)
Scr->SqueezeTitle = TRUE;
}
+#line 2481 "y.tab.c" /* yacc.c:1646 */
break;
- case 159:
-#line 507 "gram.y"
+ case 163:
+#line 531 "gram.y" /* yacc.c:1646 */
{ Scr->SqueezeTitle = FALSE; }
+#line 2487 "y.tab.c" /* yacc.c:1646 */
break;
- case 160:
-#line 508 "gram.y"
+ case 164:
+#line 532 "gram.y" /* yacc.c:1646 */
{ list = &Scr->DontSqueezeTitleL; }
+#line 2493 "y.tab.c" /* yacc.c:1646 */
break;
- case 163:
-#line 513 "gram.y"
+ case 166:
+#line 536 "gram.y" /* yacc.c:1646 */
+ {
+ Scr->TitlePos = TP_TOP;
+ }
+#line 2501 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 167:
+#line 539 "gram.y" /* yacc.c:1646 */
+ { list = &Scr->TitlePosTopL;
+ if (Scr->TitlePos == -1)
+ Scr->TitlePos = TP_TOP;
+ }
+#line 2510 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 169:
+#line 544 "gram.y" /* yacc.c:1646 */
+ {
+ Scr->TitlePos = TP_LEFT;
+ }
+#line 2518 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 170:
+#line 547 "gram.y" /* yacc.c:1646 */
+ { list = &Scr->TitlePosLeftL;
+ if (Scr->TitlePos == -1)
+ Scr->TitlePos = TP_LEFT;
+ }
+#line 2527 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 172:
+#line 552 "gram.y" /* yacc.c:1646 */
+ {
+ Scr->TitlePos = TP_BOTTOM;
+ }
+#line 2535 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 173:
+#line 555 "gram.y" /* yacc.c:1646 */
+ { list = &Scr->TitlePosBottomL;
+ if (Scr->TitlePos == -1)
+ Scr->TitlePos = TP_BOTTOM;
+ }
+#line 2544 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 175:
+#line 560 "gram.y" /* yacc.c:1646 */
+ {
+ Scr->TitlePos = TP_RIGHT;
+ }
+#line 2552 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 176:
+#line 563 "gram.y" /* yacc.c:1646 */
+ { list = &Scr->TitlePosRightL;
+ if (Scr->TitlePos == -1)
+ Scr->TitlePos = TP_RIGHT;
+ }
+#line 2561 "y.tab.c" /* yacc.c:1646 */
+ break;
+
+ case 179:
+#line 571 "gram.y" /* yacc.c:1646 */
{
if (Scr->FirstTime) {
- do_squeeze_entry (list, (yyvsp[(2) - (5)].ptr), (yyvsp[(3) - (5)].num), (yyvsp[(4) - (5)].num), (yyvsp[(5) - (5)].num));
+ do_squeeze_entry (list, (yyvsp[-3].ptr), (yyvsp[-2].num), (yyvsp[-1].num), (yyvsp[0].num));
}
}
+#line 2571 "y.tab.c" /* yacc.c:1646 */
break;
- case 167:
-#line 528 "gram.y"
+ case 183:
+#line 586 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
- AddToList(list, (yyvsp[(1) - (3)].ptr), (char *)
- AllocateIconManager((yyvsp[(1) - (3)].ptr), NULLSTR,
- (yyvsp[(2) - (3)].ptr),(yyvsp[(3) - (3)].num)));
+ AddToList(list, (yyvsp[-2].ptr), (char *)
+ AllocateIconManager((yyvsp[-2].ptr), NULLSTR,
+ (yyvsp[-1].ptr),(yyvsp[0].num)));
}
+#line 2581 "y.tab.c" /* yacc.c:1646 */
break;
- case 168:
-#line 534 "gram.y"
+ case 184:
+#line 592 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
- AddToList(list, (yyvsp[(1) - (4)].ptr), (char *)
- AllocateIconManager((yyvsp[(1) - (4)].ptr),(yyvsp[(2) - (4)].ptr),
- (yyvsp[(3) - (4)].ptr), (yyvsp[(4) - (4)].num)));
+ AddToList(list, (yyvsp[-3].ptr), (char *)
+ AllocateIconManager((yyvsp[-3].ptr),(yyvsp[-2].ptr),
+ (yyvsp[-1].ptr), (yyvsp[0].num)));
}
+#line 2591 "y.tab.c" /* yacc.c:1646 */
break;
- case 172:
-#line 548 "gram.y"
+ case 188:
+#line 606 "gram.y" /* yacc.c:1646 */
{ if (Scr->FirstTime)
- AddToList(list, (yyvsp[(1) - (1)].ptr), 0);
+ AddToList(list, (yyvsp[0].ptr), 0);
}
+#line 2599 "y.tab.c" /* yacc.c:1646 */
break;
- case 176:
-#line 560 "gram.y"
- { if (Scr->FirstTime) AddToList(list, (yyvsp[(1) - (2)].ptr), (yyvsp[(2) - (2)].ptr)); }
+ case 192:
+#line 618 "gram.y" /* yacc.c:1646 */
+ { if (Scr->FirstTime) AddToList(list, (yyvsp[-1].ptr), (yyvsp[0].ptr)); }
+#line 2605 "y.tab.c" /* yacc.c:1646 */
break;
- case 180:
-#line 570 "gram.y"
- { AddToMenu(root, "", Action, NULL, (yyvsp[(1) - (1)].num),
+ case 196:
+#line 628 "gram.y" /* yacc.c:1646 */
+ { AddToMenu(root, "", Action, NULL, (yyvsp[0].num),
NULLSTR, NULLSTR);
Action = "";
}
+#line 2614 "y.tab.c" /* yacc.c:1646 */
break;
- case 184:
-#line 583 "gram.y"
- { AddToMenu(root, (yyvsp[(1) - (2)].ptr), Action, pull, (yyvsp[(2) - (2)].num),
+ case 200:
+#line 641 "gram.y" /* yacc.c:1646 */
+ { AddToMenu(root, (yyvsp[-1].ptr), Action, pull, (yyvsp[0].num),
NULLSTR, NULLSTR);
Action = "";
pull = NULL;
}
+#line 2624 "y.tab.c" /* yacc.c:1646 */
break;
- case 185:
-#line 588 "gram.y"
+ case 201:
+#line 646 "gram.y" /* yacc.c:1646 */
{
- AddToMenu(root, (yyvsp[(1) - (7)].ptr), Action, pull, (yyvsp[(7) - (7)].num),
- (yyvsp[(3) - (7)].ptr), (yyvsp[(5) - (7)].ptr));
+ AddToMenu(root, (yyvsp[-6].ptr), Action, pull, (yyvsp[0].num),
+ (yyvsp[-4].ptr), (yyvsp[-2].ptr));
Action = "";
pull = NULL;
}
+#line 2635 "y.tab.c" /* yacc.c:1646 */
break;
- case 186:
-#line 596 "gram.y"
- { (yyval.num) = (yyvsp[(1) - (1)].num); }
+ case 202:
+#line 654 "gram.y" /* yacc.c:1646 */
+ { (yyval.num) = (yyvsp[0].num); }
+#line 2641 "y.tab.c" /* yacc.c:1646 */
break;
- case 187:
-#line 597 "gram.y"
+ case 203:
+#line 655 "gram.y" /* yacc.c:1646 */
{
- (yyval.num) = (yyvsp[(1) - (2)].num);
- Action = (yyvsp[(2) - (2)].ptr);
- switch ((yyvsp[(1) - (2)].num)) {
+ (yyval.num) = (yyvsp[-1].num);
+ Action = (yyvsp[0].ptr);
+ switch ((yyvsp[-1].num)) {
case F_MENU:
- pull = GetRoot ((yyvsp[(2) - (2)].ptr), NULLSTR,NULLSTR);
+ pull = GetRoot ((yyvsp[0].ptr), NULLSTR,NULLSTR);
pull->prev = root;
break;
case F_WARPRING:
@@ -2610,55 +2680,72 @@ yyreduce:
break;
} /* end switch */
}
+#line 2684 "y.tab.c" /* yacc.c:1646 */
break;
- case 188:
-#line 638 "gram.y"
- { (yyval.num) = (yyvsp[(1) - (1)].num); }
+ case 204:
+#line 696 "gram.y" /* yacc.c:1646 */
+ { (yyval.num) = (yyvsp[0].num); }
+#line 2690 "y.tab.c" /* yacc.c:1646 */
break;
- case 189:
-#line 639 "gram.y"
- { (yyval.num) = (yyvsp[(2) - (2)].num); }
+ case 205:
+#line 697 "gram.y" /* yacc.c:1646 */
+ { (yyval.num) = (yyvsp[0].num); }
+#line 2696 "y.tab.c" /* yacc.c:1646 */
break;
- case 190:
-#line 640 "gram.y"
- { (yyval.num) = -((yyvsp[(2) - (2)].num)); }
+ case 206:
+#line 698 "gram.y" /* yacc.c:1646 */
+ { (yyval.num) = -((yyvsp[0].num)); }
+#line 2702 "y.tab.c" /* yacc.c:1646 */
break;
- case 191:
-#line 643 "gram.y"
- { (yyval.num) = (yyvsp[(2) - (2)].num);
- if ((yyvsp[(2) - (2)].num) == 0)
+ case 207:
+#line 701 "gram.y" /* yacc.c:1646 */
+ { (yyval.num) = (yyvsp[0].num);
+ if ((yyvsp[0].num) == 0)
yyerror("bad button 0");
- if ((yyvsp[(2) - (2)].num) > MAX_BUTTONS)
+ if ((yyvsp[0].num) > MAX_BUTTONS)
{
(yyval.num) = 0;
yyerror("button number too large");
}
}
+#line 2717 "y.tab.c" /* yacc.c:1646 */
break;
- case 192:
-#line 655 "gram.y"
- { ptr = strdup((yyvsp[(1) - (1)].ptr));
+ case 208:
+#line 713 "gram.y" /* yacc.c:1646 */
+ { ptr = strdup((yyvsp[0].ptr));
RemoveDQuote(ptr);
(yyval.ptr) = ptr;
}
+#line 2726 "y.tab.c" /* yacc.c:1646 */
break;
- case 193:
-#line 660 "gram.y"
- { (yyval.num) = (yyvsp[(1) - (1)].num); }
+ case 209:
+#line 718 "gram.y" /* yacc.c:1646 */
+ { (yyval.num) = (yyvsp[0].num); }
+#line 2732 "y.tab.c" /* yacc.c:1646 */
break;
-/* Line 1267 of yacc.c. */
-#line 2660 "gram.c"
+#line 2736 "y.tab.c" /* yacc.c:1646 */
default: break;
}
+ /* User semantic actions sometimes alter yychar, and that requires
+ that yytoken be updated with the new translation. We take the
+ approach of translating immediately before every use of yytoken.
+ One alternative is translating here after every semantic action,
+ but that translation would be missed if the semantic action invokes
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
+ incorrect destructor might then be invoked immediately. In the
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
+ to an incorrect destructor call or verbose syntax error message
+ before the lookahead is translated. */
YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
YYPOPSTACK (yylen);
@@ -2667,8 +2754,7 @@ yyreduce:
*++yyvsp = yyval;
-
- /* Now `shift' the result of the reduction. Determine what state
+ /* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
@@ -2683,10 +2769,14 @@ yyreduce:
goto yynewstate;
-/*------------------------------------.
-| yyerrlab -- here on detecting error |
-`------------------------------------*/
+/*--------------------------------------.
+| yyerrlab -- here on detecting error. |
+`--------------------------------------*/
yyerrlab:
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
/* If not already recovering from an error, report this error. */
if (!yyerrstatus)
{
@@ -2694,37 +2784,36 @@ yyerrlab:
#if ! YYERROR_VERBOSE
yyerror (YY_("syntax error"));
#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+ yyssp, yytoken)
{
- YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
- if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
- {
- YYSIZE_T yyalloc = 2 * yysize;
- if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
- yyalloc = YYSTACK_ALLOC_MAXIMUM;
- if (yymsg != yymsgbuf)
- YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yyalloc);
- if (yymsg)
- yymsg_alloc = yyalloc;
- else
- {
- yymsg = yymsgbuf;
- yymsg_alloc = sizeof yymsgbuf;
- }
- }
-
- if (0 < yysize && yysize <= yymsg_alloc)
- {
- (void) yysyntax_error (yymsg, yystate, yychar);
- yyerror (yymsg);
- }
- else
- {
- yyerror (YY_("syntax error"));
- if (yysize != 0)
- goto yyexhaustedlab;
- }
+ char const *yymsgp = YY_("syntax error");
+ int yysyntax_error_status;
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ if (yysyntax_error_status == 0)
+ yymsgp = yymsg;
+ else if (yysyntax_error_status == 1)
+ {
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ if (!yymsg)
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ yysyntax_error_status = 2;
+ }
+ else
+ {
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ yymsgp = yymsg;
+ }
+ }
+ yyerror (yymsgp);
+ if (yysyntax_error_status == 2)
+ goto yyexhaustedlab;
}
+# undef YYSYNTAX_ERROR
#endif
}
@@ -2732,24 +2821,24 @@ yyerrlab:
if (yyerrstatus == 3)
{
- /* If just tried and failed to reuse look-ahead token after an
- error, discard it. */
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
if (yychar <= YYEOF)
- {
- /* Return failure if at end of input. */
- if (yychar == YYEOF)
- YYABORT;
- }
+ {
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
+ }
else
- {
- yydestruct ("Error: discarding",
- yytoken, &yylval);
- yychar = YYEMPTY;
- }
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval);
+ yychar = YYEMPTY;
+ }
}
- /* Else will try to reuse look-ahead token after shifting the error
+ /* Else will try to reuse lookahead token after shifting the error
token. */
goto yyerrlab1;
@@ -2765,7 +2854,7 @@ yyerrorlab:
if (/*CONSTCOND*/ 0)
goto yyerrorlab;
- /* Do not reclaim the symbols of the rule which action triggered
+ /* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
YYPOPSTACK (yylen);
yylen = 0;
@@ -2778,38 +2867,37 @@ yyerrorlab:
| yyerrlab1 -- common code for both syntax error and YYERROR. |
`-------------------------------------------------------------*/
yyerrlab1:
- yyerrstatus = 3; /* Each real token shifted decrements this. */
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
for (;;)
{
yyn = yypact[yystate];
- if (yyn != YYPACT_NINF)
- {
- yyn += YYTERROR;
- if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
- {
- yyn = yytable[yyn];
- if (0 < yyn)
- break;
- }
- }
+ if (!yypact_value_is_default (yyn))
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
/* Pop the current state because it cannot handle the error token. */
if (yyssp == yyss)
- YYABORT;
+ YYABORT;
yydestruct ("Error: popping",
- yystos[yystate], yyvsp);
+ yystos[yystate], yyvsp);
YYPOPSTACK (1);
yystate = *yyssp;
YY_STACK_PRINT (yyss, yyssp);
}
- if (yyn == YYFINAL)
- YYACCEPT;
-
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
/* Shift the error token. */
@@ -2833,7 +2921,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
-#ifndef yyoverflow
+#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
`-------------------------------------------------*/
@@ -2844,17 +2932,22 @@ yyexhaustedlab:
#endif
yyreturn:
- if (yychar != YYEOF && yychar != YYEMPTY)
- yydestruct ("Cleanup: discarding lookahead",
- yytoken, &yylval);
- /* Do not reclaim the symbols of the rule which action triggered
+ if (yychar != YYEMPTY)
+ {
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = YYTRANSLATE (yychar);
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval);
+ }
+ /* Do not reclaim the symbols of the rule whose action triggered
this YYABORT or YYACCEPT. */
YYPOPSTACK (yylen);
YY_STACK_PRINT (yyss, yyssp);
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp);
+ yystos[*yyssp], yyvsp);
YYPOPSTACK (1);
}
#ifndef yyoverflow
@@ -2865,12 +2958,9 @@ yyreturn:
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
#endif
- /* Make sure YYID is used. */
- return YYID (yyresult);
+ return yyresult;
}
-
-
-#line 663 "gram.y"
+#line 721 "gram.y" /* yacc.c:1906 */
static void
yyerror(const char *s)
@@ -3085,10 +3175,22 @@ static Bool CheckColormapArg (char *s)
return False;
}
+static int nsew(s)
+ register char *s;
+{
+ if (strcasecmp(s, "nw") == 0) return 1;
+ if (strcasecmp(s, "w" ) == 0) return 2;
+ if (strcasecmp(s, "sw") == 0) return 3;
+ if (strcasecmp(s, "s" ) == 0) return 4;
+ if (strcasecmp(s, "se") == 0) return 5;
+ if (strcasecmp(s, "e" ) == 0) return 6;
+ if (strcasecmp(s, "ne") == 0) return 7;
+ if (strcasecmp(s, "n" ) == 0) return 8;
+ return 0;
+}
void
twmrc_error_prefix (void)
{
fprintf (stderr, "%s: line %d: ", ProgramName, yylineno);
}
-
diff -uprN twm-1.0.9/src/gram.h twm-1.0.9-ohki-patch/src/gram.h
--- twm-1.0.9/src/gram.h 2015-04-17 14:37:03.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/gram.h 2016-03-07 17:40:34.000000000 +0900
@@ -1,14 +1,13 @@
-/* A Bison parser, made by GNU Bison 2.3. */
+/* A Bison parser, made by GNU Bison 3.0.4. */
-/* Skeleton interface for Bison's Yacc-like parsers in C
+/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
- Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or modify
+ This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2, or (at your option)
- any later version.
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,9 +15,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -33,85 +30,100 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-/* Tokens. */
+#ifndef YY_YY_Y_TAB_H_INCLUDED
+# define YY_YY_Y_TAB_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int yydebug;
+#endif
+
+/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
- /* Put the tokens into the symbol table, so that GDB and other debuggers
- know about them. */
- enum yytokentype {
- LB = 258,
- RB = 259,
- LP = 260,
- RP = 261,
- MENUS = 262,
- MENU = 263,
- BUTTON = 264,
- DEFAULT_FUNCTION = 265,
- PLUS = 266,
- MINUS = 267,
- ALL = 268,
- OR = 269,
- CURSORS = 270,
- PIXMAPS = 271,
- ICONS = 272,
- COLOR = 273,
- SAVECOLOR = 274,
- MONOCHROME = 275,
- FUNCTION = 276,
- ICONMGR_SHOW = 277,
- ICONMGR = 278,
- WINDOW_FUNCTION = 279,
- ZOOM = 280,
- ICONMGRS = 281,
- ICONMGR_GEOMETRY = 282,
- ICONMGR_NOSHOW = 283,
- MAKE_TITLE = 284,
- GRAYSCALE = 285,
- ICONIFY_BY_UNMAPPING = 286,
- DONT_ICONIFY_BY_UNMAPPING = 287,
- NO_TITLE = 288,
- AUTO_RAISE = 289,
- NO_HILITE = 290,
- ICON_REGION = 291,
- META = 292,
- SHIFT = 293,
- LOCK = 294,
- CONTROL = 295,
- WINDOW = 296,
- TITLE = 297,
- ICON = 298,
- ROOT = 299,
- FRAME = 300,
- COLON = 301,
- EQUALS = 302,
- SQUEEZE_TITLE = 303,
- DONT_SQUEEZE_TITLE = 304,
- START_ICONIFIED = 305,
- NO_TITLE_HILITE = 306,
- TITLE_HILITE = 307,
- MOVE = 308,
- RESIZE = 309,
- WAIT = 310,
- SELECT = 311,
- KILL = 312,
- LEFT_TITLEBUTTON = 313,
- RIGHT_TITLEBUTTON = 314,
- NUMBER = 315,
- KEYWORD = 316,
- NKEYWORD = 317,
- CKEYWORD = 318,
- CLKEYWORD = 319,
- FKEYWORD = 320,
- FSKEYWORD = 321,
- SKEYWORD = 322,
- DKEYWORD = 323,
- JKEYWORD = 324,
- WINDOW_RING = 325,
- WARP_CURSOR = 326,
- ERRORTOKEN = 327,
- NO_STACKMODE = 328,
- STRING = 329
- };
+ enum yytokentype
+ {
+ LB = 258,
+ RB = 259,
+ LP = 260,
+ RP = 261,
+ MENUS = 262,
+ MENU = 263,
+ BUTTON = 264,
+ DEFAULT_FUNCTION = 265,
+ PLUS = 266,
+ MINUS = 267,
+ ALL = 268,
+ OR = 269,
+ CURSORS = 270,
+ PIXMAPS = 271,
+ ICONS = 272,
+ COLOR = 273,
+ SAVECOLOR = 274,
+ MONOCHROME = 275,
+ FUNCTION = 276,
+ ICONMGR_SHOW = 277,
+ ICONMGR = 278,
+ WINDOW_FUNCTION = 279,
+ ZOOM = 280,
+ ICONMGRS = 281,
+ ICONMGR_GEOMETRY = 282,
+ ICONMGR_NOSHOW = 283,
+ MAKE_TITLE = 284,
+ GRAYSCALE = 285,
+ ICONIFY_BY_UNMAPPING = 286,
+ DONT_ICONIFY_BY_UNMAPPING = 287,
+ NO_TITLE = 288,
+ AUTO_RAISE = 289,
+ NO_HILITE = 290,
+ ICON_REGION = 291,
+ META = 292,
+ SHIFT = 293,
+ LOCK = 294,
+ CONTROL = 295,
+ WINDOW = 296,
+ TITLE = 297,
+ ICON = 298,
+ ROOT = 299,
+ FRAME = 300,
+ COLON = 301,
+ EQUALS = 302,
+ SQUEEZE_TITLE = 303,
+ DONT_SQUEEZE_TITLE = 304,
+ START_ICONIFIED = 305,
+ NO_TITLE_HILITE = 306,
+ TITLE_HILITE = 307,
+ MOVE = 308,
+ RESIZE = 309,
+ WAIT = 310,
+ SELECT = 311,
+ KILL = 312,
+ LEFT_TITLEBUTTON = 313,
+ RIGHT_TITLEBUTTON = 314,
+ NUMBER = 315,
+ KEYWORD = 316,
+ NKEYWORD = 317,
+ CKEYWORD = 318,
+ CLKEYWORD = 319,
+ FKEYWORD = 320,
+ FSKEYWORD = 321,
+ SKEYWORD = 322,
+ DKEYWORD = 323,
+ JKEYWORD = 324,
+ WINDOW_RING = 325,
+ WARP_CURSOR = 326,
+ ERRORTOKEN = 327,
+ NO_STACKMODE = 328,
+ WARP_CURSOR_POS = 329,
+ STRING = 330,
+ TITLE_AT_TOP = 331,
+ TITLE_AT_BOTTOM = 332,
+ TITLE_AT_LEFT = 333,
+ TITLE_AT_RIGHT = 334,
+ MENU_RUNS = 335
+ };
#endif
/* Tokens. */
#define LB 258
@@ -185,25 +197,35 @@
#define WARP_CURSOR 326
#define ERRORTOKEN 327
#define NO_STACKMODE 328
-#define STRING 329
-
-
-
+#define WARP_CURSOR_POS 329
+#define STRING 330
+#define TITLE_AT_TOP 331
+#define TITLE_AT_BOTTOM 332
+#define TITLE_AT_LEFT 333
+#define TITLE_AT_RIGHT 334
+#define MENU_RUNS 335
+/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE
-#line 107 "gram.y"
+
+union YYSTYPE
{
+#line 109 "gram.y" /* yacc.c:1909 */
+
int num;
char *ptr;
-}
-/* Line 1489 of yacc.c. */
-#line 202 "gram.h"
- YYSTYPE;
-# define yystype YYSTYPE /* obsolescent; will be withdrawn */
-# define YYSTYPE_IS_DECLARED 1
+
+#line 219 "y.tab.h" /* yacc.c:1909 */
+};
+
+typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
#endif
+
extern YYSTYPE yylval;
+int yyparse (void);
+
+#endif /* !YY_YY_Y_TAB_H_INCLUDED */
diff -uprN twm-1.0.9/src/gram.y twm-1.0.9-ohki-patch/src/gram.y
--- twm-1.0.9/src/gram.y 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/gram.y 2016-03-07 13:25:04.000000000 +0900
@@ -91,6 +91,8 @@ static Bool CheckWarpRingArg ( char *s )
static Bool CheckColormapArg ( char *s );
static void RemoveDQuote ( char *str );
+static int nsew ( char *s);
+
static char *ptr;
static name_list **list;
static int cont = 0;
@@ -122,13 +124,17 @@ static void yyerror ( const char *s );
%token <num> NUMBER KEYWORD NKEYWORD CKEYWORD CLKEYWORD FKEYWORD FSKEYWORD
%token <num> SKEYWORD DKEYWORD JKEYWORD WINDOW_RING WARP_CURSOR ERRORTOKEN
%token <num> NO_STACKMODE
+%token <num> WARP_CURSOR_POS
%token <ptr> STRING
+%token <num> TITLE_AT_TOP TITLE_AT_BOTTOM TITLE_AT_LEFT TITLE_AT_RIGHT
+%token <num> MENU_RUNS
%type <ptr> string
%type <num> pixmap_list cursor_list color_list save_color_list stmt
%type <num> win_color_list iconm_list win_list icon_list function menu
%type <num> noarg sarg error narg squeeze color_entry
%type <num> action button number signed_number full fullkey
+%type <num> titlepos
%start twmrc
@@ -145,6 +151,18 @@ stmt : error
| sarg
| narg
| squeeze
+ | titlepos
+ | MENU_RUNS string { if (strcmp($2, "t2b")== 0)
+ Scr->MenuRuns = MenuRuns_T2B;
+ else if (strcmp($2, "b2t")== 0)
+ Scr->MenuRuns = MenuRuns_B2T;
+ else if (strcmp($2, "r2l")== 0)
+ Scr->MenuRuns = MenuRuns_R2L;
+ else if (strcmp($2, "l2r")== 0)
+ Scr->MenuRuns = MenuRuns_L2R;
+ else fprintf(stderr,
+ "MenuRuns \"{t2b|b2t|r2l|l2r}\"\n");
+ }
| ICON_REGION string DKEYWORD DKEYWORD number number
{ AddIconRegion($2, $3, $4, $5, $6); }
| ICONMGR_GEOMETRY string number { if (Scr->FirstTime)
@@ -274,6 +292,12 @@ stmt : error
win_list
| WARP_CURSOR { if (Scr->FirstTime)
Scr->WarpCursor = TRUE; }
+ | WARP_CURSOR_POS number
+ { if (Scr->FirstTime)
+ Scr->WarpCursorPos = $2; }
+ | WARP_CURSOR_POS string
+ { if (Scr->FirstTime)
+ Scr->WarpCursorPos = nsew($2); }
| WINDOW_RING { list = &Scr->WindowRingL; }
win_list
;
@@ -509,6 +533,40 @@ squeeze : SQUEEZE_TITLE {
win_list
;
+titlepos : TITLE_AT_TOP {
+ Scr->TitlePos = TP_TOP;
+ }
+ | TITLE_AT_TOP { list = &Scr->TitlePosTopL;
+ if (Scr->TitlePos == -1)
+ Scr->TitlePos = TP_TOP;
+ }
+ win_list
+ | TITLE_AT_LEFT {
+ Scr->TitlePos = TP_LEFT;
+ }
+ | TITLE_AT_LEFT { list = &Scr->TitlePosLeftL;
+ if (Scr->TitlePos == -1)
+ Scr->TitlePos = TP_LEFT;
+ }
+ win_list
+ | TITLE_AT_BOTTOM {
+ Scr->TitlePos = TP_BOTTOM;
+ }
+ | TITLE_AT_BOTTOM { list = &Scr->TitlePosBottomL;
+ if (Scr->TitlePos == -1)
+ Scr->TitlePos = TP_BOTTOM;
+ }
+ win_list
+ | TITLE_AT_RIGHT {
+ Scr->TitlePos = TP_RIGHT;
+ }
+ | TITLE_AT_RIGHT { list = &Scr->TitlePosRightL;
+ if (Scr->TitlePos == -1)
+ Scr->TitlePos = TP_RIGHT;
+ }
+ win_list
+ ;
+
win_sqz_entries : /* Empty */
| win_sqz_entries string JKEYWORD signed_number number {
if (Scr->FirstTime) {
@@ -874,6 +932,19 @@ static Bool CheckColormapArg (char *s)
return False;
}
+static int nsew(s)
+ register char *s;
+{
+ if (strcasecmp(s, "nw") == 0) return 1;
+ if (strcasecmp(s, "w" ) == 0) return 2;
+ if (strcasecmp(s, "sw") == 0) return 3;
+ if (strcasecmp(s, "s" ) == 0) return 4;
+ if (strcasecmp(s, "se") == 0) return 5;
+ if (strcasecmp(s, "e" ) == 0) return 6;
+ if (strcasecmp(s, "ne") == 0) return 7;
+ if (strcasecmp(s, "n" ) == 0) return 8;
+ return 0;
+}
void
twmrc_error_prefix (void)
diff -uprN twm-1.0.9/src/iconmgr.c twm-1.0.9-ohki-patch/src/iconmgr.c
--- twm-1.0.9/src/iconmgr.c 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/iconmgr.c 2016-03-07 13:25:04.000000000 +0900
@@ -175,7 +175,7 @@ void MoveIconManager(int dir)
int row_inc, col_inc;
int got_it;
- if (!Active) return;
+ if (!Active || !Active->iconmgr) return; /* XXX */
cur_row = Active->row;
cur_col = Active->col;
@@ -227,15 +227,27 @@ void MoveIconManager(int dir)
{
new_row += row_inc;
new_col += col_inc;
- if (new_row < 0)
+ if (new_row < 0) {
new_row = ip->cur_rows - 1;
- if (new_col < 0)
+ if (--new_col < 0)
+ new_col = ip->cur_columns -1;
+ }
+ if (new_col < 0) {
new_col = ip->cur_columns - 1;
- if (new_row >= ip->cur_rows)
+ if (--new_row < 0)
+ new_row = ip->cur_rows - 1;
+ }
+ if (new_row >= ip->cur_rows) {
new_row = 0;
- if (new_col >= ip->cur_columns)
+ if (++new_col >= ip->cur_columns)
+ new_col = 0;
+ }
+ if (new_col >= ip->cur_columns) {
new_col = 0;
-
+ if (++new_row >= ip->cur_rows)
+ new_row = 0;
+ }
+
/* Now let's go through the list to see if there is an entry with this
* new position
*/
@@ -291,7 +303,7 @@ void JumpIconManager(int dir)
ScreenInfo *sp;
int screen;
- if (!Active) return;
+ if (!Active || !Active->iconmgr) return; /* XXX */
#define ITER(i) (dir == F_NEXTICONMGR ? (i)->next : (i)->prev)
@@ -683,9 +695,16 @@ void PackIconManager(IconMgr *ip)
XResizeWindow(dpy, ip->w, newwidth, ip->height);
savewidth = ip->width;
- if (ip->twm_win)
+ if (ip->twm_win) {
+ if (ip->twm_win->title_pos == TP_TOP ||
+ ip->twm_win->title_pos == TP_BOTTOM)
SetupWindow (ip->twm_win,
ip->twm_win->frame_x, ip->twm_win->frame_y,
newwidth, ip->height + ip->twm_win->title_height, -1);
+ else
+ SetupWindow (ip->twm_win,
+ ip->twm_win->frame_x, ip->twm_win->frame_y,
+ newwidth + ip->twm_win->title_height, ip->height, -1);
+ }
ip->width = savewidth;
}
diff -uprN twm-1.0.9/src/menus.c twm-1.0.9-ohki-patch/src/menus.c
--- twm-1.0.9/src/menus.c 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/menus.c 2016-03-07 17:39:44.000000000 +0900
@@ -122,11 +122,43 @@ static void MakeMenu ( MenuRoot *mr );
static void Execute ( const char *s );
static void HideIconManager ( void );
static void WarpAlongRing ( XButtonEvent *ev, Bool forward );
-static int WarpThere ( TwmWindow * t );
+static int WarpThere ( TwmWindow *t );
static void WarpToWindow ( TwmWindow *t );
#define SHADOWWIDTH 5 /* in pixels */
+static void
+set_pos(int *x, int *y, TwmWindow *p, int how)
+{
+ int height = p->attr.height;
+ int width = p->attr.width;
+ switch (how) {
+ case 1: /* upper left */
+ *x = 2; *y = 5; break;
+ case 2: /* middle left */
+ *x = 2; *y = height / 2; break;
+ case 3: /* lower left */
+ *x = 2; *y = height - 5; break;
+ case 4: /* middle bottom */
+ *x = width / 2 ; *y = height - 5; break;
+ case 5: /* lower right */
+ *x = width - 2 ; *y = height - 5; break;
+ case 6: /* middle right */
+ *x = width - 2 ; *y = height / 2; break;
+ case 7: /* upper right */
+ *x = width - 2 ; *y = 5; break;
+ case 8: /* middle top */
+ *x = width / 2 ; *y = 5; break;
+ default: /* middle */
+ *x = width / 2 ; *y = height / 2; break;
+ }
+ if (p->title_height > 0) {
+ if (p->title_pos == TP_TOP)
+ *y += Scr->TitleHeight;
+ if (p->title_pos == TP_LEFT)
+ *x += Scr->TitleHeight;
+ }
+}
@@ -367,6 +399,7 @@ void
PaintEntry(MenuRoot *mr, MenuItem *mi, int exposure)
{
int y_offset;
+ int y_offset_x;
int text_y;
GC gc;
@@ -375,6 +408,7 @@ PaintEntry(MenuRoot *mr, MenuItem *mi, i
#endif
y_offset = mi->item_num * Scr->EntryHeight;
text_y = y_offset + Scr->MenuFont.y;
+ y_offset_x = y_offset + (Scr->EntryHeight - Scr->MenuFont.height);
if (mi->func != F_TITLE)
{
@@ -384,13 +418,24 @@ PaintEntry(MenuRoot *mr, MenuItem *mi, i
{
XSetForeground(dpy, Scr->NormalGC, mi->hi_back);
- XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset,
- mr->width, Scr->EntryHeight);
+ if (VMenu(Scr))
+ XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset,
+ mr->width, Scr->EntryHeight);
+ else
+ XFillRectangle(dpy, mr->w, Scr->NormalGC, y_offset, 0,
+ Scr->EntryHeight, mr->width);
MyFont_ChangeGC(mi->hi_fore, mi->hi_back, &Scr->MenuFont);
- MyFont_DrawString(dpy, mr->w, &Scr->MenuFont, Scr->NormalGC, mi->x,
- text_y, mi->item, mi->strlen);
+ if (VMenu(Scr))
+ MyFont_DrawString(dpy, mr->w, &Scr->MenuFont, Scr->NormalGC,
+ mi->x, text_y,
+ mi->item, mi->strlen);
+ else
+ MyFont_DrawString_Rotated(dpy, mr->w, &Scr->MenuFont,
+ Scr->NormalGC,
+ mi->x, y_offset_x,
+ mi->item, mi->strlen, &mi->pixmap_1);
gc = Scr->NormalGC;
}
@@ -400,8 +445,12 @@ PaintEntry(MenuRoot *mr, MenuItem *mi, i
{
XSetForeground(dpy, Scr->NormalGC, mi->back);
- XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset,
- mr->width, Scr->EntryHeight);
+ if (VMenu(Scr))
+ XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset,
+ mr->width, Scr->EntryHeight);
+ else
+ XFillRectangle(dpy, mr->w, Scr->NormalGC, y_offset, 0,
+ Scr->EntryHeight, mr->width);
MyFont_ChangeGC(mi->fore, mi->back, &Scr->MenuFont);
gc = Scr->NormalGC;
@@ -409,8 +458,13 @@ PaintEntry(MenuRoot *mr, MenuItem *mi, i
else
gc = Scr->MenuGC;
- MyFont_DrawString(dpy, mr->w, &Scr->MenuFont, gc,
- mi->x, text_y, mi->item, mi->strlen);
+ if (VMenu(Scr))
+ MyFont_DrawString(dpy, mr->w, &Scr->MenuFont, gc,
+ mi->x, text_y, mi->item, mi->strlen);
+ else
+ MyFont_DrawString_Rotated(dpy, mr->w, &Scr->MenuFont, gc,
+ mi->x, y_offset_x,
+ mi->item, mi->strlen, &mi->pixmap_0);
}
@@ -424,8 +478,21 @@ PaintEntry(MenuRoot *mr, MenuItem *mi, i
}
x = mr->width - Scr->pullW - 5;
y = y_offset + ((Scr->MenuFont.height - Scr->pullH) / 2);
- XCopyPlane(dpy, Scr->pullPm, mr->w, gc, 0, 0,
- Scr->pullW, Scr->pullH, x, y, 1);
+ if (VMenu(Scr)) {
+ if (Scr->MenuAtLeft == TRUE)
+ XCopyPlane(dpy, Scr->pullPm, mr->w, gc, 0, 0,
+ Scr->pullW, Scr->pullH, 5, y, 1);
+ else
+ XCopyPlane(dpy, Scr->pullPm, mr->w, gc, 0, 0,
+ Scr->pullW, Scr->pullH, x, y, 1);
+ } else {
+ if (Scr->MenuAtLeft == TRUE)
+ XCopyPlane(dpy, Scr->pullPm, mr->w, gc, 0, 0,
+ Scr->pullW, Scr->pullH, y+4, 5, 1);
+ else
+ XCopyPlane(dpy, Scr->pullPm, mr->w, gc, 0, 0,
+ Scr->pullW, Scr->pullH, y+4, x, 1);
+ }
}
}
else
@@ -435,23 +502,40 @@ PaintEntry(MenuRoot *mr, MenuItem *mi, i
XSetForeground(dpy, Scr->NormalGC, mi->back);
/* fill the rectangle with the title background color */
- XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset,
- mr->width, Scr->EntryHeight);
+ if (VMenu(Scr))
+ XFillRectangle(dpy, mr->w, Scr->NormalGC, 0, y_offset,
+ mr->width, Scr->EntryHeight);
+ else
+ XFillRectangle(dpy, mr->w, Scr->NormalGC, y_offset, 0,
+ Scr->EntryHeight, mr->width);
{
XSetForeground(dpy, Scr->NormalGC, mi->fore);
/* now draw the dividing lines */
- if (y_offset)
- XDrawLine (dpy, mr->w, Scr->NormalGC, 0, y_offset,
- mr->width, y_offset);
- y = ((mi->item_num+1) * Scr->EntryHeight)-1;
- XDrawLine(dpy, mr->w, Scr->NormalGC, 0, y, mr->width, y);
+ if (VMenu(Scr)) {
+ if (y_offset)
+ XDrawLine (dpy, mr->w, Scr->NormalGC, 0, y_offset,
+ mr->width, y_offset);
+ y = ((mi->item_num+1) * Scr->EntryHeight)-1;
+ XDrawLine(dpy, mr->w, Scr->NormalGC, 0, y, mr->width, y);
+ }
}
MyFont_ChangeGC(mi->fore, mi->back, &Scr->MenuFont);
/* finally render the title */
- MyFont_DrawString(dpy, mr->w, &Scr->MenuFont, Scr->NormalGC, mi->x,
- text_y, mi->item, mi->strlen);
+ if (VMenu(Scr))
+ MyFont_DrawString(dpy, mr->w, &Scr->MenuFont, Scr->NormalGC, mi->x,
+ text_y, mi->item, mi->strlen);
+ else {
+ MyFont_DrawString_Rotated(dpy, mr->w, &Scr->MenuFont, Scr->NormalGC,
+ mi->x, y_offset_x,
+ mi->item, mi->strlen, &mi->pixmap_0);
+ if (y_offset)
+ XDrawLine (dpy, mr->w, Scr->NormalGC, y_offset, 0,
+ y_offset, mr->width);
+ y = ((mi->item_num+1) * Scr->EntryHeight)-1;
+ XDrawLine(dpy, mr->w, Scr->NormalGC, y, 0, y, mr->width);
+ }
}
}
@@ -468,8 +552,10 @@ PaintMenu(MenuRoot *mr, XEvent *e)
/* be smart about handling the expose, redraw only the entries
* that we need to
*/
- if (e->xexpose.y < (y_offset + Scr->EntryHeight) &&
- (e->xexpose.y + e->xexpose.height) > y_offset)
+ if (VMenu(Scr) && e->xexpose.y < (y_offset + Scr->EntryHeight) &&
+ (e->xexpose.y + e->xexpose.height) > y_offset ||
+ HMenu(Scr) && e->xexpose.x < (y_offset + Scr->EntryHeight) &&
+ (e->xexpose.x + e->xexpose.width) > y_offset)
{
PaintEntry(mr, mi, True);
}
@@ -537,7 +623,8 @@ UpdateMenu(void)
Scr = (struct ScreenInfo *) context_data;
if (x < 0 || y < 0 ||
- x >= ActiveMenu->width || y >= ActiveMenu->height)
+ (VMenu(Scr) && (x >= ActiveMenu->width || y >= ActiveMenu->height)) ||
+ (HMenu(Scr) && (x >= ActiveMenu->height || y >= ActiveMenu->width)))
{
if (ActiveItem && ActiveItem->func != F_TITLE)
{
@@ -549,7 +636,10 @@ UpdateMenu(void)
}
/* look for the entry that the mouse is in */
- entry = y / Scr->EntryHeight;
+ if (VMenu(Scr))
+ entry = y / Scr->EntryHeight;
+ else
+ entry = x / Scr->EntryHeight;
for (i = 0, mi = ActiveMenu->first; mi != NULL; i++, mi=mi->next)
{
if (i == entry)
@@ -588,18 +678,28 @@ UpdateMenu(void)
/* now check to see if we were over the arrow of a pull right entry */
if (ActiveItem && ActiveItem->func == F_MENU &&
- ((ActiveMenu->width - x) < (ActiveMenu->width >> 1)))
+ ( VMenu(Scr) &&
+ ( (((Scr->MenuAtLeft == FALSE)?(ActiveMenu->width - x):(x)))
+ < (ActiveMenu->width * 2 / 5)) ||
+ HMenu(Scr) &&
+ ( (((Scr->MenuAtLeft == FALSE)?(ActiveMenu->width - y):(y)))
+ < (ActiveMenu->width * 2 / 5))))
{
MenuRoot *save = ActiveMenu;
int savex = MenuOrigins[MenuDepth - 1].x;
int savey = MenuOrigins[MenuDepth - 1].y;
if (MenuDepth < MAXMENUDEPTH) {
+ if (VMenu(Scr))
PopUpMenu (ActiveItem->sub,
(savex + (ActiveMenu->width >> 1)),
- (savey + ActiveItem->item_num * Scr->EntryHeight)
- /*(savey + ActiveItem->item_num * Scr->EntryHeight +
- (Scr->EntryHeight >> 1))*/, False);
+ (savey + ActiveItem->item_num * Scr->EntryHeight),
+ False);
+ else
+ PopUpMenu (ActiveItem->sub,
+ (savex + ActiveItem->item_num * Scr->EntryHeight),
+ (savey + (ActiveMenu->width >> 1)),
+ False);
} else if (!badItem) {
Bell(XkbBI_MinorError,0,None);
badItem = ActiveItem;
@@ -699,6 +799,7 @@ AddToMenu(MenuRoot *menu, const char *it
tmp = malloc(sizeof(MenuItem));
tmp->root = menu;
+ tmp->pixmap_0 = tmp->pixmap_1 = None;
if (menu->first == NULL)
{
@@ -745,7 +846,27 @@ AddToMenu(MenuRoot *menu, const char *it
menu->pull = TRUE;
}
tmp->item_num = menu->items++;
-
+ /* move last entry (i.e. tmp) to head */
+ if ((Scr->MenuRuns == MenuRuns_B2T || Scr->MenuRuns == MenuRuns_R2L)
+ && menu->first != menu->last) {
+ int i;
+ MenuItem *mi;
+
+ /* remove last entry (i.e. tmp) */
+ menu->last = tmp->prev;
+ menu->last->next = NULL;
+ /* put tmp at head */
+ menu->first->prev = tmp;
+ tmp->next = menu->first;
+ tmp->prev = NULL;
+ menu->first = tmp;
+ tmp->prev = NULL;
+ /* set sequence number */
+ for (i = 0, mi = menu->first; mi; mi = mi->next)
+ mi->item_num = i++;
+ if (i != menu->items)
+ fprintf(stderr, "AddToMenu(): items count mismatch!\n");
+ }
return (tmp);
}
@@ -795,7 +916,12 @@ MakeMenu(MenuRoot *mr)
for (cur = mr->first; cur != NULL; cur = cur->next)
{
if (cur->func != F_TITLE)
- cur->x = 5;
+ {
+ if (Scr->MenuAtLeft == TRUE && mr->pull == TRUE)
+ cur->x = 5 + 16;
+ else
+ cur->x = 5;
+ }
else
{
cur->x = width - MyFont_TextWidth(&Scr->MenuFont, cur->item,
@@ -820,8 +946,8 @@ MakeMenu(MenuRoot *mr)
attributes.save_under = True;
}
mr->shadow = XCreateWindow (dpy, Scr->Root, 0, 0,
- (unsigned int) mr->width,
- (unsigned int) mr->height,
+ VMenu(Scr) ? (unsigned int) mr->width : (unsigned int) mr->height,
+ VMenu(Scr) ? (unsigned int) mr->height : (unsigned int) mr->width,
(unsigned int)0,
CopyFromParent,
(unsigned int) CopyFromParent,
@@ -841,14 +967,14 @@ MakeMenu(MenuRoot *mr)
valuemask |= CWBackingStore;
attributes.backing_store = Always;
}
- mr->w = XCreateWindow (dpy, Scr->Root, 0, 0, (unsigned int) mr->width,
- (unsigned int) mr->height,
+ mr->w = XCreateWindow (dpy, Scr->Root, 0, 0,
+ VMenu(Scr) ? (unsigned int) mr->width : (unsigned int) mr->height,
+ VMenu(Scr) ? (unsigned int) mr->height : (unsigned int) mr->width,
(unsigned int) Scr->MenuBorderWidth,
CopyFromParent, (unsigned int) CopyFromParent,
(Visual *) CopyFromParent,
valuemask, &attributes);
-
XSaveContext(dpy, mr->w, MenuContext, (caddr_t)mr);
XSaveContext(dpy, mr->w, ScreenContext, (caddr_t)Scr);
@@ -1050,20 +1176,54 @@ PopUpMenu (MenuRoot *menu, int x, int y,
menu->entered = FALSE;
if (center) {
+ if (VMenu(Scr)) {
x -= (menu->width / 2);
y -= (Scr->EntryHeight / 2); /* sticky menus would be nice here */
+ } else {
+ y -= (menu->width / 2);
+ x -= (Scr->EntryHeight / 2); /* sticky menus would be nice here */
+ }
+
+ if (Scr->MenuAtLeft == TRUE) {
+ if (VMenu(Scr))
+ x -= menu->width / 4;
+ else
+ y -= menu->width / 4;
+ } else {
+ if (VMenu(Scr))
+ x += menu->width / 4;
+ else
+ y += menu->width / 4;
+ }
+ } else {
+ if (Scr->MenuAtLeft == TRUE) {
+ if (VMenu(Scr))
+ x -= menu->width;
+ else
+ y -= menu->width;
+ }
}
+ if (Scr->MenuRuns == MenuRuns_B2T)
+ y -= menu->height - Scr->EntryHeight;
+ else if (Scr->MenuRuns == MenuRuns_R2L)
+ x -= menu->height - Scr->EntryHeight;
/*
* clip to screen
*/
- if (x + menu->width > Scr->MyDisplayWidth) {
+ if (VMenu(Scr) && x + menu->width > Scr->MyDisplayWidth) {
x = Scr->MyDisplayWidth - menu->width;
}
+ if (HMenu(Scr) && x + menu->height > Scr->MyDisplayWidth) {
+ x = Scr->MyDisplayWidth - menu->height;
+ }
if (x < 0) x = 0;
- if (y + menu->height > Scr->MyDisplayHeight) {
+ if (VMenu(Scr) && y + menu->height > Scr->MyDisplayHeight) {
y = Scr->MyDisplayHeight - menu->height;
}
+ if (HMenu(Scr) && y + menu->width > Scr->MyDisplayHeight) {
+ y = Scr->MyDisplayHeight - menu->width;
+ }
if (y < 0) y = 0;
MenuOrigins[MenuDepth].x = x;
@@ -1178,8 +1338,13 @@ resizeFromCenter(Window w, TwmWindow *tm
namelen = strlen (tmp_win->name);
#endif
bw2 = tmp_win->frame_bw * 2;
- AddingW = tmp_win->attr.width + bw2;
- AddingH = tmp_win->attr.height + tmp_win->title_height + bw2;
+ if (tmp_win->title_pos == TP_TOP || tmp_win->title_pos == TP_BOTTOM) {
+ AddingW = tmp_win->attr.width + bw2;
+ AddingH = tmp_win->attr.height + tmp_win->title_height + bw2;
+ } else {
+ AddingW = tmp_win->attr.width + tmp_win->title_height + bw2;
+ AddingH = tmp_win->attr.height + bw2;
+ }
#if 0
width = (SIZE_HINDENT + MyFont_TextWidth (&Scr->SizeFont,
tmp_win->name, namelen));
@@ -1205,12 +1370,20 @@ resizeFromCenter(Window w, TwmWindow *tm
lastx = -10000;
lasty = -10000;
#if 0
+#if 1
+ MoveOutline(Scr->Root,
+ origDragX - JunkBW, origDragY - JunkBW,
+ DragWidth * JunkBW, DragHeight * JunkBW,
+ tmp_win->frame_bw,
+ tmp_win->title_height, tmp_win->title_pos);
+#else
MoveOutline(Scr->Root,
origDragX - JunkBW, origDragY - JunkBW,
DragWidth * JunkBW, DragHeight * JunkBW,
tmp_win->frame_bw,
tmp_win->title_height);
#endif
+#endif
MenuStartResize(tmp_win, origDragX, origDragY, DragWidth, DragHeight);
while (TRUE)
{
@@ -1614,7 +1787,8 @@ ExecuteFunction(int func, const char *ac
origDragX - JunkBW, origDragY - JunkBW,
DragWidth + 2 * JunkBW, DragHeight + 2 * JunkBW,
tmp_win->frame_bw,
- moving_icon ? 0 : tmp_win->title_height);
+ moving_icon ? 0 : tmp_win->title_height,
+ tmp_win->title_pos);
/*
* This next line causes HandleReleaseNotify to call
* XRaiseWindow(). This is solely to preserve the
@@ -1671,7 +1845,7 @@ ExecuteFunction(int func, const char *ac
if (Scr->OpaqueMove)
XMoveWindow (dpy, DragWindow, origDragX, origDragY);
else
- MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0);
+ MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0, 0);
DragWindow = None;
}
}
@@ -1696,7 +1870,7 @@ ExecuteFunction(int func, const char *ac
}
if (Event.type == releaseEvent)
{
- MoveOutline(rootw, 0, 0, 0, 0, 0, 0);
+ MoveOutline(rootw, 0, 0, 0, 0, 0, 0, 0);
if (moving_icon &&
((CurrentDragX != origDragX ||
CurrentDragY != origDragY)))
@@ -1784,7 +1958,8 @@ ExecuteFunction(int func, const char *ac
else
MoveOutline(eventp->xmotion.root, xl, yt, w, h,
tmp_win->frame_bw,
- moving_icon ? 0 : tmp_win->title_height);
+ moving_icon ? 0 : tmp_win->title_height,
+ tmp_win->title_pos);
}
}
else if (DragWindow != None)
@@ -1824,7 +1999,8 @@ ExecuteFunction(int func, const char *ac
else
MoveOutline(eventp->xmotion.root, xl, yt, w, h,
tmp_win->frame_bw,
- moving_icon ? 0 : tmp_win->title_height);
+ moving_icon ? 0 : tmp_win->title_height,
+ tmp_win->title_pos);
}
}
@@ -2092,14 +2268,25 @@ ExecuteFunction(int func, const char *ac
case F_WARPTO:
{
+ static TwmWindow *last_win = NULL;
register TwmWindow *t;
int len;
len = strlen(action);
- for (t = Scr->TwmRoot.next; t != NULL; t = t->next) {
+ for (t = Scr->TwmRoot.next; t != NULL; t = t->next)
+ if (t == last_win) break;
+ if (t) for (t = t->next; t != NULL; t = t->next) {
if (!strncmp(action, t->name, len))
if (WarpThere(t)) break;
+ if (!strncmp(action, t->icon_name, len))
+ if (WarpThere(t)) break;
+ }
+ if (!t) for (t = Scr->TwmRoot.next; t != NULL; t = t->next) {
+ if (!strncmp(action, t->name, len))
+ if (WarpThere(t)) break;
+ if (!strncmp(action, t->icon_name, len))
+ if (WarpThere(t)) break;
}
if (!t) {
for (t = Scr->TwmRoot.next; t != NULL; t = t->next) {
@@ -2116,6 +2303,8 @@ ExecuteFunction(int func, const char *ac
if (!t)
Bell(XkbBI_MinorError,0,None);
+ else
+ last_win = t;
}
break;
@@ -2243,6 +2432,38 @@ ExecuteFunction(int func, const char *ac
fprintf (stderr, "%s: unable to start: %s\n", ProgramName, *Argv);
break;
+ case F_TITLEPOS:
+ { int pos = -1;
+ if (strcasecmp(action, "top") == 0)
+ pos = TP_TOP;
+ else if (strcasecmp(action, "left") == 0)
+ pos = TP_LEFT;
+ else if (strcasecmp(action, "bottom") == 0)
+ pos = TP_BOTTOM;
+ else if (strcasecmp(action, "right") == 0)
+ pos = TP_RIGHT;
+ if (context == C_TITLE) {
+ if (pos != tmp_win->title_pos)
+ ChangeTitlePos(tmp_win, pos);
+ } else {
+ Scr->TitlePosDynamic = pos;
+ }
+ }
+ break;
+
+ case F_TITLESQZ:
+ if (context != C_TITLE)
+ break;
+ if (strcasecmp(action, "left") == 0)
+ ChangeSqueeze(tmp_win, J_LEFT);
+ else if (strcasecmp(action, "center") == 0)
+ ChangeSqueeze(tmp_win, J_CENTER);
+ else if (strcasecmp(action, "right") == 0)
+ ChangeSqueeze(tmp_win, J_RIGHT);
+ else if (strcasecmp(action, "none") == 0)
+ ChangeSqueeze(tmp_win, -1);
+
+ break;
}
if (ButtonPressed == -1) XUngrabPointer(dpy, CurrentTime);
@@ -2814,6 +3035,14 @@ DestroyMenu (MenuRoot *menu)
for (item = menu->first; item; ) {
MenuItem *tmp = item;
item = item->next;
+ if (tmp->pixmap_0) {
+ XFreePixmap(dpy, tmp->pixmap_0);
+ tmp->pixmap_0 = None;
+ }
+ if (tmp->pixmap_1) {
+ XFreePixmap(dpy, tmp->pixmap_1);
+ tmp->pixmap_1 = None;
+ }
free (tmp);
}
}
@@ -2860,13 +3089,14 @@ WarpAlongRing (XButtonEvent *ev, Bool fo
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;
+ p->ring.curs_x -= t->frame_bw;
+ p->ring.curs_y -= t->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_height + p->frame_bw) {
/* somehow out of window */
- p->ring.curs_x = p->frame_width / 2;
- p->ring.curs_y = p->frame_height / 2;
+ set_pos(&p->ring.curs_x, &p->ring.curs_y, p, Scr->WarpCursorPos);
}
}
}
@@ -2884,8 +3114,7 @@ WarpToWindow (TwmWindow *t)
x = t->ring.curs_x;
y = t->ring.curs_y;
} else {
- x = t->frame_width / 2;
- y = t->frame_height / 2;
+ set_pos(&x, &y, t, Scr->WarpCursorPos);
}
XWarpPointer (dpy, None, t->frame, 0, 0, 0, 0, x, y);
}
diff -uprN twm-1.0.9/src/menus.h twm-1.0.9-ohki-patch/src/menus.h
--- twm-1.0.9/src/menus.h 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/menus.h 2016-03-07 14:47:19.000000000 +0900
@@ -72,6 +72,8 @@ typedef struct MenuItem
struct MenuItem *prev; /* prev menu item */
struct MenuRoot *sub; /* MenuRoot of a pull right menu */
struct MenuRoot *root; /* back pointer to my MenuRoot */
+ Pixmap pixmap_0; /* rotated string pixcel for state == 0 */
+ Pixmap pixmap_1; /* rotated string pixcel for state == 1 */
const char *item; /* the character string displayed */
const char *action; /* action to be performed */
Pixel fore; /* foreground color */
diff -uprN twm-1.0.9/src/parse.c twm-1.0.9-ohki-patch/src/parse.c
--- twm-1.0.9/src/parse.c 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/parse.c 2016-03-07 13:25:04.000000000 +0900
@@ -334,6 +334,9 @@ typedef struct _TwmKeyword {
#define kw0_NoCaseSensitive 23
#define kw0_NoRaiseOnWarp 24
#define kw0_WarpUnmapped 25
+#define kw0_MenuBottomUp 26
+#define kw0_MenuAtLeft 27
+#define kw0_MenuUpward 28
#define kws_UsePPosition 1
#define kws_IconFont 2
@@ -464,6 +467,8 @@ static TwmKeyword keytable[] = {
{ "f.source", FSKEYWORD, F_BEEP }, /* XXX - don't work */
{ "f.startwm", FSKEYWORD, F_STARTWM },
{ "f.title", FKEYWORD, F_TITLE },
+ { "f.titlepos", FSKEYWORD, F_TITLEPOS },
+ { "f.titlesqz", FSKEYWORD, F_TITLESQZ },
{ "f.topzoom", FKEYWORD, F_TOPZOOM },
{ "f.twmrc", FKEYWORD, F_RESTART },
{ "f.unfocus", FKEYWORD, F_UNFOCUS },
@@ -514,14 +519,18 @@ static TwmKeyword keytable[] = {
{ "maketitle", MAKE_TITLE, 0 },
{ "maxwindowsize", SKEYWORD, kws_MaxWindowSize },
{ "menu", MENU, 0 },
+ { "menuatleft", KEYWORD, kw0_MenuAtLeft },
{ "menubackground", CKEYWORD, kwc_MenuBackground },
{ "menubordercolor", CKEYWORD, kwc_MenuBorderColor },
{ "menuborderwidth", NKEYWORD, kwn_MenuBorderWidth },
+ { "menubottomup", KEYWORD, kw0_MenuBottomUp },
{ "menufont", SKEYWORD, kws_MenuFont },
{ "menuforeground", CKEYWORD, kwc_MenuForeground },
+ { "menuruns", MENU_RUNS, 0},
{ "menushadowcolor", CKEYWORD, kwc_MenuShadowColor },
{ "menutitlebackground", CKEYWORD, kwc_MenuTitleBackground },
{ "menutitleforeground", CKEYWORD, kwc_MenuTitleForeground },
+ { "menuupward", KEYWORD, kw0_MenuUpward },
{ "meta", META, 0 },
{ "mod", META, 0 }, /* fake it */
{ "monochrome", MONOCHROME, 0 },
@@ -569,6 +578,10 @@ static TwmKeyword keytable[] = {
{ "starticonified", START_ICONIFIED, 0 },
{ "t", TITLE, 0 },
{ "title", TITLE, 0 },
+ { "titleatbottom", TITLE_AT_BOTTOM, 0},
+ { "titleatleft", TITLE_AT_LEFT, 0},
+ { "titleatright", TITLE_AT_RIGHT, 0},
+ { "titleattop", TITLE_AT_TOP, 0},
{ "titlebackground", CLKEYWORD, kwcl_TitleBackground },
{ "titlebuttonborderwidth", NKEYWORD, kwn_TitleButtonBorderWidth },
{ "titlefont", SKEYWORD, kws_TitleFont },
@@ -580,6 +593,7 @@ static TwmKeyword keytable[] = {
{ "w", WINDOW, 0 },
{ "wait", WAIT, 0 },
{ "warpcursor", WARP_CURSOR, 0 },
+ { "warpcursorpos", WARP_CURSOR_POS, 0 },
{ "warpunmapped", KEYWORD, kw0_WarpUnmapped },
{ "west", DKEYWORD, D_WEST },
{ "window", WINDOW, 0 },
@@ -721,6 +735,19 @@ int do_single_keyword (int keyword)
case kw0_WarpUnmapped:
Scr->WarpUnmapped = TRUE;
return 1;
+
+ case kw0_MenuBottomUp:
+ Scr->MenuAtLeft = TRUE;
+ Scr->MenuRuns = MenuRuns_B2T;
+ return 1;
+
+ case kw0_MenuAtLeft:
+ Scr->MenuAtLeft = TRUE;
+ return 1;
+
+ case kw0_MenuUpward:
+ Scr->MenuRuns = MenuRuns_B2T;
+ return 1;
}
return 0;
diff -uprN twm-1.0.9/src/parse.h twm-1.0.9-ohki-patch/src/parse.h
--- twm-1.0.9/src/parse.h 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/parse.h 2016-03-07 13:25:04.000000000 +0900
@@ -146,6 +146,8 @@ extern int mods;
#define F_COLORMAP 110 /* string */
#define F_PRIORITY 111 /* string */
#define F_STARTWM 114 /* string */
+#define F_TITLEPOS 115 /* string */
+#define F_TITLESQZ 116 /* string */
#define D_NORTH 1
#define D_SOUTH 2
diff -uprN twm-1.0.9/src/resize.c twm-1.0.9-ohki-patch/src/resize.c
--- twm-1.0.9/src/resize.c 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/resize.c 2016-03-07 13:45:17.000000000 +0900
@@ -184,7 +184,7 @@ StartResize(XEvent *evp, TwmWindow *tmp_
MoveOutline (Scr->Root, dragx - 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);
+ tmp_win->frame_bw, tmp_win->title_height, tmp_win->title_pos);
}
@@ -216,13 +216,14 @@ MenuStartResize(TwmWindow *tmp_win, int
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);
+ tmp_win->frame_bw, tmp_win->title_height, tmp_win->title_pos);
}
/**
* begin a windorew resize operation from AddWindow
* \param tmp_win the TwmWindow pointer
*/
+
void
AddStartResize(TwmWindow *tmp_win, int x, int y, int w, int h)
{
@@ -347,7 +348,7 @@ MenuDoResize(int x_root, int y_root, Twm
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);
+ tmp_win->frame_bw, tmp_win->title_height, tmp_win->title_pos);
}
DisplaySize(tmp_win, dragWidth, dragHeight);
@@ -462,7 +463,7 @@ DoResize(int x_root, int y_root, TwmWind
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);
+ tmp_win->frame_bw, tmp_win->title_height, tmp_win->title_pos);
}
DisplaySize(tmp_win, dragWidth, dragHeight);
@@ -488,8 +489,13 @@ DisplaySize(TwmWindow *tmp_win, int widt
last_width = width;
last_height = height;
+ if (tmp_win->title_pos == TP_TOP || tmp_win->title_pos == TP_BOTTOM) {
dheight = height - tmp_win->title_height;
dwidth = width;
+ } else {
+ dheight = height;
+ dwidth = width - tmp_win->title_height;
+ }
/*
* ICCCM says that PMinSize is the default is no PBaseSize is given,
@@ -533,7 +539,7 @@ EndResize(void)
fprintf(stderr, "EndResize\n");
#endif
- MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0);
+ MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0, 0);
XUnmapWindow(dpy, Scr->SizeWindow);
XFindContext(dpy, ResizeWindow, TwmContext, (caddr_t *)&tmp_win);
@@ -569,7 +575,7 @@ EndResize(void)
void
MenuEndResize(TwmWindow *tmp_win)
{
- MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0);
+ MoveOutline(Scr->Root, 0, 0, 0, 0, 0, 0, 0);
XUnmapWindow(dpy, Scr->SizeWindow);
ConstrainSize (tmp_win, &dragWidth, &dragHeight);
AddingX = dragx - tmp_win->frame_bw;
@@ -617,6 +623,9 @@ ConstrainSize (TwmWindow *tmp_win, int *
int dwidth = *widthp, dheight = *heightp;
+ if (tmp_win->title_pos == TP_LEFT || tmp_win->title_pos == TP_RIGHT)
+ dwidth -= tmp_win->title_height;
+ else
dheight -= tmp_win->title_height;
if (tmp_win->hints.flags & PMinSize) {
@@ -724,8 +733,13 @@ ConstrainSize (TwmWindow *tmp_win, int *
/*
* Fourth, account for border width and title height
*/
+ if (tmp_win->title_pos == TP_LEFT || tmp_win->title_pos == TP_RIGHT) {
+ *widthp = dwidth + tmp_win->title_height;
+ *heightp = dheight;
+ } else {
*widthp = dwidth;
*heightp = dheight + tmp_win->title_height;
+ }
}
@@ -778,8 +792,14 @@ void SetupFrame (TwmWindow *tmp_win, int
bw = tmp_win->frame_bw; /* -1 means current frame width */
if (tmp_win->iconmgr) {
- tmp_win->iconmgrp->width = w;
- h = tmp_win->iconmgrp->height + tmp_win->title_height;
+ if (tmp_win->title_pos == TP_TOP ||
+ tmp_win->title_pos == TP_BOTTOM) {
+ tmp_win->iconmgrp->width = w;
+ h = tmp_win->iconmgrp->height + tmp_win->title_height;
+ } else {
+ tmp_win->iconmgrp->width = w - tmp_win->title_height;
+ h = tmp_win->iconmgrp->height;
+ }
}
/*
@@ -796,12 +816,33 @@ void SetupFrame (TwmWindow *tmp_win, int
title_width = xwc.width = w;
title_height = Scr->TitleHeight + bw;
+ if (tmp_win->title_pos == TP_LEFT || tmp_win->title_pos == TP_RIGHT) {
+ /* title_width actually means height of title */
+ title_width = h;
+ ComputeWindowTitleOffsets (tmp_win, h, True);
+ } else
ComputeWindowTitleOffsets (tmp_win, xwc.width, True);
reShape = (tmp_win->wShaped ? TRUE : FALSE);
if (tmp_win->squeeze_info) /* check for title shaping */
{
title_width = tmp_win->rightx + Scr->TBInfo.rightoff;
+ if (tmp_win->title_pos == TP_LEFT || tmp_win->title_pos == TP_RIGHT) {
+ if (title_width < h)
+ {
+ xwc.width = title_width;
+ if (tmp_win->frame_height != h ||
+ tmp_win->frame_width != w ||
+ tmp_win->frame_bw != bw ||
+ title_width != tmp_win->title_width)
+ reShape = TRUE;
+ }
+ else
+ {
+ if (!tmp_win->wShaped) reShape = TRUE;
+ title_width = h;
+ }
+ } else {
if (title_width < xwc.width)
{
xwc.width = title_width;
@@ -816,6 +857,7 @@ void SetupFrame (TwmWindow *tmp_win, int
if (!tmp_win->wShaped) reShape = TRUE;
title_width = xwc.width;
}
+ }
}
tmp_win->title_width = title_width;
@@ -828,10 +870,29 @@ void SetupFrame (TwmWindow *tmp_win, int
tmp_win->title_y = xwc.y = -bw;
xwcm |= (CWX | CWY | CWBorderWidth);
}
+ if (tmp_win->squeeze_info == NULL && tmp_win->title_pos != TP_TOP) {
+ /* can't call ComputeTitleLocation() yet! */
+ tmp_win->title_x = -bw;
+ tmp_win->title_y = -bw;
+ if (tmp_win->title_pos == TP_BOTTOM)
+ tmp_win->title_y += (h - tmp_win->title_height + bw);
+ if (tmp_win->title_pos == TP_RIGHT)
+ tmp_win->title_x += (w - tmp_win->title_height + bw);
+ xwc.x = tmp_win->title_x;
+ xwc.y = tmp_win->title_y;
+ xwcm |= (CWX | CWY);
+ }
+ if (tmp_win->title_pos == TP_LEFT || tmp_win->title_pos == TP_RIGHT) {
+ xwcm |= CWHeight;
+ xwc.height = title_width;
+ xwcm &= ~CWWidth;
+ /* xwc.width = Scr->TitleHeight */;
+ }
XConfigureWindow(dpy, tmp_win->title_w, xwcm, &xwc);
}
+ if (tmp_win->title_pos == TP_TOP || tmp_win->title_pos == TP_BOTTOM) {
if (tmp_win->attr.width != w)
tmp_win->widthEverChangedByUser = True;
@@ -840,9 +901,35 @@ void SetupFrame (TwmWindow *tmp_win, int
tmp_win->attr.width = w;
tmp_win->attr.height = h - tmp_win->title_height;
+ } else {
+ if (tmp_win->attr.width != (w - tmp_win->title_height))
+ tmp_win->widthEverChangedByUser = True;
+
+ if (tmp_win->attr.height != h)
+ tmp_win->heightEverChangedByUser = True;
- XMoveResizeWindow (dpy, tmp_win->w, 0, tmp_win->title_height,
- w, h - tmp_win->title_height);
+ tmp_win->attr.width = w - tmp_win->title_height;
+ tmp_win->attr.height = h;
+ }
+
+ switch (tmp_win->title_pos) {
+ case TP_TOP:
+ XMoveResizeWindow (dpy, tmp_win->w, 0, tmp_win->title_height,
+ w, h - tmp_win->title_height);
+ break;
+ case TP_BOTTOM:
+ XMoveResizeWindow (dpy, tmp_win->w, 0, 0,
+ w, h - tmp_win->title_height);
+ break;
+ case TP_LEFT:
+ XMoveResizeWindow (dpy, tmp_win->w, tmp_win->title_height, 0,
+ w - tmp_win->title_height, h);
+ break;
+ case TP_RIGHT:
+ XMoveResizeWindow (dpy, tmp_win->w, 0, 0,
+ w - tmp_win->title_height, h);
+ break;
+ }
/*
* fix up frame and assign size/location values in tmp_win
@@ -874,6 +961,13 @@ void SetupFrame (TwmWindow *tmp_win, int
}
xwcm = CWX | CWWidth;
+ if (tmp_win->title_pos == TP_LEFT || tmp_win->title_pos == TP_RIGHT) {
+ xwcm &= ~CWX;
+ xwcm |= CWY | CWHeight;
+ xwc.y = xwc.x;
+ xwc.height = xwc.width;
+ xwc.width = (Scr->TitleHeight - 2 * Scr->FramePadding);
+ }
XConfigureWindow(dpy, tmp_win->hilite_w, xwcm, &xwc);
}
@@ -887,12 +981,38 @@ void SetupFrame (TwmWindow *tmp_win, int
client_event.xconfigure.display = dpy;
client_event.xconfigure.event = tmp_win->w;
client_event.xconfigure.window = tmp_win->w;
+ switch (tmp_win->title_pos) {
+ case TP_TOP:
client_event.xconfigure.x = (x + tmp_win->frame_bw - tmp_win->old_bw);
client_event.xconfigure.y = (y + tmp_win->frame_bw +
tmp_win->title_height - tmp_win->old_bw);
client_event.xconfigure.width = tmp_win->frame_width;
client_event.xconfigure.height = tmp_win->frame_height -
tmp_win->title_height;
+ break;
+ case TP_BOTTOM:
+ client_event.xconfigure.x = (x + tmp_win->frame_bw - tmp_win->old_bw);
+ client_event.xconfigure.y = (y + tmp_win->frame_bw - tmp_win->old_bw);
+ client_event.xconfigure.width = tmp_win->frame_width;
+ client_event.xconfigure.height = tmp_win->frame_height -
+ tmp_win->title_height;
+ break;
+ case TP_LEFT:
+ client_event.xconfigure.x = (x + tmp_win->frame_bw +
+ tmp_win->title_height - tmp_win->old_bw);
+ client_event.xconfigure.y = (y + tmp_win->frame_bw - tmp_win->old_bw);
+ client_event.xconfigure.width = tmp_win->frame_width -
+ tmp_win->title_height;
+ client_event.xconfigure.height = tmp_win->frame_height;
+ break;
+ case TP_RIGHT:
+ client_event.xconfigure.x = (x + tmp_win->frame_bw - tmp_win->old_bw);
+ client_event.xconfigure.y = (y + tmp_win->frame_bw - tmp_win->old_bw);
+ client_event.xconfigure.width = tmp_win->frame_width -
+ tmp_win->title_height;
+ client_event.xconfigure.height = tmp_win->frame_height;
+ break;
+ }
client_event.xconfigure.border_width = tmp_win->old_bw;
/* Real ConfigureNotify events say we're above title window, so ... */
/* what if we don't have a title ????? */
@@ -1026,15 +1146,31 @@ SetFrameShape (TwmWindow *tmp)
/*
* need to do general case
*/
- XShapeCombineShape (dpy, tmp->frame, ShapeBounding,
- 0, tmp->title_height, tmp->w,
- ShapeBounding, ShapeSet);
- if (tmp->title_w) {
+ if (tmp->title_pos == TP_TOP || tmp->title_pos == TP_BOTTOM) {
+ XShapeCombineShape (dpy, tmp->frame, ShapeBounding,
+ 0,
+ (tmp->title_pos == TP_TOP)?tmp->title_height:0,
+ tmp->w,
+ ShapeBounding, ShapeSet);
+ if (tmp->title_w) {
+ XShapeCombineShape (dpy, tmp->frame, ShapeBounding,
+ tmp->title_x + tmp->frame_bw,
+ tmp->title_y + tmp->frame_bw,
+ tmp->title_w, ShapeBounding,
+ ShapeUnion);
+ }
+ } else {
XShapeCombineShape (dpy, tmp->frame, ShapeBounding,
- tmp->title_x + tmp->frame_bw,
- tmp->title_y + tmp->frame_bw,
- tmp->title_w, ShapeBounding,
- ShapeUnion);
+ (tmp->title_pos == TP_LEFT)?tmp->title_height:0,
+ 0, tmp->w,
+ ShapeBounding, ShapeSet);
+ if (tmp->title_w) {
+ XShapeCombineShape (dpy, tmp->frame, ShapeBounding,
+ tmp->title_x + tmp->frame_bw,
+ tmp->title_y + tmp->frame_bw,
+ tmp->title_w, ShapeBounding,
+ ShapeUnion);
+ }
}
} else {
/*
@@ -1052,28 +1188,64 @@ SetFrameShape (TwmWindow *tmp)
*
* The frame_width and frame_height do *not* include borders.
*/
+ if (tmp->title_pos == TP_TOP || tmp->title_pos == TP_BOTTOM) {
+ int order = (tmp->title_pos == TP_TOP)?YXBanded:Unsorted;
/* border */
newBounding[0].x = tmp->title_x;
newBounding[0].y = tmp->title_y;
+ if (tmp->title_pos == TP_BOTTOM)
+ newBounding[0].y += tmp->frame_bw;
newBounding[0].width = tmp->title_width + fbw2;
newBounding[0].height = tmp->title_height;
newBounding[1].x = -tmp->frame_bw;
- newBounding[1].y = Scr->TitleHeight;
+ newBounding[1].y = (tmp->title_pos == TP_TOP)?
+ Scr->TitleHeight : -tmp->frame_bw;
newBounding[1].width = tmp->attr.width + fbw2;
newBounding[1].height = tmp->attr.height + fbw2;
XShapeCombineRectangles (dpy, tmp->frame, ShapeBounding, 0, 0,
- newBounding, 2, ShapeSet, YXBanded);
+ newBounding, 2, ShapeSet, order);
/* insides */
newClip[0].x = tmp->title_x + tmp->frame_bw;
- newClip[0].y = 0;
+ newClip[0].y = (tmp->title_pos == TP_TOP)?
+ 0 : tmp->attr.height + tmp->frame_bw;
newClip[0].width = tmp->title_width;
newClip[0].height = Scr->TitleHeight;
newClip[1].x = 0;
- newClip[1].y = tmp->title_height;
+ newClip[1].y = (tmp->title_pos == TP_TOP)?
+ tmp->title_height : 0;
newClip[1].width = tmp->attr.width;
newClip[1].height = tmp->attr.height;
XShapeCombineRectangles (dpy, tmp->frame, ShapeClip, 0, 0,
- newClip, 2, ShapeSet, YXBanded);
+ newClip, 2, ShapeSet, order);
+ } else {
+ int order = Unsorted;
+ /* border */
+ newBounding[0].x = tmp->title_x;
+ if (tmp->title_pos == TP_RIGHT)
+ newBounding[0].x += tmp->frame_bw;
+ newBounding[0].y = tmp->title_y;
+ newBounding[0].width = tmp->title_height;
+ newBounding[0].height = tmp->title_width + fbw2;
+ newBounding[1].x = (tmp->title_pos == TP_LEFT)?
+ Scr->TitleHeight : -tmp->frame_bw;
+ newBounding[1].y = -tmp->frame_bw;
+ newBounding[1].width = tmp->attr.width + fbw2;
+ newBounding[1].height = tmp->attr.height + fbw2;
+ XShapeCombineRectangles (dpy, tmp->frame, ShapeBounding, 0, 0,
+ newBounding, 2, ShapeSet, order);
+ /* insides */
+ newClip[0].x = (tmp->title_pos == TP_LEFT)?
+ 0 : tmp->attr.width + tmp->frame_bw;
+ newClip[0].y = tmp->title_y + tmp->frame_bw;
+ newClip[0].width = Scr->TitleHeight;
+ newClip[0].height = tmp->title_width;
+ newClip[1].x = (tmp->title_pos == TP_LEFT)? tmp->title_height : 0;
+ newClip[1].y = 0;
+ newClip[1].width = tmp->attr.width;
+ newClip[1].height = tmp->attr.height;
+ XShapeCombineRectangles (dpy, tmp->frame, ShapeClip, 0, 0,
+ newClip, 2, ShapeSet, order);
+ }
} else {
(void) XShapeCombineMask (dpy, tmp->frame, ShapeBounding, 0, 0,
None, ShapeSet);
@@ -1139,3 +1311,233 @@ SetFrameShape (TwmWindow *tmp)
* are really deltax and deltay to lower right handle corner, so they need
* to have -1 subtracted from would normally be the actual extents.
*/
+
+
+/***********************************************************************
+ *
+ * Procedure:
+ * RelocateBtns - relocate buttons
+ *
+ * Inputs:
+ * tmp_win - the TwmWindow pointer
+ * topbtm - TRUE when top or bottom
+ *
+ ***********************************************************************
+ */
+static void
+RelocateBtns (tmp_win, topbtm)
+ TwmWindow *tmp_win;
+ int topbtm;
+{
+ TBWindow *tbw;
+ TitleButton *tb;
+ XSetWindowAttributes attributes;
+ XWindowChanges xwc;
+ int y, leftx, rightx, boxwidth;
+
+ if (tmp_win->titlebuttons == NULL || topbtm == -1)
+ return;
+
+ leftx = y = Scr->TBInfo.leftx;
+ rightx = tmp_win->rightx;
+ boxwidth = (Scr->TBInfo.width + Scr->TBInfo.pad);
+
+ for (tb = Scr->TBInfo.head, tbw = tmp_win->titlebuttons; tb;
+ tb = tb->next, tbw++) {
+ int x;
+
+ XConfigureWindow(dpy, tbw->window, (CWX|CWY), &xwc);
+ if (tb->rightside) {
+ x = rightx;
+ rightx += boxwidth;
+ if (topbtm == TRUE) {
+ attributes.win_gravity = NorthEastGravity;
+ xwc.x = x;
+ xwc.y = y;
+ } else {
+ attributes.win_gravity = SouthWestGravity;
+ xwc.x = y;
+ xwc.y = x;
+ }
+ } else {
+ x = leftx;
+ leftx += boxwidth;
+ if (topbtm == TRUE) {
+ xwc.x = x;
+ xwc.y = y;
+ } else {
+ xwc.x = y;
+ xwc.y = x;
+ }
+ attributes.win_gravity = NorthWestGravity;
+ }
+ XChangeWindowAttributes(dpy, tbw->window, CWWinGravity, &attributes);
+ XConfigureWindow(dpy, tbw->window, (CWX|CWY), &xwc);
+ }
+}
+
+/***********************************************************************
+ *
+ * Procedure:
+ * ChangeTitlePos - change the position of titlebar
+ *
+ * Inputs:
+ * tmp_win - the TwmWindow pointer
+ * pos - position of titlebar
+ *
+ ***********************************************************************
+ */
+void
+ChangeTitlePos (tmp_win, pos)
+ TwmWindow *tmp_win;
+ int pos;
+{
+ int h, w;
+ int x, y;
+ int reloc_btns = -1;
+
+
+ if (pos == -1 || tmp_win->title_pos == pos)
+ return; /* nothing to do */
+
+ h = tmp_win->frame_height;
+ w = tmp_win->frame_width;
+
+ /* reconfigure title window if necessary */
+ if (tmp_win->title_w) {
+ XWindowChanges xwc_w, xwc_h;
+ unsigned long xwcm_w, xwcm_h;
+ xwcm_w = xwcm_h = 0;
+ if (tmp_win->title_pos != TP_TOP && pos == TP_TOP) {
+ xwcm_w |= CWX | CWY;
+ xwc_w.x = - tmp_win->frame_bw;
+ xwc_w.y = - tmp_win->frame_bw;
+ }
+ if (tmp_win->title_pos == TP_TOP || tmp_win->title_pos == TP_BOTTOM) {
+ if (pos == TP_LEFT || pos == TP_RIGHT) {
+ xwcm_w |= CWHeight | CWWidth;
+ xwc_w.height = tmp_win->attr.height;
+ xwc_w.width = Scr->TitleHeight;
+ if (tmp_win->title_height && tmp_win->hilite_w) {
+ /* SetupWindow() do the real work */
+ xwcm_h |= CWHeight | CWWidth | CWX | CWY;
+ xwc_h.height = tmp_win->attr.height;
+ xwc_h.width = (Scr->TitleHeight - 2 * Scr->FramePadding);
+ xwc_h.x = Scr->FramePadding;
+ xwc_h.y = 0;
+ }
+ reloc_btns = FALSE;
+ h -= tmp_win->title_height;
+ w += tmp_win->title_height;
+ }
+ } else {
+ if (pos == TP_TOP || pos == TP_BOTTOM) {
+ xwcm_w |= CWHeight | CWWidth;
+ xwc_w.height = Scr->TitleHeight;
+ xwc_w.width = tmp_win->attr.width;
+ if (tmp_win->title_height && tmp_win->hilite_w) {
+ /* SetupWindow() do the real work */
+ xwcm_h |= CWHeight | CWWidth | CWX | CWY;
+ xwc_h.height = (Scr->TitleHeight - 2 * Scr->FramePadding);
+ xwc_h.width = tmp_win->attr.width;
+ xwc_h.x = 0;
+ xwc_h.y = Scr->FramePadding;
+ }
+ reloc_btns = TRUE;
+ h += tmp_win->title_height;
+ w -= tmp_win->title_height;
+ }
+ }
+ if (xwcm_w)
+ XConfigureWindow(dpy, tmp_win->title_w, xwcm_w, &xwc_w);
+ if (xwcm_h)
+ XConfigureWindow(dpy, tmp_win->hilite_w, xwcm_h, &xwc_h);
+ }
+
+ x = tmp_win->frame_x;
+ y = tmp_win->frame_y;
+
+ if (tmp_win->title_pos == TP_TOP)
+ y += tmp_win->title_height;
+ else if (tmp_win->title_pos == TP_LEFT)
+ x += tmp_win->title_height;
+
+ if (pos == TP_TOP)
+ y -= tmp_win->title_height;
+ else if (pos == TP_LEFT)
+ x -= tmp_win->title_height;
+
+ tmp_win->title_pos = pos;
+ tmp_win->title_width = -1; /* force SetFrameShape() */
+
+
+ SetupWindow(tmp_win, x, y, w, h, tmp_win->frame_bw);
+
+ RelocateBtns (tmp_win, reloc_btns);
+}
+
+/***********************************************************************
+ *
+ * Procedure:
+ * ChangeSqueeze - change the squeeze status of titlebar
+ *
+ * Inputs:
+ * tmp_win - the TwmWindow pointer
+ * justify - squeeze justify (J_LEFT, J_CENTER, J_RIGHT)
+ *
+ ***********************************************************************
+ */
+void
+ChangeSqueeze (tmp_win, justify)
+ TwmWindow *tmp_win;
+ int justify;
+{
+ static SqueezeInfo default_squeeze[] = {
+ {J_LEFT, 0, 0 },
+ {J_CENTER, 0, 0 },
+ {J_RIGHT, 0, 0 }
+ };
+ int i;
+
+ if (tmp_win->squeeze_info == NULL && justify == -1)
+ return; /* should not happen */
+
+ if (tmp_win->squeeze_info && tmp_win->squeeze_info->justify == justify)
+ return;
+
+ if (justify == -1) {
+ /* need to resize title bar window */
+ XWindowChanges xwc;
+ unsigned long xwcm;
+
+ if (tmp_win->title_pos == TP_TOP ||
+ tmp_win->title_pos == TP_BOTTOM) {
+ xwcm = CWWidth;
+ xwc.width = tmp_win->attr.width;
+ } else {
+ xwcm = CWHeight;
+ xwc.height = tmp_win->attr.height;
+ }
+ XConfigureWindow(dpy, tmp_win->title_w, xwcm, &xwc);
+ XConfigureWindow(dpy, tmp_win->hilite_w, xwcm, &xwc);
+
+ tmp_win->squeeze_info = NULL;
+ } else {
+ for (i=0; i < sizeof(default_squeeze)/sizeof(default_squeeze[0]); i++)
+ if (default_squeeze[i].justify == justify) {
+ tmp_win->squeeze_info = &default_squeeze[i];
+ break;
+ }
+ if (i >= sizeof(default_squeeze)/sizeof(default_squeeze[0]))
+ return;
+ }
+
+ tmp_win->title_width = -1; /* force SetFrameShape() */
+
+ SetupWindow(tmp_win, tmp_win->frame_x, tmp_win->frame_y,
+ tmp_win->frame_width, tmp_win->frame_height,
+ tmp_win->frame_bw);
+
+ if (justify == -1)
+ SetFrameShape(tmp_win);
+}
diff -uprN twm-1.0.9/src/resize.h twm-1.0.9-ohki-patch/src/resize.h
--- twm-1.0.9/src/resize.h 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/resize.h 2016-03-07 13:25:04.000000000 +0900
@@ -74,5 +74,7 @@ extern void SetFrameShape ( TwmWindow *t
extern void SetupFrame ( TwmWindow *tmp_win, int x, int y, int w, int h, int bw, Bool sendEvent );
extern void SetupWindow ( TwmWindow *tmp_win, int x, int y, int w, int h, int bw );
extern void StartResize ( XEvent *evp, TwmWindow *tmp_win, Bool fromtitlebar );
+extern void ChangeTitlePos ( TwmWindow *tmp_win, int pos );
+extern void ChangeSqueeze ( TwmWindow *tmp_win, int justify );
#endif /* _RESIZE_ */
diff -uprN twm-1.0.9/src/screen.h twm-1.0.9-ohki-patch/src/screen.h
--- twm-1.0.9/src/screen.h 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/screen.h 2016-03-07 13:25:04.000000000 +0900
@@ -215,6 +215,21 @@ typedef struct ScreenInfo
short AutoRelativeResize; /* start resize relative to position in quad */
short FocusRoot; /* is the input focus on the root ? */
short WarpCursor; /* warp cursor on de-iconify ? */
+ short WarpCursorPos; /* pos to warp cursor on de-iconify ? */
+ short MenuAtLeft; /* place menu on left side */
+ short MenuRuns; /* place menu items */
+#define MenuRuns_T2B 0 /* Top to Bottom */
+#define MenuRuns_B2T 1 /* Bottom to Top */
+#define MenuRuns_R2L 2 /* Right to Left */
+#define MenuRuns_L2R 3 /* Left to Right */
+#define VMenu(x) ((((x)->MenuRuns) & 2) == 0)
+#define HMenu(x) ((((x)->MenuRuns) & 2) == 2)
+ short TitlePos; /* title bar position */
+ short TitlePosDynamic; /* title bar position dynamic override */
+ name_list *TitlePosTopL; /* windows which have title at top */
+ name_list *TitlePosLeftL; /* windows which have title at left */
+ name_list *TitlePosBottomL; /* windows which have title at bottom */
+ name_list *TitlePosRightL; /* windows which have title at right */
short ForceIcon; /* force the icon to the user specified */
short NoGrabServer; /* don't do server grabs */
short NoRaiseMove; /* don't raise window following move */
diff -uprN twm-1.0.9/src/twm.c twm-1.0.9-ohki-patch/src/twm.c
--- twm-1.0.9/src/twm.c 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/twm.c 2016-03-07 13:42:33.000000000 +0900
@@ -101,6 +101,8 @@ int HasShape; /* server supports shape
int ShapeEventBase, ShapeErrorBase;
int HasSync; /* server supports SYNC extension? */
int SyncEventBase, SyncErrorBase;
+int HasRandr; /* server supports Randr extension? */
+int RandrEventBase, RandrErrorBase;
ScreenInfo **ScreenList; /* structures for each screen */
ScreenInfo *Scr = NULL; /* the cur and prev screens */
int PreviousScreen; /* last screen that we were on */
@@ -349,6 +351,7 @@ main(int argc, char *argv[])
HasShape = XShapeQueryExtension (dpy, &ShapeEventBase, &ShapeErrorBase);
HasSync = XSyncQueryExtension(dpy, &SyncEventBase, &SyncErrorBase);
+ HasRandr = XRRQueryExtension(dpy, &RandrEventBase, &RandrErrorBase);
TwmContext = XUniqueContext();
MenuContext = XUniqueContext();
IconManagerContext = XUniqueContext();
@@ -462,6 +465,8 @@ main(int argc, char *argv[])
Scr->DontSqueezeTitleL = NULL;
Scr->WindowRingL = NULL;
Scr->WarpCursorL = NULL;
+ if (HasRandr)
+ XRRSelectInput(dpy, RootWindow(dpy, scrnum), True);
/* remember to put an initialization in InitVariables also
*/
@@ -555,6 +560,15 @@ main(int argc, char *argv[])
Scr->tbpm.menu = None;
Scr->tbpm.delete = None;
+ Scr->WarpCursorPos = 0;
+ Scr->MenuAtLeft = FALSE;
+ Scr->MenuRuns = MenuRuns_T2B;
+ Scr->TitlePos = -1;
+ Scr->TitlePosDynamic = -1;
+ Scr->TitlePosTopL = NULL;
+ Scr->TitlePosLeftL = NULL;
+ Scr->TitlePosBottomL = NULL;
+ Scr->TitlePosRightL = NULL;
InitVariables();
InitMenus();
@@ -562,12 +576,17 @@ main(int argc, char *argv[])
ParseTwmrc(InitFile);
assign_var_savecolor(); /* storeing pixels for twmrc "entities" */
if (Scr->SqueezeTitle == -1) Scr->SqueezeTitle = FALSE;
+ if (Scr->TitlePos == -1) Scr->TitlePos = TP_TOP;
+ if (HMenu(Scr))
+ NewFontCursor(&Scr->MenuCursor, "sb_up_arrow");
if (!Scr->HaveFonts) CreateFonts();
CreateGCs();
MakeMenus();
Scr->TitleBarFont.y += Scr->FramePadding;
Scr->TitleHeight = Scr->TitleBarFont.height + Scr->FramePadding * 2;
+ if (Scr->TitleBarFont.height < 4) /* XXX */
+ Scr->TitleHeight = 1;
/* make title height be odd so buttons look nice and centered */
if (!(Scr->TitleHeight & 1)) Scr->TitleHeight++;
@@ -770,6 +789,15 @@ InitVariables(void)
Scr->FocusRoot = TRUE;
Scr->Focus = NULL;
Scr->WarpCursor = FALSE;
+ Scr->WarpCursorPos = 0;
+ Scr->MenuAtLeft = FALSE;
+ Scr->MenuRuns = MenuRuns_T2B;
+ Scr->TitlePos = -1;
+ Scr->TitlePosDynamic = -1;
+ FreeList(&Scr->TitlePosTopL);
+ FreeList(&Scr->TitlePosLeftL);
+ FreeList(&Scr->TitlePosBottomL);
+ FreeList(&Scr->TitlePosRightL);
Scr->ForceIcon = FALSE;
Scr->NoGrabServer = FALSE;
Scr->NoRaiseMove = FALSE;
@@ -854,7 +882,6 @@ RestoreWithdrawnLocation (TwmWindow *tmp
&JunkWidth, &JunkHeight, &bw, &JunkDepth)) {
GetGravityOffsets (tmp, &gravx, &gravy);
- if (gravy < 0) xwc.y -= tmp->title_height;
if (bw != tmp->old_bw) {
int xoff, yoff;
diff -uprN twm-1.0.9/src/twm.h twm-1.0.9-ohki-patch/src/twm.h
--- twm-1.0.9/src/twm.h 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/twm.h 2016-03-07 14:16:09.000000000 +0900
@@ -70,6 +70,7 @@ from The Open Group.
#include <X11/Xutil.h>
#include <X11/cursorfont.h>
#include <X11/extensions/shape.h>
+#include <X11/extensions/Xrandr.h>
#include <X11/Xfuncs.h>
#include <X11/StringDefs.h>
#include <X11/Intrinsic.h>
@@ -226,6 +227,7 @@ typedef struct TwmWindow
int old_bw; /* border width before reparenting */
Window frame; /* the frame window */
Window title_w; /* the title bar window */
+ Pixmap title_pixmap; /* the title string rotated CW */
Window hilite_w; /* the hilite window */
Pixmap gray;
Window icon_w; /* the icon window */
@@ -245,6 +247,15 @@ typedef struct TwmWindow
int icon_height; /* height of the icon bitmap */
int title_height; /* height of the title bar */
int title_width; /* width of the title bar */
+ /*
+ * title_height & title_width are size of title bar in
+ * horizontale layout even if title_pos is TP_LEFT or TP_RIGHT
+ */
+ int title_pos; /* position of title bar */
+#define TP_TOP 0
+#define TP_LEFT 1
+#define TP_BOTTOM 2
+#define TP_RIGHT 3
char *full_name; /* full name of the window */
char *name; /* name of the window */
char *icon_name; /* name of the icon */
@@ -354,6 +365,7 @@ extern XtAppContext appContext;
extern Window ResizeWindow; /* the window we are resizing */
extern int HasShape; /* this server supports Shape extension */
extern int HasSync; /* this server supports SYNC extension */
+extern int HasRandr; /* this server supports Randr extension */
extern int PreviousScreen;
@@ -410,6 +422,9 @@ extern Bool use_fontset;
extern int ShapeEventBase;
extern int ShapeErrorBase;
+extern int RandrEventBase;
+extern int RandrErrorBase;
+
#define _XA_MIT_PRIORITY_COLORS TwmAtoms[0]
#define _XA_WM_CHANGE_STATE TwmAtoms[1]
#define _XA_WM_STATE TwmAtoms[2]
diff -uprN twm-1.0.9/src/util.c twm-1.0.9-ohki-patch/src/util.c
--- twm-1.0.9/src/util.c 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/util.c 2016-03-07 21:18:52.139282962 +0900
@@ -90,7 +90,8 @@ int HotX, HotY;
* \param bw border width of the frame
* \param th title height
*/
-void MoveOutline(Window root, int x, int y, int width, int height, int bw, int th)
+
+void MoveOutline(Window root, int x, int y, int width, int height, int bw, int th, int pos)
{
static int lastx = 0;
static int lasty = 0;
@@ -98,13 +99,14 @@ void MoveOutline(Window root, int x, int
static int lastHeight = 0;
static int lastBW = 0;
static int lastTH = 0;
+ static int lastPOS = 0;
int xl, xr, yt, yb, xinnerl, xinnerr, yinnert, yinnerb;
int xthird, ythird;
XSegment outline[18];
register XSegment *r;
if (x == lastx && y == lasty && width == lastWidth && height == lastHeight
- && lastBW == bw && th == lastTH)
+ && lastBW == bw && th == lastTH && pos == lastPOS)
return;
r = outline;
@@ -116,10 +118,27 @@ void MoveOutline(Window root, int x, int
xr = lastx + lastWidth - 1; \
yt = lasty; \
yb = lasty + lastHeight - 1; \
+ if (lastPOS == TP_TOP || lastPOS == TP_BOTTOM) { \
xinnerl = xl + lastBW; \
xinnerr = xr - lastBW; \
- yinnert = yt + lastTH + lastBW; \
+ if (lastPOS == TP_TOP) { \
+ yinnert = yt + lastTH + lastBW; \
+ yinnerb = yb - lastBW; \
+ } else { \
+ yinnert = yt + lastBW; \
+ yinnerb = yb - lastTH - lastBW; \
+ } \
+ } else { \
+ yinnert = yt + lastBW; \
yinnerb = yb - lastBW; \
+ if (lastPOS == TP_LEFT) { \
+ xinnerl = xl + lastTH + lastBW; \
+ xinnerr = xr - lastBW; \
+ } else { \
+ xinnerl = xl + lastBW; \
+ xinnerr = xr - lastTH - lastBW; \
+ } \
+ } \
xthird = (xinnerr - xinnerl) / 3; \
ythird = (yinnerb - yinnert) / 3; \
\
@@ -172,10 +191,31 @@ void MoveOutline(Window root, int x, int
r++; \
\
if (lastTH != 0) { \
+ if (lastPOS == TP_TOP || lastPOS == TP_BOTTOM) { \
+ if (lastPOS == TP_TOP) { \
r->x1 = xl; \
r->y1 = yt + lastTH; \
r->x2 = xr; \
r->y2 = r->y1; \
+ } else { \
+ r->x1 = xl; \
+ r->y1 = yb - lastTH; \
+ r->x2 = xr; \
+ r->y2 = r->y1; \
+ } \
+ } else { \
+ if (lastPOS == TP_LEFT) { \
+ r->x1 = xl + lastTH; \
+ r->y1 = yt; \
+ r->x2 = r->x1; \
+ r->y2 = yb; \
+ } else { \
+ r->x1 = xr - lastTH; \
+ r->y1 = yt; \
+ r->x2 = r->x1; \
+ r->y2 = yb; \
+ } \
+ } \
r++; \
} \
}
@@ -189,6 +229,7 @@ void MoveOutline(Window root, int x, int
lastHeight = height;
lastBW = bw;
lastTH = th;
+ lastPOS = pos;
/* draw the new one, if any */
DRAWIT ();
@@ -686,6 +727,82 @@ MyFont_DrawString(Display *dpy, Drawable
}
void
+MyFont_DrawString_Rotated(Display *dpy, Drawable d, MyFont *font, GC gc,
+ int x, int y, const char *string, int len,
+ Pixmap *pixp)
+{
+ int h, w;
+
+ if (len <= 0) return;
+
+ /* h = Scr->EntryHeight; */
+ h = font->height;
+ w = MyFont_TextWidth(font, string, len);
+
+ if (*pixp == None) {
+ XImage *title_h, *title_v;
+ Pixmap title_pix;
+ GC MonoGC;
+ int i, j;
+
+ /* draw a title horizontally to a monochrome pixmap */
+ title_pix = XCreatePixmap(dpy, Scr->Root, w, h, 1);
+ MonoGC = XCreateGC(dpy, title_pix, 0, NULL);
+ XSetForeground(dpy, MonoGC, WhitePixel(dpy, Scr->screen));
+ XSetBackground(dpy, MonoGC, WhitePixel(dpy, Scr->screen));
+ XFillRectangle(dpy, title_pix, MonoGC, 0, 0, w, h);
+ XSetFont(dpy, MonoGC, font->font->fid);
+ XSetForeground(dpy, MonoGC, BlackPixel(dpy, Scr->screen));
+
+ MyFont_DrawString (dpy, title_pix, font,
+ MonoGC, 0, font->y,
+ string, len);
+
+ title_h = XGetImage(dpy, title_pix, 0, 0, w, h, AllPlanes, XYPixmap);
+ XFreeGC(dpy, MonoGC);
+ XFreePixmap(dpy, title_pix);
+ if (title_h == NULL) {
+ fprintf(stderr,
+ "MyFont_DrawString_Rorated(): can't get title image\n");
+ return;
+ }
+
+ /* allocate XImage for Rotated Title */
+ title_v = XCreateImage(dpy, 0, 1, XYBitmap, 0, NULL, h, w, 8, 0);
+ if (title_v == NULL) {
+ fprintf(stderr, "MyFont_DrawString_Rorated(): can't alloc XImage\n");
+ XDestroyImage(title_h);
+ return;
+ }
+ title_v->data = (char *)calloc(1, title_v->bytes_per_line * w);
+ if (title_v->data == NULL) {
+ fprintf(stderr,
+ "MyFont_DrawString_Rorated(): can't alloc XImage data\n");
+ XDestroyImage(title_h);
+ XDestroyImage(title_v);
+ return;
+ }
+ /* rotate CW */
+ for (i = 0; i < h; i++)
+ for (j = 0; j < w; j++)
+ XPutPixel(title_v, i, j,
+ XGetPixel(title_h, j, h-1-i)?0:1);
+ XDestroyImage(title_h);
+
+ /* put image to pixmap */
+ *pixp = XCreatePixmap(dpy, Scr->Root,
+ h, w, Scr->d_depth);
+ /* XSetForeground(dpy, gc, Gcv.background); */
+ XFillRectangle(dpy, *pixp, gc, 0, 0, h, w);
+ /* XSetForeground(dpy, gc, Gcv.foreground); */
+ XPutImage(dpy, *pixp, gc, title_v,
+ 0, 0, 0, 0, h, w);
+ XDestroyImage(title_v);
+ }
+ XCopyArea(dpy, *pixp, d, gc, 0, 0, h, w, y, x);
+}
+
+void
MyFont_ChangeGC(unsigned long fix_fore, unsigned long fix_back,
MyFont *fix_font)
{
diff -uprN twm-1.0.9/src/util.h twm-1.0.9-ohki-patch/src/util.h
--- twm-1.0.9/src/util.h 2015-04-17 14:36:39.000000000 +0900
+++ twm-1.0.9-ohki-patch/src/util.h 2016-03-07 13:25:04.000000000 +0900
@@ -62,7 +62,7 @@ in this Software without prior written a
#define _UTIL_
extern void MoveOutline ( Window root, int x, int y, int width, int height,
- int bw, int th );
+ int bw, int th, int pos );
extern void Zoom ( Window wf, Window wt );
extern char * ExpandFilename ( char *name );
extern void GetUnknownIcon ( const char *name );
@@ -81,7 +81,10 @@ extern void MyFont_DrawImageString( Disp
GC gc, int x, int y, const char * string,
int len);
extern void MyFont_DrawString( Display *dpy, Drawable d, MyFont *font, GC gc,
- int x, int y, const char * string, int len);
+ int x, int y, const char * string, int len);
+extern void MyFont_DrawString_Rotated( Display *dpy, Drawable d, MyFont *font,
+ GC gc, int x, int y, const char * string,
+ int len, Pixmap * pixp);
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment