rename color_rgb to RrColor

This commit is contained in:
Dana Jansens 2003-06-21 01:56:14 +00:00
parent b1f5555218
commit bd59576748
5 changed files with 32 additions and 32 deletions

View file

@ -7,7 +7,7 @@
XColor *pseudo_colors; XColor *pseudo_colors;
int pseudo_bpc; int pseudo_bpc;
void color_allocate_gc(color_rgb *in) void color_allocate_gc(RrColor *in)
{ {
XGCValues gcv; XGCValues gcv;
@ -18,7 +18,7 @@ void color_allocate_gc(color_rgb *in)
GCForeground | GCCapStyle, &gcv); GCForeground | GCCapStyle, &gcv);
} }
color_rgb *RrColorParse(const RrInstance *inst, gchar *colorname) RrColor *RrColorParse(const RrInstance *inst, gchar *colorname)
{ {
XColor xcol; XColor xcol;
@ -36,16 +36,16 @@ color_rgb *RrColorParse(const RrInstance *inst, gchar *colorname)
return RrColorNew(inst, xcol.red >> 8, xcol.green >> 8, xcol.blue >> 8); return RrColorNew(inst, xcol.red >> 8, xcol.green >> 8, xcol.blue >> 8);
} }
color_rgb *RrColorNew(const RrInstance *inst, gint r, gint g, gint b) RrColor *RrColorNew(const RrInstance *inst, gint r, gint g, gint b)
{ {
/* this should be replaced with something far cooler */ /* this should be replaced with something far cooler */
color_rgb *out = NULL; RrColor *out = NULL;
XColor xcol; XColor xcol;
xcol.red = (r << 8) | r; xcol.red = (r << 8) | r;
xcol.green = (g << 8) | g; xcol.green = (g << 8) | g;
xcol.blue = (b << 8) | b; xcol.blue = (b << 8) | b;
if (XAllocColor(RrDisplay(inst), RrColormap(inst), &xcol)) { if (XAllocColor(RrDisplay(inst), RrColormap(inst), &xcol)) {
out = g_new(color_rgb, 1); out = g_new(RrColor, 1);
out->inst = inst; out->inst = inst;
out->r = xcol.red >> 8; out->r = xcol.red >> 8;
out->g = xcol.green >> 8; out->g = xcol.green >> 8;
@ -58,7 +58,7 @@ color_rgb *RrColorNew(const RrInstance *inst, gint r, gint g, gint b)
/*XXX same color could be pointed to twice, this might have to be a refcount*/ /*XXX same color could be pointed to twice, this might have to be a refcount*/
void RrColorFree(color_rgb *c) void RrColorFree(RrColor *c)
{ {
if (c) { if (c) {
if (c->gc) XFreeGC(RrDisplay(c->inst), c->gc); if (c->gc) XFreeGC(RrDisplay(c->inst), c->gc);

View file

@ -31,7 +31,7 @@ struct _RrColor {
GC gc; GC gc;
}; };
void color_allocate_gc(color_rgb *in); void color_allocate_gc(RrColor *in);
XColor *pickColor(const RrInstance *inst, gint r, gint g, gint b); XColor *pickColor(const RrInstance *inst, gint r, gint g, gint b);
void reduce_depth(const RrInstance *inst, pixel32 *data, XImage *im); void reduce_depth(const RrInstance *inst, pixel32 *data, XImage *im);
void increase_depth(const RrInstance *inst, pixel32 *data, XImage *im); void increase_depth(const RrInstance *inst, pixel32 *data, XImage *im);

View file

@ -16,7 +16,7 @@ typedef struct _RrTextureRGBA RrTextureRGBA;
typedef struct _RrTextureText RrTextureText; typedef struct _RrTextureText RrTextureText;
typedef struct _RrPixmapMask RrPixmapMask; typedef struct _RrPixmapMask RrPixmapMask;
typedef struct _RrInstance RrInstance; typedef struct _RrInstance RrInstance;
typedef struct _RrColor color_rgb; /* XXX ugly */ typedef struct _RrColor RrColor;
typedef guint32 pixel32; /* XXX prefix */ typedef guint32 pixel32; /* XXX prefix */
typedef guint16 pixel16; typedef guint16 pixel16;
@ -62,11 +62,11 @@ struct _RrSurface {
RrSurfaceColorType grad; RrSurfaceColorType grad;
RrReliefType relief; RrReliefType relief;
RrBevelType bevel; RrBevelType bevel;
color_rgb *primary; RrColor *primary;
color_rgb *secondary; RrColor *secondary;
color_rgb *border_color; RrColor *border_color;
color_rgb *bevel_dark; RrColor *bevel_dark;
color_rgb *bevel_light; RrColor *bevel_light;
gboolean interlaced; gboolean interlaced;
gboolean border; gboolean border;
RrAppearance *parent; RrAppearance *parent;
@ -81,7 +81,7 @@ struct _RrTextureText {
gint shadow; gint shadow;
gchar tint; gchar tint;
guchar offset; guchar offset;
color_rgb *color; RrColor *color;
gchar *string; gchar *string;
}; };
@ -94,7 +94,7 @@ struct _RrPixmapMask {
}; };
struct _RrTextureMask { struct _RrTextureMask {
color_rgb *color; RrColor *color;
RrPixmapMask *mask; RrPixmapMask *mask;
}; };
@ -153,9 +153,9 @@ gint RrBlueMask (const RrInstance *inst);
guint RrPseudoBPC (const RrInstance *inst); guint RrPseudoBPC (const RrInstance *inst);
XColor* RrPseudoColors (const RrInstance *inst); XColor* RrPseudoColors (const RrInstance *inst);
color_rgb *RrColorNew (const RrInstance *inst, gint r, gint g, gint b); RrColor *RrColorNew (const RrInstance *inst, gint r, gint g, gint b);
color_rgb *RrColorParse (const RrInstance *inst, gchar *colorname); RrColor *RrColorParse (const RrInstance *inst, gchar *colorname);
void RrColorFree (color_rgb *in); void RrColorFree (RrColor *in);
RrAppearance *RrAppearanceNew (const RrInstance *inst, gint numtex); RrAppearance *RrAppearanceNew (const RrInstance *inst, gint numtex);
RrAppearance *RrAppearanceCopy (RrAppearance *a); RrAppearance *RrAppearanceCopy (RrAppearance *a);

View file

@ -11,7 +11,7 @@ static XrmDatabase loaddb(char *theme);
static gboolean read_int(XrmDatabase db, char *rname, int *value); static gboolean read_int(XrmDatabase db, char *rname, int *value);
static gboolean read_string(XrmDatabase db, char *rname, char **value); static gboolean read_string(XrmDatabase db, char *rname, char **value);
static gboolean read_color(XrmDatabase db, const RrInstance *inst, static gboolean read_color(XrmDatabase db, const RrInstance *inst,
gchar *rname, color_rgb **value); gchar *rname, RrColor **value);
static gboolean read_mask(XrmDatabase db, const RrInstance *inst, static gboolean read_mask(XrmDatabase db, const RrInstance *inst,
gchar *rname, gchar *theme, gchar *rname, gchar *theme,
RrPixmapMask **value); RrPixmapMask **value);
@ -767,7 +767,7 @@ static gboolean read_string(XrmDatabase db, char *rname, char **value)
} }
static gboolean read_color(XrmDatabase db, const RrInstance *inst, static gboolean read_color(XrmDatabase db, const RrInstance *inst,
gchar *rname, color_rgb **value) gchar *rname, RrColor **value)
{ {
gboolean ret = FALSE; gboolean ret = FALSE;
char *rclass = create_class_name(rname); char *rclass = create_class_name(rname);
@ -776,7 +776,7 @@ static gboolean read_color(XrmDatabase db, const RrInstance *inst,
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) && if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) { retvalue.addr != NULL) {
color_rgb *c = RrColorParse(inst, retvalue.addr); RrColor *c = RrColorParse(inst, retvalue.addr);
if (c != NULL) { if (c != NULL) {
*value = c; *value = c;
ret = TRUE; ret = TRUE;

View file

@ -24,17 +24,17 @@ struct _RrTheme {
gint grip_width; gint grip_width;
/* style settings - colors */ /* style settings - colors */
color_rgb *b_color; RrColor *b_color;
color_rgb *cb_focused_color; RrColor *cb_focused_color;
color_rgb *cb_unfocused_color; RrColor *cb_unfocused_color;
color_rgb *title_focused_color; RrColor *title_focused_color;
color_rgb *title_unfocused_color; RrColor *title_unfocused_color;
color_rgb *titlebut_focused_color; RrColor *titlebut_focused_color;
color_rgb *titlebut_unfocused_color; RrColor *titlebut_unfocused_color;
color_rgb *menu_title_color; RrColor *menu_title_color;
color_rgb *menu_color; RrColor *menu_color;
color_rgb *menu_disabled_color; RrColor *menu_disabled_color;
color_rgb *menu_hilite_color; RrColor *menu_hilite_color;
/* style settings - fonts */ /* style settings - fonts */
gint winfont_height; gint winfont_height;