master
steffen 13 years ago
parent fecfe775c2
commit 86ef5ffb33

@ -1,4 +1,4 @@
/* $id: Exp $ */ /* $Id: gui.c,v 1.3 2013/02/16 20:29:16 steffen Exp $ */
/*************************************************************************** /***************************************************************************
* gui.c * gui.c
* *

@ -28,6 +28,7 @@
#include "osmroute.h" #include "osmroute.h"
#define GUI_TEXTLEN 256 #define GUI_TEXTLEN 256
#define GUI_MAX_ITEM 256
enum { enum {
EGUI_NONE, EGUI_NONE,
@ -38,6 +39,14 @@ enum {
EGUI_MOUSERELEASED EGUI_MOUSERELEASED
}; };
enum {
GUI_NONE,
GUI_BUTTON,
GUI_LIST,
GUI_ENTRY,
GUI_CHECKBOX,
GUI_LABEL
};
/* /*
* styles for the windows.. * styles for the windows..
@ -109,22 +118,10 @@ struct {
} typedef GUICheckbox; } typedef GUICheckbox;
#define GUI_WIN_BUTTONS 16 struct _GUIItem_ {
#define GUI_WIN_ENTRYS 8 int type;
#define GUI_WIN_LABELS 16 void *item;
#define GUI_WIN_CHECKBOXES 16 } typedef GUIItem;
#define GUI_WIN_LISTS 4
#define GUI_WIN_ELEMENTS 32
enum {
GUINONE,
GUIBUTTON,
GUILIST,
GUIENTRY,
GUICHECKBOX,
GUILABEL
};
struct _GUIWindow_ { struct _GUIWindow_ {
void (*callback_close) (); void (*callback_close) ();
@ -140,14 +137,8 @@ struct _GUIWindow_ {
int h; int h;
int style; int style;
GUIButton buttons[GUI_WIN_BUTTONS]; GUIItem items[GUI_MAX_ITEM];
GUIEntry entrys[GUI_WIN_ENTRYS]; void *focus;
GUICheckbox checkboxes[GUI_WIN_CHECKBOXES];
GUILabel labels[GUI_WIN_LABELS];
GUIList lists[GUI_WIN_LISTS];
void *focus; // element which holds the focus
} typedef GUIWindow; } typedef GUIWindow;
extern GUIWindow *currentwin; extern GUIWindow *currentwin;
@ -157,7 +148,7 @@ extern void gui_draw ();
extern void gui_close (); extern void gui_close ();
extern int gui_event (GUIEvent event); extern int gui_event (GUIEvent event);
extern void guiwindow_new (GUIWindow *win, int w, int h); extern void guiwindow_new (GUIWindow *win, int w, int h, char *title);
extern void guiwindow_close (GUIWindow *win); extern void guiwindow_close (GUIWindow *win);
/* button functions */ /* button functions */

Loading…
Cancel
Save