Navit SVN

/work/compile/navit/src/navit/gui/internal/gui_internal.h

00001 struct widget; // defined in gui_internal.c
00002 struct graphics_image;
00003 
00004 #define STATE_VISIBLE 1
00005 #define STATE_SELECTED 2
00006 #define STATE_HIGHLIGHTED 4
00007 #define STATE_SENSITIVE 8
00008 #define STATE_EDIT 16
00009 #define STATE_CLEAR 32
00010 #define STATE_EDITABLE 64
00011 #define STATE_SCROLLABLE 128
00012 
00013 #define GESTURE_RINGSIZE 100
00014 
00015 enum widget_type {
00016         widget_box=1,
00017         widget_button,
00018         widget_label,
00019         widget_image,
00020         widget_table,
00021         widget_table_row
00022 };
00023 
00024 enum flags {
00025         gravity_none=0x00,
00026         gravity_left=1,
00027         gravity_xcenter=2,
00028         gravity_right=4,
00029         gravity_top=8,
00030         gravity_ycenter=16,
00031         gravity_bottom=32,
00032         gravity_left_top=gravity_left|gravity_top,
00033         gravity_top_center=gravity_xcenter|gravity_top,
00034         gravity_right_top=gravity_right|gravity_top,
00035         gravity_left_center=gravity_left|gravity_ycenter,
00036         gravity_center=gravity_xcenter|gravity_ycenter,
00037         gravity_right_center=gravity_right|gravity_ycenter,
00038         gravity_left_bottom=gravity_left|gravity_bottom,
00039         gravity_bottom_center=gravity_xcenter|gravity_bottom,
00040         gravity_right_bottom=gravity_right|gravity_bottom,
00041         flags_expand=0x100,
00042         flags_fill=0x200,
00043         orientation_horizontal=0x10000,
00044         orientation_vertical=0x20000,
00045         orientation_horizontal_vertical=0x40000,
00046 };
00047 
00048 
00049 struct gui_internal_methods {
00050         void (*add_callback)(struct gui_priv *priv, struct callback *cb);
00051         void (*remove_callback)(struct gui_priv *priv, struct callback *cb);
00052         void (*menu_render)(struct gui_priv *this);
00053         struct graphics_image * (*image_new_xs)(struct gui_priv *this, const char *name);
00054         struct graphics_image * (*image_new_l)(struct gui_priv *this, const char *name);
00055 };
00056 
00057 struct gui_internal_widget_methods {
00058         void (*append)(struct widget *parent, struct widget *child);
00059         struct widget * (*button_new)(struct gui_priv *this, char *text, struct graphics_image *image, enum flags flags);
00060         struct widget * (*button_new_with_callback)(struct gui_priv *this, char *text, struct graphics_image *image, enum flags flags, void(*func)(struct gui_priv *priv, struct widget *widget, void *data), void *data);
00061         struct widget * (*box_new)(struct gui_priv *this, enum flags flags);
00062         struct widget * (*label_new)(struct gui_priv *this, char *text);
00063         struct widget * (*image_new)(struct gui_priv *this, struct graphics_image *image);
00064         struct widget * (*keyboard)(struct gui_priv *this, int mode);
00065         struct widget * (*menu)(struct gui_priv *this, const char *label);
00066         enum flags (*get_flags)(struct widget *widget);
00067         void (*set_flags)(struct widget *widget, enum flags flags);
00068         int (*get_state)(struct widget *widget);
00069         void (*set_state)(struct widget *widget, int state);
00070         void (*set_func)(struct widget *widget, void (*func)(struct gui_priv *priv, struct widget *widget, void *data));
00071         void (*set_data)(struct widget *widget, void *data);
00072         void (*set_default_background)(struct gui_priv *this, struct widget *widget);
00073 
00074 };
00075 
00076 struct gui_internal_data {
00077         struct gui_priv *priv;
00078         struct gui_internal_methods *gui;
00079         struct gui_internal_widget_methods *widget;
00080 };