summaryrefslogtreecommitdiff
path: root/src/widget
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget')
-rw-r--r--src/widget/widget.c12
-rw-r--r--src/widget/widget.h12
-rw-r--r--src/widget/widget_button.c32
-rw-r--r--src/widget/widget_button.h8
-rw-r--r--src/widget/widget_buttonimage.c20
-rw-r--r--src/widget/widget_buttonimage.h10
-rw-r--r--src/widget/widget_catchkey.c24
-rw-r--r--src/widget/widget_catchkey.h12
-rw-r--r--src/widget/widget_check.c26
-rw-r--r--src/widget/widget_check.h12
-rw-r--r--src/widget/widget_choicegroup.c36
-rw-r--r--src/widget/widget_choicegroup.h14
-rw-r--r--src/widget/widget_image.c14
-rw-r--r--src/widget/widget_image.h8
-rw-r--r--src/widget/widget_label.c20
-rw-r--r--src/widget/widget_label.h8
-rw-r--r--src/widget/widget_select.c44
-rw-r--r--src/widget/widget_select.h16
-rw-r--r--src/widget/widget_textfield.c40
-rw-r--r--src/widget/widget_textfield.h12
20 files changed, 190 insertions, 190 deletions
diff --git a/src/widget/widget.c b/src/widget/widget.c
index b72a463..9cf2e7e 100644
--- a/src/widget/widget.c
+++ b/src/widget/widget.c
@@ -7,7 +7,7 @@
#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 *widget_new(int type, int x, int y, int w, int h, void *private_data)
{
widget_t *new;
@@ -22,13 +22,13 @@ widget_t *newWidget(int type, int x, int y, int w, int h, void *private_data)
return new;
}
-void widgetSetLocation(widget_t * p, int x, int y)
+void widget_set_location(widget_t * p, int x, int y)
{
p->x = x;
p->y = y;
}
-void widgetGetLocation(widget_t * p, int *x, int *y)
+void widget_get_location(widget_t * p, int *x, int *y)
{
if (x != NULL)
*x = p->x;
@@ -37,13 +37,13 @@ void widgetGetLocation(widget_t * p, int *x, int *y)
*y = p->y;
}
-void widgetSetSize(widget_t * p, int w, int h)
+void widget_get_size(widget_t * p, int w, int h)
{
p->w = w;
p->h = h;
}
-void widgetGetSize(widget_t * p, int *w, int *h)
+void widget_set_size(widget_t * p, int *w, int *h)
{
if (w != NULL)
*w = p->w;
@@ -52,7 +52,7 @@ void widgetGetSize(widget_t * p, int *w, int *h)
*h = p->h;
}
-void destroyWidget(widget_t * p)
+void widget_destroy(widget_t * p)
{
free(p);
}
diff --git a/src/widget/widget.h b/src/widget/widget.h
index c18a687..ad0f9a6 100644
--- a/src/widget/widget.h
+++ b/src/widget/widget.h
@@ -22,12 +22,12 @@ typedef struct widget_struct {
void *private_data;
} widget_t;
-extern widget_t *newWidget(int type, int x, int y, int w, int h,
+extern widget_t *widget_new(int type, int x, int y, int w, int h,
void *private_data);
-extern void widgetSetLocation(widget_t * p, int x, int y);
-extern void widgetGetLocation(widget_t * p, int *x, int *y);
-extern void widgetSetSize(widget_t * p, int w, int h);
-extern void widgetGetSize(widget_t * p, int *w, int *h);
-extern void destroyWidget(widget_t * p);
+extern void widget_set_location(widget_t * p, int x, int y);
+extern void widget_get_location(widget_t * p, int *x, int *y);
+extern void widget_get_size(widget_t * p, int w, int h);
+extern void widget_set_size(widget_t * p, int *w, int *h);
+extern void widget_destroy(widget_t * p);
#endif
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);
}
diff --git a/src/widget/widget_button.h b/src/widget/widget_button.h
index ac238be..a42e35c 100644
--- a/src/widget/widget_button.h
+++ b/src/widget/widget_button.h
@@ -17,10 +17,10 @@ typedef struct widget_button {
void (*fce_event) (void *);
} widget_button_t;
-extern widget_t *newWidgetButton(char *text, int x, int y,
+extern widget_t *button_new(char *text, int x, int y,
void (*fce_event) (void *));
-extern void drawWidgetButton(widget_t * widget);
-extern void eventWidgetButton(widget_t * widget);
-extern void destroyWidgetButton(widget_t * widget);
+extern void button_draw(widget_t * widget);
+extern void button_event(widget_t * widget);
+extern void button_destroy(widget_t * widget);
#endif
diff --git a/src/widget/widget_buttonimage.c b/src/widget/widget_buttonimage.c
index a896142..a924c5d 100644
--- a/src/widget/widget_buttonimage.c
+++ b/src/widget/widget_buttonimage.c
@@ -10,7 +10,7 @@
#include "widget.h"
#include "widget_buttonimage.h"
-widget_t *newWidgetButtonimage(image_t * image, int x, int y, void (*fce_event) (void *))
+widget_t *buttonImage_new(image_t * image, int x, int y, void (*fce_event) (void *))
{
widget_buttonimage_t *new;
@@ -21,10 +21,10 @@ widget_t *newWidgetButtonimage(image_t * image, int x, int y, void (*fce_event)
new->active = 0;
new->fce_event = fce_event;
- return newWidget(WIDGET_TYPE_BUTTONIMAGE, x, y, new->w, new->h, new);
+ return widget_new(WIDGET_TYPE_BUTTONIMAGE, x, y, new->w, new->h, new);
}
-void setWidgetButtonimageActive(widget_t * widget, bool_t active)
+void buttonImage_set_active(widget_t * widget, bool_t active)
{
widget_buttonimage_t *p;
@@ -35,7 +35,7 @@ void setWidgetButtonimageActive(widget_t * widget, bool_t active)
p->active = active;
}
-void drawWidgetButtonimage(widget_t * widget)
+void buttonImage_draw(widget_t * widget)
{
widget_buttonimage_t *p;
@@ -43,10 +43,10 @@ void drawWidgetButtonimage(widget_t * widget)
assert(widget->type == WIDGET_TYPE_BUTTONIMAGE);
p = (widget_buttonimage_t *) widget->private_data;
- drawImage(p->image, widget->x, widget->y, p->active * p->w, 0, p->w, p->h);
+ image_draw(p->image, widget->x, widget->y, p->active * p->w, 0, p->w, p->h);
}
-void eventWidgetButtonimage(widget_t * widget)
+void buttonImage_event(widget_t * widget)
{
widget_buttonimage_t *p;
static int my_time = 0;
@@ -62,17 +62,17 @@ void eventWidgetButtonimage(widget_t * widget)
return;
}
- getMousePosition(&x, &y);
+ interface_get_mouse_position(&x, &y);
if (x >= widget->x && x <= widget->x + p->w &&
- y >= widget->y && y <= widget->y + p->h && isMouseClicked()) {
+ y >= widget->y && y <= widget->y + p->h && interface_is_mouse_clicket()) {
my_time = WIDGET_BUTTONIMAGE_TIME;
p->active = 1;
p->fce_event(widget);
}
}
-void destroyWidgetButtonimage(widget_t * widget)
+void buttonImage_destroy(widget_t * widget)
{
widget_buttonimage_t *p;
@@ -82,5 +82,5 @@ void destroyWidgetButtonimage(widget_t * widget)
p = (widget_buttonimage_t *) widget->private_data;
free(p);
- destroyWidget(widget);
+ widget_destroy(widget);
}
diff --git a/src/widget/widget_buttonimage.h b/src/widget/widget_buttonimage.h
index 5a0ab7c..2b05fe6 100644
--- a/src/widget/widget_buttonimage.h
+++ b/src/widget/widget_buttonimage.h
@@ -16,12 +16,12 @@ typedef struct widget_buttonimageimage {
void (*fce_event) (void *);
} widget_buttonimage_t;
-extern widget_t *newWidgetButtonimage(image_t * image, int x, int y,
+extern widget_t *buttonImage_new(image_t * image, int x, int y,
void (*fce_event) (void *));
-extern void setWidgetButtonimageActive(widget_t * widget, bool_t active);
-extern void drawWidgetButtonimage(widget_t * widget);
-extern void eventWidgetButtonimage(widget_t * widget);
-extern void destroyWidgetButtonimage(widget_t * widget);
+extern void buttonImage_set_active(widget_t * widget, bool_t active);
+extern void buttonImage_draw(widget_t * widget);
+extern void buttonImage_event(widget_t * widget);
+extern void buttonImage_destroy(widget_t * widget);
#endif
diff --git a/src/widget/widget_catchkey.c b/src/widget/widget_catchkey.c
index b213890..6e1268c 100644
--- a/src/widget/widget_catchkey.c
+++ b/src/widget/widget_catchkey.c
@@ -9,7 +9,7 @@
#include "widget.h"
#include "widget_catchkey.h"
-widget_t *newWidgetCatchkey(int key, int x, int y, void *event)
+widget_t *catchKey_new(int key, int x, int y, void *event)
{
widget_catchkey_t *new;
@@ -18,10 +18,10 @@ widget_t *newWidgetCatchkey(int key, int x, int y, void *event)
new->fce_event = event;
new->active = FALSE;
- return newWidget(WIDGET_TYPE_CATCHKEY, x, y, WIDGET_CATCHKEY_WIDTH, WIDGET_CATCHKEY_HEIGHT, new);
+ return widget_new(WIDGET_TYPE_CATCHKEY, x, y, WIDGET_CATCHKEY_WIDTH, WIDGET_CATCHKEY_HEIGHT, new);
}
-int getWidgetCatchKey(widget_t * widget)
+int catchKey_get(widget_t * widget)
{
widget_catchkey_t *p;
@@ -33,7 +33,7 @@ int getWidgetCatchKey(widget_t * widget)
return p->key;
}
-void setWidgetCatchKey(widget_t * widget, int key)
+void catchKey_set(widget_t * widget, int key)
{
widget_catchkey_t *p;
@@ -45,7 +45,7 @@ void setWidgetCatchKey(widget_t * widget, int key)
p->key = key;
}
-void drawWidgetCatchkey(widget_t * widget)
+void catchKey_draw(widget_t * widget)
{
widget_catchkey_t *p;
char *name;
@@ -65,9 +65,9 @@ void drawWidgetCatchkey(widget_t * widget)
}
if (p->active) {
- drawFont(name, widget->x, widget->y, COLOR_RED);
+ font_draw(name, widget->x, widget->y, COLOR_RED);
} else {
- drawFont(name, widget->x, widget->y, COLOR_WHITE);
+ font_draw(name, widget->x, widget->y, COLOR_WHITE);
}
}
@@ -93,7 +93,7 @@ static int getPessAnyKey()
return WIDGET_CATCHKEY_NOKEY;
}
-void eventWidgetCatchkey(widget_t * widget)
+void catchKey_event(widget_t * widget)
{
widget_catchkey_t *p;
int x, y;
@@ -103,9 +103,9 @@ void eventWidgetCatchkey(widget_t * widget)
p = (widget_catchkey_t *) widget->private_data;
- getMousePosition(&x, &y);
+ interface_get_mouse_position(&x, &y);
- if (isMouseClicked()) {
+ if (interface_is_mouse_clicket()) {
if (x >= widget->x && x <= widget->x + WIDGET_CATCHKEY_WIDTH &&
y >= widget->y && y <= widget->y + WIDGET_CATCHKEY_HEIGHT) {
p->active = TRUE;
@@ -126,7 +126,7 @@ void eventWidgetCatchkey(widget_t * widget)
}
}
-void destroyWidgetCatchkey(widget_t * widget)
+void catchKey_destroy(widget_t * widget)
{
widget_catchkey_t *p;
@@ -136,5 +136,5 @@ void destroyWidgetCatchkey(widget_t * widget)
p = (widget_catchkey_t *) widget->private_data;
free(p);
- destroyWidget(widget);
+ widget_destroy(widget);
}
diff --git a/src/widget/widget_catchkey.h b/src/widget/widget_catchkey.h
index 106bc92..6a431e4 100644
--- a/src/widget/widget_catchkey.h
+++ b/src/widget/widget_catchkey.h
@@ -17,11 +17,11 @@ typedef struct widget_catchkey_struct {
void (*fce_event) (void *p);
} widget_catchkey_t;
-extern widget_t *newWidgetCatchkey(int key, int x, int y, void *event);
-extern int getWidgetCatchKey(widget_t * p);
-extern void setWidgetCatchKey(widget_t * p, int key);
-extern void drawWidgetCatchkey(widget_t * p);
-extern void eventWidgetCatchkey(widget_t * p);
-extern void destroyWidgetCatchkey(widget_t * p);
+extern widget_t *catchKey_new(int key, int x, int y, void *event);
+extern int catchKey_get(widget_t * p);
+extern void catchKey_set(widget_t * p, int key);
+extern void catchKey_draw(widget_t * p);
+extern void catchKey_event(widget_t * p);
+extern void catchKey_destroy(widget_t * p);
#endif
diff --git a/src/widget/widget_check.c b/src/widget/widget_check.c
index e574211..07c5da5 100644
--- a/src/widget/widget_check.c
+++ b/src/widget/widget_check.c
@@ -9,7 +9,7 @@
#include "widget.h"
#include "widget_check.h"
-widget_t *newWidgetCheck(int x, int y, bool_t status, void (*fce_event) (void *))
+widget_t *check_new(int x, int y, bool_t status, void (*fce_event) (void *))
{
widget_check_t *new;
@@ -18,10 +18,10 @@ widget_t *newWidgetCheck(int x, int y, bool_t status, void (*fce_event) (void *
new->status = status;
new->fce_event = fce_event;
- return newWidget(WIDGET_TYPE_CHECK, x, y, WIDGET_CHECK_WIDTH, WIDGET_CHECK_HEIGHT, new);
+ return widget_new(WIDGET_TYPE_CHECK, x, y, WIDGET_CHECK_WIDTH, WIDGET_CHECK_HEIGHT, new);
}
-void drawWidgetCheck(widget_t * widget)
+void check_draw(widget_t * widget)
{
widget_check_t *p;
static image_t *g_check = NULL;
@@ -33,10 +33,10 @@ void drawWidgetCheck(widget_t * widget)
p = (widget_check_t *) widget->private_data;
- getMousePosition(&x, &y);
+ interface_get_mouse_position(&x, &y);
if (g_check == NULL) {
- g_check = addImageData("check.png", IMAGE_ALPHA, "check", IMAGE_GROUP_BASE);
+ g_check = image_add("check.png", IMAGE_ALPHA, "check", IMAGE_GROUP_BASE);
}
if (p->status == TRUE) {
@@ -45,10 +45,10 @@ void drawWidgetCheck(widget_t * widget)
offset = WIDGET_CHECK_WIDTH;
}
- drawImage(g_check, widget->x, widget->y, offset, 0, WIDGET_CHECK_WIDTH, WIDGET_CHECK_HEIGHT);
+ image_draw(g_check, widget->x, widget->y, offset, 0, WIDGET_CHECK_WIDTH, WIDGET_CHECK_HEIGHT);
}
-void eventWidgetCheck(widget_t * widget)
+void check_event(widget_t * widget)
{
widget_check_t *p;
int x, y;
@@ -63,11 +63,11 @@ void eventWidgetCheck(widget_t * widget)
return;
}
- getMousePosition(&x, &y);
+ interface_get_mouse_position(&x, &y);
if (x >= widget->x && x <= widget->x + WIDGET_CHECK_WIDTH &&
y >= widget->y && y <= widget->y + WIDGET_CHECK_HEIGHT &&
- isMouseClicked()) {
+ interface_is_mouse_clicket()) {
if (p->status == TRUE) {
p->status = FALSE;
p->time = WIDGET_CHECK_TIME_SWITCH_STATUS;
@@ -82,7 +82,7 @@ void eventWidgetCheck(widget_t * widget)
}
}
-bool_t getWidgetCheckStatus(widget_t * widget)
+bool_t check_get_status(widget_t * widget)
{
widget_check_t *p;
@@ -94,7 +94,7 @@ bool_t getWidgetCheckStatus(widget_t * widget)
return p->status;
}
-void setWidgetCheckStatus(widget_t * widget, bool_t status)
+void check_set_status(widget_t * widget, bool_t status)
{
widget_check_t *p;
@@ -105,7 +105,7 @@ void setWidgetCheckStatus(widget_t * widget, bool_t status)
p->status = status;
}
-void destroyWidgetCheck(widget_t * widget)
+void check_destroy(widget_t * widget)
{
widget_check_t *p;
@@ -114,5 +114,5 @@ void destroyWidgetCheck(widget_t * widget)
p = (widget_check_t *) widget->private_data;
free(p);
- destroyWidget(widget);
+ widget_destroy(widget);
}
diff --git a/src/widget/widget_check.h b/src/widget/widget_check.h
index 007e82c..5969541 100644
--- a/src/widget/widget_check.h
+++ b/src/widget/widget_check.h
@@ -17,12 +17,12 @@ typedef struct widget_check {
void (*fce_event) (void *);
} widget_check_t;
-extern widget_t *newWidgetCheck(int x, int y, bool_t status,
+extern widget_t *check_new(int x, int y, bool_t status,
void (*fce_event) (void *));
-extern void drawWidgetCheck(widget_t * widget);
-extern void eventWidgetCheck(widget_t * widget);
-extern bool_t getWidgetCheckStatus(widget_t * widget);
-extern void setWidgetCheckStatus(widget_t * widget, bool_t status);
-extern void destroyWidgetCheck(widget_t * widget);
+extern void check_draw(widget_t * widget);
+extern void check_event(widget_t * widget);
+extern bool_t check_get_status(widget_t * widget);
+extern void check_set_status(widget_t * widget, bool_t status);
+extern void check_destroy(widget_t * widget);
#endif
diff --git a/src/widget/widget_choicegroup.c b/src/widget/widget_choicegroup.c
index 5173164..700c043 100644
--- a/src/widget/widget_choicegroup.c
+++ b/src/widget/widget_choicegroup.c
@@ -9,7 +9,7 @@
#include "widget.h"
#include "widget_choicegroup.h"
-widget_t *newWidgetChoicegroup(int x, int y, bool_t status, list_t * list, void (*fce_event) (void *))
+widget_t *choiceGroup_new(int x, int y, bool_t status, list_t * list, void (*fce_event) (void *))
{
widget_choicegroup_t *new;
widget_t *widget;
@@ -20,14 +20,14 @@ widget_t *newWidgetChoicegroup(int x, int y, bool_t status, list_t * list, void
new->fce_event = fce_event;
new->list = list;
- widget = newWidget(WIDGET_TYPE_CHOICE, x, y, WIDGET_CHOICEGROUP_WIDTH, WIDGET_CHOICEGROUP_HEIGHT, new);
+ widget = widget_new(WIDGET_TYPE_CHOICE, x, y, WIDGET_CHOICEGROUP_WIDTH, WIDGET_CHOICEGROUP_HEIGHT, new);
- addList(new->list, widget);
+ list_add(new->list, widget);
return widget;
}
-void drawWidgetChoicegroup(widget_t * widget)
+void choiceGroup_draw(widget_t * widget)
{
widget_choicegroup_t *p;
static image_t *g_choicegroup = NULL;
@@ -39,10 +39,10 @@ void drawWidgetChoicegroup(widget_t * widget)
p = (widget_choicegroup_t *) widget->private_data;
- getMousePosition(&x, &y);
+ interface_get_mouse_position(&x, &y);
if (g_choicegroup == NULL) {
- g_choicegroup = addImageData("choice.png", IMAGE_ALPHA, "choicegroup", IMAGE_GROUP_BASE);
+ g_choicegroup = image_add("choice.png", IMAGE_ALPHA, "choicegroup", IMAGE_GROUP_BASE);
}
if (p->status == TRUE) {
@@ -51,11 +51,11 @@ void drawWidgetChoicegroup(widget_t * widget)
offset = WIDGET_CHOICEGROUP_WIDTH;
}
- drawImage(g_choicegroup, widget->x, widget->y, offset, 0,
+ image_draw(g_choicegroup, widget->x, widget->y, offset, 0,
WIDGET_CHOICEGROUP_WIDTH, WIDGET_CHOICEGROUP_HEIGHT);
}
-void setWidgetChoiceActive(widget_t * widget)
+void choiceGroup_set_active(widget_t * widget)
{
widget_choicegroup_t *p;
int i;
@@ -82,7 +82,7 @@ void setWidgetChoiceActive(widget_t * widget)
}
}
-bool_t getWidgetChoiceStatus(widget_t * widget)
+bool_t choiceGroup_get_status(widget_t * widget)
{
widget_choicegroup_t *p;
@@ -94,7 +94,7 @@ bool_t getWidgetChoiceStatus(widget_t * widget)
return p->status;
}
-void setWidgetChoiceStatus(widget_t * widget, bool_t status)
+void choiceGroup_set_status(widget_t * widget, bool_t status)
{
widget_choicegroup_t *p;
@@ -105,7 +105,7 @@ void setWidgetChoiceStatus(widget_t * widget, bool_t status)
p->status = status;
}
-void eventWidgetChoicegroup(widget_t * widget)
+void choiceGroup_event(widget_t * widget)
{
widget_choicegroup_t *p;
int x, y;
@@ -120,16 +120,16 @@ void eventWidgetChoicegroup(widget_t * widget)
return;
}
- getMousePosition(&x, &y);
+ interface_get_mouse_position(&x, &y);
if (x >= widget->x && x <= widget->x + WIDGET_CHOICEGROUP_WIDTH &&
y >= widget->y && y <= widget->y + WIDGET_CHOICEGROUP_HEIGHT &&
- isMouseClicked()) {
- setWidgetChoiceActive(widget);
+ interface_is_mouse_clicket()) {
+ choiceGroup_set_active(widget);
}
}
-void destroyWidgetChoicegroup(widget_t * widget)
+void choiceGroup_destroy(widget_t * widget)
{
widget_choicegroup_t *p;
int my_index;
@@ -138,10 +138,10 @@ void destroyWidgetChoicegroup(widget_t * widget)
assert(widget->type == WIDGET_TYPE_CHOICE);
p = (widget_choicegroup_t *) widget->private_data;
- my_index = searchListItem(p->list, widget);
+ my_index = list_search(p->list, widget);
assert(my_index != -1);
- delList(p->list, my_index);
+ list_del(p->list, my_index);
free(p);
- destroyWidget(widget);
+ widget_destroy(widget);
}
diff --git a/src/widget/widget_choicegroup.h b/src/widget/widget_choicegroup.h
index a892d74..a74b0d8 100644
--- a/src/widget/widget_choicegroup.h
+++ b/src/widget/widget_choicegroup.h
@@ -19,15 +19,15 @@ typedef struct widget_choicegroup {
list_t *list;
} widget_choicegroup_t;
-extern widget_t *newWidgetChoicegroup(int x, int y, bool_t status,
+extern widget_t *choiceGroup_new(int x, int y, bool_t status,
list_t * list,
void (*fce_event) (void *));
-extern void drawWidgetChoicegroup(widget_t * p);
-extern void setWidgetChoiceActive(widget_t * widget);
-extern bool_t getWidgetChoiceStatus(widget_t * widget);
-extern void setWidgetChoiceStatus(widget_t * widget, bool_t status);
-extern void eventWidgetChoicegroup(widget_t * p);
-extern void destroyWidgetChoicegroup(widget_t * p);
+extern void choiceGroup_draw(widget_t * p);
+extern void choiceGroup_set_active(widget_t * widget);
+extern bool_t choiceGroup_get_status(widget_t * widget);
+extern void choiceGroup_set_status(widget_t * widget, bool_t status);
+extern void choiceGroup_event(widget_t * p);
+extern void choiceGroup_destroy(widget_t * p);
#endif
diff --git a/src/widget/widget_image.c b/src/widget/widget_image.c
index ad49f9e..ed07cb0 100644
--- a/src/widget/widget_image.c
+++ b/src/widget/widget_image.c
@@ -11,17 +11,17 @@
#include "widget.h"
#include "widget_image.h"
-widget_t *newWidgetImage(int x, int y, image_t * image)
+widget_t *wid_image_new(int x, int y, image_t * image)
{
widget_image_t *new;
new = malloc(sizeof(widget_image_t));
new->image = image;
- return newWidget(WIDGET_TYPE_IMAGE, x, y, image->w, image->h, new);
+ return widget_new(WIDGET_TYPE_IMAGE, x, y, image->w, image->h, new);
}
-void drawWidgetImage(widget_t * widget)
+void wid_image_draw(widget_t * widget)
{
widget_image_t *p;
@@ -29,16 +29,16 @@ void drawWidgetImage(widget_t * widget)
assert(widget->type == WIDGET_TYPE_IMAGE);
p = (widget_image_t *) widget->private_data;
- drawImage(p->image, widget->x, widget->y, 0, 0, p->image->w, p->image->h);
+ image_draw(p->image, widget->x, widget->y, 0, 0, p->image->w, p->image->h);
}
-void eventWidgetImage(widget_t * widget)
+void wid_image_event(widget_t * widget)
{
assert(widget != NULL);
assert(widget->type == WIDGET_TYPE_IMAGE);
}
-void destroyWidgetImage(widget_t * widget)
+void wid_image_destroy(widget_t * widget)
{
widget_image_t *p;
@@ -48,5 +48,5 @@ void destroyWidgetImage(widget_t * widget)
p = (widget_image_t *) widget->private_data;
free(p);
- destroyWidget(widget);
+ widget_destroy(widget);
}
diff --git a/src/widget/widget_image.h b/src/widget/widget_image.h
index 081fbda..2af63e6 100644
--- a/src/widget/widget_image.h
+++ b/src/widget/widget_image.h
@@ -11,9 +11,9 @@ typedef struct widget_image {
image_t *image;
} widget_image_t;
-extern widget_t *newWidgetImage(int x, int y, image_t * image);
-extern void drawWidgetImage(widget_t * p);
-extern void eventWidgetImage(widget_t * p);
-extern void destroyWidgetImage(widget_t * p);
+extern widget_t *wid_image_new(int x, int y, image_t * image);
+extern void wid_image_draw(widget_t * p);
+extern void wid_image_event(widget_t * p);
+extern void wid_image_destroy(widget_t * p);
#endif
diff --git a/src/widget/widget_label.c b/src/widget/widget_label.c
index e3c907c..8ef7fad 100644
--- a/src/widget/widget_label.c
+++ b/src/widget/widget_label.c
@@ -8,19 +8,19 @@
#include "widget_label.h"
#include "widget.h"
-widget_t *newWidgetLabel(char *text, int x, int y, int bind)
+widget_t *label_new(char *text, int x, int y, int bind)
{
widget_label_t *new;
new = malloc(sizeof(widget_label_t));
new->text = strdup(text);
new->bind = bind;
- getTextSize(text, &(new->w), &(new->h));
+ font_text_size(text, &(new->w), &(new->h));
- return newWidget(WIDGET_TYPE_LABEL, x, y, new->w, new->h, new);
+ return widget_new(WIDGET_TYPE_LABEL, x, y, new->w, new->h, new);
}
-void drawWidgetLabel(widget_t * widget)
+void label_draw(widget_t * widget)
{
widget_label_t *p;
@@ -31,24 +31,24 @@ void drawWidgetLabel(widget_t * widget)
switch (p->bind) {
case WIDGET_LABEL_RIGHT:
- drawFont(p->text, widget->x + p->w, widget->y + p->h / 2, COLOR_WHITE);
+ font_draw(p->text, widget->x + p->w, widget->y + p->h / 2, COLOR_WHITE);
break;
case WIDGET_LABEL_LEFT:
- drawFont(p->text, widget->x, widget->y + widget->h / 2, COLOR_WHITE);
+ font_draw(p->text, widget->x, widget->y + widget->h / 2, COLOR_WHITE);
break;
case WIDGET_LABEL_CENTER:
- drawFont(p->text, widget->x - p->w / 2, widget->y + p->h / 2, COLOR_WHITE);
+ font_draw(p->text, widget->x - p->w / 2, widget->y + p->h / 2, COLOR_WHITE);
break;
}
}
-void eventWidgetLabel(widget_t * widget)
+void label_event(widget_t * widget)
{
assert(widget != NULL);
assert(widget->type == WIDGET_TYPE_LABEL);
}
-void destroyWidgetLabel(widget_t * widget)
+void label_destroy(widget_t * widget)
{
widget_label_t *p;
@@ -60,5 +60,5 @@ void destroyWidgetLabel(widget_t * widget)
free(p->text);
free(p);
- destroyWidget(widget);
+ widget_destroy(widget);
}
diff --git a/src/widget/widget_label.h b/src/widget/widget_label.h
index 743db7e..a2c7a2a 100644
--- a/src/widget/widget_label.h
+++ b/src/widget/widget_label.h
@@ -16,9 +16,9 @@ typedef struct widget_label {
# define WIDGET_LABEL_LEFT 2
# define WIDGET_LABEL_CENTER 3
-extern widget_t *newWidgetLabel(char *text, int x, int y, int bind);
-extern void drawWidgetLabel(widget_t * widget);
-extern void eventWidgetLabel(widget_t * widget);
-extern void destroyWidgetLabel(widget_t * widget);
+extern widget_t *label_new(char *text, int x, int y, int bind);
+extern void label_draw(widget_t * widget);
+extern void label_event(widget_t * widget);
+extern void label_destroy(widget_t * widget);
#endif
diff --git a/src/widget/widget_select.c b/src/widget/widget_select.c
index f53e583..88b22ac 100644
--- a/src/widget/widget_select.c
+++ b/src/widget/widget_select.c
@@ -9,19 +9,19 @@
#include "widget.h"
#include "widget_select.h"
-widget_t *newWidgetSelect(int x, int y, void (*fce_event) (void *))
+widget_t *select_new(int x, int y, void (*fce_event) (void *))
{
widget_select_t *new;
new = malloc(sizeof(widget_select_t));
new->select = -1;
new->fce_event = fce_event;
- new->list = newList();
+ new->list = list_new();
- return newWidget(WIDGET_TYPE_SELECT, x, y, 0, 0, new);
+ return widget_new(WIDGET_TYPE_SELECT, x, y, 0, 0, new);
}
-char *getWidgetSelectItem(widget_t * widget)
+char *select_get_item(widget_t * widget)
{
widget_select_t *p;
@@ -37,7 +37,7 @@ char *getWidgetSelectItem(widget_t * widget)
return (char *) p->list->list[p->select];
}
-int getWidgetSelectIndex(widget_t * widget)
+int select_get_index(widget_t * widget)
{
widget_select_t *p;
@@ -49,7 +49,7 @@ int getWidgetSelectIndex(widget_t * widget)
return p->select;
}
-void addToWidgetSelect(widget_t * widget, char *s)
+void select_add(widget_t * widget, char *s)
{
widget_select_t *p;
@@ -58,10 +58,10 @@ void addToWidgetSelect(widget_t * widget, char *s)
p = (widget_select_t *) widget->private_data;
- addList(p->list, strdup(s));
+ list_add(p->list, strdup(s));
}
-void removeAllFromWidgetSelect(widget_t * widget)
+void select_remove_all(widget_t * widget)
{
widget_select_t *p;
@@ -71,11 +71,11 @@ void removeAllFromWidgetSelect(widget_t * widget)
p = (widget_select_t *) widget->private_data;
while (p->list->count > 0) {
- delListItem(p->list, 0, free);
+ list_del_item(p->list, 0, free);
}
}
-void drawWidgetSelect(widget_t * widget)
+void select_draw(widget_t * widget)
{
widget_select_t *p;
int x, y, w, h;
@@ -84,7 +84,7 @@ void drawWidgetSelect(widget_t * widget)
assert(widget != NULL);
assert(widget->type == WIDGET_TYPE_SELECT);
- getMousePosition(&x, &y);
+ interface_get_mouse_position(&x, &y);
p = (widget_select_t *) widget->private_data;
for (i = 0; i < p->list->count; i++) {
@@ -92,22 +92,22 @@ void drawWidgetSelect(widget_t * widget)
line = (char *) p->list->list[i];
- getTextSize(line, &w, &h);
+ font_text_size(line, &w, &h);
if (x > widget->x && y > widget->y + i * 20 &&
x < widget->x + w && y < widget->y + i * 20 + h) {
- drawFont(line, widget->x, widget->y + i * 20, COLOR_YELLOW);
+ font_draw(line, widget->x, widget->y + i * 20, COLOR_YELLOW);
} else {
if (p->select == i) {
- drawFont(line, widget->x, widget->y + i * 20, COLOR_RED);
+ font_draw(line, widget->x, widget->y + i * 20, COLOR_RED);
} else {
- drawFont(line, widget->x, widget->y + i * 20, COLOR_WHITE);
+ font_draw(line, widget->x, widget->y + i * 20, COLOR_WHITE);
}
}
}
}
-void eventWidgetSelect(widget_t * widget)
+void select_event(widget_t * widget)
{
widget_select_t *p;
int x, y, w, h;
@@ -117,25 +117,25 @@ void eventWidgetSelect(widget_t * widget)
assert(widget->type == WIDGET_TYPE_SELECT);
p = (widget_select_t *) widget->private_data;
- getMousePosition(&x, &y);
+ interface_get_mouse_position(&x, &y);
for (i = 0; i < p->list->count; i++) {
char *line;
line = (char *) p->list->list[i];
- getTextSize(line, &w, &h);
+ font_text_size(line, &w, &h);
if (x > widget->x && y > widget->y + i * 20 &&
x < widget->x + w && y < widget->y + i * 20 + h &&
- isMouseClicked()) {
+ interface_is_mouse_clicket()) {
p->select = i;
p->fce_event(p);
}
}
}
-void destroyWidgetSelect(widget_t * widget)
+void select_destroy(widget_t * widget)
{
widget_select_t *p;
@@ -144,7 +144,7 @@ void destroyWidgetSelect(widget_t * widget)
p = (widget_select_t *) widget->private_data;
- destroyListItem(p->list, free);
+ list_destroy_item(p->list, free);
free(p);
- destroyWidget(widget);
+ widget_destroy(widget);
}
diff --git a/src/widget/widget_select.h b/src/widget/widget_select.h
index 9d772cc..36a9890 100644
--- a/src/widget/widget_select.h
+++ b/src/widget/widget_select.h
@@ -14,13 +14,13 @@ typedef struct widget_select {
void (*fce_event) (void *);
} widget_select_t;
-extern widget_t *newWidgetSelect(int x, int y, void (*fce_event) (void *));
-extern char *getWidgetSelectItem(widget_t * widget);
-extern int getWidgetSelectIndex(widget_t * widget);
-extern void addToWidgetSelect(widget_t * widget, char *s);
-extern void removeAllFromWidgetSelect(widget_t * widget);
-extern void drawWidgetSelect(widget_t * widget);
-extern void eventWidgetSelect(widget_t * widget);
-extern void destroyWidgetSelect(widget_t * widget);
+extern widget_t *select_new(int x, int y, void (*fce_event) (void *));
+extern char *select_get_item(widget_t * widget);
+extern int select_get_index(widget_t * widget);
+extern void select_add(widget_t * widget, char *s);
+extern void select_remove_all(widget_t * widget);
+extern void select_draw(widget_t * widget);
+extern void select_event(widget_t * widget);
+extern void select_destroy(widget_t * widget);
#endif
diff --git a/src/widget/widget_textfield.c b/src/widget/widget_textfield.c
index 94fef18..07481b9 100644
--- a/src/widget/widget_textfield.c
+++ b/src/widget/widget_textfield.c
@@ -12,7 +12,7 @@
//#define ZZEEXX86_READKEY
-widget_t *newWidgetTextfield(char *text, int filter, int x, int y)
+widget_t *textField_new(char *text, int filter, int x, int y)
{
widget_textfield_t *new;
@@ -25,9 +25,9 @@ widget_t *newWidgetTextfield(char *text, int filter, int x, int y)
new->atime = 0;
new->active = FALSE;
new->filter = filter;
- getTextSize(text, &new->w, &new->h);
+ font_text_size(text, &new->w, &new->h);
- return newWidget(WIDGET_TYPE_TEXTFILED, x, y,
+ return widget_new(WIDGET_TYPE_TEXTFILED, x, y,
WIDGET_TEXTFIELD_WIDTH, WIDGET_TEXTFIELD_HEIGHT, new);
}
@@ -43,17 +43,17 @@ static void drawBackground(widget_t * widget)
p = (widget_textfield_t *) widget->private_data;
if (g_textfield0 == NULL) {
- g_textfield0 = addImageData("textfield0.png", IMAGE_ALPHA, "textfiled0", IMAGE_GROUP_BASE);
+ g_textfield0 = image_add("textfield0.png", IMAGE_ALPHA, "textfiled0", IMAGE_GROUP_BASE);
}
if (g_textfield1 == NULL) {
- g_textfield1 = addImageData("textfield1.png", IMAGE_ALPHA, "textfiled1", IMAGE_GROUP_BASE);
+ g_textfield1 = image_add("textfield1.png", IMAGE_ALPHA, "textfiled1", IMAGE_GROUP_BASE);
}
if (p->active) {
- drawImage(g_textfield1, widget->x, widget->y, 0, 0, g_textfield1->w, g_textfield1->h);
+ image_draw(g_textfield1, widget->x, widget->y, 0, 0, g_textfield1->w, g_textfield1->h);
} else {
- drawImage(g_textfield0, widget->x, widget->y, 0, 0, g_textfield0->w, g_textfield0->h);
+ image_draw(g_textfield0, widget->x, widget->y, 0, 0, g_textfield0->w, g_textfield0->h);
}
}
@@ -81,14 +81,14 @@ static void drawText(widget_t * widget)
p->timeBlick = 0;
}
- //drawFont(str, p->x+WIDGET_TEXTFIELD_TEXT_OFFSET_X, p->y+p->h/2, COLOR_WHITE);
+ //font_draw(str, p->x+WIDGET_TEXTFIELD_TEXT_OFFSET_X, p->y+p->h/2, COLOR_WHITE);
//printf("p->y: %d\nheight: %d\n p->h: %d\n", p->y, WIDGET_TEXTFIELD_HEIGHT, p->h);
- drawFont(str, widget->x + WIDGET_TEXTFIELD_TEXT_OFFSET_X,
+ font_draw(str, widget->x + WIDGET_TEXTFIELD_TEXT_OFFSET_X,
widget->y + WIDGET_TEXTFIELD_HEIGHT / 2 - p->h / 2, COLOR_WHITE);
}
-void drawWidgetTextfield(widget_t * widget)
+void textField_draw(widget_t * widget)
{
assert(widget != NULL);
assert(widget->type == WIDGET_TYPE_TEXTFILED);
@@ -97,7 +97,7 @@ void drawWidgetTextfield(widget_t * widget)
drawText(widget);
}
-void setWidgetTextFiledText(widget_t * widget, char *text)
+void textField_set_text(widget_t * widget, char *text)
{
widget_textfield_t *p;
@@ -108,10 +108,10 @@ void setWidgetTextFiledText(widget_t * widget, char *text)
memset(p->text, 0, STR_SIZE);
strcpy(p->text, text);
- getTextSize(text, &p->w, &p->h);
+ font_text_size(text, &p->w, &p->h);
}
-char *getTextFromWidgetTextfield(widget_t * widget)
+char *textField_get_text(widget_t * widget)
{
widget_textfield_t *p;
@@ -177,7 +177,7 @@ static void checkText(widget_textfield_t * p)
}
}
- getTextSize(p->text, &p->w, &p->h);
+ font_text_size(p->text, &p->w, &p->h);
}
#ifdef ZZEEXX86_READKEY
@@ -204,7 +204,7 @@ static void readKey(widget_textfield_t * p)
if (len > 0) {
p->time = 0;
p->text[len - 1] = '\0';
- getTextSize(p->text, &p->w, &p->h);
+ font_text_size(p->text, &p->w, &p->h);
}
return;
@@ -406,7 +406,7 @@ static void readKey(widget_textfield_t * p)
}
#endif
-void eventWidgetTextfield(widget_t * widget)
+void textField_event(widget_t * widget)
{
widget_textfield_t *p;
int x, y;
@@ -416,9 +416,9 @@ void eventWidgetTextfield(widget_t * widget)
p = (widget_textfield_t *) widget->private_data;
- getMousePosition(&x, &y);
+ interface_get_mouse_position(&x, &y);
- if (isMouseClicked()) {
+ if (interface_is_mouse_clicket()) {
if (x >= widget->x && x <= widget->x + WIDGET_TEXTFIELD_WIDTH &&
y >= widget->y && y <= widget->y + WIDGET_TEXTFIELD_HEIGHT) {
p->active = TRUE;
@@ -430,7 +430,7 @@ void eventWidgetTextfield(widget_t * widget)
readKey(p);
}
-void destroyWidgetTextfield(widget_t * widget)
+void textField_destroy(widget_t * widget)
{
widget_textfield_t *p;
@@ -440,5 +440,5 @@ void destroyWidgetTextfield(widget_t * widget)
p = (widget_textfield_t *) widget->private_data;
free(p);
- destroyWidget(widget);
+ widget_destroy(widget);
}
diff --git a/src/widget/widget_textfield.h b/src/widget/widget_textfield.h
index 7991deb..7f8e198 100644
--- a/src/widget/widget_textfield.h
+++ b/src/widget/widget_textfield.h
@@ -31,11 +31,11 @@ typedef struct widget_textfield {
bool_t active;
} widget_textfield_t;
-extern widget_t *newWidgetTextfield(char *text, int filter, int x, int y);
-extern void setWidgetTextFiledText(widget_t * widget, char *text);
-extern char *getTextFromWidgetTextfield(widget_t * widget);
-extern void drawWidgetTextfield(widget_t * widget);
-extern void eventWidgetTextfield(widget_t * widget);
-extern void destroyWidgetTextfield(widget_t * widget);
+extern widget_t *textField_new(char *text, int filter, int x, int y);
+extern void textField_set_text(widget_t * widget, char *text);
+extern char *textField_get_text(widget_t * widget);
+extern void textField_draw(widget_t * widget);
+extern void textField_event(widget_t * widget);
+extern void textField_destroy(widget_t * widget);
#endif