summaryrefslogtreecommitdiff
path: root/navit/gui/internal
diff options
context:
space:
mode:
authorLionel AINS <lains@caramail.com>2018-10-15 08:43:02 +0200
committerLionel AINS <lains@caramail.com>2018-10-15 08:43:02 +0200
commit59948f00ece870973facf2df0e45afd0c3088702 (patch)
tree65fc08dd92e7cfe59404bdab2630e7d3f817510a /navit/gui/internal
parent4886c93b4461799f9742275ed5ee5ed2d31dee22 (diff)
downloadnavit-59948f00ece870973facf2df0e45afd0c3088702.tar.gz
Cleanup and doxygen doc
Diffstat (limited to 'navit/gui/internal')
-rw-r--r--navit/gui/internal/gui_internal.c18
-rw-r--r--navit/gui/internal/gui_internal_widget.c36
-rw-r--r--navit/gui/internal/gui_internal_widget.h2
3 files changed, 40 insertions, 16 deletions
diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c
index 34ac3eab9..2c48efd0c 100644
--- a/navit/gui/internal/gui_internal.c
+++ b/navit/gui/internal/gui_internal.c
@@ -2679,11 +2679,16 @@ static void gui_internal_setup(struct gui_priv *this) {
g_free(gui_file);
}
-//##############################################################################################################
-//# Description:
-//# Comment:
-//# Authors: Martin Schaller (04/2008)
-//##############################################################################################################
+/**
+ * @brief Callback function invoked when display area is resized
+ *
+ * @param data A generic argument structure pointer, here we use it to store the the internal GUI context (this)
+ * @param wnew The new width of the display area
+ * @param hnew The new height of the display area
+ *
+ * @author Martin Schaller
+ * @date 2008/04
+ */
static void gui_internal_resize(void *data, int wnew, int hnew) {
GList *l;
struct widget *w;
@@ -2714,7 +2719,8 @@ static void gui_internal_resize(void *data, int wnew, int hnew) {
void (*redisplay)(struct gui_priv *priv, struct widget *widget, void *data);
redisplay=w->menu_data->redisplay;
dbg(lvl_error, "redisplay%c=NULL", redisplay?'!':'=');
- if (!gui_internal_widget_reload_href(this, w)) {
+ if (!gui_internal_widget_reload_href(this, w)) { /* If the foremost widget is a HTML menu, reload & redraw it from its href */
+ /* If not, resize the foremost widget */
dbg(lvl_error, "Current GUI displayed is not a menu");
dbg(lvl_error, "Will call resize with w=%d, h=%d", wnew, hnew)
gui_internal_menu_resize(this, wnew, hnew);
diff --git a/navit/gui/internal/gui_internal_widget.c b/navit/gui/internal/gui_internal_widget.c
index 791c6826c..e91810164 100644
--- a/navit/gui/internal/gui_internal_widget.c
+++ b/navit/gui/internal/gui_internal_widget.c
@@ -139,6 +139,8 @@ static void gui_internal_label_render(struct gui_priv *this, struct widget *w) {
*
* @param this The internal GUI instance
* @param w The widget to render
+ * @param wnew The new width of the widget
+ * @param hnew THe new height of the widget
*/
static void gui_internal_label_resize(struct gui_priv *this, struct widget *w, int wnew, int hnew) {
}
@@ -608,6 +610,14 @@ static void gui_internal_box_pack(struct gui_priv *this, struct widget *w) {
}
}
+/**
+ * @brief Resize a box widget.
+ *
+ * @param this The internal GUI instance
+ * @param w The widget to render
+ * @param wnew The new width of the widget
+ * @param hnew THe new height of the widget
+ */
static void gui_internal_box_resize(struct gui_priv *this, struct widget *w, int wnew, int hnew) {
gui_internal_widget_reset_pack(this, w);
@@ -762,6 +772,14 @@ void gui_internal_widget_render(struct gui_priv *this, struct widget *w) {
}
}
+/**
+ * @brief Generic widget resize function (that will call the appropriate resize function depending on the widget type).
+ *
+ * @param this The internal GUI instance
+ * @param w The widget to render
+ * @param wnew The new width of the widget
+ * @param hnew THe new height of the widget
+ */
void gui_internal_widget_resize(struct gui_priv *this, struct widget *w, int wnew, int hnew) {
if(w->p.x > this->root.w || w->p.y > this->root.h || w->state & STATE_INVISIBLE)
return;
@@ -775,12 +793,11 @@ void gui_internal_widget_resize(struct gui_priv *this, struct widget *w, int wne
dbg(lvl_error, "Resizing label at %p to w=%d, h=%d (text=\"%s\")", w, wnew, hnew, w->text);
gui_internal_label_resize(this, w, wnew, hnew);
break;
- case widget_image:
- dbg(lvl_error, "resize not yet implemented for widget_image");
+ case widget_image: /* No resize needed for images */
break;
case widget_table:
- dbg(lvl_error, "Not resizing table at %p to w=%d, h=%d", w, wnew, hnew);
- //gui_internal_table_resize(this, w, wnew, hnew);
+ dbg(lvl_error, "Resizing table at %p to w=%d, h=%d", w, wnew, hnew);
+ gui_internal_table_resize(this, w, wnew, hnew);
break;
default:
break;
@@ -1359,17 +1376,18 @@ void gui_internal_table_render(struct gui_priv * this, struct widget * w) {
/**
* @brief Resize a table widget.
*
- * @param this The graphics context
- * @param w The table widget to render.
+ * @param this The internal GUI instance
+ * @param w The widget to render
+ * @param wnew The new width of the widget
+ * @param hnew THe new height of the widget
*/
void gui_internal_table_resize(struct gui_priv * this, struct widget * w, int wnew, int hnew) {
-
w->w = wnew;
w->h = hnew;
- gui_internal_widget_reset_pack(this, w);
- gui_internal_table_pack(this, w);
+// gui_internal_widget_reset_pack(this, w);
+// gui_internal_table_pack(this, w);
}
/**
diff --git a/navit/gui/internal/gui_internal_widget.h b/navit/gui/internal/gui_internal_widget.h
index 098e9645c..c5c5cb681 100644
--- a/navit/gui/internal/gui_internal_widget.h
+++ b/navit/gui/internal/gui_internal_widget.h
@@ -24,7 +24,7 @@ struct widget {
void (*func)(struct gui_priv *priv, struct widget *widget, void *data);
/**
* A function to be invoked on resize or move
- * @param widged The widget that is resized
+ * @param widget The widget that is resized
*/
void (*on_resize)(struct gui_priv *priv, struct widget *widget, void *data, int neww, int newh);
enum gui_internal_reason reason;