#include <X11/Xft/Xft.h>
#include <glib.h>
#include "color.h"
-#include "font.h"
-
-#ifdef HAVE_STDINT_H
-# include <stdint.h>
-#else
-# ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-# endif
-#endif
-
-#ifdef HAVE_STDINT_H
-typedef uint32_t pixel32;
-typedef uint16_t pixel16;
-#else
-typedef u_int32_t pixel32;
-typedef u_int16_t pixel16;
-#endif /* HAVE_STDINT_H */
-
-#if (G_ENDIAN == G_BIG_ENDIAN)
-#define default_red_shift 0
-#define default_green_shift 8
-#define default_blue_shift 16
-#define endian MSBFirst
-#else
-#define default_red_shift 16
-#define default_green_shift 8
-#define default_blue_shift 0
-#define endian LSBFirst
-#endif /* G_ENDIAN == G_BIG_ENDIAN */
+#include "kernel/geom.h"
typedef enum {
Surface_Planar,
typedef enum {
Bitmask,
Text,
- RGBA
+ RGBA,
+ NoTexture
} TextureType;
+struct Appearance;
+
typedef struct PlanarSurface {
SurfaceColorType grad;
ReliefType relief;
color_rgb *border_color;
gboolean interlaced;
gboolean border;
+ struct Appearance *parent;
+ int parentx;
+ int parenty;
pixel32 *pixel_data;
} PlanarSurface;
SurfaceData data;
} Surface;
+typedef struct {
+ XftFont *xftfont;
+ int height;
+ int elipses_length;
+} ObFont;
+
+typedef enum {
+ Justify_Center,
+ Justify_Left,
+ Justify_Right
+} Justify;
+
typedef struct TextureText {
ObFont *font;
+ Justify justify;
int shadow;
- int offset;
+ char tint;
+ unsigned char offset;
color_rgb *color;
char *string;
-} TextureText;
+} TextureText;
+
+typedef struct {
+ Pixmap mask;
+ guint w, h;
+ char *data;
+} pixmap_mask;
typedef struct TextureMask {
color_rgb *color;
+ pixmap_mask *mask;
} TextureMask;
typedef struct TextureRGBA {
- int poo;
+ guint width;
+ guint height;
+ unsigned long *data;
+/* cached scaled so we don't have to scale often */
+ guint cwidth;
+ guint cheight;
+ unsigned long *cache;
} TextureRGBA;
typedef union {
} TextureData;
typedef struct Texture {
+ Rect position;
TextureType type;
TextureData data;
} Texture;
typedef struct Appearance {
Surface surface;
+ Rect area;
int textures;
Texture *texture;
Pixmap pixmap;
extern int render_depth;
extern Colormap render_colormap;
-void (*paint)(Window win, Appearance *l, int w, int h);
+void (*paint)(Window win, Appearance *l);
void render_startup(void);
void init_appearance(Appearance *l);
-void x_paint(Window win, Appearance *l, int w, int h);
+void x_paint(Window win, Appearance *l);
void render_shutdown(void);
Appearance *appearance_new(SurfaceType type, int numtex);
Appearance *appearance_copy(Appearance *a);
void appearance_free(Appearance *a);
+void truecolor_startup(void);
+void pseudocolor_startup(void);
+void pixel32_to_pixmap(pixel32 *in, Pixmap out, int x, int y, int w, int h);
+
+void appearance_minsize(Appearance *l, int *w, int *h);
+
+void render_pixmap_to_rgba(Pixmap pmap, Pixmap mask,
+ int *w, int *h, gulong **data);
+
#endif /*__render_h*/