summaryrefslogtreecommitdiff
path: root/src/testWidget.c
blob: d55c3d6160579220c69d421b75137f029da32e54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#include "bdm-widget.h"
#include <cairo/cairo.h>

BDMImage * images;
BDMText * texts;
BDMWidget * mywidget;
int init (BDMWidget * widget)
{
	images = malloc(sizeof(BDMImage));
	texts = malloc(sizeof(BDMText));
	mywidget = widget;

	images->attrib = malloc(sizeof(BDMPaintAttribs));

	images->attrib->x = 500;
	images->attrib->y = 500;
	images->attrib->alpha = 1.0f;
	images->attrib->width = 100;
	images->attrib->height = 100;
	images->attrib->xrot = 0;
	images->attrib->needsPainting = 1;
	images->attrib->cairoOperator = CAIRO_OPERATOR_OVER;
	images->attrib->updateFont = 0;

	images->next = 0;
	images->prev = 0;
	images->widget = widget;

	images->pixbuf = gdk_pixbuf_new_from_file("./babytux.png",NULL);
	images->pixW = gdk_pixbuf_get_width(images->pixbuf);
	images->pixH = gdk_pixbuf_get_height(images->pixbuf);

	texts->attrib = malloc(sizeof(BDMPaintAttribs));

	texts->attrib->x = 100;
	texts->attrib->y = 100;
	texts->attrib->alpha = 1.0f;
	texts->attrib->width = 100;
	texts->attrib->height = 100;
	texts->attrib->xrot = 0;
	texts->attrib->needsPainting = 1;
	texts->attrib->cairoOperator = CAIRO_OPERATOR_OVER;
	texts->attrib->updateFont = 1;

	texts->next = 0;
	texts->prev = 0;
	texts->widget = widget;

	texts->font = NULL;
	texts->text = "Beryl? Sexy stuff!";
	texts->family = "Sans";
	texts->size = 20;
	texts->color[0] = 0x0;
	texts->color[1] = 0x0;
	texts->color[2] = 0x0;
	texts->color[3] = 0xffff;
	texts->style = 0;
	texts->ellipsize = 0;

	widget->attrib->needsPainting = 1;
	return 1;
	
	// Initialize images and texts
}

int fini (void)
{
	// STUFF
	return 1;
}

int update (void)
{
	// BLA
	images->attrib->x+=1;
	return 1;
}

BDMImage * getImages(void)
{
	return images;
}

BDMText * getTexts(void)
{
	return texts;
}

int handleEvent(BDMEvent * event)
{
	return 1;
}