X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fmenu.c;h=caf3887b69ffff432ab9d97aba7e2ce25f2653ee;hb=10232a436a7286ae35afaa57cefbb9dc41610572;hp=3143c91119a7ba2bb7bc0d7b0668a9b40da88545;hpb=71d2605e1c24732e923333419d829f1c5f867fed;p=chaz%2Fopenbox diff --git a/openbox/menu.c b/openbox/menu.c index 3143c911..caf3887b 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -39,7 +39,7 @@ void menu_destroy_hash_value(Menu *self) stacking_remove(self); - appearance_free(self->a_title); + RrAppearanceFree(self->a_title); XDestroyWindow(ob_display, self->title); XDestroyWindow(ob_display, self->frame); XDestroyWindow(ob_display, self->items); @@ -54,9 +54,9 @@ void menu_entry_free(MenuEntry *self) g_hash_table_remove(window_map, &self->item); - appearance_free(self->a_item); - appearance_free(self->a_disabled); - appearance_free(self->a_hilite); + RrAppearanceFree(self->a_item); + RrAppearanceFree(self->a_disabled); + RrAppearanceFree(self->a_hilite); XDestroyWindow(ob_display, self->item); g_free(self); @@ -65,8 +65,10 @@ void menu_entry_free(MenuEntry *self) void menu_startup() { Menu *m; +/* Menu *s; Menu *t; +*/ Action *a; menu_hash = g_hash_table_new_full(g_str_hash, g_str_equal, @@ -125,8 +127,8 @@ static Window createWindow(Window parent, unsigned long mask, XSetWindowAttributes *attrib) { return XCreateWindow(ob_display, parent, 0, 0, 1, 1, 0, - render_depth, InputOutput, render_visual, - mask, attrib); + RrDepth(ob_rr_inst), InputOutput, + RrVisual(ob_rr_inst), mask, attrib); } @@ -164,17 +166,17 @@ Menu *menu_new_full(char *label, char *name, Menu *parent, self->title = createWindow(self->frame, CWEventMask, &attrib); self->items = createWindow(self->frame, 0, &attrib); - XSetWindowBorderWidth(ob_display, self->frame, theme_bwidth); - XSetWindowBackground(ob_display, self->frame, theme_b_color->pixel); - XSetWindowBorderWidth(ob_display, self->title, theme_bwidth); - XSetWindowBorder(ob_display, self->frame, theme_b_color->pixel); - XSetWindowBorder(ob_display, self->title, theme_b_color->pixel); + XSetWindowBorderWidth(ob_display, self->frame, ob_rr_theme->bwidth); + XSetWindowBackground(ob_display, self->frame, ob_rr_theme->b_color->pixel); + XSetWindowBorderWidth(ob_display, self->title, ob_rr_theme->bwidth); + XSetWindowBorder(ob_display, self->frame, ob_rr_theme->b_color->pixel); + XSetWindowBorder(ob_display, self->title, ob_rr_theme->b_color->pixel); XMapWindow(ob_display, self->title); XMapWindow(ob_display, self->items); - self->a_title = appearance_copy(theme_a_menu_title); - self->a_items = appearance_copy(theme_a_menu); + self->a_title = RrAppearanceCopy(ob_rr_theme->a_menu_title); + self->a_items = RrAppearanceCopy(ob_rr_theme->a_menu); g_hash_table_insert(window_map, &self->frame, self); g_hash_table_insert(window_map, &self->title, self); @@ -234,9 +236,9 @@ void menu_add_entry(Menu *menu, MenuEntry *entry) attrib.event_mask = ENTRY_EVENTMASK; entry->item = createWindow(menu->items, CWEventMask, &attrib); XMapWindow(ob_display, entry->item); - entry->a_item = appearance_copy(theme_a_menu_item); - entry->a_disabled = appearance_copy(theme_a_menu_disabled); - entry->a_hilite = appearance_copy(theme_a_menu_hilite); + entry->a_item = RrAppearanceCopy(ob_rr_theme->a_menu_item); + entry->a_disabled = RrAppearanceCopy(ob_rr_theme->a_menu_disabled); + entry->a_hilite = RrAppearanceCopy(ob_rr_theme->a_menu_hilite); menu->invalid = TRUE; @@ -272,7 +274,6 @@ void menu_show_full(Menu *self, int x, int y, Client *client) } } - void menu_hide(Menu *self) { if (self->shown) { XUnmapWindow(ob_display, self->frame); @@ -364,14 +365,14 @@ void menu_control_mouseover(MenuEntry *self, gboolean enter) { /* TODO: I don't understand why these bevels should be here. Something must be wrong in the width calculation */ x = self->parent->location.x + self->parent->size.width + - theme_bevel; + ob_rr_theme->bevel; /* need to get the width. is this bad?*/ menu_render(self->submenu); if (self->submenu->size.width + x > screen_physical_size.width) x = self->parent->location.x - self->submenu->size.width - - theme_bevel; + ob_rr_theme->bevel; menu_show_full(self->submenu, x, self->parent->location.y + self->y,