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;
/*! 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
}
}
-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:
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)
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 */
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;
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;
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;
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;
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;
}
}
-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;
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;
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);
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;
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;
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;
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);
#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;
/* 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) {
#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
# 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;
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);
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,
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;
}
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);
}
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,
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,
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;
return FALSE;
}
- *data = g_new(pixel32, pw * ph);
+ *data = g_new(RrPixel32, pw * ph);
increase_depth(inst, *data, xi);
if (mask) {
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,
RrAppearance *parent;
gint parentx;
gint parenty;
- pixel32 *pixel_data;
+ RrPixel32 *RrPixel_data;
};
struct _RrTextureText {
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 {
gboolean RrPixmapToRGBA(const RrInstance *inst,
Pixmap pmap, Pixmap mask,
- gint *w, gint *h, pixel32 **data);
+ gint *w, gint *h, RrPixel32 **data);
#endif /*__render_h*/