summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorracarr <racarr>2007-01-28 17:11:48 +0000
committerracarr <racarr>2007-01-28 17:11:48 +0000
commitb21beede0e4f5a15b50f3f2f076f66d3fad324ba (patch)
tree45a2e1de709de8f63549557f666e63c67e885be5
parent1036ab7daf2abda4b75d4fb3c2b541889e8d5fd1 (diff)
downloadberyl-desktop-manager-b21beede0e4f5a15b50f3f2f076f66d3fad324ba.tar.gz
beryl-desktop-manager-b21beede0e4f5a15b50f3f2f076f66d3fad324ba.tar.bz2
Add structs and explanation for bdm-widget system
-rw-r--r--src/bdm-widget.h11
-rw-r--r--src/bdm.h42
2 files changed, 53 insertions, 0 deletions
diff --git a/src/bdm-widget.h b/src/bdm-widget.h
new file mode 100644
index 0000000..435083c
--- /dev/null
+++ b/src/bdm-widget.h
@@ -0,0 +1,11 @@
+#include "bdm.h"
+int init(void);
+int fini(void);
+int update(void);
+
+int getNumImages(void);
+BDMImage * getImages(void);
+
+int getNumText(void);
+BDMText * getText(void);
+
diff --git a/src/bdm.h b/src/bdm.h
index d212902..6f605cb 100644
--- a/src/bdm.h
+++ b/src/bdm.h
@@ -46,4 +46,46 @@ typedef struct _ScreenArea
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;
+
+ int xrot;
+ int yrot;
+
+ int alpha;
+} BDMPaintAttribs;
+
+typedef struct _BDMImage
+{
+ BDMPaintAttribs * attrib;
+
+ GdkPixbuf * pixbuf;
+}
+
+typedef struct _BDMText
+{
+ BDMPaintAttribs * attrib;
+
+ char * text;
+ // Add font information, will use pango
+}
+
GSList * Wallpapers=NULL;