Appearance *ob_a_focused_handle;
Appearance *ob_a_unfocused_handle;
+Appearance *ob_app_hilite_label;
+Appearance *ob_app_unhilite_label;
+
static void layout_title(ObFrame *self);
static void mouse_event(const ObEvent *e, ObFrame *self);
ob_a_icon = appearance_new(Surface_Planar, 1);
ob_a_focused_handle = appearance_new(Surface_Planar, 0);
ob_a_unfocused_handle = appearance_new(Surface_Planar, 0);
+ ob_app_hilite_label = appearance_new(Surface_Planar, 1);
+ ob_app_unhilite_label = appearance_new(Surface_Planar, 1);
if (obtheme_load()) {
RECT_SET(ob_a_focused_pressed_desk->area, 0, 0,
appearance_free(ob_a_icon);
appearance_free(ob_a_focused_handle);
appearance_free(ob_a_unfocused_handle);
+ appearance_free(ob_app_hilite_label);
+ appearance_free(ob_app_unhilite_label);
}
static Window createWindow(Window parent, unsigned long mask,
extern Appearance *ob_a_focused_handle;
extern Appearance *ob_a_unfocused_handle;
+extern Appearance *ob_app_hilite_label;
+extern Appearance *ob_app_unhilite_label;
+
typedef struct ObFrame {
Frame frame;
RECT_SET(a->texture[0].position, 0, 0, BUTTON_SIZE,BUTTON_SIZE);
paint(self->close, a);
}
+
+void render_label(Window win, Rect *area, char *text,
+ gboolean hilight, gboolean toplevel)
+{
+ Appearance *a;
+
+ a = hilight ? ob_app_hilite_label : ob_app_unhilite_label;
+ a->texture[0].data.text.string = text;
+ RECT_SET(a->area, 0, 0, area->width, area->height);
+ a->texture[0].position = a->area;
+
+ if (toplevel) {
+ XSetWindowBorderWidth(ob_display, win, ob_s_bwidth);
+ XSetWindowBorder(ob_display, win, ob_s_b_color->pixel);
+ }
+
+ paint(win, a);
+}
+
+void size_label(char *text, gboolean hilight, gboolean toplevel, Size *s)
+{
+ Appearance *a;
+
+ a = hilight ? ob_app_hilite_label : ob_app_unhilite_label;
+ a->texture[0].data.text.string = text;
+
+ appearance_minsize(a, s);
+ s->width += ob_s_bevel * 2;
+ s->height += ob_s_bevel * 2;
+}
ob_s_close_mask = pixmap_mask_new(7, 7, data);
}
+ /* read the decoration textures */
if (!read_appearance(db, "window.title.focus", ob_a_focused_title))
set_default_appearance(ob_a_focused_title);
if (!read_appearance(db, "window.title.unfocus", ob_a_unfocused_title))
if (!read_appearance(db, "window.grip.unfocus", ob_a_unfocused_grip))
set_default_appearance(ob_a_unfocused_grip);
+ /* read the appearances for rendering non-decorations. these cannot be
+ parent-relative */
+ if (ob_a_focused_label->surface.data.planar.grad !=
+ Background_ParentRelative) {
+ if (!read_appearance(db, "window.label.focus", ob_app_hilite_label))
+ set_default_appearance(ob_app_hilite_label);
+ } else {
+ if (!read_appearance(db, "window.title.focus", ob_app_hilite_label))
+ set_default_appearance(ob_app_hilite_label);
+ }
+ if (ob_a_unfocused_label->surface.data.planar.grad !=
+ Background_ParentRelative) {
+ if (!read_appearance(db, "window.label.unfocus",ob_app_unhilite_label))
+ set_default_appearance(ob_app_unhilite_label);
+ } else {
+ if (!read_appearance(db, "window.title.unfocus",ob_app_unhilite_label))
+ set_default_appearance(ob_app_unhilite_label);
+ }
+
+ /* read buttons textures */
if (!read_appearance(db, "window.button.pressed.focus",
ob_a_focused_pressed_max))
if (!read_appearance(db, "window.button.pressed",
ob_a_focused_label->texture[0].data.text.offset = engine_shadow_offset;
ob_a_focused_label->texture[0].data.text.tint = engine_shadow_tint;
ob_a_focused_label->texture[0].data.text.color = ob_s_title_focused_color;
+ ob_app_hilite_label->texture[0].type = Text;
+ ob_app_hilite_label->texture[0].data.text.justify = winjust;
+ ob_app_hilite_label->texture[0].data.text.font = ob_s_winfont;
+ ob_app_hilite_label->texture[0].data.text.shadow = engine_shadow;
+ ob_app_hilite_label->texture[0].data.text.offset = engine_shadow_offset;
+ ob_app_hilite_label->texture[0].data.text.tint = engine_shadow_tint;
+ ob_app_hilite_label->texture[0].data.text.color = ob_s_title_focused_color;
ob_a_unfocused_label->texture[0].type = Text;
ob_a_unfocused_label->texture[0].data.text.justify = winjust;
ob_a_unfocused_label->texture[0].data.text.tint = engine_shadow_tint;
ob_a_unfocused_label->texture[0].data.text.color =
ob_s_title_unfocused_color;
+ ob_app_unhilite_label->texture[0].type = Text;
+ ob_app_unhilite_label->texture[0].data.text.justify = winjust;
+ ob_app_unhilite_label->texture[0].data.text.font = ob_s_winfont;
+ ob_app_unhilite_label->texture[0].data.text.shadow = engine_shadow;
+ ob_app_unhilite_label->texture[0].data.text.offset = engine_shadow_offset;
+ ob_app_unhilite_label->texture[0].data.text.tint = engine_shadow_tint;
+ ob_app_unhilite_label->texture[0].data.text.color =
+ ob_s_title_unfocused_color;
ob_a_focused_unpressed_max->texture[0].type =
ob_a_focused_pressed_max->texture[0].type =
int engine_shadow_offset;
int engine_shadow_tint;
+EngineFrameNew *engine_frame_new;
+EngineFrameGrabClient *engine_frame_grab_client;
+EngineFrameReleaseClient *engine_frame_release_client;
+EngineFrameAdjustArea *engine_frame_adjust_area;
+EngineFrameAdjustShape *engine_frame_adjust_shape;
+EngineFrameAdjustState *engine_frame_adjust_state;
+EngineFrameAdjustFocus *engine_frame_adjust_focus;
+EngineFrameAdjustTitle *engine_frame_adjust_title;
+EngineFrameAdjustIcon *engine_frame_adjust_icon;
+EngineFrameShow *engine_frame_show;
+EngineFrameHide *engine_frame_hide;
+EngineGetContext *engine_get_context;
+EngineRenderLabel *engine_render_label;
+EngineSizeLabel *engine_size_label;
+
static GModule *module = NULL;
static EngineStartup *estartup = NULL;
static EngineShutdown *eshutdown = NULL;
LOADSYM(frame_show, engine_frame_show);
LOADSYM(frame_hide, engine_frame_hide);
LOADSYM(get_context, engine_get_context);
+ LOADSYM(render_label, engine_render_label);
+ LOADSYM(size_label, engine_size_label);
if (!estartup())
return FALSE;
void engine_load();
void engine_shutdown();
-EngineFrameNew *engine_frame_new;
+extern EngineFrameNew *engine_frame_new;
-EngineFrameGrabClient *engine_frame_grab_client;
-EngineFrameReleaseClient *engine_frame_release_client;
+extern EngineFrameGrabClient *engine_frame_grab_client;
+extern EngineFrameReleaseClient *engine_frame_release_client;
-EngineFrameAdjustArea *engine_frame_adjust_area;
-EngineFrameAdjustShape *engine_frame_adjust_shape;
-EngineFrameAdjustState *engine_frame_adjust_state;
-EngineFrameAdjustFocus *engine_frame_adjust_focus;
-EngineFrameAdjustTitle *engine_frame_adjust_title;
-EngineFrameAdjustIcon *engine_frame_adjust_icon;
+extern EngineFrameAdjustArea *engine_frame_adjust_area;
+extern EngineFrameAdjustShape *engine_frame_adjust_shape;
+extern EngineFrameAdjustState *engine_frame_adjust_state;
+extern EngineFrameAdjustFocus *engine_frame_adjust_focus;
+extern EngineFrameAdjustTitle *engine_frame_adjust_title;
+extern EngineFrameAdjustIcon *engine_frame_adjust_icon;
-EngineFrameShow *engine_frame_show;
-EngineFrameHide *engine_frame_hide;
+extern EngineFrameShow *engine_frame_show;
+extern EngineFrameHide *engine_frame_hide;
-EngineGetContext *engine_get_context;
+extern EngineGetContext *engine_get_context;
+
+extern EngineRenderLabel *engine_render_label;
+extern EngineSizeLabel *engine_size_label;
#endif