From: Dana Jansens Date: Sat, 21 Jun 2003 02:00:42 +0000 (+0000) Subject: rename pixel32/16 to RrPixel32/16 X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=092616de9a809a1c9a646901521ffcc1f337e913;p=chaz%2Fopenbox rename pixel32/16 to RrPixel32/16 --- diff --git a/openbox/client.c b/openbox/client.c index d7a99def..24d77127 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1333,7 +1333,7 @@ void client_update_icons(Client *self) if (w*h == 0) continue; - self->icons[j].data = g_new(pixel32, w * h); + self->icons[j].data = g_new(RrPixel32, w * h); for (x = 0, y = 0, t = 0; t < w * h; ++t, ++x, ++i) { if (x >= w) { x = 0; diff --git a/openbox/client.h b/openbox/client.h index e45b3771..ff7f67c7 100644 --- a/openbox/client.h +++ b/openbox/client.h @@ -18,7 +18,7 @@ struct Group; /*! Holds an icon in ARGB format */ typedef struct Icon { int width, height; - pixel32 *data; + RrPixel32 *data; } Icon; /*! The MWM Hints as retrieved from the window property diff --git a/render/color.c b/render/color.c index 345736a3..73e25769 100644 --- a/render/color.c +++ b/render/color.c @@ -66,12 +66,12 @@ void RrColorFree(RrColor *c) } } -void reduce_depth(const RrInstance *inst, pixel32 *data, XImage *im) +void reduce_depth(const RrInstance *inst, RrPixel32 *data, XImage *im) { int r, g, b; int x,y; - pixel32 *p32 = (pixel32 *) im->data; - pixel16 *p16 = (pixel16 *) im->data; + RrPixel32 *p32 = (RrPixel32 *) im->data; + RrPixel16 *p16 = (RrPixel16 *) im->data; unsigned char *p8 = (unsigned char *)im->data; switch (im->bits_per_pixel) { case 32: @@ -174,12 +174,12 @@ static void swap_byte_order(XImage *im) im->byte_order = LSBFirst; } -void increase_depth(const RrInstance *inst, pixel32 *data, XImage *im) +void increase_depth(const RrInstance *inst, RrPixel32 *data, XImage *im) { int r, g, b; int x,y; - pixel32 *p32 = (pixel32 *) im->data; - pixel16 *p16 = (pixel16 *) im->data; + RrPixel32 *p32 = (RrPixel32 *) im->data; + RrPixel16 *p16 = (RrPixel16 *) im->data; unsigned char *p8 = (unsigned char *)im->data; if (im->byte_order != render_endian) diff --git a/render/color.h b/render/color.h index ba9fb22b..8768d83a 100644 --- a/render/color.h +++ b/render/color.h @@ -33,7 +33,7 @@ struct _RrColor { void color_allocate_gc(RrColor *in); XColor *pickColor(const RrInstance *inst, gint r, gint g, gint b); -void reduce_depth(const RrInstance *inst, pixel32 *data, XImage *im); -void increase_depth(const RrInstance *inst, pixel32 *data, XImage *im); +void reduce_depth(const RrInstance *inst, RrPixel32 *data, XImage *im); +void increase_depth(const RrInstance *inst, RrPixel32 *data, XImage *im); #endif /* __color_h */ diff --git a/render/gradient.c b/render/gradient.c index feb4ad08..fc4c46c7 100644 --- a/render/gradient.c +++ b/render/gradient.c @@ -5,8 +5,8 @@ void gradient_render(RrSurface *sf, int w, int h) { - pixel32 *data = sf->pixel_data; - pixel32 current; + RrPixel32 *data = sf->RrPixel_data; + RrPixel32 current; unsigned int r,g,b; int off, x; @@ -85,8 +85,8 @@ void gradient_render(RrSurface *sf, int w, int h) void gradient_vertical(RrSurface *sf, int w, int h) { - pixel32 *data = sf->pixel_data; - pixel32 current; + RrPixel32 *data = sf->RrPixel_data; + RrPixel32 current; float dr, dg, db; unsigned int r,g,b; int x, y; @@ -114,8 +114,8 @@ void gradient_vertical(RrSurface *sf, int w, int h) void gradient_horizontal(RrSurface *sf, int w, int h) { - pixel32 *data = sf->pixel_data; - pixel32 current; + RrPixel32 *data = sf->RrPixel_data; + RrPixel32 current; float dr, dg, db; unsigned int r,g,b; int x, y; @@ -143,8 +143,8 @@ void gradient_horizontal(RrSurface *sf, int w, int h) void gradient_diagonal(RrSurface *sf, int w, int h) { - pixel32 *data = sf->pixel_data; - pixel32 current; + RrPixel32 *data = sf->RrPixel_data; + RrPixel32 current; float drx, dgx, dbx, dry, dgy, dby; unsigned int r,g,b; int x, y; @@ -181,8 +181,8 @@ void gradient_diagonal(RrSurface *sf, int w, int h) void gradient_crossdiagonal(RrSurface *sf, int w, int h) { - pixel32 *data = sf->pixel_data; - pixel32 current; + RrPixel32 *data = sf->RrPixel_data; + RrPixel32 current; float drx, dgx, dbx, dry, dgy, dby; unsigned int r,g,b; int x, y; @@ -217,11 +217,11 @@ void gradient_crossdiagonal(RrSurface *sf, int w, int h) } } -void highlight(pixel32 *x, pixel32 *y, gboolean raised) +void highlight(RrPixel32 *x, RrPixel32 *y, gboolean raised) { int r, g, b; - pixel32 *up, *down; + RrPixel32 *up, *down; if (raised) { up = x; down = y; @@ -283,7 +283,7 @@ static void create_bevel_colors(RrAppearance *l) void gradient_solid(RrAppearance *l, int x, int y, int w, int h) { - pixel32 pix; + RrPixel32 pix; int i, a, b; RrSurface *sp = &l->surface; int left = x, top = y, right = x + w - 1, bottom = y + h - 1; @@ -296,7 +296,7 @@ void gradient_solid(RrAppearance *l, int x, int y, int w, int h) for (a = 0; a < w; a++) for (b = 0; b < h; b++) - sp->pixel_data[a + b * w] = pix; + sp->RrPixel_data[a + b * w] = pix; XFillRectangle(RrDisplay(l->inst), l->pixmap, sp->primary->gc, x, y, w, h); @@ -392,9 +392,9 @@ void gradient_solid(RrAppearance *l, int x, int y, int w, int h) void gradient_pyramid(RrSurface *sf, int inw, int inh) { - pixel32 *data = sf->pixel_data; - pixel32 *end = data + inw*inh - 1; - pixel32 current; + RrPixel32 *data = sf->RrPixel_data; + RrPixel32 *end = data + inw*inh - 1; + RrPixel32 current; float drx, dgx, dbx, dry, dgy, dby; unsigned int r,g,b; int x, y, h=(inh/2) + 1, w=(inw/2) + 1; @@ -437,9 +437,9 @@ void gradient_pyramid(RrSurface *sf, int inw, int inh) void gradient_rectangle(RrSurface *sf, int inw, int inh) { - pixel32 *data = sf->pixel_data; - pixel32 *end = data + inw*inh - 1; - pixel32 current; + RrPixel32 *data = sf->RrPixel_data; + RrPixel32 *end = data + inw*inh - 1; + RrPixel32 current; float drx, dgx, dbx, dry, dgy, dby; unsigned int r,g,b; int x, y, h=(inh/2) + 1, w=(inw/2) + 1; @@ -485,9 +485,9 @@ void gradient_rectangle(RrSurface *sf, int inw, int inh) void gradient_pipecross(RrSurface *sf, int inw, int inh) { - pixel32 *data = sf->pixel_data; - pixel32 *end = data + inw*inh - 1; - pixel32 current; + RrPixel32 *data = sf->RrPixel_data; + RrPixel32 *end = data + inw*inh - 1; + RrPixel32 current; float drx, dgx, dbx, dry, dgy, dby; unsigned int r,g,b; int x, y, h=(inh/2) + 1, w=(inw/2) + 1; diff --git a/render/gradient.h b/render/gradient.h index 9487ce7f..0c523816 100644 --- a/render/gradient.h +++ b/render/gradient.h @@ -12,7 +12,7 @@ void gradient_pyramid(RrSurface *sf, int w, int h); void gradient_pipecross(RrSurface *sf, int w, int h); void gradient_rectangle(RrSurface *sf, int w, int h); void gradient_solid(RrAppearance *l, int x, int y, int w, int h); -void highlight(pixel32 *x, pixel32 *y, gboolean raised); +void highlight(RrPixel32 *x, RrPixel32 *y, gboolean raised); void render_gl_gradient(RrSurface *sf, int x, int y, int w, int h); diff --git a/render/image.c b/render/image.c index 5209d120..6667abf7 100644 --- a/render/image.c +++ b/render/image.c @@ -4,9 +4,9 @@ #include -void image_draw(pixel32 *target, RrTextureRGBA *rgba, Rect *area) +void image_draw(RrPixel32 *target, RrTextureRGBA *rgba, Rect *area) { - pixel32 *draw = rgba->data; + RrPixel32 *draw = rgba->data; gint c, i, e, t, sfw, sfh; sfw = area->width; sfh = area->height; @@ -24,7 +24,7 @@ void image_draw(pixel32 *target, RrTextureRGBA *rgba, Rect *area) /* scale it and cache it */ if (rgba->cache != NULL) g_free(rgba->cache); - rgba->cache = g_new(pixel32, sfw * sfh); + rgba->cache = g_new(RrPixel32, sfw * sfh); rgba->cwidth = sfw; rgba->cheight = sfh; for (i = 0, c = 0, e = sfw*sfh; i < e; ++i) { diff --git a/render/image.h b/render/image.h index 65c2ad5c..e92ce0f6 100644 --- a/render/image.h +++ b/render/image.h @@ -4,6 +4,6 @@ #include "render.h" #include "../kernel/geom.h" -void image_draw(pixel32 *target, RrTextureRGBA *rgba, Rect *area); +void image_draw(RrPixel32 *target, RrTextureRGBA *rgba, Rect *area); #endif diff --git a/render/render.c b/render/render.c index f2a0572f..82c9e26f 100644 --- a/render/render.c +++ b/render/render.c @@ -15,12 +15,12 @@ # include #endif -static void pixel32_to_pixmap(RrAppearance *l, gint x, gint y, gint w, gint h); +static void RrPixel32_to_pixmap(RrAppearance *l, gint x, gint y, gint w, gint h); void RrPaint(RrAppearance *l, Window win, gint w, gint h) { int i, transferred = 0, sw; - pixel32 *source, *dest; + RrPixel32 *source, *dest; Pixmap oldp; Rect tarea; /* area in which to draw textures */ gboolean resized; @@ -47,19 +47,19 @@ void RrPaint(RrAppearance *l, Window win, gint w, gint h) RrVisual(l->inst), RrColormap(l->inst)); g_assert(l->xftdraw != NULL); - g_free(l->surface.pixel_data); - l->surface.pixel_data = g_new(pixel32, w * h); + g_free(l->surface.RrPixel_data); + l->surface.RrPixel_data = g_new(RrPixel32, w * h); if (l->surface.grad == RR_SURFACE_PARENTREL) { g_assert (l->surface.parent); g_assert (l->surface.parent->w); sw = l->surface.parent->w; - source = (l->surface.parent->surface.pixel_data + l->surface.parentx + + source = (l->surface.parent->surface.RrPixel_data + l->surface.parentx + sw * l->surface.parenty); - dest = l->surface.pixel_data; + dest = l->surface.RrPixel_data; for (i = 0; i < h; i++, source += sw, dest += w) { - memcpy(dest, source, w * sizeof(pixel32)); + memcpy(dest, source, w * sizeof(RrPixel32)); } } else if (l->surface.grad == RR_SURFACE_SOLID) gradient_solid(l, 0, 0, w, h); @@ -93,7 +93,7 @@ void RrPaint(RrAppearance *l, Window win, gint w, gint h) if (!transferred) { transferred = 1; if (l->surface.grad != RR_SURFACE_SOLID) - pixel32_to_pixmap(l, 0, 0, w, h); + RrPixel32_to_pixmap(l, 0, 0, w, h); } if (l->xftdraw == NULL) { l->xftdraw = XftDrawCreate(RrDisplay(l->inst), l->pixmap, @@ -106,14 +106,14 @@ void RrPaint(RrAppearance *l, Window win, gint w, gint h) if (!transferred) { transferred = 1; if (l->surface.grad != RR_SURFACE_SOLID) - pixel32_to_pixmap(l, 0, 0, w, h); + RrPixel32_to_pixmap(l, 0, 0, w, h); } if (l->texture[i].data.mask.color->gc == None) color_allocate_gc(l->texture[i].data.mask.color); RrPixmapMaskDraw(l->pixmap, &l->texture[i].data.mask, &tarea); break; case RR_TEXTURE_RGBA: - image_draw(l->surface.pixel_data, + image_draw(l->surface.RrPixel_data, &l->texture[i].data.rgba, &tarea); break; } @@ -122,7 +122,7 @@ void RrPaint(RrAppearance *l, Window win, gint w, gint h) if (!transferred) { transferred = 1; if (l->surface.grad != RR_SURFACE_SOLID) - pixel32_to_pixmap(l, 0, 0, w, h); + RrPixel32_to_pixmap(l, 0, 0, w, h); } @@ -192,7 +192,7 @@ RrAppearance *RrAppearanceCopy(RrAppearance *orig) spc->interlaced = spo->interlaced; spc->border = spo->border; - spc->pixel_data = NULL; + spc->RrPixel_data = NULL; copy->textures = orig->textures; copy->texture = g_memdup(orig->texture, @@ -217,30 +217,30 @@ void RrAppearanceFree(RrAppearance *a) RrColorFree(p->border_color); RrColorFree(p->bevel_dark); RrColorFree(p->bevel_light); - g_free(p->pixel_data); + g_free(p->RrPixel_data); g_free(a); } } -static void pixel32_to_pixmap(RrAppearance *l, gint x, gint y, gint w, gint h) +static void RrPixel32_to_pixmap(RrAppearance *l, gint x, gint y, gint w, gint h) { - pixel32 *in, *scratch; + RrPixel32 *in, *scratch; Pixmap out; XImage *im = NULL; im = XCreateImage(RrDisplay(l->inst), RrVisual(l->inst), RrDepth(l->inst), ZPixmap, 0, NULL, w, h, 32, 0); g_assert(im != NULL); - in = l->surface.pixel_data; + in = l->surface.RrPixel_data; out = l->pixmap; im->byte_order = render_endian; /* this malloc is a complete waste of time on normal 32bpp as reduce_depth just sets im->data = data and returns */ - scratch = g_new(pixel32, im->width * im->height); + scratch = g_new(RrPixel32, im->width * im->height); im->data = (char*) scratch; reduce_depth(l->inst, in, im); XPutImage(RrDisplay(l->inst), out, @@ -305,7 +305,7 @@ void RrMinsize(RrAppearance *l, gint *w, gint *h) gboolean RrPixmapToRGBA(const RrInstance *inst, Pixmap pmap, Pixmap mask, - gint *w, gint *h, pixel32 **data) + gint *w, gint *h, RrPixel32 **data) { Window xr; gint xx, xy; @@ -335,7 +335,7 @@ gboolean RrPixmapToRGBA(const RrInstance *inst, return FALSE; } - *data = g_new(pixel32, pw * ph); + *data = g_new(RrPixel32, pw * ph); increase_depth(inst, *data, xi); if (mask) { diff --git a/render/render.h b/render/render.h index fb48bd5f..30bf4846 100644 --- a/render/render.h +++ b/render/render.h @@ -18,8 +18,8 @@ typedef struct _RrPixmapMask RrPixmapMask; typedef struct _RrInstance RrInstance; typedef struct _RrColor RrColor; -typedef guint32 pixel32; /* XXX prefix */ -typedef guint16 pixel16; +typedef guint32 RrPixel32; +typedef guint16 RrPixel16; typedef enum { RR_RELIEF_FLAT, @@ -72,7 +72,7 @@ struct _RrSurface { RrAppearance *parent; gint parentx; gint parenty; - pixel32 *pixel_data; + RrPixel32 *RrPixel_data; }; struct _RrTextureText { @@ -101,11 +101,11 @@ struct _RrTextureMask { struct _RrTextureRGBA { gint width; gint height; - pixel32 *data; + RrPixel32 *data; /* cached scaled so we don't have to scale often */ gint cwidth; gint cheight; - pixel32 *cache; + RrPixel32 *cache; }; union _RrTextureData { @@ -166,6 +166,6 @@ void RrMinsize (RrAppearance *l, gint *w, gint *h); gboolean RrPixmapToRGBA(const RrInstance *inst, Pixmap pmap, Pixmap mask, - gint *w, gint *h, pixel32 **data); + gint *w, gint *h, RrPixel32 **data); #endif /*__render_h*/