summaryrefslogtreecommitdiff
path: root/src/menus.h
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2019-11-23 05:48:34 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2019-11-23 05:48:34 -0500
commit077a496c38fc993d7691ce5aab1e9c2b4aee4b02 (patch)
treea426a7cb6deae949b6d6931ca6c0bd371a9ad9ac /src/menus.h
parent2e0923ba703d040160bac1deb05d5d6d4cbd62aa (diff)
Formatted most of the C files using "twm-indent", part of cindent at
https://invisible-island.net/cindent/ That is essentially a script which adds typedefs to the x-indent.sh script. No object-code changed in this reformatting. Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/menus.h')
-rw-r--r--src/menus.h188
1 files changed, 94 insertions, 94 deletions
diff --git a/src/menus.h b/src/menus.h
index cadffaf..de0629c 100644
--- a/src/menus.h
+++ b/src/menus.h
@@ -49,87 +49,81 @@ in this Software without prior written authorization from The Open Group.
/** OR PERFORMANCE OF THIS SOFTWARE. **/
/*****************************************************************************/
-
/***********************************************************************
*
* twm menus include file
*
- * 17-Nov-87 Thomas E. LaStrange File created
+ * 17-Nov-87 Thomas E. LaStrange File created
*
***********************************************************************/
#ifndef _MENUS_
#define _MENUS_
-#define TWM_ROOT "bLoB_GoOp" /* my private root menu */
-#define TWM_WINDOWS "TwmWindows" /* for f.menu "TwmWindows" */
-
-#define MAX_FILE_SIZE 4096 /* max chars to read from file for cut */
-
-typedef struct MenuItem
-{
- struct MenuItem *next; /* next menu item */
- struct MenuItem *prev; /* prev menu item */
- struct MenuRoot *sub; /* MenuRoot of a pull right menu */
- struct MenuRoot *root; /* back pointer to my MenuRoot */
- const char *item; /* the character string displayed */
- const char *action; /* action to be performed */
- Pixel fore; /* foreground color */
- Pixel back; /* background color */
- Pixel hi_fore; /* highlight foreground */
- Pixel hi_back; /* highlight background */
- short item_num; /* item number of this menu */
- short x; /* x coordinate for text */
- short func; /* twm built in function */
- short state; /* video state, 0 = normal, 1 = reversed */
- short strlen; /* strlen(item) */
- short user_colors; /* colors were specified */
+#define TWM_ROOT "bLoB_GoOp" /* my private root menu */
+#define TWM_WINDOWS "TwmWindows" /* for f.menu "TwmWindows" */
+
+#define MAX_FILE_SIZE 4096 /* max chars to read from file for cut */
+
+typedef struct MenuItem {
+ struct MenuItem *next; /* next menu item */
+ struct MenuItem *prev; /* prev menu item */
+ struct MenuRoot *sub; /* MenuRoot of a pull right menu */
+ struct MenuRoot *root; /* back pointer to my MenuRoot */
+ const char *item; /* the character string displayed */
+ const char *action; /* action to be performed */
+ Pixel fore; /* foreground color */
+ Pixel back; /* background color */
+ Pixel hi_fore; /* highlight foreground */
+ Pixel hi_back; /* highlight background */
+ short item_num; /* item number of this menu */
+ short x; /* x coordinate for text */
+ short func; /* twm built in function */
+ short state; /* video state, 0 = normal, 1 = reversed */
+ short strlen; /* strlen(item) */
+ short user_colors; /* colors were specified */
} MenuItem;
-typedef struct MenuRoot
-{
- struct MenuItem *first; /* first item in menu */
- struct MenuItem *last; /* last item in menu */
- struct MenuRoot *prev; /* previous root menu if pull right */
- struct MenuRoot *next; /* next in list of root menus */
- const char *name; /* name of root */
- Window w; /* the window of the menu */
- Window shadow; /* the shadow window */
- Pixel hi_fore; /* highlight foreground */
- Pixel hi_back; /* highlight background */
- short mapped; /* NEVER_MAPPED, UNMAPPED, or MAPPED */
- short height; /* height of the menu */
- short width; /* width of the menu */
- short items; /* number of items in the menu */
- short pull; /* is there a pull right entry ? */
- short entered; /* EnterNotify following pop up */
- short real_menu; /* this is a real menu */
+typedef struct MenuRoot {
+ struct MenuItem *first; /* first item in menu */
+ struct MenuItem *last; /* last item in menu */
+ struct MenuRoot *prev; /* previous root menu if pull right */
+ struct MenuRoot *next; /* next in list of root menus */
+ const char *name; /* name of root */
+ Window w; /* the window of the menu */
+ Window shadow; /* the shadow window */
+ Pixel hi_fore; /* highlight foreground */
+ Pixel hi_back; /* highlight background */
+ short mapped; /* NEVER_MAPPED, UNMAPPED, or MAPPED */
+ short height; /* height of the menu */
+ short width; /* width of the menu */
+ short items; /* number of items in the menu */
+ short pull; /* is there a pull right entry ? */
+ short entered; /* EnterNotify following pop up */
+ short real_menu; /* this is a real menu */
} MenuRoot;
-#define NEVER_MAPPED 0 /* constants for mapped field of MenuRoot */
-#define UNMAPPED 1
-#define MAPPED 2
-
+#define NEVER_MAPPED 0 /* constants for mapped field of MenuRoot */
+#define UNMAPPED 1
+#define MAPPED 2
-typedef struct MouseButton
-{
- int func; /* the function number */
- int mask; /* modifier mask */
- MenuRoot *menu; /* menu if func is F_MENU */
- MenuItem *item; /* action to perform if func != F_MENU */
+typedef struct MouseButton {
+ int func; /* the function number */
+ int mask; /* modifier mask */
+ MenuRoot *menu; /* menu if func is F_MENU */
+ MenuItem *item; /* action to perform if func != F_MENU */
} MouseButton;
-typedef struct FuncKey
-{
- struct FuncKey *next; /* next in the list of function keys */
- char *name; /* key name */
- KeySym keysym; /* X keysym */
- KeyCode keycode; /* X keycode */
- int cont; /* context */
- int mods; /* modifiers */
- int func; /* function to perform */
- char *win_name; /* window name (if any) */
- char *action; /* action string (if any) */
+typedef struct FuncKey {
+ struct FuncKey *next; /* next in the list of function keys */
+ char *name; /* key name */
+ KeySym keysym; /* X keysym */
+ KeyCode keycode; /* X keycode */
+ int cont; /* context */
+ int mods; /* modifiers */
+ int func; /* function to perform */
+ char *win_name; /* window name (if any) */
+ char *action; /* action string (if any) */
} FuncKey;
extern int RootFunction;
@@ -149,12 +143,12 @@ extern int menuFromFrameOrWindowOrTitlebar;
extern int ResizeOrigX;
extern int ResizeOrigY;
-#define MAXMENUDEPTH 10 /* max number of nested menus */
+#define MAXMENUDEPTH 10 /* max number of nested menus */
extern int MenuDepth;
-#define MOVE_NONE 0 /* modes of constrained move */
-#define MOVE_VERT 1
-#define MOVE_HORIZ 2
+#define MOVE_NONE 0 /* modes of constrained move */
+#define MOVE_VERT 1
+#define MOVE_HORIZ 2
#define WARPSCREEN_NEXT "next"
#define WARPSCREEN_PREV "prev"
@@ -164,29 +158,35 @@ extern int MenuDepth;
#define COLORMAP_PREV "prev"
#define COLORMAP_DEFAULT "default"
-extern void InitMenus ( void );
-extern Bool AddFuncKey ( char *name, int cont, int mods, int func, char *win_name, char *action );
-extern int CreateTitleButton ( const char *name, int func, const char *action, MenuRoot *menuroot, Bool rightside, Bool append );
-extern void InitTitlebarButtons ( void );
-extern void PaintEntry ( MenuRoot *mr, MenuItem *mi, int exposure );
-extern void PaintMenu ( MenuRoot *mr, XEvent *e );
-extern void UpdateMenu ( void );
-extern MenuRoot * NewMenuRoot ( const char *name );
-extern MenuItem * AddToMenu ( MenuRoot *menu, const char *item, const char *action, MenuRoot *sub, int func, const char *fore, const char *back );
-extern void MakeMenus ( void );
-extern Bool PopUpMenu ( MenuRoot *menu, int x, int y, Bool center );
-extern void PopDownMenu ( void );
-extern MenuRoot * FindMenuRoot ( const char *name );
-extern int ExecuteFunction ( int func, const char *action, Window w, TwmWindow *tmp_win, XEvent *eventp, int context, int pulldown );
-extern void ReGrab ( void );
-extern void FocusOnRoot ( void );
-extern void DeIconify ( TwmWindow *tmp_win );
-extern void Iconify ( TwmWindow *tmp_win, int def_x, int def_y );
-extern void SetMapStateProp ( TwmWindow *tmp_win, int state );
-extern void WarpToScreen ( int n, int inc );
-extern void SetBorder ( TwmWindow *tmp, Bool onoroff );
-extern void SendDeleteWindowMessage ( TwmWindow *tmp, Time timestamp );
-extern void SendSaveYourselfMessage ( TwmWindow *tmp, Time timestamp );
-extern void SendTakeFocusMessage ( TwmWindow *tmp, Time timestamp );
-
-#endif /* _MENUS_ */
+extern void InitMenus(void);
+extern Bool AddFuncKey(char *name, int cont, int mods, int func, char *win_name,
+ char *action);
+extern int CreateTitleButton(const char *name, int func, const char *action,
+ MenuRoot *menuroot, Bool rightside, Bool append);
+extern void InitTitlebarButtons(void);
+extern void PaintEntry(MenuRoot *mr, MenuItem *mi, int exposure);
+extern void PaintMenu(MenuRoot *mr, XEvent *e);
+extern void UpdateMenu(void);
+extern MenuRoot *NewMenuRoot(const char *name);
+extern MenuItem *AddToMenu(MenuRoot *menu, const char *item, const char *action,
+ MenuRoot *sub, int func, const char *fore,
+ const char *back);
+extern void MakeMenus(void);
+extern Bool PopUpMenu(MenuRoot *menu, int x, int y, Bool center);
+extern void PopDownMenu(void);
+extern MenuRoot *FindMenuRoot(const char *name);
+extern int ExecuteFunction(int func, const char *action, Window w,
+ TwmWindow *tmp_win, XEvent *eventp, int context,
+ int pulldown);
+extern void ReGrab(void);
+extern void FocusOnRoot(void);
+extern void DeIconify(TwmWindow *tmp_win);
+extern void Iconify(TwmWindow *tmp_win, int def_x, int def_y);
+extern void SetMapStateProp(TwmWindow *tmp_win, int state);
+extern void WarpToScreen(int n, int inc);
+extern void SetBorder(TwmWindow *tmp, Bool onoroff);
+extern void SendDeleteWindowMessage(TwmWindow *tmp, Time timestamp);
+extern void SendSaveYourselfMessage(TwmWindow *tmp, Time timestamp);
+extern void SendTakeFocusMessage(TwmWindow *tmp, Time timestamp);
+
+#endif /* _MENUS_ */