summaryrefslogtreecommitdiff
path: root/src/widget/widget.c
diff options
context:
space:
mode:
authororoborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-08-16 21:00:29 +0000
committeroroborus <oroborus@0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e>2008-08-16 21:00:29 +0000
commitc68df329f2483d8fc9b75488c695787cd18c20a4 (patch)
tree18e11cd70360c77606ecdeafe5dbd8f9ff0c12d7 /src/widget/widget.c
parent753fde16397b5943091aa1e9112cea1e5ded0ca5 (diff)
- vsetky widegety pouzivaju widget_t
( priparava na kontajner s widgetmi ) git-svn-id: http://opensvn.csie.org/tuxanci_ng@201 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e
Diffstat (limited to 'src/widget/widget.c')
-rw-r--r--src/widget/widget.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/widget/widget.c b/src/widget/widget.c
new file mode 100644
index 0000000..2d9ee19
--- /dev/null
+++ b/src/widget/widget.c
@@ -0,0 +1,52 @@
+
+#include <stdlib.h>
+#include <assert.h>
+
+#include "main.h"
+
+#include "widget.h"
+#include "widget_label.h"
+
+widget_t* newWidget(int type, int x, int y, int w, int h, void *private_data)
+{
+ widget_t *new;
+
+ new = malloc( sizeof(widget_t) );
+ new->type = type;
+ new->x = x;
+ new->y = y;
+ new->w = w;
+ new->h = h;
+ new->private_data = private_data;
+
+ return new;
+}
+
+void widgetSetLocation(widget_t *p, int x, int y)
+{
+ p->x = x;
+ p->y = y;
+}
+
+void widgetGetLocation(widget_t *p, int *x, int *y)
+{
+ if( x != NULL )*x = p->x;
+ if( y != NULL )*y = p->y;
+}
+
+void widgetSetSize(widget_t *p, int w, int h)
+{
+ p->w = w;
+ p->h = h;
+}
+
+void widgetGetSize(widget_t *p, int *w, int *h)
+{
+ if( w != NULL )*w = p->w;
+ if( h != NULL )*h = p->h;
+}
+
+void destroyWidget(widget_t *p)
+{
+ free(p);
+}