#ifndef _BDM_H #define _BDM_H #include #include #include #include #include #include #include #include #include //quinn was here #define NEW(a,b) a * b ;\ b = malloc(sizeof(a));\ memset((b),0,sizeof(a)); #define TEXT_STYLE_NORMAL (1 << 0) #define TEXT_STYLE_BOLD (1 << 1) #define TEXT_STYLE_ITALIC (1 << 2) typedef enum { WALLPAPER_TYPE_PIXBUF, WALLPAPER_TYPE_COUNT } WallpaperType; typedef struct _PixbufWallpaper { GdkPixbuf * source; int width; int height; } PixbufWallpaper; typedef union _WallUnion { PixbufWallpaper pixbuf; } WallUnion; typedef struct _Wallpaper { WallpaperType type; WallUnion data; } Wallpaper; typedef struct _ScreenArea { int width; int height; Wallpaper * wallpaper; GtkWidget * window; float alpha; } ScreenArea; //Widget engine /* * Let me provide an explanation of how this is supposed to work: * Each widget will be a library, and will have the functions defined in bdm-widget.h. * * At load time init is called at which point a widget should make a BDMImage for each image it plans to render, likewise for text objects. At * that point BDM will then call getNumImages, getImages, likewise for text. At each paint the following happens: For each widget paint each BDMImage and BDMText based on it's current BDMPaintAttribs Call (*widget)->update() which will modify the BDMPaintAttribs of it's components based on information it gathers or has gathered through whatever interesting means it has of doing so. */ typedef struct _BDMPaintAttribs { int width; int height; int x; int y; double xrot; float alpha; int needsPainting; int updateFont; int cairoOperator; } BDMPaintAttribs; typedef struct _BDMImage BDMImage; typedef struct _BDMWidget BDMWidget; struct _BDMImage { BDMPaintAttribs * attrib; BDMImage * next; BDMImage * prev; GdkPixbuf * pixbuf; BDMWidget * widget; int pixW; int pixH; } ; typedef struct _BDMText BDMText; struct _BDMText { BDMPaintAttribs * attrib; BDMText *next; BDMText *prev; char * text; BDMWidget * widget; PangoFontDescription *font; char *family; int size; unsigned short color[4]; unsigned int style; unsigned short ellipsize; } ; typedef struct _BDMEvent { GdkEvent * event; // Add more useful stuff } BDMEvent; typedef int (*BDMWidgetInitProc) (BDMWidget * widget); typedef int (*BDMWidgetFiniProc) (void); typedef int (*BDMWidgetUpdateProc) (void); typedef BDMImage * (*BDMWidgetGetImagesProc) (void); typedef BDMText * (*BDMWidgetGetTextProc) (void); typedef int (*BDMWidgetHandleEventProc) (BDMEvent *event); typedef void (*BDMWidgetSetBDMWidgetProc) (BDMWidget * widget); struct _BDMWidget { BDMPaintAttribs * attrib; BDMImage * images; BDMText * texts; BDMWidget * next; BDMWidget * prev; ScreenArea * screenArea; BDMWidgetInitProc initWidget; BDMWidgetFiniProc finiWidget; BDMWidgetUpdateProc updateWidget; BDMWidgetGetImagesProc getImages; BDMWidgetGetTextProc getTexts; BDMWidgetHandleEventProc handleEvent; }; GSList * Widgets = NULL; GSList * Wallpapers=NULL; #endif