summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2003-10-15 03:59:35 +0000
committerDana Jansens <danakj@orodu.net>2003-10-15 03:59:35 +0000
commit740c5b2a20d5110435d0874f8cc6a4c9dfd14777 (patch)
tree41dd6d301a1da504b6bc9ec7b4cccea2efd16423 /render
parent8085f3490fb5790d15fcb47988bbc24e17467725 (diff)
consistant glib type usage
Diffstat (limited to 'render')
-rw-r--r--render/color.c26
-rw-r--r--render/color.h8
-rw-r--r--render/font.c10
-rw-r--r--render/font.h2
-rw-r--r--render/gradient.c58
-rw-r--r--render/gradient.h2
-rw-r--r--render/image.c4
-rw-r--r--render/instance.c20
-rw-r--r--render/mask.c2
-rw-r--r--render/render.c4
-rw-r--r--render/render.h6
-rw-r--r--render/test.c10
-rw-r--r--render/theme.c68
13 files changed, 110 insertions, 110 deletions
diff --git a/render/color.c b/render/color.c
index 485b3d66..491dc47b 100644
--- a/render/color.c
+++ b/render/color.c
@@ -114,11 +114,11 @@ void RrColorFree(RrColor *c)
void RrReduceDepth(const RrInstance *inst, RrPixel32 *data, XImage *im)
{
- int r, g, b;
- int x,y;
+ gint r, g, b;
+ gint x,y;
RrPixel32 *p32 = (RrPixel32 *) im->data;
RrPixel16 *p16 = (RrPixel16 *) im->data;
- unsigned char *p8 = (unsigned char *)im->data;
+ guchar *p8 = (guchar *)im->data;
switch (im->bits_per_pixel) {
case 32:
if ((RrRedOffset(inst) != RrDefaultRedOffset) ||
@@ -136,7 +136,7 @@ void RrReduceDepth(const RrInstance *inst, RrPixel32 *data, XImage *im)
data += im->width;
p32 += im->width;
}
- } else im->data = (char*) data;
+ } else im->data = (gchar*) data;
break;
case 16:
for (y = 0; y < im->height; y++) {
@@ -186,13 +186,13 @@ XColor *RrPickColor(const RrInstance *inst, gint r, gint g, gint b)
static void swap_byte_order(XImage *im)
{
- int x, y, di;
+ gint x, y, di;
di = 0;
for (y = 0; y < im->height; ++y) {
for (x = 0; x < im->height; ++x) {
- char *c = &im->data[di + x * im->bits_per_pixel / 8];
- char t;
+ gchar *c = &im->data[di + x * im->bits_per_pixel / 8];
+ gchar t;
switch (im->bits_per_pixel) {
case 32:
@@ -220,11 +220,11 @@ static void swap_byte_order(XImage *im)
void RrIncreaseDepth(const RrInstance *inst, RrPixel32 *data, XImage *im)
{
- int r, g, b;
- int x,y;
+ gint r, g, b;
+ gint x,y;
RrPixel32 *p32 = (RrPixel32 *) im->data;
RrPixel16 *p16 = (RrPixel16 *) im->data;
- unsigned char *p8 = (unsigned char *)im->data;
+ guchar *p8 = (guchar *)im->data;
if (im->byte_order != LSBFirst)
swap_byte_order(im);
@@ -286,17 +286,17 @@ void RrIncreaseDepth(const RrInstance *inst, RrPixel32 *data, XImage *im)
}
}
-int RrColorRed(const RrColor *c)
+gint RrColorRed(const RrColor *c)
{
return c->r;
}
-int RrColorGreen(const RrColor *c)
+gint RrColorGreen(const RrColor *c)
{
return c->g;
}
-int RrColorBlue(const RrColor *c)
+gint RrColorBlue(const RrColor *c)
{
return c->b;
}
diff --git a/render/color.h b/render/color.h
index d620f8a4..703fc3e3 100644
--- a/render/color.h
+++ b/render/color.h
@@ -29,10 +29,10 @@
struct _RrColor {
const RrInstance *inst;
- int r;
- int g;
- int b;
- unsigned long pixel;
+ gint r;
+ gint g;
+ gint b;
+ gulong pixel;
GC gc;
gint key;
diff --git a/render/font.c b/render/font.c
index 155b373f..ce74cad1 100644
--- a/render/font.c
+++ b/render/font.c
@@ -63,7 +63,7 @@ static void measure_font(RrFont *f)
f->elipses_length = (signed) info.xOff;
}
-static RrFont *openfont(const RrInstance *inst, char *fontstring)
+static RrFont *openfont(const RrInstance *inst, gchar *fontstring)
{
RrFont *out;
FcPattern *pat, *match;
@@ -108,7 +108,7 @@ static RrFont *openfont(const RrInstance *inst, char *fontstring)
return out;
}
-RrFont *RrFontOpen(const RrInstance *inst, char *fontstring)
+RrFont *RrFontOpen(const RrInstance *inst, gchar *fontstring)
{
RrFont *out;
@@ -149,20 +149,20 @@ static void font_measure_full(const RrFont *f, const gchar *str,
*y = info.height + (f->shadow ? ABS(f->offset) : 0);
}
-int RrFontMeasureString(const RrFont *f, const gchar *str)
+gint RrFontMeasureString(const RrFont *f, const gchar *str)
{
gint x, y;
font_measure_full (f, str, &x, &y);
return x + 4;
}
-int RrFontHeight(const RrFont *f)
+gint RrFontHeight(const RrFont *f)
{
return f->xftfont->ascent + f->xftfont->descent +
(f->shadow ? f->offset : 0);
}
-int RrFontMaxCharWidth(const RrFont *f)
+gint RrFontMaxCharWidth(const RrFont *f)
{
return (signed) f->xftfont->max_advance_width;
}
diff --git a/render/font.h b/render/font.h
index ab52b450..6f8d511c 100644
--- a/render/font.h
+++ b/render/font.h
@@ -31,7 +31,7 @@ struct _RrFont {
gint offset;
};
-RrFont *RrFontOpen(const RrInstance *inst, char *fontstring);
+RrFont *RrFontOpen(const RrInstance *inst, gchar *fontstring);
void RrFontClose(RrFont *f);
void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *position);
#endif /* __font_h */
diff --git a/render/gradient.c b/render/gradient.c
index fa54fbb2..53f7e25c 100644
--- a/render/gradient.c
+++ b/render/gradient.c
@@ -23,19 +23,19 @@
#include <glib.h>
static void highlight(RrPixel32 *x, RrPixel32 *y, gboolean raised);
-static void gradient_solid(RrAppearance *l, int w, int h);
-static void gradient_vertical(RrSurface *sf, int w, int h);
-static void gradient_horizontal(RrSurface *sf, int w, int h);
-static void gradient_diagonal(RrSurface *sf, int w, int h);
-static void gradient_crossdiagonal(RrSurface *sf, int w, int h);
-static void gradient_pyramid(RrSurface *sf, int inw, int inh);
-
-void RrRender(RrAppearance *a, int w, int h)
+static void gradient_solid(RrAppearance *l, gint w, gint h);
+static void gradient_vertical(RrSurface *sf, gint w, gint h);
+static void gradient_horizontal(RrSurface *sf, gint w, gint h);
+static void gradient_diagonal(RrSurface *sf, gint w, gint h);
+static void gradient_crossdiagonal(RrSurface *sf, gint w, gint h);
+static void gradient_pyramid(RrSurface *sf, gint inw, gint inh);
+
+void RrRender(RrAppearance *a, gint w, gint h)
{
RrPixel32 *data = a->surface.pixel_data;
RrPixel32 current;
- unsigned int r,g,b;
- int off, x;
+ guint r,g,b;
+ gint off, x;
switch (a->surface.grad) {
case RR_SURFACE_SOLID:
@@ -62,7 +62,7 @@ void RrRender(RrAppearance *a, int w, int h)
}
if (a->surface.interlaced) {
- int i;
+ gint i;
RrPixel32 *p;
r = a->surface.interlace_color->r;
@@ -121,7 +121,7 @@ void RrRender(RrAppearance *a, int w, int h)
static void highlight(RrPixel32 *x, RrPixel32 *y, gboolean raised)
{
- int r, g, b;
+ gint r, g, b;
RrPixel32 *up, *down;
if (raised) {
@@ -155,7 +155,7 @@ static void highlight(RrPixel32 *x, RrPixel32 *y, gboolean raised)
static void create_bevel_colors(RrAppearance *l)
{
- int r, g, b;
+ gint r, g, b;
/* light color */
r = l->surface.primary->r;
@@ -181,12 +181,12 @@ static void create_bevel_colors(RrAppearance *l)
l->surface.bevel_dark = RrColorNew(l->inst, r, g, b);
}
-static void gradient_solid(RrAppearance *l, int w, int h)
+static void gradient_solid(RrAppearance *l, gint w, gint h)
{
RrPixel32 pix;
- int i, a, b;
+ gint i, a, b;
RrSurface *sp = &l->surface;
- int left = 0, top = 0, right = w - 1, bottom = h - 1;
+ gint left = 0, top = 0, right = w - 1, bottom = h - 1;
pix = (sp->primary->r << RrDefaultRedOffset)
+ (sp->primary->g << RrDefaultGreenOffset)
@@ -285,8 +285,8 @@ static void gradient_solid(RrAppearance *l, int w, int h)
/* * * * * * * * * * * * * * GRADIENT MAGIC WOOT * * * * * * * * * * * * * * */
#define VARS(x) \
- unsigned int color##x[3]; \
- int len##x, cdelta##x[3], error##x[3] = { 0, 0, 0 }, inc##x[3]; \
+ guint color##x[3]; \
+ gint len##x, cdelta##x[3], error##x[3] = { 0, 0, 0 }, inc##x[3]; \
gboolean bigslope##x[3] /* color slope > 1 */
#define SETUP(x, from, to, w) \
@@ -334,7 +334,7 @@ static void gradient_solid(RrAppearance *l, int w, int h)
#define NEXT(x) \
{ \
- int i; \
+ gint i; \
for (i = 2; i >= 0; --i) { \
if (!cdelta##x[i]) continue; \
\
@@ -359,9 +359,9 @@ static void gradient_solid(RrAppearance *l, int w, int h)
} \
}
-static void gradient_horizontal(RrSurface *sf, int w, int h)
+static void gradient_horizontal(RrSurface *sf, gint w, gint h)
{
- int x, y;
+ gint x, y;
RrPixel32 *data = sf->pixel_data, *datav;
RrPixel32 current;
@@ -384,9 +384,9 @@ static void gradient_horizontal(RrSurface *sf, int w, int h)
*(data + y * w) = current;
}
-static void gradient_vertical(RrSurface *sf, int w, int h)
+static void gradient_vertical(RrSurface *sf, gint w, gint h)
{
- int x, y;
+ gint x, y;
RrPixel32 *data = sf->pixel_data;
RrPixel32 current;
@@ -406,9 +406,9 @@ static void gradient_vertical(RrSurface *sf, int w, int h)
}
-static void gradient_diagonal(RrSurface *sf, int w, int h)
+static void gradient_diagonal(RrSurface *sf, gint w, gint h)
{
- int x, y;
+ gint x, y;
RrPixel32 *data = sf->pixel_data;
RrColor left, right;
RrColor extracorner;
@@ -453,9 +453,9 @@ static void gradient_diagonal(RrSurface *sf, int w, int h)
*data = COLOR(x);
}
-static void gradient_crossdiagonal(RrSurface *sf, int w, int h)
+static void gradient_crossdiagonal(RrSurface *sf, gint w, gint h)
{
- int x, y;
+ gint x, y;
RrPixel32 *data = sf->pixel_data;
RrColor left, right;
RrColor extracorner;
@@ -500,9 +500,9 @@ static void gradient_crossdiagonal(RrSurface *sf, int w, int h)
*data = COLOR(x);
}
-static void gradient_pyramid(RrSurface *sf, int inw, int inh)
+static void gradient_pyramid(RrSurface *sf, gint inw, gint inh)
{
- int x, y, w = (inw >> 1) + 1, h = (inh >> 1) + 1;
+ gint x, y, w = (inw >> 1) + 1, h = (inh >> 1) + 1;
RrPixel32 *data = sf->pixel_data;
RrPixel32 *end = data + inw*inh - 1;
RrPixel32 current;
diff --git a/render/gradient.h b/render/gradient.h
index 875f5e17..50a22c52 100644
--- a/render/gradient.h
+++ b/render/gradient.h
@@ -22,6 +22,6 @@
#include "render.h"
-void RrRender(RrAppearance *a, int w, int h);
+void RrRender(RrAppearance *a, gint w, gint h);
#endif /* __gradient_h */
diff --git a/render/image.c b/render/image.c
index 09d94f17..10aa9b13 100644
--- a/render/image.c
+++ b/render/image.c
@@ -133,10 +133,10 @@ void RrImageDraw(RrPixel32 *target, RrTextureRGBA *rgba,
/* keep the ratio */
dw = area->width;
- dh = (int)(dw * ((double)sh / sw));
+ dh = (gint)(dw * ((gdouble)sh / sw));
if (dh > area->height) {
dh = area->height;
- dw = (int)(dh * ((double)sw / sh));
+ dw = (gint)(dh * ((gdouble)sw / sh));
}
if (sw != dw || sh != dh) {
diff --git a/render/instance.c b/render/instance.c
index f4a2441e..ca584519 100644
--- a/render/instance.c
+++ b/render/instance.c
@@ -44,11 +44,11 @@ dest(gpointer data)
static void f(gpointer key, gpointer value, gpointer n)
{
RrColor *c = value;
- if (c->id == *(int*)n)
+ if (c->id == *(gint*)n)
g_message("color %d has %d references", c->id, c->refcount);
}
-void print_refs(int id)
+void print_refs(gint id)
{
g_hash_table_foreach(RrColorHash(definst), f, &id);
}
@@ -89,7 +89,7 @@ RrInstance* RrInstanceNew (Display *display, gint screen)
void RrTrueColorSetup (RrInstance *inst)
{
- unsigned long red_mask, green_mask, blue_mask;
+ gulong red_mask, green_mask, blue_mask;
XImage *timage = NULL;
timage = XCreateImage(inst->display, inst->visual, inst->depth,
@@ -120,9 +120,9 @@ void RrTrueColorSetup (RrInstance *inst)
void RrPseudoColorSetup (RrInstance *inst)
{
XColor icolors[256];
- int tr, tg, tb, n, r, g, b, i, incolors, ii;
- unsigned long dev;
- int cpc, _ncolors;
+ gint tr, tg, tb, n, r, g, b, i, incolors, ii;
+ gulong dev;
+ gint cpc, _ncolors;
/* determine the number of colors and the bits-per-color */
inst->pseudo_bpc = 2; /* XXX THIS SHOULD BE A USER OPTION */
@@ -142,9 +142,9 @@ void RrPseudoColorSetup (RrInstance *inst)
for (n = 0, r = 0; r < cpc; r++)
for (g = 0; g < cpc; g++)
for (b = 0; b < cpc; b++, n++) {
- tr = (int)(((float)(r)/(float)(cpc-1)) * 0xFF);
- tg = (int)(((float)(g)/(float)(cpc-1)) * 0xFF);
- tb = (int)(((float)(b)/(float)(cpc-1)) * 0xFF);
+ tr = (gint)(((gfloat)(r)/(gfloat)(cpc-1)) * 0xFF);
+ tg = (gint)(((gfloat)(g)/(gfloat)(cpc-1)) * 0xFF);
+ tb = (gint)(((gfloat)(b)/(gfloat)(cpc-1)) * 0xFF);
inst->pseudo_colors[n].red = tr | tr << 8;
inst->pseudo_colors[n].green = tg | tg << 8;
inst->pseudo_colors[n].blue = tb | tb << 8;
@@ -171,7 +171,7 @@ void RrPseudoColorSetup (RrInstance *inst)
/* try match unallocated ones */
for (i = 0; i < _ncolors; i++) {
if (!inst->pseudo_colors[i].flags) { /* if it wasn't allocated... */
- unsigned long closest = 0xffffffff, close = 0;
+ gulong closest = 0xffffffff, close = 0;
for (ii = 0; ii < incolors; ii++) {
/* find deviations */
r = (inst->pseudo_colors[i].red - icolors[ii].red) & 0xff;
diff --git a/render/mask.c b/render/mask.c
index 3144aff4..11e589bc 100644
--- a/render/mask.c
+++ b/render/mask.c
@@ -46,7 +46,7 @@ void RrPixmapMaskFree(RrPixmapMask *m)
void RrPixmapMaskDraw(Pixmap p, const RrTextureMask *m, const RrRect *area)
{
- int x, y;
+ gint x, y;
if (m->mask == None) return; /* no mask given */
/* set the clip region */
diff --git a/render/render.c b/render/render.c
index 3fb4965b..cb29165e 100644
--- a/render/render.c
+++ b/render/render.c
@@ -39,7 +39,7 @@ static void pixel_data_to_pixmap(RrAppearance *l,
void RrPaint(RrAppearance *a, Window win, gint w, gint h)
{
- int i, transferred = 0, sw;
+ gint i, transferred = 0, sw;
RrPixel32 *source, *dest;
Pixmap oldp;
RrRect tarea; /* area in which to draw textures */
@@ -278,7 +278,7 @@ static void pixel_data_to_pixmap(RrAppearance *l,
as reduce_depth just sets im->data = data and returns
*/
scratch = g_new(RrPixel32, im->width * im->height);
- im->data = (char*) scratch;
+ im->data = (gchar*) scratch;
RrReduceDepth(l->inst, in, im);
XPutImage(RrDisplay(l->inst), out,
DefaultGC(RrDisplay(l->inst), RrScreen(l->inst)),
diff --git a/render/render.h b/render/render.h
index df81daf1..3e76ed8b 100644
--- a/render/render.h
+++ b/render/render.h
@@ -200,9 +200,9 @@ RrAppearance *RrAppearanceNew (const RrInstance *inst, gint numtex);
RrAppearance *RrAppearanceCopy (RrAppearance *a);
void RrAppearanceFree (RrAppearance *a);
-int RrFontMeasureString (const RrFont *f, const gchar *str);
-int RrFontHeight (const RrFont *f);
-int RrFontMaxCharWidth (const RrFont *f);
+gint RrFontMeasureString (const RrFont *f, const gchar *str);
+gint RrFontHeight (const RrFont *f);
+gint RrFontMaxCharWidth (const RrFont *f);
void RrPaint (RrAppearance *a, Window win, gint w, gint h);
void RrMinsize (RrAppearance *a, gint *w, gint *h);
diff --git a/render/test.c b/render/test.c
index 2c5d75e8..b50053c2 100644
--- a/render/test.c
+++ b/render/test.c
@@ -26,19 +26,19 @@
#include "render.h"
#include <glib.h>
-static int x_error_handler(Display * disp, XErrorEvent * error)
+static gint x_error_handler(Display * disp, XErrorEvent * error)
{
- char buf[1024];
+ gchar buf[1024];
XGetErrorText(disp, error->error_code, buf, 1024);
printf("%s\n", buf);
return 0;
}
Display *ob_display;
-int ob_screen;
+gint ob_screen;
Window ob_root;
-int main()
+gint main()
{
Window win;
RrInstance *inst;
@@ -46,7 +46,7 @@ int main()
Window root;
XEvent report;
- int h = 500, w = 500;
+ gint h = 500, w = 500;
ob_display = XOpenDisplay(NULL);
XSetErrorHandler(x_error_handler);
diff --git a/render/theme.c b/render/theme.c
index 8ad64a7a..bb6a1232 100644
--- a/render/theme.c
+++ b/render/theme.c
@@ -30,9 +30,9 @@
#include <stdlib.h>
#include <string.h>
-static XrmDatabase loaddb(RrTheme *theme, char *name);
-static gboolean read_int(XrmDatabase db, char *rname, int *value);
-static gboolean read_string(XrmDatabase db, char *rname, char **value);
+static XrmDatabase loaddb(RrTheme *theme, gchar *name);
+static gboolean read_int(XrmDatabase db, gchar *rname, gint *value);
+static gboolean read_string(XrmDatabase db, gchar *rname, gchar **value);
static gboolean read_color(XrmDatabase db, const RrInstance *inst,
gchar *rname, RrColor **value);
static gboolean read_mask(const RrInstance *inst,
@@ -303,11 +303,11 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
} else {
{
guchar data[] = { 0x7f, 0x7f, 0x7f, 0x41, 0x41, 0x41, 0x7f };
- theme->max_mask = RrPixmapMaskNew(inst, 7, 7, (char*)data);
+ theme->max_mask = RrPixmapMaskNew(inst, 7, 7, (gchar*)data);
}
{
guchar data[] = { 0x7c, 0x44, 0x47, 0x47, 0x7f, 0x1f, 0x1f };
- theme->max_toggled_mask = RrPixmapMaskNew(inst, 7, 7, (char*)data);
+ theme->max_toggled_mask = RrPixmapMaskNew(inst, 7, 7, (gchar*)data);
}
theme->max_pressed_mask = RrPixmapMaskCopy(theme->max_mask);
theme->max_disabled_mask = RrPixmapMaskCopy(theme->max_mask);
@@ -332,7 +332,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
} else {
{
guchar data[] = { 0x00, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x7f };
- theme->iconify_mask = RrPixmapMaskNew(inst, 7, 7, (char*)data);
+ theme->iconify_mask = RrPixmapMaskNew(inst, 7, 7, (gchar*)data);
}
theme->iconify_pressed_mask = RrPixmapMaskCopy(theme->iconify_mask);
theme->iconify_disabled_mask = RrPixmapMaskCopy(theme->iconify_mask);
@@ -364,12 +364,12 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
} else {
{
guchar data[] = { 0x63, 0x63, 0x00, 0x00, 0x00, 0x63, 0x63 };
- theme->desk_mask = RrPixmapMaskNew(inst, 7, 7, (char*)data);
+ theme->desk_mask = RrPixmapMaskNew(inst, 7, 7, (gchar*)data);
}
{
guchar data[] = { 0x00, 0x36, 0x36, 0x08, 0x36, 0x36, 0x00 };
theme->desk_toggled_mask = RrPixmapMaskNew(inst, 7, 7,
- (char*)data);
+ (gchar*)data);
}
theme->desk_pressed_mask = RrPixmapMaskCopy(theme->desk_mask);
theme->desk_disabled_mask = RrPixmapMaskCopy(theme->desk_mask);
@@ -397,12 +397,12 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
} else {
{
guchar data[] = { 0x7f, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00 };
- theme->shade_mask = RrPixmapMaskNew(inst, 7, 7, (char*)data);
+ theme->shade_mask = RrPixmapMaskNew(inst, 7, 7, (gchar*)data);
}
{
guchar data[] = { 0x7f, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x7f };
theme->shade_toggled_mask = RrPixmapMaskNew(inst, 7, 7,
- (char*)data);
+ (gchar*)data);
}
theme->shade_pressed_mask = RrPixmapMaskCopy(theme->shade_mask);
theme->shade_disabled_mask = RrPixmapMaskCopy(theme->shade_mask);
@@ -425,7 +425,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
} else {
{
guchar data[] = { 0x63, 0x77, 0x3e, 0x1c, 0x3e, 0x77, 0x63 };
- theme->close_mask = RrPixmapMaskNew(inst, 7, 7, (char*)data);
+ theme->close_mask = RrPixmapMaskNew(inst, 7, 7, (gchar*)data);
}
theme->close_pressed_mask = RrPixmapMaskCopy(theme->close_mask);
theme->close_disabled_mask = RrPixmapMaskCopy(theme->close_mask);
@@ -434,7 +434,7 @@ RrTheme* RrThemeNew(const RrInstance *inst, gchar *name)
if (!read_mask(inst, "bullet.xbm", theme, &theme->menu_bullet_mask)) {
guchar data[] = { 0x01, 0x03, 0x07, 0x0f, 0x07, 0x03, 0x01 };
- theme->menu_bullet_mask = RrPixmapMaskNew(inst, 4, 7, (char*)data);
+ theme->menu_bullet_mask = RrPixmapMaskNew(inst, 4, 7, (gchar*)data);
}
/* read the decoration textures */
@@ -1045,7 +1045,7 @@ void RrThemeFree(RrTheme *theme)
}
}
-static XrmDatabase loaddb(RrTheme *theme, char *name)
+static XrmDatabase loaddb(RrTheme *theme, gchar *name)
{
GSList *it;
XrmDatabase db = NULL;
@@ -1085,10 +1085,10 @@ static XrmDatabase loaddb(RrTheme *theme, char *name)
return db;
}
-static char *create_class_name(char *rname)
+static gchar *create_class_name(gchar *rname)
{
- char *rclass = g_strdup(rname);
- char *p = rclass;
+ gchar *rclass = g_strdup(rname);
+ gchar *p = rclass;
while (TRUE) {
*p = toupper(*p);
@@ -1100,16 +1100,16 @@ static char *create_class_name(char *rname)
return rclass;
}
-static gboolean read_int(XrmDatabase db, char *rname, int *value)
+static gboolean read_int(XrmDatabase db, gchar *rname, gint *value)
{
gboolean ret = FALSE;
- char *rclass = create_class_name(rname);
- char *rettype, *end;
+ gchar *rclass = create_class_name(rname);
+ gchar *rettype, *end;
XrmValue retvalue;
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
retvalue.addr != NULL) {
- *value = (int)strtol(retvalue.addr, &end, 10);
+ *value = (gint)strtol(retvalue.addr, &end, 10);
if (end != retvalue.addr)
ret = TRUE;
}
@@ -1118,11 +1118,11 @@ static gboolean read_int(XrmDatabase db, char *rname, int *value)
return ret;
}
-static gboolean read_string(XrmDatabase db, char *rname, char **value)
+static gboolean read_string(XrmDatabase db, gchar *rname, gchar **value)
{
gboolean ret = FALSE;
- char *rclass = create_class_name(rname);
- char *rettype;
+ gchar *rclass = create_class_name(rname);
+ gchar *rettype;
XrmValue retvalue;
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
@@ -1139,8 +1139,8 @@ static gboolean read_color(XrmDatabase db, const RrInstance *inst,
gchar *rname, RrColor **value)
{
gboolean ret = FALSE;
- char *rclass = create_class_name(rname);
- char *rettype;
+ gchar *rclass = create_class_name(rname);
+ gchar *rettype;
XrmValue retvalue;
if (XrmGetResource(db, rname, rclass, &rettype, &retvalue) &&
@@ -1161,15 +1161,15 @@ static gboolean read_mask(const RrInstance *inst,
RrPixmapMask **value)
{
gboolean ret = FALSE;
- char *s;
- int hx, hy; /* ignored */
- unsigned int w, h;
- unsigned char *b;
+ gchar *s;
+ gint hx, hy; /* ignored */
+ guint w, h;
+ guchar *b;
s = g_build_filename(theme->path, maskname, NULL);
if (XReadBitmapFileData(s, &w, &h, &b, &hx, &hy) == BitmapSuccess) {
ret = TRUE;
- *value = RrPixmapMaskNew(inst, w, h, (char*)b);
+ *value = RrPixmapMaskNew(inst, w, h, (gchar*)b);
XFree(b);
}
g_free(s);
@@ -1182,7 +1182,7 @@ static void parse_appearance(gchar *tex, RrSurfaceColorType *grad,
gboolean *interlaced, gboolean *border,
gboolean allow_trans)
{
- char *t;
+ gchar *t;
/* convert to all lowercase */
for (t = tex; *t != '\0'; ++t)
@@ -1237,9 +1237,9 @@ static gboolean read_appearance(XrmDatabase db, const RrInstance *inst,
gboolean allow_trans)
{
gboolean ret = FALSE;
- char *rclass = create_class_name(rname);
- char *cname, *ctoname, *bcname, *icname;
- char *rettype;
+ gchar *rclass = create_class_name(rname);
+ gchar *cname, *ctoname, *bcname, *icname;
+ gchar *rettype;
XrmValue retvalue;
cname = g_strconcat(rname, ".color", NULL);