all repos — openbox @ 092616de9a809a1c9a646901521ffcc1f337e913

openbox fork - make it a bit more like ryudo

rename pixel32/16 to RrPixel32/16
Dana Jansens danakj@orodu.net
commit

092616de9a809a1c9a646901521ffcc1f337e913

parent

bd59576748db274c1a5e6ffece5df51d7d700b23

M openbox/client.copenbox/client.c

@@ -1333,7 +1333,7 @@ h = self->icons[j].height = data[i++];

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;
M openbox/client.hopenbox/client.h

@@ -18,7 +18,7 @@

/*! 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
M render/color.crender/color.c

@@ -66,12 +66,12 @@ g_free(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 @@ else

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)
M render/color.hrender/color.h

@@ -33,7 +33,7 @@ };

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 */
M render/gradient.crender/gradient.c

@@ -5,8 +5,8 @@ #include <glib.h>

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_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_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_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_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 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 @@ }

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 @@ + (sp->primary->b << default_blue_offset);

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_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_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_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;
M render/gradient.hrender/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);
M render/image.crender/image.c

@@ -4,9 +4,9 @@ #include "color.h"

#include <glib.h> -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 @@

/* 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) {
M render/image.hrender/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
M render/render.crender/render.c

@@ -15,12 +15,12 @@ #ifdef HAVE_STDLIB_H

# include <stdlib.h> #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 @@ l->xftdraw = XftDrawCreate(RrDisplay(l->inst), l->pixmap,

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 @@ case RR_TEXTURE_TEXT:

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 @@ case RR_TEXTURE_MASK:

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 @@

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 @@ else spc->bevel_light = NULL;

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 @@ RrColorFree(p->secondary);

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 @@ }

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 @@ if (!xm)

return FALSE; } - *data = g_new(pixel32, pw * ph); + *data = g_new(RrPixel32, pw * ph); increase_depth(inst, *data, xi); if (mask) {
M render/render.hrender/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 @@ gboolean border;

RrAppearance *parent; gint parentx; gint parenty; - pixel32 *pixel_data; + RrPixel32 *RrPixel_data; }; struct _RrTextureText {

@@ -101,11 +101,11 @@

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*/