summaryrefslogtreecommitdiff
path: root/src/widget/widget_button.c
diff options
context:
space:
mode:
authorDusan Durech <dusan@debian.debian>2009-04-12 14:29:51 +0200
committerDusan Durech <dusan@debian.debian>2009-04-12 14:29:51 +0200
commit876fc624df9728ee0feee26e1b31b53ed9ef3326 (patch)
treee20814ab6d07fb892284dcee11bc492532bdabaa /src/widget/widget_button.c
parentdff1cbc31ca8d585c01f5bebd08e50cf07fd2b0c (diff)
convert all name function from oldName to new_name
Diffstat (limited to 'src/widget/widget_button.c')
-rw-r--r--src/widget/widget_button.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/widget/widget_button.c b/src/widget/widget_button.c
index ca1573a..f0031ce 100644
--- a/src/widget/widget_button.c
+++ b/src/widget/widget_button.c
@@ -11,20 +11,20 @@
#include "widget.h"
#include "widget_button.h"
-widget_t *newWidgetButton(char *text, int x, int y, void (*fce_event) (void *))
+widget_t *button_new(char *text, int x, int y, void (*fce_event) (void *))
{
widget_button_t *new;
new = malloc(sizeof(widget_button_t));
new->text = strdup(text);
new->fce_event = fce_event;
- getTextSize(text, &(new->w), &(new->h));
+ font_text_size(text, &(new->w), &(new->h));
- return newWidget(WIDGET_TYPE_BUTTON, x, y,
+ return widget_new(WIDGET_TYPE_BUTTON, x, y,
WIDGET_BUTTON_WIDTH, WIDGET_BUTTON_HEIGHT, new);
}
-void drawWidgetButton(widget_t * widget)
+void button_draw(widget_t * widget)
{
widget_button_t *p;
static image_t *g_button0 = NULL;
@@ -35,30 +35,30 @@ void drawWidgetButton(widget_t * widget)
assert(widget->type == WIDGET_TYPE_BUTTON);
p = (widget_button_t *) widget->private_data;
- getMousePosition(&x, &y);
+ interface_get_mouse_position(&x, &y);
if (g_button0 == NULL) {
- g_button0 = addImageData("button0.png", IMAGE_ALPHA, "button0", IMAGE_GROUP_BASE);
+ g_button0 = image_add("button0.png", IMAGE_ALPHA, "button0", IMAGE_GROUP_BASE);
}
if (g_button1 == NULL) {
g_button1 =
- addImageData("button1.png", IMAGE_ALPHA, "button1", IMAGE_GROUP_BASE);
+ image_add("button1.png", IMAGE_ALPHA, "button1", IMAGE_GROUP_BASE);
}
if (x >= widget->x && x <= widget->x + WIDGET_BUTTON_WIDTH &&
y >= widget->y && y <= widget->y + WIDGET_BUTTON_HEIGHT) {
- drawImage(g_button1, widget->x, widget->y, 0, 0, g_button0->w, g_button0->h);
+ image_draw(g_button1, widget->x, widget->y, 0, 0, g_button0->w, g_button0->h);
} else {
- drawImage(g_button0, widget->x, widget->y, 0, 0, g_button0->w, g_button0->h);
+ image_draw(g_button0, widget->x, widget->y, 0, 0, g_button0->w, g_button0->h);
}
- //drawFont(p->text, p->x+WIDGET_BUTTON_WIDTH/2-p->w/2, p->y+p->h/2, COLOR_WHITE);
- drawFont(p->text, widget->x + WIDGET_BUTTON_WIDTH / 2 - p->w / 2,
+ //font_draw(p->text, p->x+WIDGET_BUTTON_WIDTH/2-p->w/2, p->y+p->h/2, COLOR_WHITE);
+ font_draw(p->text, widget->x + WIDGET_BUTTON_WIDTH / 2 - p->w / 2,
widget->y + WIDGET_BUTTON_HEIGHT / 2 - p->h / 2, COLOR_WHITE);
}
-void eventWidgetButton(widget_t * widget)
+void button_event(widget_t * widget)
{
widget_button_t *p;
static int my_time = 0;
@@ -74,11 +74,11 @@ void eventWidgetButton(widget_t * widget)
return;
}
- getMousePosition(&x, &y);
+ interface_get_mouse_position(&x, &y);
if (x >= widget->x && x <= widget->x + WIDGET_BUTTON_WIDTH &&
y >= widget->y && y <= widget->y + WIDGET_BUTTON_HEIGHT &&
- isMouseClicked()) {
+ interface_is_mouse_clicket()) {
my_time = WIDGET_BUTTON_TIME;
DEBUG_MSG(_("Event caught\n"));
@@ -87,7 +87,7 @@ void eventWidgetButton(widget_t * widget)
}
}
-void destroyWidgetButton(widget_t * widget)
+void button_destroy(widget_t * widget)
{
widget_button_t *p;
@@ -99,5 +99,5 @@ void destroyWidgetButton(widget_t * widget)
free(p->text);
free(p);
- destroyWidget(widget);
+ widget_destroy(widget);
}