* detect and disallow circular transient-for hints
[fvwm.git] / fvwm / menuparameters.h
blob4b08738f75b37f7b3be6cbfd1d3f71c955ce6ff7
1 /* -*-c-*- */
3 #ifndef MENU_PARAMETERS_H
4 #define MENU_PARAMETERS_H
6 /* ---------------------------- included header files ---------------------- */
8 /* Do not #include any files - the file including this file has to take care of
9 * it. */
11 /* ---------------------------- forward declarations ----------------------- */
13 struct MenuRoot;
14 struct MenuParameters;
15 struct MenuReturn;
16 struct MenuItem;
17 struct FvwmWindow;
19 /* ---------------------------- type definitions --------------------------- */
21 /* Return values for UpdateMenu, do_menu, menuShortcuts. This is a lame
22 * hack, in that "_BUTTON" is added to mean a button-release caused the
23 * return-- the macros below help deal with the ugliness. */
24 typedef enum MenuRC
26 MENU_ERROR = -1,
27 MENU_NOP = 0,
28 MENU_DONE,
29 MENU_ABORTED,
30 MENU_SUBMENU_DONE,
31 MENU_DOUBLE_CLICKED,
32 MENU_POPUP,
33 MENU_POPDOWN,
34 MENU_SELECTED,
35 MENU_NEWITEM,
36 MENU_NEWITEM_MOVEMENU,
37 MENU_NEWITEM_FIND,
38 MENU_POST,
39 MENU_UNPOST,
40 MENU_TEAR_OFF,
41 MENU_SUBMENU_TORN_OFF,
42 MENU_KILL_TEAR_OFF_MENU,
43 /* propagate the event to a different menu */
44 MENU_PROPAGATE_EVENT
45 } MenuRC;
47 typedef struct MenuReturn
49 MenuRC rc;
50 struct MenuRoot *target_menu;
51 struct
53 unsigned do_unpost_submenu : 1;
54 unsigned is_first_item_selected : 1;
55 unsigned is_key_press : 1;
56 unsigned is_menu_posted : 1;
57 } flags;
58 } MenuReturn;
60 typedef struct MenuPosHints
62 /* suggested x/y position */
63 int x;
64 int y;
65 /* additional offset to x */
66 int x_offset;
67 /* width of the parent menu or item */
68 int menu_width;
69 /* to take menu width into account (0, -1 or -0.5) */
70 float x_factor;
71 /* additional offset factor to x */
72 float context_x_factor;
73 /* same with height */
74 float y_factor;
75 int screen_origin_x;
76 int screen_origin_y;
77 /* False if referring to absolute screen position */
78 Bool is_relative;
79 /* True if referring to a part of a menu */
80 Bool is_menu_relative;
81 Bool has_screen_origin;
82 } MenuPosHints;
84 typedef struct MenuOptions
86 struct MenuPosHints pos_hints;
87 /* A position on the Xinerama screen on which the menu should be
88 * started. */
89 struct
91 unsigned do_not_warp : 1;
92 unsigned do_warp_on_select : 1;
93 unsigned do_warp_title : 1;
94 unsigned do_select_in_place : 1;
95 unsigned do_tear_off_immediately : 1;
96 unsigned has_poshints : 1;
97 unsigned is_fixed : 1;
98 } flags;
99 } MenuOptions;
101 typedef struct MenuParameters
103 struct MenuRoot *menu;
104 struct MenuRoot *parent_menu;
105 struct MenuItem *parent_item;
106 const exec_context_t **pexc;
107 struct FvwmWindow *tear_off_root_menu_window;
108 char **ret_paction;
109 XEvent *event_propagate_to_submenu;
110 struct MenuOptions *pops;
111 /* A position on the Xinerama screen on which the menu should be
112 * started. */
113 int screen_origin_x;
114 int screen_origin_y;
115 struct
117 unsigned has_default_action : 1;
118 unsigned is_already_mapped : 1;
119 unsigned is_first_root_menu : 1;
120 unsigned is_invoked_by_key_press : 1;
121 unsigned is_sticky : 1;
122 unsigned is_submenu : 1;
123 unsigned is_triggered_by_keypress : 1;
124 } flags;
125 } MenuParameters;
127 typedef struct MenuRepaintTransparentParameters
129 struct MenuRoot *mr;
130 struct FvwmWindow *fw;
131 } MenuRepaintTransparentParameters;
133 #endif /* MENU_PARAMETERS_H */