From: Derek Foreman Date: Sun, 25 May 2003 22:50:50 +0000 (+0000) Subject: everything compiles. everything is broken. X-Git-Tag: gl~2 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=c2464dc2e3f7da758f5df40fa5e654447fbae8e9;p=dana%2Fopenbox.git everything compiles. everything is broken. rendertest works, yay. --- diff --git a/openbox/dock.c b/openbox/dock.c index 934d3d03..aaae5b6e 100644 --- a/openbox/dock.c +++ b/openbox/dock.c @@ -32,7 +32,6 @@ void dock_startup() CWOverrideRedirect | CWEventMask, &attrib); dock->a_frame = appearance_copy(theme_a_unfocused_title); - XSetWindowBorder(ob_display, dock->frame, theme_b_color->pixel); XSetWindowBorderWidth(ob_display, dock->frame, theme_bwidth); g_hash_table_insert(window_map, &dock->frame, dock); diff --git a/openbox/frame.c b/openbox/frame.c index 211a275c..4076db83 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -133,10 +133,6 @@ Frame *frame_new() XMapWindow(ob_display, self->label); /* set colors/appearance/sizes for stuff that doesn't change */ - XSetWindowBorder(ob_display, self->window, theme_b_color->pixel); - XSetWindowBorder(ob_display, self->label, theme_b_color->pixel); - XSetWindowBorder(ob_display, self->rgrip, theme_b_color->pixel); - XSetWindowBorder(ob_display, self->lgrip, theme_b_color->pixel); XResizeWindow(ob_display, self->max, theme_button_size, theme_button_size); XResizeWindow(ob_display, self->iconify, diff --git a/openbox/framerender.c b/openbox/framerender.c index 737dfe95..7033c441 100644 --- a/openbox/framerender.c +++ b/openbox/framerender.c @@ -14,13 +14,6 @@ static void framerender_close(Frame *self, Appearance *a); void framerender_frame(Frame *self) { - if (self->focused) - XSetWindowBorder(ob_display, self->plate, - theme_cb_focused_color->pixel); - else - XSetWindowBorder(ob_display, self->plate, - theme_cb_unfocused_color->pixel); - if (self->client->decorations & Decor_Titlebar) { Appearance *t, *l, *m, *n, *i, *d, *s, *c; diff --git a/openbox/menu.c b/openbox/menu.c index 2af1a01f..b67f92c3 100644 --- a/openbox/menu.c +++ b/openbox/menu.c @@ -163,13 +163,13 @@ Menu *menu_new_full(char *label, char *name, Menu *parent, attrib.event_mask = TITLE_EVENTMASK; 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); - +*/ XMapWindow(ob_display, self->title); XMapWindow(ob_display, self->items); diff --git a/openbox/popup.c b/openbox/popup.c index efde0758..6f2cd240 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -99,10 +99,10 @@ void popup_show(Popup *self, char *text, Icon *icon) self->bg = XCreateWindow(ob_display, ob_root, 0, 0, 1, 1, 0, render_depth, InputOutput, render_visual, CWOverrideRedirect, &attrib); - +/* XSetWindowBorderWidth(ob_display, self->bg, theme_bwidth); XSetWindowBorder(ob_display, self->bg, theme_b_color->pixel); - +*/ self->text = XCreateWindow(ob_display, self->bg, 0, 0, 1, 1, 0, render_depth, InputOutput, render_visual, 0, NULL); diff --git a/openbox/screen.c b/openbox/screen.c index a1ad36e0..c65c23cd 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -482,9 +482,11 @@ void screen_install_colormap(Client *client, gboolean install) if (client == NULL) { if (install) - XInstallColormap(ob_display, render_colormap); + XInstallColormap(ob_display, + DefaultColormap(ob_display, ob_screen)); else - XUninstallColormap(ob_display, render_colormap); + XUninstallColormap(ob_display, + DefaultColormap(ob_display, ob_screen)); } else { if (XGetWindowAttributes(ob_display, client->window, &wa) && wa.colormap != None) { diff --git a/render/color.c b/render/color.c index ca1f6e89..59c528d6 100644 --- a/render/color.c +++ b/render/color.c @@ -5,19 +5,7 @@ #include "color.h" #include "../kernel/openbox.h" -XColor *pseudo_colors; -int pseudo_bpc; - -void color_allocate_gc(color_rgb *in) -{ - XGCValues gcv; - - gcv.foreground = in->pixel; - gcv.cap_style = CapProjecting; - in->gc = XCreateGC(ob_display, ob_root, GCForeground | GCCapStyle, &gcv); -} - -color_rgb *color_parse(char *colorname) +gboolean color_parse(char *colorname, struct RrRGB *ret) { XColor xcol; @@ -28,42 +16,19 @@ color_rgb *color_parse(char *colorname) xcol.green = 0; xcol.blue = 0; xcol.pixel = 0; - if (!XParseColor(ob_display, render_colormap, colorname, &xcol)) { + if (!XParseColor(ob_display, + DefaultColormap(ob_display, ob_screen), + colorname, &xcol)) { g_warning("unable to parse color '%s'", colorname); - return NULL; - } - return color_new(xcol.red >> 8, xcol.green >> 8, xcol.blue >> 8); -} - -color_rgb *color_new(int r, int g, int b) -{ -/* this should be replaced with something far cooler */ - color_rgb *out; - XColor xcol; - xcol.red = (r << 8) | r; - xcol.green = (g << 8) | g; - xcol.blue = (b << 8) | b; - if (XAllocColor(ob_display, render_colormap, &xcol)) { - out = g_new(color_rgb, 1); - out->r = xcol.red >> 8; - out->g = xcol.green >> 8; - out->b = xcol.blue >> 8; - out->gc = None; - out->pixel = xcol.pixel; - return out; - } - return NULL; -} - -/*XXX same color could be pointed to twice, this might have to be a refcount*/ - -void color_free(color_rgb *c) -{ - if (c != NULL) { - if (c->gc != None) - XFreeGC(ob_display, c->gc); - g_free(c); + ret->r = 0.0; + ret->g = 0.0; + ret->b = 0.0; + return FALSE; } + ret->r = (xcol.red >> 8)/255.0; + ret->g = (xcol.green >> 8)/255.0; + ret->b = (xcol.blue >> 8)/255.0; + return TRUE; } void reduce_depth(pixel32 *data, XImage *im) @@ -109,6 +74,7 @@ void reduce_depth(pixel32 *data, XImage *im) p16 += im->bytes_per_line/2; } break; +/* case 8: g_assert(render_visual->class != TrueColor); for (y = 0; y < im->height; y++) { @@ -116,25 +82,17 @@ void reduce_depth(pixel32 *data, XImage *im) p8[x] = pickColor(data[x] >> default_red_offset, data[x] >> default_green_offset, data[x] >> default_blue_offset)->pixel; + } + data += im->width; + p8 += im->bytes_per_line; } - data += im->width; - p8 += im->bytes_per_line; - } - +*/ break; default: g_message("your bit depth is currently unhandled\n"); } } -XColor *pickColor(int r, int g, int b) -{ - r = (r & 0xff) >> (8-pseudo_bpc); - g = (g & 0xff) >> (8-pseudo_bpc); - b = (b & 0xff) >> (8-pseudo_bpc); - return &pseudo_colors[(r << (2*pseudo_bpc)) + (g << (1*pseudo_bpc)) + b]; -} - static void swap_byte_order(XImage *im) { int x, y, di; @@ -177,7 +135,6 @@ void increase_depth(pixel32 *data, XImage *im) int x,y; pixel32 *p32 = (pixel32 *) im->data; pixel16 *p16 = (pixel16 *) im->data; - unsigned char *p8 = (unsigned char *)im->data; if (im->byte_order != render_endian) swap_byte_order(im); @@ -217,6 +174,7 @@ void increase_depth(pixel32 *data, XImage *im) } break; case 8: +#if 0 g_assert(render_visual->class != TrueColor); for (y = 0; y < im->height; y++) { for (x = 0; x < im->width; x++) { @@ -253,7 +211,7 @@ void increase_depth(pixel32 *data, XImage *im) data += im->width; p8 += im->bytes_per_line; } - +#endif break; default: g_message("your bit depth is currently unhandled\n"); diff --git a/render/color.h b/render/color.h index fb669fb5..3108d6f5 100644 --- a/render/color.h +++ b/render/color.h @@ -36,19 +36,13 @@ typedef u_int16_t pixel16; #endif /* G_BYTE_ORDER == G_BIG_ENDIAN */ -typedef struct color_rgb { - int r; - int g; - int b; - unsigned long pixel; - GC gc; -} color_rgb; +struct RrRGB { + float r,g,b; +}; -void color_allocate_gc(color_rgb *in); -XColor *pickColor(int r, int g, int b); -color_rgb *color_parse(char *colorname); -color_rgb *color_new(int r, int g, int b); -void color_free(color_rgb *in); +#define rr_color_set(col, x, y, z) (col).r = (x), (col).g = (y), (col).b = (z) + +gboolean color_parse(char *colorname, struct RrRGB *ret); void reduce_depth(pixel32 *data, XImage *im); void increase_depth(pixel32 *data, XImage *im); @@ -64,7 +58,4 @@ extern int render_red_mask; extern int render_green_mask; extern int render_blue_mask; -extern int pseudo_bpc; -#define pseudo_ncolors() (1 << (pseudo_bpc * 3)) -extern XColor *pseudo_colors; #endif /* __color_h */ diff --git a/render/gradient.c b/render/gradient.c index 8afa4b79..6165215e 100644 --- a/render/gradient.c +++ b/render/gradient.c @@ -11,14 +11,12 @@ void render_gl_gradient(Surface *sf, int x, int y, int w, int h) float sr, sg, sb; float ar, ag, ab; - pr = (float)sf->data.planar.primary->r/255.0; - pg = (float)sf->data.planar.primary->g/255.0; - pb = (float)sf->data.planar.primary->b/255.0; - if (sf->data.planar.secondary) { - sr = (float)sf->data.planar.secondary->r/255.0; - sg = (float)sf->data.planar.secondary->g/255.0; - sb = (float)sf->data.planar.secondary->b/255.0; - } + pr = sf->data.planar.primary.r; + pg = sf->data.planar.primary.g; + pb = sf->data.planar.primary.b; + sr = sf->data.planar.secondary.r; + sg = sf->data.planar.secondary.g; + sb = sf->data.planar.secondary.b; switch (sf->data.planar.grad) { case Background_Solid: /* already handled */ glBegin(GL_TRIANGLES); diff --git a/render/mask.c b/render/mask.c index 22cb3fee..9eb6eec2 100644 --- a/render/mask.c +++ b/render/mask.c @@ -25,24 +25,6 @@ void mask_draw(Pixmap p, TextureMask *m, Rect *position) { int x, y; if (m->mask == None) return; /* no mask given */ - - /* set the clip region */ - x = position->x + (position->width - m->mask->w) / 2; - y = position->y + (position->height - m->mask->h) / 2; - - if (x < 0) x = 0; - if (y < 0) y = 0; - - XSetClipMask(ob_display, m->color->gc, m->mask->mask); - XSetClipOrigin(ob_display, m->color->gc, x, y); - - /* fill in the clipped region */ - XFillRectangle(ob_display, p, m->color->gc, x, y, - x + m->mask->w, y + m->mask->h); - - /* unset the clip region */ - XSetClipMask(ob_display, m->color->gc, None); - XSetClipOrigin(ob_display, m->color->gc, 0, 0); } pixmap_mask *pixmap_mask_copy(pixmap_mask *src) diff --git a/render/render.c b/render/render.c index 7dfbaee0..bbfd3fd1 100644 --- a/render/render.c +++ b/render/render.c @@ -14,12 +14,12 @@ #ifdef HAVE_STDLIB_H # include #endif +#include int render_depth; XVisualInfo render_visual_info; Visual *render_visual; -Colormap render_colormap; int render_red_offset = 0, render_green_offset = 0, render_blue_offset = 0; int render_red_shift, render_green_shift, render_blue_shift; @@ -30,10 +30,8 @@ GLXContext render_glx_context; int render_glx_rating(XVisualInfo *v) { - int er; int rating = 0; int val; - printf("evaluating visual %d\n", v->visualid); glXGetConfig(ob_display, v, GLX_BUFFER_SIZE, &val); printf("buffer size %d\n", val); @@ -84,7 +82,6 @@ void render_startup(void) render_depth = DefaultDepth(ob_display, ob_screen); render_visual = DefaultVisual(ob_display, ob_screen); - render_colormap = DefaultColormap(ob_display, ob_screen); vimatch.screen = ob_screen; vimatch.class = TrueColor; @@ -108,8 +105,6 @@ void render_startup(void) printf("picked visual %d with rating %d\n", best, rate); render_depth = vilist[best].depth; render_visual = vilist[best].visual; - render_colormap = XCreateColormap(ob_display, ob_root, - render_visual, AllocNone); render_visual_info = vilist[best]; render_glx_context = glXCreateContext(ob_display, &render_visual_info, NULL, True); @@ -166,7 +161,6 @@ void render_shutdown(void) Appearance *appearance_new(SurfaceType type, int numtex) { - PlanarSurface *p; Appearance *out; out = g_new(Appearance, 1); @@ -175,65 +169,16 @@ Appearance *appearance_new(SurfaceType type, int numtex) if (numtex) out->texture = g_new0(Texture, numtex); else out->texture = NULL; - switch (type) { - case Surface_Planar: - p = &out->surface.data.planar; - p->primary = NULL; - p->secondary = NULL; - p->border_color = NULL; - p->bevel_dark = NULL; - p->bevel_light = NULL; - p->pixel_data = NULL; - break; - } return out; } Appearance *appearance_copy(Appearance *orig) { - PlanarSurface *spo, *spc; Appearance *copy = g_new(Appearance, 1); copy->surface.type = orig->surface.type; switch (orig->surface.type) { case Surface_Planar: - spo = &(orig->surface.data.planar); - spc = &(copy->surface.data.planar); - spc->grad = spo->grad; - spc->relief = spo->relief; - spc->bevel = spo->bevel; - if (spo->primary != NULL) - spc->primary = color_new(spo->primary->r, - spo->primary->g, - spo->primary->b); - else spc->primary = NULL; - - if (spo->secondary != NULL) - spc->secondary = color_new(spo->secondary->r, - spo->secondary->g, - spo->secondary->b); - else spc->secondary = NULL; - - if (spo->border_color != NULL) - spc->border_color = color_new(spo->border_color->r, - spo->border_color->g, - spo->border_color->b); - else spc->border_color = NULL; - - if (spo->bevel_dark != NULL) - spc->bevel_dark = color_new(spo->bevel_dark->r, - spo->bevel_dark->g, - spo->bevel_dark->b); - else spc->bevel_dark = NULL; - - if (spo->bevel_light != NULL) - spc->bevel_light = color_new(spo->bevel_light->r, - spo->bevel_light->g, - spo->bevel_light->b); - else spc->bevel_light = NULL; - - spc->interlaced = spo->interlaced; - spc->border = spo->border; - spc->pixel_data = NULL; + copy->surface.data.planar = orig->surface.data.planar; break; } copy->textures = orig->textures; @@ -247,15 +192,6 @@ void appearance_free(Appearance *a) PlanarSurface *p; if (a->textures) g_free(a->texture); - if (a->surface.type == Surface_Planar) { - p = &a->surface.data.planar; - color_free(p->primary); - color_free(p->secondary); - color_free(p->border_color); - color_free(p->bevel_dark); - color_free(p->bevel_light); - g_free(p->pixel_data); - } g_free(a); } } diff --git a/render/render.h b/render/render.h index bd64f111..97994ddf 100644 --- a/render/render.h +++ b/render/render.h @@ -47,17 +47,16 @@ typedef struct PlanarSurface { SurfaceColorType grad; ReliefType relief; BevelType bevel; - color_rgb *primary; - color_rgb *secondary; - color_rgb *border_color; - color_rgb *bevel_dark; - color_rgb *bevel_light; + struct RrRGB primary; + struct RrRGB secondary; + struct RrRGB border_color; + struct RrRGB bevel_dark; + struct RrRGB bevel_light; gboolean interlaced; gboolean border; struct Appearance *parent; int parentx; int parenty; - pixel32 *pixel_data; } PlanarSurface; typedef struct NonplanarSurface { @@ -92,7 +91,7 @@ typedef struct TextureText { int shadow; char tint; unsigned char offset; - color_rgb *color; + struct RrRGB color; char *string; } TextureText; @@ -103,7 +102,7 @@ typedef struct { } pixmap_mask; typedef struct TextureMask { - color_rgb *color; + struct RrRGB color; pixmap_mask *mask; } TextureMask; diff --git a/render/test.c b/render/test.c index 7c3c83b3..9f5efa29 100644 --- a/render/test.c +++ b/render/test.c @@ -52,8 +52,8 @@ int main() look = appearance_new(Surface_Planar, 0); look->surface.data.planar.grad = Background_Pyramid; - look->surface.data.planar.secondary = color_parse("Yellow"); - look->surface.data.planar.primary = color_parse("Blue"); + color_parse("Yellow", &look->surface.data.planar.secondary); + color_parse("Blue", &look->surface.data.planar.primary); look->surface.data.planar.interlaced = FALSE; look->area.x = 0; look->area.y = 0; diff --git a/render/theme.c b/render/theme.c index 8ba7a9dc..87fb64ab 100644 --- a/render/theme.c +++ b/render/theme.c @@ -5,6 +5,9 @@ #include #include +#include +#include +#include /* style settings - geometry */ int theme_bevel; @@ -12,17 +15,17 @@ int theme_handle_height; int theme_bwidth; int theme_cbwidth; /* style settings - colors */ -color_rgb *theme_b_color; -color_rgb *theme_cb_focused_color; -color_rgb *theme_cb_unfocused_color; -color_rgb *theme_title_focused_color; -color_rgb *theme_title_unfocused_color; -color_rgb *theme_titlebut_focused_color; -color_rgb *theme_titlebut_unfocused_color; -color_rgb *theme_menu_title_color; -color_rgb *theme_menu_color; -color_rgb *theme_menu_disabled_color; -color_rgb *theme_menu_hilite_color; +struct RrRGB theme_b_color; +struct RrRGB theme_cb_focused_color; +struct RrRGB theme_cb_unfocused_color; +struct RrRGB theme_title_focused_color; +struct RrRGB theme_title_unfocused_color; +struct RrRGB theme_titlebut_focused_color; +struct RrRGB theme_titlebut_unfocused_color; +struct RrRGB theme_menu_title_color; +struct RrRGB theme_menu_color; +struct RrRGB theme_menu_disabled_color; +struct RrRGB theme_menu_hilite_color; /* style settings - fonts */ int theme_winfont_height; ObFont *theme_winfont; @@ -101,11 +104,6 @@ Appearance *theme_app_icon; void theme_startup() { - theme_b_color = theme_cb_unfocused_color = theme_cb_focused_color = - theme_title_unfocused_color = theme_title_focused_color = - theme_titlebut_unfocused_color = theme_titlebut_focused_color = - theme_menu_color = theme_menu_title_color = theme_menu_disabled_color = - theme_menu_hilite_color = NULL; theme_winfont = theme_mtitlefont = theme_mfont = NULL; theme_title_layout = NULL; theme_max_set_mask = theme_max_unset_mask = NULL; @@ -164,18 +162,6 @@ void theme_startup() void theme_shutdown() { - color_free(theme_b_color); - color_free(theme_cb_unfocused_color); - color_free(theme_cb_focused_color); - color_free(theme_title_unfocused_color); - color_free(theme_title_focused_color); - color_free(theme_titlebut_unfocused_color); - color_free(theme_titlebut_focused_color); - color_free(theme_menu_color); - color_free(theme_menu_title_color); - color_free(theme_menu_disabled_color); - color_free(theme_menu_hilite_color); - pixmap_mask_free(theme_max_set_mask); pixmap_mask_free(theme_max_unset_mask); pixmap_mask_free(theme_desk_set_mask); @@ -303,7 +289,7 @@ static gboolean read_string(XrmDatabase db, char *rname, char **value) return ret; } -static gboolean read_color(XrmDatabase db, char *rname, color_rgb **value) +static gboolean read_color(XrmDatabase db, char *rname, struct RrRGB *value) { gboolean ret = FALSE; char *rclass = create_class_name(rname); @@ -311,14 +297,13 @@ static gboolean read_color(XrmDatabase db, char *rname, color_rgb **value) XrmValue retvalue; if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) && - retvalue.addr != NULL) { - color_rgb *c = color_parse(retvalue.addr); - if (c != NULL) { - *value = c; - ret = TRUE; - } + retvalue.addr != NULL) + ret = color_parse(retvalue.addr, value); + else { + value->r = 0.0; + value->g = 0.0; + value->b = 0.0; } - g_free(rclass); return ret; } @@ -460,14 +445,10 @@ static gboolean read_appearance(XrmDatabase db, char *rname, Appearance *value) &value->surface.data.planar.bevel, &value->surface.data.planar.interlaced, &value->surface.data.planar.border); - if (!read_color(db, cname, &value->surface.data.planar.primary)) - value->surface.data.planar.primary = color_new(0, 0, 0); - if (!read_color(db, ctoname, &value->surface.data.planar.secondary)) - value->surface.data.planar.secondary = color_new(0, 0, 0); + read_color(db, cname, &value->surface.data.planar.primary); + read_color(db, ctoname, &value->surface.data.planar.secondary); if (value->surface.data.planar.border) - if (!read_color(db, bcname, - &value->surface.data.planar.border_color)) - value->surface.data.planar.border_color = color_new(0, 0, 0); + read_color(db, bcname, &value->surface.data.planar.border_color); ret = TRUE; } @@ -485,8 +466,8 @@ static void set_default_appearance(Appearance *a) a->surface.data.planar.bevel = Bevel1; a->surface.data.planar.interlaced = FALSE; a->surface.data.planar.border = FALSE; - a->surface.data.planar.primary = color_new(0, 0, 0); - a->surface.data.planar.secondary = color_new(0, 0, 0); + rr_color_set(a->surface.data.planar.primary, 0.0, 0.0, 0.0); + rr_color_set(a->surface.data.planar.secondary, 0.0, 0.0, 0.0); } char *theme_load(char *theme) @@ -622,32 +603,25 @@ char *theme_load(char *theme) theme_cbwidth < 0 || theme_cbwidth > 100) theme_cbwidth = theme_bevel; /* load colors */ - if (!read_color(db, "borderColor", &theme_b_color)) - theme_b_color = color_new(0, 0, 0); + read_color(db, "borderColor", &theme_b_color); if (!read_color(db, "window.frame.focusColor", &theme_cb_focused_color)) - theme_cb_focused_color = color_new(0xff, 0xff, 0xff); + rr_color_set(theme_cb_focused_color, 1.0, 1.0, 1.0); if (!read_color(db, "window.frame.unfocusColor",&theme_cb_unfocused_color)) - theme_cb_unfocused_color = color_new(0xff, 0xff, 0xff); - if (!read_color(db, "window.label.focus.textColor", - &theme_title_focused_color)) - theme_title_focused_color = color_new(0x0, 0x0, 0x0); + rr_color_set(theme_cb_unfocused_color, 1.0, 1.0, 1.0); + read_color(db, "window.label.focus.textColor", &theme_title_focused_color); if (!read_color(db, "window.label.unfocus.textColor", &theme_title_unfocused_color)) - theme_title_unfocused_color = color_new(0xff, 0xff, 0xff); - if (!read_color(db, "window.button.focus.picColor", - &theme_titlebut_focused_color)) - theme_titlebut_focused_color = color_new(0, 0, 0); + rr_color_set(theme_title_unfocused_color, 1.0, 1.0, 1.0); + read_color(db, "window.button.focus.picColor", + &theme_titlebut_focused_color); if (!read_color(db, "window.button.unfocus.picColor", &theme_titlebut_unfocused_color)) - theme_titlebut_unfocused_color = color_new(0xff, 0xff, 0xff); - if (!read_color(db, "menu.title.textColor", &theme_menu_title_color)) - theme_menu_title_color = color_new(0, 0, 0); + rr_color_set(theme_titlebut_unfocused_color, 1.0, 1.0, 1.0); + read_color(db, "menu.title.textColor", &theme_menu_title_color); if (!read_color(db, "menu.frame.textColor", &theme_menu_color)) - theme_menu_color = color_new(0xff, 0xff, 0xff); - if (!read_color(db, "menu.frame.disableColor", &theme_menu_disabled_color)) - theme_menu_disabled_color = color_new(0, 0, 0); - if (!read_color(db, "menu.hilite.textColor", &theme_menu_hilite_color)) - theme_menu_hilite_color = color_new(0, 0, 0); + rr_color_set(theme_menu_color, 1.0, 1.0, 1.0); + read_color(db, "menu.frame.disableColor", &theme_menu_disabled_color); + read_color(db, "menu.hilite.textColor", &theme_menu_hilite_color); if (read_mask(db, "window.button.max.mask", theme, &theme_max_unset_mask)){ if (!read_mask(db, "window.button.max.toggled.mask", theme, diff --git a/render/theme.h b/render/theme.h index 2a93c8df..73597ae2 100644 --- a/render/theme.h +++ b/render/theme.h @@ -16,13 +16,13 @@ extern int theme_cbwidth; #define theme_button_size (theme_label_height - 2) #define theme_grip_width (theme_button_size * 2) -extern color_rgb *theme_b_color; -extern color_rgb *theme_cb_focused_color; -extern color_rgb *theme_cb_unfocused_color; -extern color_rgb *theme_title_focused_color; -extern color_rgb *theme_title_unfocused_color; -extern color_rgb *theme_titlebut_focused_color; -extern color_rgb *theme_titlebut_unfocused_color; +extern struct RrRGB theme_b_color; +extern struct RrRGB theme_cb_focused_color; +extern struct RrRGB theme_cb_unfocused_color; +extern struct RrRGB theme_title_focused_color; +extern struct RrRGB theme_title_unfocused_color; +extern struct RrRGB theme_titlebut_focused_color; +extern struct RrRGB theme_titlebut_unfocused_color; extern int theme_winfont_height; extern ObFont *theme_winfont;