1 #ifndef ob__menuframe_h
2 #define ob__menuframe_h
6 #include "render/render.h"
14 typedef struct _ObMenuFrame ObMenuFrame
;
15 typedef struct _ObMenuEntryFrame ObMenuEntryFrame
;
17 extern GList
*menu_frame_visible
;
21 /* stuff to be an ObWindow */
22 Window_InternalType type
;
27 /* The client that the visual instance of the menu is associated with for
29 struct _ObClient
*client
;
35 ObMenuEntryFrame
*selected
;
37 /* If a titlebar is displayed for the menu or not (for top-level menus) */
40 /* On-screen area (including borders!) */
42 gint inner_w
; /* inside the borders */
43 gint title_h
; /* includes the bwidth below it */
44 gint item_h
; /* height of all normal items */
45 gint text_x
; /* offset at which the text appears in the items */
46 gint text_w
; /* width of the text area in the items */
51 RrAppearance
*a_title
;
52 RrAppearance
*a_items
;
55 struct _ObMenuEntryFrame
57 struct _ObMenuEntry
*entry
;
67 RrAppearance
*a_normal
;
68 RrAppearance
*a_disabled
;
69 RrAppearance
*a_selected
;
73 RrAppearance
*a_bullet_normal
;
74 RrAppearance
*a_bullet_selected
;
75 RrAppearance
*a_separator
;
76 RrAppearance
*a_text_normal
;
77 RrAppearance
*a_text_disabled
;
78 RrAppearance
*a_text_selected
;
81 ObMenuFrame
* menu_frame_new(struct _ObMenu
*menu
, struct _ObClient
*client
);
82 void menu_frame_free(ObMenuFrame
*self
);
84 void menu_frame_move(ObMenuFrame
*self
, gint x
, gint y
);
85 void menu_frame_move_on_screen(ObMenuFrame
*self
);
87 void menu_frame_show(ObMenuFrame
*self
, ObMenuFrame
*parent
);
88 void menu_frame_hide(ObMenuFrame
*self
);
90 void menu_frame_hide_all();
91 void menu_frame_hide_all_client(struct _ObClient
*client
);
93 void menu_frame_select(ObMenuFrame
*self
, ObMenuEntryFrame
*entry
);
94 void menu_frame_select_previous(ObMenuFrame
*self
);
95 void menu_frame_select_next(ObMenuFrame
*self
);
97 ObMenuFrame
* menu_frame_under(gint x
, gint y
);
98 ObMenuEntryFrame
* menu_entry_frame_under(gint x
, gint y
);
100 void menu_entry_frame_show_submenu(ObMenuEntryFrame
*self
);
102 void menu_entry_frame_execute(ObMenuEntryFrame
*self
, gboolean hide
);