summaryrefslogtreecommitdiff
path: root/src/widget/widget_buttonimage.c~
diff options
context:
space:
mode:
authorTomas Chvatal (scarabeus) <tomas.chvatal@gmail.com>2008-10-22 22:51:24 +0200
committerTomas Chvatal (scarabeus) <tomas.chvatal@gmail.com>2008-10-22 22:51:24 +0200
commit44daf03024fbf7cbffa10349044786f6ab784821 (patch)
treefe311eb22e2d853dfc18fde1a9e55d21815f4f82 /src/widget/widget_buttonimage.c~
parente12753d2ec9db83ec08bb9db63902a82fb245cdd (diff)
Revert "X"
This reverts commit e12753d2ec9db83ec08bb9db63902a82fb245cdd.
Diffstat (limited to 'src/widget/widget_buttonimage.c~')
-rw-r--r--src/widget/widget_buttonimage.c~88
1 files changed, 0 insertions, 88 deletions
diff --git a/src/widget/widget_buttonimage.c~ b/src/widget/widget_buttonimage.c~
deleted file mode 100644
index 27e94a3..0000000
--- a/src/widget/widget_buttonimage.c~
+++ /dev/null
@@ -1,88 +0,0 @@
-
-#include <stdlib.h>
-#include <assert.h>
-
-#include "main.h"
-#include "interface.h"
-#include "font.h"
-#include "image.h"
-
-#include "widget.h"
-#include "widget_buttonimage.h"
-
-widget_t* newWidgetButtonimage(image_t *image, int x, int y, void (*fce_event)(void *))
-{
- widget_buttonimage_t *new;
-
- new = malloc( sizeof(widget_buttonimage_t) );
- new->image = image;
- new->w = image->w/2;
- new->h = image->h;
- new->active = 0;
- new->fce_event = fce_event;
-
- return newWidget(WIDGET_TYPE_BUTTONIMAGE, x, y, new->w, new->h, new);
-}
-
-void setWidgetButtonimageActive(widget_t *widget, bool_t active)
-{
- widget_buttonimage_t *p;
-
- assert( widget != NULL );
- assert( widget->type == WIDGET_TYPE_BUTTONIMAGE );
-
- p = (widget_buttonimage_t *)widget->private_data;
- p->active = active;
-}
-
-void drawWidgetButtonimage(widget_t *widget)
-{
- widget_buttonimage_t *p;
-
- assert( widget != NULL );
- 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);
-}
-
-void eventWidgetButtonimage(widget_t *widget)
-{
- widget_buttonimage_t *p;
- static int time = 0;
- int x, y;
-
- assert( widget != NULL );
- assert( widget->type == WIDGET_TYPE_BUTTONIMAGE );
-
- p = (widget_buttonimage_t *) widget->private_data;
- if( time > 0)
- {
- time--;
- return;
- }
-
- getMousePosition(&x, &y);
-
- if( x >= widget->x && x <= widget->x+p->w &&
- y >= widget->y && y <= widget->y+p->h &&
- isMouseClicked() )
- {
- time = WIDGET_BUTTONIMAGE_TIME;
- p->active = 1;
- p->fce_event(widget);
- }
-}
-
-void destroyWidgetButtonimage(widget_t *widget)
-{
- widget_buttonimage_t *p;
-
- assert( widget != NULL );
- assert( widget->type == WIDGET_TYPE_BUTTONIMAGE );
-
- p = (widget_buttonimage_t *) widget->private_data;
-
- free(p);
- destroyWidget(widget);
-}