diff options
Diffstat (limited to 'navit/gui/internal')
| -rw-r--r-- | navit/gui/internal/CMakeLists.txt | 4 | ||||
| -rw-r--r-- | navit/gui/internal/gui_internal.c | 18 | ||||
| -rw-r--r-- | navit/gui/internal/gui_internal.h | 107 | ||||
| -rw-r--r-- | navit/gui/internal/gui_internal_keyboard.h | 28 | ||||
| -rw-r--r-- | navit/gui/internal/gui_internal_poi.h | 69 | ||||
| -rw-r--r-- | navit/gui/internal/gui_internal_priv.h | 274 | ||||
| -rw-r--r-- | navit/gui/internal/gui_internal_widget.h | 233 |
7 files changed, 375 insertions, 358 deletions
diff --git a/navit/gui/internal/CMakeLists.txt b/navit/gui/internal/CMakeLists.txt index 230e315d6..b758ba7e6 100644 --- a/navit/gui/internal/CMakeLists.txt +++ b/navit/gui/internal/CMakeLists.txt @@ -1 +1,3 @@ -module_add_library(gui_internal gui_internal.c gui_internal_bookmark.c gui_internal_command.c gui_internal_gesture.c gui_internal_html.c gui_internal_menu.c gui_internal_poi.c gui_internal_search.c gui_internal_widget.c gui_internal_keyboard.c) +module_add_library(gui_internal gui_internal.c gui_internal_bookmark.c gui_internal_command.c gui_internal_gesture.c + gui_internal_html.c gui_internal_menu.c gui_internal_poi.c gui_internal_search.c gui_internal_widget.c + gui_internal_keyboard.c) diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c index e8ccaab1c..39e0b6d18 100644 --- a/navit/gui/internal/gui_internal.c +++ b/navit/gui/internal/gui_internal.c @@ -236,7 +236,8 @@ static void gui_internal_button_attr_pressed(struct gui_priv *this, struct widge } struct widget * -gui_internal_button_navit_attr_new(struct gui_priv *this, const char *text, enum flags flags, struct attr *on, struct attr *off) { +gui_internal_button_navit_attr_new(struct gui_priv *this, const char *text, enum flags flags, struct attr *on, + struct attr *off) { struct graphics_image *image=NULL; struct widget *ret; if (!on && !off) @@ -258,7 +259,8 @@ gui_internal_button_navit_attr_new(struct gui_priv *this, const char *text, enum } struct widget * -gui_internal_button_map_attr_new(struct gui_priv *this, const char *text, enum flags flags, struct map *map, struct attr *on, struct attr *off, int deflt) { +gui_internal_button_map_attr_new(struct gui_priv *this, const char *text, enum flags flags, struct map *map, + struct attr *on, struct attr *off, int deflt) { struct graphics_image *image=NULL; struct widget *ret; image=image_new_xs(this, "gui_inactive"); @@ -527,7 +529,8 @@ void gui_internal_apply_config(struct gui_priv *this) { this->spacing = current_config->spacing; } else { this->spacing = this->config.spacing; - dbg(lvl_info, "Overriding default spacing %d with value %d provided in config file", current_config->spacing, this->config.spacing); + dbg(lvl_info, "Overriding default spacing %d with value %d provided in config file", current_config->spacing, + this->config.spacing); } if (!this->fonts[0]) { int i,sizes[]= {100,66,50}; @@ -1183,7 +1186,8 @@ static void gui_internal_cmd_delete_waypoint(struct gui_priv *this, struct widge * 2048: "Show search results on the map" * TODO define constants for these values */ -void gui_internal_cmd_position_do(struct gui_priv *this, struct pcoord *pc_in, struct coord_geo *g_in, struct widget *wm, const char *name, int flags) { +void gui_internal_cmd_position_do(struct gui_priv *this, struct pcoord *pc_in, struct coord_geo *g_in, + struct widget *wm, const char *name, int flags) { struct widget *wb,*w,*wtable,*row,*wc,*wbc,*wclosest=NULL; struct coord_geo g; struct pcoord pc; @@ -2786,7 +2790,8 @@ static int gui_internal_keynav_find_prev(struct widget *wi, struct widget *curre return NO_RESULT_YET; } -static void gui_internal_keynav_find_closest(struct widget *wi, struct point *p, int dx, int dy, int *distance, struct widget **result) { +static void gui_internal_keynav_find_closest(struct widget *wi, struct point *p, int dx, int dy, int *distance, + struct widget **result) { GList *l=wi->children; // Skip hidden elements if (wi->p.x==0 && wi->p.y==0 && wi->w==0 && wi->h==0) @@ -3293,7 +3298,8 @@ void gui_internal_populate_route_table(struct gui_priv * this, struct navit * na //# Comment: //# Authors: Martin Schaller (04/2008) //############################################################################################################## -static struct gui_priv * gui_internal_new(struct navit *nav, struct gui_methods *meth, struct attr **attrs, struct gui *gui) { +static struct gui_priv * gui_internal_new(struct navit *nav, struct gui_methods *meth, struct attr **attrs, + struct gui *gui) { struct color color_white= {0xffff,0xffff,0xffff,0xffff}; struct color color_black= {0x0,0x0,0x0,0xffff}; struct color back2_color= {0x4141,0x4141,0x4141,0xffff}; diff --git a/navit/gui/internal/gui_internal.h b/navit/gui/internal/gui_internal.h index 1a5cd13d3..734d31d38 100644 --- a/navit/gui/internal/gui_internal.h +++ b/navit/gui/internal/gui_internal.h @@ -15,71 +15,72 @@ struct gui_priv; #define GESTURE_RINGSIZE 100 enum widget_type { - widget_box=1, - widget_button, - widget_label, - widget_image, - widget_table, - widget_table_row + widget_box=1, + widget_button, + widget_label, + widget_image, + widget_table, + widget_table_row }; enum flags { - gravity_none=0x00, - gravity_left=1, - gravity_xcenter=2, - gravity_right=4, - gravity_top=8, - gravity_ycenter=16, - gravity_bottom=32, - gravity_left_top=gravity_left|gravity_top, - gravity_top_center=gravity_xcenter|gravity_top, - gravity_right_top=gravity_right|gravity_top, - gravity_left_center=gravity_left|gravity_ycenter, - gravity_center=gravity_xcenter|gravity_ycenter, - gravity_right_center=gravity_right|gravity_ycenter, - gravity_left_bottom=gravity_left|gravity_bottom, - gravity_bottom_center=gravity_xcenter|gravity_bottom, - gravity_right_bottom=gravity_right|gravity_bottom, - flags_expand=0x100, - flags_fill=0x200, - flags_swap=0x400, - flags_scrollx=0x800, - flags_scrolly=0x1000, - orientation_horizontal=0x10000, - orientation_vertical=0x20000, - orientation_horizontal_vertical=0x40000, + gravity_none=0x00, + gravity_left=1, + gravity_xcenter=2, + gravity_right=4, + gravity_top=8, + gravity_ycenter=16, + gravity_bottom=32, + gravity_left_top=gravity_left|gravity_top, + gravity_top_center=gravity_xcenter|gravity_top, + gravity_right_top=gravity_right|gravity_top, + gravity_left_center=gravity_left|gravity_ycenter, + gravity_center=gravity_xcenter|gravity_ycenter, + gravity_right_center=gravity_right|gravity_ycenter, + gravity_left_bottom=gravity_left|gravity_bottom, + gravity_bottom_center=gravity_xcenter|gravity_bottom, + gravity_right_bottom=gravity_right|gravity_bottom, + flags_expand=0x100, + flags_fill=0x200, + flags_swap=0x400, + flags_scrollx=0x800, + flags_scrolly=0x1000, + orientation_horizontal=0x10000, + orientation_vertical=0x20000, + orientation_horizontal_vertical=0x40000, }; struct gui_internal_methods { - void (*add_callback)(struct gui_priv *priv, struct callback *cb); - void (*remove_callback)(struct gui_priv *priv, struct callback *cb); - void (*menu_render)(struct gui_priv *this); - struct graphics_image * (*image_new_xs)(struct gui_priv *this, const char *name); - struct graphics_image * (*image_new_l)(struct gui_priv *this, const char *name); + void (*add_callback)(struct gui_priv *priv, struct callback *cb); + void (*remove_callback)(struct gui_priv *priv, struct callback *cb); + void (*menu_render)(struct gui_priv *this); + struct graphics_image * (*image_new_xs)(struct gui_priv *this, const char *name); + struct graphics_image * (*image_new_l)(struct gui_priv *this, const char *name); }; struct gui_internal_widget_methods { - void (*append)(struct widget *parent, struct widget *child); - struct widget * (*button_new)(struct gui_priv *this, const char *text, struct graphics_image *image, enum flags flags); - struct widget * (*button_new_with_callback)(struct gui_priv *this, const char *text, struct graphics_image *image, enum flags flags, void(*func)(struct gui_priv *priv, struct widget *widget, void *data), void *data); - struct widget * (*box_new)(struct gui_priv *this, enum flags flags); - struct widget * (*label_new)(struct gui_priv *this, const char *text); - struct widget * (*image_new)(struct gui_priv *this, struct graphics_image *image); - struct widget * (*keyboard)(struct gui_priv *this, int mode); - struct widget * (*menu)(struct gui_priv *this, const char *label); - enum flags (*get_flags)(struct widget *widget); - void (*set_flags)(struct widget *widget, enum flags flags); - int (*get_state)(struct widget *widget); - void (*set_state)(struct widget *widget, int state); - void (*set_func)(struct widget *widget, void (*func)(struct gui_priv *priv, struct widget *widget, void *data)); - void (*set_data)(struct widget *widget, void *data); - void (*set_default_background)(struct gui_priv *this, struct widget *widget); + void (*append)(struct widget *parent, struct widget *child); + struct widget * (*button_new)(struct gui_priv *this, const char *text, struct graphics_image *image, enum flags flags); + struct widget * (*button_new_with_callback)(struct gui_priv *this, const char *text, struct graphics_image *image, + enum flags flags, void(*func)(struct gui_priv *priv, struct widget *widget, void *data), void *data); + struct widget * (*box_new)(struct gui_priv *this, enum flags flags); + struct widget * (*label_new)(struct gui_priv *this, const char *text); + struct widget * (*image_new)(struct gui_priv *this, struct graphics_image *image); + struct widget * (*keyboard)(struct gui_priv *this, int mode); + struct widget * (*menu)(struct gui_priv *this, const char *label); + enum flags (*get_flags)(struct widget *widget); + void (*set_flags)(struct widget *widget, enum flags flags); + int (*get_state)(struct widget *widget); + void (*set_state)(struct widget *widget, int state); + void (*set_func)(struct widget *widget, void (*func)(struct gui_priv *priv, struct widget *widget, void *data)); + void (*set_data)(struct widget *widget, void *data); + void (*set_default_background)(struct gui_priv *this, struct widget *widget); }; struct gui_internal_data { - struct gui_priv *priv; - struct gui_internal_methods *gui; - struct gui_internal_widget_methods *widget; + struct gui_priv *priv; + struct gui_internal_methods *gui; + struct gui_internal_widget_methods *widget; }; diff --git a/navit/gui/internal/gui_internal_keyboard.h b/navit/gui/internal/gui_internal_keyboard.h index 9b9039224..b9887c915 100644 --- a/navit/gui/internal/gui_internal_keyboard.h +++ b/navit/gui/internal/gui_internal_keyboard.h @@ -2,21 +2,21 @@ * Modes for the on-screen keyboard */ enum vkbd_mode { - /* layouts */ - VKBD_LATIN_UPPER = 0, /*!< Latin uppercase characters */ - VKBD_LATIN_LOWER = 8, /*!< Latin lowercase characters */ - VKBD_NUMERIC = 16, /*!< Numeric keyboard */ - VKBD_UMLAUT_UPPER = 24, /*!< Extended Latin uppercase characters */ - VKBD_UMLAUT_LOWER = 32, /*!< Extended Latin lowercase characters */ - VKBD_CYRILLIC_UPPER = 40, /*!< Cyrillic uppercase characters */ - VKBD_CYRILLIC_LOWER = 48, /*!< Cyrillic lowercase characters */ - VKBD_DEGREE = 56, /*!< Numeric keyboard with extra characters (NESW, degree, minute) for coordinate input */ + /* layouts */ + VKBD_LATIN_UPPER = 0, /*!< Latin uppercase characters */ + VKBD_LATIN_LOWER = 8, /*!< Latin lowercase characters */ + VKBD_NUMERIC = 16, /*!< Numeric keyboard */ + VKBD_UMLAUT_UPPER = 24, /*!< Extended Latin uppercase characters */ + VKBD_UMLAUT_LOWER = 32, /*!< Extended Latin lowercase characters */ + VKBD_CYRILLIC_UPPER = 40, /*!< Cyrillic uppercase characters */ + VKBD_CYRILLIC_LOWER = 48, /*!< Cyrillic lowercase characters */ + VKBD_DEGREE = 56, /*!< Numeric keyboard with extra characters (NESW, degree, minute) for coordinate input */ - /* modifiers and masks */ - VKBD_FLAG_2 = 2, /* FIXME seems to show alpha/num switch (VKBD_NUMERIC and VKBD_LATIN_* only) and switches to lowercase after first character */ - VKBD_MASK_7 = 7, /* FIXME modifiers for layout? */ - VKBD_FLAG_1024 = 1024, /* FIXME what is this for? Seems to have to do something with scroll box visibility */ - VKBD_LAYOUT_MASK = ~7, /* when XORed with the mode, preserves only the layout FIXME document properly */ + /* modifiers and masks */ + VKBD_FLAG_2 = 2, /* FIXME seems to show alpha/num switch (VKBD_NUMERIC and VKBD_LATIN_* only) and switches to lowercase after first character */ + VKBD_MASK_7 = 7, /* FIXME modifiers for layout? */ + VKBD_FLAG_1024 = 1024, /* FIXME what is this for? Seems to have to do something with scroll box visibility */ + VKBD_LAYOUT_MASK = ~7, /* when XORed with the mode, preserves only the layout FIXME document properly */ }; /* prototypes */ diff --git a/navit/gui/internal/gui_internal_poi.h b/navit/gui/internal/gui_internal_poi.h index 4e6bed74b..c2515a1c6 100644 --- a/navit/gui/internal/gui_internal_poi.h +++ b/navit/gui/internal/gui_internal_poi.h @@ -6,40 +6,40 @@ struct poi_param { - /** - * =1 if selnb is defined, 0 otherwize. - */ - unsigned char sel; + /** + * =1 if selnb is defined, 0 otherwize. + */ + unsigned char sel; - /** - * Index to struct selector selectors[], shows what type of POIs is defined. - */ - unsigned char selnb; - /** - * Page number to display. - */ - unsigned char pagenb; - /** - * Radius (number of 10-kilometer intervals) to search for POIs. - */ - unsigned char dist; - /** - * Should filter phrase be compared to postal address of the POI. - * =0 - name filter, =1 - address filter, =2 - address filter, including postal code - */ - unsigned char AddressFilterType; - /** - * Filter string, casefold()ed and divided into substrings at the spaces, which are replaced by ASCII 0*. - */ - char *filterstr; - /** - * list of pointers to individual substrings of filterstr. - */ - GList *filter; - /** - * Number of POIs in this list - */ - int count; + /** + * Index to struct selector selectors[], shows what type of POIs is defined. + */ + unsigned char selnb; + /** + * Page number to display. + */ + unsigned char pagenb; + /** + * Radius (number of 10-kilometer intervals) to search for POIs. + */ + unsigned char dist; + /** + * Should filter phrase be compared to postal address of the POI. + * =0 - name filter, =1 - address filter, =2 - address filter, including postal code + */ + unsigned char AddressFilterType; + /** + * Filter string, casefold()ed and divided into substrings at the spaces, which are replaced by ASCII 0*. + */ + char *filterstr; + /** + * list of pointers to individual substrings of filterstr. + */ + GList *filter; + /** + * Number of POIs in this list + */ + int count; }; /* prototypes */ @@ -50,7 +50,8 @@ struct poi_param; struct widget; void gui_internal_poi_param_free(void *p); void gui_internal_poi_param_set_filter(struct poi_param *param, char *text); -struct widget *gui_internal_cmd_pois_item(struct gui_priv *this, struct coord *center, struct item *item, struct coord *c, struct route *route, int dist, char *name); +struct widget *gui_internal_cmd_pois_item(struct gui_priv *this, struct coord *center, struct item *item, + struct coord *c, struct route *route, int dist, char *name); char *gui_internal_compose_item_address_string(struct item *item, int prependPostal); void gui_internal_cmd_pois_filter(struct gui_priv *this, struct widget *wm, void *data); void gui_internal_cmd_pois(struct gui_priv *this, struct widget *wm, void *data); diff --git a/navit/gui/internal/gui_internal_priv.h b/navit/gui/internal/gui_internal_priv.h index 66b3e41fe..d28cac649 100644 --- a/navit/gui/internal/gui_internal_priv.h +++ b/navit/gui/internal/gui_internal_priv.h @@ -6,33 +6,33 @@ */ struct gui_config_settings { - /** - * The base size (in fractions of a point) to use for text. - */ - int font_size; - /** - * The size (in pixels) that xs style icons should be scaled to. - * This icon size is typically used in various lists and should be set to value which allows a list row to be easily cliked or dragged. - */ - int icon_xs; - /** - * The size (in pixels) that s style icons (small) should be scaled to, used for the menu top row icons - */ - int icon_s; - /** - * The size (in pixels) that l style icons should be scaled to, used for icons defined in the menu html - */ - int icon_l; - /** - * The default amount of spacing (in pixels) to place between GUI elements. - */ - int spacing; + /** + * The base size (in fractions of a point) to use for text. + */ + int font_size; + /** + * The size (in pixels) that xs style icons should be scaled to. + * This icon size is typically used in various lists and should be set to value which allows a list row to be easily cliked or dragged. + */ + int icon_xs; + /** + * The size (in pixels) that s style icons (small) should be scaled to, used for the menu top row icons + */ + int icon_s; + /** + * The size (in pixels) that l style icons should be scaled to, used for icons defined in the menu html + */ + int icon_l; + /** + * The default amount of spacing (in pixels) to place between GUI elements. + */ + int spacing; }; struct route_data { - struct widget * route_table; - int route_showing; + struct widget * route_table; + int route_showing; }; /** @@ -41,136 +41,136 @@ struct route_data { * @author Martin Schaller (04/2008) */ struct gui_priv { - struct navit *nav; - struct attr self; - struct window *win; - struct graphics *gra; - struct graphics_gc *background; - struct graphics_gc *background2; - struct graphics_gc *highlight_background; - struct graphics_gc *foreground; - struct graphics_gc *text_foreground; - struct graphics_gc *text_background; - struct color background_color, background2_color, text_foreground_color, text_background_color; - int spacing; - int font_size; - char *font_name; - int fullscreen; - struct graphics_font *fonts[3]; - int icon_xs; /**< The size (in pixels) that xs style icons should be scaled to. + struct navit *nav; + struct attr self; + struct window *win; + struct graphics *gra; + struct graphics_gc *background; + struct graphics_gc *background2; + struct graphics_gc *highlight_background; + struct graphics_gc *foreground; + struct graphics_gc *text_foreground; + struct graphics_gc *text_background; + struct color background_color, background2_color, text_foreground_color, text_background_color; + int spacing; + int font_size; + char *font_name; + int fullscreen; + struct graphics_font *fonts[3]; + int icon_xs; /**< The size (in pixels) that xs style icons should be scaled to. * This icon size can be too small to click it on some devices. */ - int icon_s; /**< The size (in pixels) that s style icons (small) should be scaled to */ - int icon_l; /**< The size (in pixels) that l style icons should be scaled to */ - int pressed; - struct widget *widgets; - int widgets_count; - int redraw; - struct widget root; - struct widget *highlighted,*editable; - struct widget *highlighted_menu; - struct pcoord clickp, vehiclep; - struct attr *click_coord_geo, *position_coord_geo; - struct search_list *sl; - int ignore_button; - int menu_on_map_click; - char *on_map_click; - int signal_on_map_click; - char *country_iso2; - int speech; - int keyboard; /**< Whether the internal GUI keyboard is enabled */ - int keyboard_required; /**< Whether keyboard input is needed. This is only used by the + int icon_s; /**< The size (in pixels) that s style icons (small) should be scaled to */ + int icon_l; /**< The size (in pixels) that l style icons should be scaled to */ + int pressed; + struct widget *widgets; + int widgets_count; + int redraw; + struct widget root; + struct widget *highlighted,*editable; + struct widget *highlighted_menu; + struct pcoord clickp, vehiclep; + struct attr *click_coord_geo, *position_coord_geo; + struct search_list *sl; + int ignore_button; + int menu_on_map_click; + char *on_map_click; + int signal_on_map_click; + char *country_iso2; + int speech; + int keyboard; /**< Whether the internal GUI keyboard is enabled */ + int keyboard_required; /**< Whether keyboard input is needed. This is only used by the * HTML menu, text entry dialogs do not use this member. */ - struct gui_config_settings config; /**< The setting information read from the configuration file. + struct gui_config_settings config; /**< The setting information read from the configuration file. * values of -1 indicate no value was specified in the config file. */ - struct event_idle *idle; - struct callback *motion_cb,*button_cb,*resize_cb,*keypress_cb,*window_closed_cb,*idle_cb, *motion_timeout_callback; - struct event_timeout *motion_timeout_event; - struct point current; + struct event_idle *idle; + struct callback *motion_cb,*button_cb,*resize_cb,*keypress_cb,*window_closed_cb,*idle_cb, *motion_timeout_callback; + struct event_timeout *motion_timeout_event; + struct point current; - struct callback * vehicle_cb; - struct route_data route_data; /**< Stores information about the route. */ + struct callback * vehicle_cb; + struct route_data route_data; /**< Stores information about the route. */ - struct gui_internal_data data; - struct callback_list *cbl; - int flags; - int cols; - struct attr osd_configuration; /**< The OSD configuration, a set of flags controlling which OSD + struct gui_internal_data data; + struct callback_list *cbl; + int flags; + int cols; + struct attr osd_configuration; /**< The OSD configuration, a set of flags controlling which OSD * items will be visible. */ - int pitch; /**< The pitch for the 3D map view. */ - int flags_town,flags_street,flags_house_number; - int radius; - int mouse_button_clicked_on_map; -/* html */ - char *html_text; - int html_depth; - struct widget *html_container; - int html_skip; - char *html_anchor; - char *href; - int html_anchor_found; - struct form *form; - struct html { - int skip; - enum html_tag { - html_tag_none, - html_tag_a, - html_tag_h1, - html_tag_html, - html_tag_img, - html_tag_script, - html_tag_form, - html_tag_input, - html_tag_div, - } tag; - char *command; - char *name; - char *href; - char *refresh_cond; - char *class; - int font_size; - struct widget *w; - struct widget *container; - } html[10]; + int pitch; /**< The pitch for the 3D map view. */ + int flags_town,flags_street,flags_house_number; + int radius; + int mouse_button_clicked_on_map; + /* html */ + char *html_text; + int html_depth; + struct widget *html_container; + int html_skip; + char *html_anchor; + char *href; + int html_anchor_found; + struct form *form; + struct html { + int skip; + enum html_tag { + html_tag_none, + html_tag_a, + html_tag_h1, + html_tag_html, + html_tag_img, + html_tag_script, + html_tag_form, + html_tag_input, + html_tag_div, + } tag; + char *command; + char *name; + char *href; + char *refresh_cond; + char *class; + int font_size; + struct widget *w; + struct widget *container; + } html[10]; -/* gestures */ + /* gestures */ - struct gesture_elem { - long long msec; - struct point p; - } gesture_ring[GESTURE_RINGSIZE]; - int gesture_ring_last, gesture_ring_first; + struct gesture_elem { + long long msec; + struct point p; + } gesture_ring[GESTURE_RINGSIZE]; + int gesture_ring_last, gesture_ring_first; - int hide_keys; //Flag to set the keyboard mode 1: hide impossible keys on search; 0: highlight them. - int results_map_population; + int hide_keys; //Flag to set the keyboard mode 1: hide impossible keys on search; 0: highlight them. + int results_map_population; }; struct menu_data { - struct widget *search_list; - struct widget *keyboard; - struct widget *button_bar; - struct widget *menu; - int keyboard_mode; - void (*redisplay)(struct gui_priv *priv, struct widget *widget, void *data); - struct widget *redisplay_widget; - char *href; - struct attr refresh_callback_obj,refresh_callback; + struct widget *search_list; + struct widget *keyboard; + struct widget *button_bar; + struct widget *menu; + int keyboard_mode; + void (*redisplay)(struct gui_priv *priv, struct widget *widget, void *data); + struct widget *redisplay_widget; + char *href; + struct attr refresh_callback_obj,refresh_callback; }; struct heightline { - struct heightline *next; - int height; - struct coord_rect bbox; - int count; - struct coord c[0]; + struct heightline *next; + int height; + struct coord_rect bbox; + int count; + struct coord c[0]; }; struct diagram_point { - struct diagram_point *next; - struct coord c; + struct diagram_point *next; + struct coord c; }; /* prototypes */ enum flags; @@ -190,18 +190,22 @@ struct widget; struct graphics_image *image_new_xs(struct gui_priv *this, const char *name); struct graphics_image *image_new_s(struct gui_priv *this, const char *name); struct graphics_image *image_new_l(struct gui_priv *this, const char *name); -struct widget *gui_internal_button_navit_attr_new(struct gui_priv *this, const char *text, enum flags flags, struct attr *on, struct attr *off); -struct widget *gui_internal_button_map_attr_new(struct gui_priv *this, const char *text, enum flags flags, struct map *map, struct attr *on, struct attr *off, int deflt); +struct widget *gui_internal_button_navit_attr_new(struct gui_priv *this, const char *text, enum flags flags, + struct attr *on, struct attr *off); +struct widget *gui_internal_button_map_attr_new(struct gui_priv *this, const char *text, enum flags flags, + struct map *map, struct attr *on, struct attr *off, int deflt); void gui_internal_say(struct gui_priv *this, struct widget *w, int questionmark); void gui_internal_back(struct gui_priv *this, struct widget *w, void *data); void gui_internal_cmd_return(struct gui_priv *this, struct widget *wm, void *data); void gui_internal_cmd_main_menu(struct gui_priv *this, struct widget *wm, void *data); struct widget *gui_internal_time_help(struct gui_priv *this); void gui_internal_apply_config(struct gui_priv *this); -void gui_internal_select_waypoint(struct gui_priv *this, const char *title, const char *hint, struct widget *wm_, void (*cmd)(struct gui_priv *priv, struct widget *widget, void *data), void *data); +void gui_internal_select_waypoint(struct gui_priv *this, const char *title, const char *hint, struct widget *wm_, + void (*cmd)(struct gui_priv *priv, struct widget *widget, void *data), void *data); void gui_internal_call_linked_on_finish(struct gui_priv *this, struct widget *wm, void *data); char *removecase(char *s); -void gui_internal_cmd_position_do(struct gui_priv *this, struct pcoord *pc_in, struct coord_geo *g_in, struct widget *wm, const char *name, int flags); +void gui_internal_cmd_position_do(struct gui_priv *this, struct pcoord *pc_in, struct coord_geo *g_in, + struct widget *wm, const char *name, int flags); void gui_internal_cmd_position(struct gui_priv *this, struct widget *wm, void *data); void gui_internal_cmd_bookmarks(struct gui_priv *this, struct widget *wm, void *data); void gui_internal_keypress_do(struct gui_priv *this, char *key); diff --git a/navit/gui/internal/gui_internal_widget.h b/navit/gui/internal/gui_internal_widget.h index 33f03e478..c1cc030f8 100644 --- a/navit/gui/internal/gui_internal_widget.h +++ b/navit/gui/internal/gui_internal_widget.h @@ -1,7 +1,7 @@ enum gui_internal_reason { - gui_internal_reason_click=1, - gui_internal_reason_keypress, - gui_internal_reason_keypress_finish + gui_internal_reason_click=1, + gui_internal_reason_keypress, + gui_internal_reason_keypress_finish }; //############################################################################################################## @@ -10,96 +10,96 @@ enum gui_internal_reason { //# Authors: Martin Schaller (04/2008) //############################################################################################################## struct widget { - enum widget_type type; - struct graphics_gc *background,*text_background; - struct graphics_gc *foreground_frame; - struct graphics_gc *foreground; - char *text; - struct graphics_image *img; - /** - * A function to be invoked on actions. - * @li widget The widget that is receiving the button press. - * - */ - void (*func)(struct gui_priv *priv, struct widget *widget, void *data); - enum gui_internal_reason reason; - int datai; - void *data; - /** - * @brief A function to deallocate data - */ - void (*data_free)(void *data); + enum widget_type type; + struct graphics_gc *background,*text_background; + struct graphics_gc *foreground_frame; + struct graphics_gc *foreground; + char *text; + struct graphics_image *img; + /** + * A function to be invoked on actions. + * @li widget The widget that is receiving the button press. + * + */ + void (*func)(struct gui_priv *priv, struct widget *widget, void *data); + enum gui_internal_reason reason; + int datai; + void *data; + /** + * @brief A function to deallocate data + */ + void (*data_free)(void *data); - /** - * @brief a function that will be called as the widget is being destroyed. - * This function can act as a destructor for the widget. It allows for - * on deallocation actions to be specified on a per widget basis. - * This function will call g_free on the widget (if required). - */ - void (*wfree) (struct gui_priv *this_, struct widget * w); - char *prefix; - char *name; - char *speech; - char *command; - struct pcoord c; - struct item item; - int selection_id; - int state; - struct point p; - int wmin,hmin; - int w,h; - int textw,texth; - int font_idx; - int bl,br,bt,bb,spx,spy; - int border; - int packed; - /** - * The number of widgets to layout horizontally when doing - * a orientation_horizontal_vertical layout - */ - int cols; - enum flags flags; - int flags2; - void *instance; - int (*set_attr)(void *, struct attr *); - int (*get_attr)(void *, enum attr_type, struct attr *, struct attr_iter *); - void (*remove_cb)(void *, struct callback *cb); - struct callback *cb; - struct attr on; - struct attr off; - int deflt; - int is_on; - int redraw; - struct menu_data *menu_data; - struct form *form; - GList *children; - struct widget *parent; - struct scroll_buttons *scroll_buttons; + /** + * @brief a function that will be called as the widget is being destroyed. + * This function can act as a destructor for the widget. It allows for + * on deallocation actions to be specified on a per widget basis. + * This function will call g_free on the widget (if required). + */ + void (*wfree) (struct gui_priv *this_, struct widget * w); + char *prefix; + char *name; + char *speech; + char *command; + struct pcoord c; + struct item item; + int selection_id; + int state; + struct point p; + int wmin,hmin; + int w,h; + int textw,texth; + int font_idx; + int bl,br,bt,bb,spx,spy; + int border; + int packed; + /** + * The number of widgets to layout horizontally when doing + * a orientation_horizontal_vertical layout + */ + int cols; + enum flags flags; + int flags2; + void *instance; + int (*set_attr)(void *, struct attr *); + int (*get_attr)(void *, enum attr_type, struct attr *, struct attr_iter *); + void (*remove_cb)(void *, struct callback *cb); + struct callback *cb; + struct attr on; + struct attr off; + int deflt; + int is_on; + int redraw; + struct menu_data *menu_data; + struct form *form; + GList *children; + struct widget *parent; + struct scroll_buttons *scroll_buttons; }; struct scroll_buttons { - /** - * Button box should not be displayed if button_box_hide is not zero. - */ - int button_box_hide; - /** - * A container box that is the child of the table widget that contains+groups - * the next and previous button. - */ - struct widget * button_box; - /** - * A button widget to handle 'next page' requests - */ - struct widget * next_button; - /** - * A button widget to handle 'previous page' requests. - */ - struct widget * prev_button; - /** - * a pointer to the gui context. - * This is needed by the free function to destroy the buttons. - */ - struct gui_priv * this; + /** + * Button box should not be displayed if button_box_hide is not zero. + */ + int button_box_hide; + /** + * A container box that is the child of the table widget that contains+groups + * the next and previous button. + */ + struct widget * button_box; + /** + * A button widget to handle 'next page' requests + */ + struct widget * next_button; + /** + * A button widget to handle 'previous page' requests. + */ + struct widget * prev_button; + /** + * a pointer to the gui context. + * This is needed by the free function to destroy the buttons. + */ + struct gui_priv * this; }; /** @@ -111,20 +111,19 @@ struct scroll_buttons { * The table_data structure needs to be freed with data_free along with the widget. * */ -struct table_data -{ - /** - * A GList pointer into a widget->children list that indicates the row - * currently being rendered at the top of the table. - */ - GList * top_row; - /** - * A Glist pointer into a widget->children list that indicates the row - * currently being rendered at the bottom of the table. - */ - GList * bottom_row; +struct table_data { + /** + * A GList pointer into a widget->children list that indicates the row + * currently being rendered at the top of the table. + */ + GList * top_row; + /** + * A Glist pointer into a widget->children list that indicates the row + * currently being rendered at the bottom of the table. + */ + GList * bottom_row; - struct scroll_buttons scroll_buttons; + struct scroll_buttons scroll_buttons; }; @@ -133,18 +132,17 @@ struct table_data * * */ -struct table_column_desc -{ +struct table_column_desc { - /** - * The computed height of a cell in the table. - */ - int height; + /** + * The computed height of a cell in the table. + */ + int height; - /** - * The computed width of a cell in the table. - */ - int width; + /** + * The computed width of a cell in the table. + */ + int width; }; /* prototypes */ enum flags; @@ -159,9 +157,14 @@ struct widget *gui_internal_label_new_abbrev(struct gui_priv *this, const char * struct widget *gui_internal_image_new(struct gui_priv *this, struct graphics_image *image); struct widget *gui_internal_text_font_new(struct gui_priv *this, const char *text, int font, enum flags flags); struct widget *gui_internal_text_new(struct gui_priv *this, const char *text, enum flags flags); -struct widget *gui_internal_button_font_new_with_callback(struct gui_priv *this, const char *text, int font, struct graphics_image *image, enum flags flags, void (*func)(struct gui_priv *priv, struct widget *widget, void *data), void *data); -struct widget *gui_internal_button_new_with_callback(struct gui_priv *this, const char *text, struct graphics_image *image, enum flags flags, void (*func)(struct gui_priv *priv, struct widget *widget, void *data), void *data); -struct widget *gui_internal_button_new(struct gui_priv *this, const char *text, struct graphics_image *image, enum flags flags); +struct widget *gui_internal_button_font_new_with_callback(struct gui_priv *this, const char *text, int font, + struct graphics_image *image, enum flags flags, void (*func)(struct gui_priv *priv, struct widget *widget, void *data), + void *data); +struct widget *gui_internal_button_new_with_callback(struct gui_priv *this, const char *text, + struct graphics_image *image, enum flags flags, void (*func)(struct gui_priv *priv, struct widget *widget, void *data), + void *data); +struct widget *gui_internal_button_new(struct gui_priv *this, const char *text, struct graphics_image *image, + enum flags flags); struct widget *gui_internal_find_widget(struct widget *wi, struct point *p, int flags); void gui_internal_highlight_do(struct gui_priv *this, struct widget *found); void gui_internal_highlight(struct gui_priv *this); |
