summaryrefslogtreecommitdiff
path: root/navit/gui/internal/gui_internal.c
diff options
context:
space:
mode:
Diffstat (limited to 'navit/gui/internal/gui_internal.c')
-rw-r--r--navit/gui/internal/gui_internal.c59
1 files changed, 33 insertions, 26 deletions
diff --git a/navit/gui/internal/gui_internal.c b/navit/gui/internal/gui_internal.c
index 3affd52e4..fd450b57c 100644
--- a/navit/gui/internal/gui_internal.c
+++ b/navit/gui/internal/gui_internal.c
@@ -88,6 +88,7 @@
#include "gui_internal_gesture.h"
#include "gui_internal_poi.h"
#include "gui_internal_command.h"
+#include "gui_internal_keyboard.h"
/**
@@ -743,9 +744,7 @@ gui_internal_call_linked_on_finish(struct gui_priv *this, struct widget *wm, voi
struct widget * gui_internal_keyboard(struct gui_priv *this, int mode);
-
-
-
+struct widget * gui_internal_keyboard_show_native(struct gui_priv *this, struct widget *w, int mode, char *lang);
static void
@@ -1674,9 +1673,15 @@ gui_internal_keypress_do(struct gui_priv *this, char *key)
dbg(lvl_info,"wi->state=0x%x\n", wi->state);
}
text=g_strdup_printf("%s%s", wi->text ? wi->text : "", key);
+
+ gui_internal_keyboard_to_lower_case(this);
}
g_free(wi->text);
wi->text=text;
+
+ if(!wi->text || !*wi->text)
+ gui_internal_keyboard_to_upper_case(this);
+
if (wi->func) {
wi->reason=gui_internal_reason_keypress;
wi->func(this, wi, wi->data);
@@ -2668,6 +2673,12 @@ static void gui_internal_resize(void *data, int w, int h)
this->root.h=h;
changed=1;
}
+ /*
+ * If we're drawing behind system bars on Android, watching for actual size changes will not catch
+ * fullscreen toggle events. As a workaround, always assume a size change if padding is supplied.
+ */
+ if (!changed && this->gra && graphics_get_data(this->gra, "padding"))
+ changed = 1;
dbg(lvl_debug,"w=%d h=%d children=%p\n", w, h, this->root.children);
navit_handle_resize(this->nav, w, h);
if (this->root.children) {
@@ -2697,7 +2708,9 @@ gui_internal_keynav_point(struct widget *w, int dx, int dy, struct point *p)
static struct widget*
gui_internal_keynav_find_next_sensitive_child(struct widget *wi) {
GList *l=wi->children;
- if (wi && wi->state & STATE_SENSITIVE)
+ if (wi->state & STATE_OFFSCREEN)
+ return NULL;
+ if (wi->state & STATE_SENSITIVE)
return wi;
while (l) {
struct widget* tmp = gui_internal_keynav_find_next_sensitive_child(l->data);
@@ -2742,6 +2755,9 @@ gui_internal_keynav_find_prev(struct widget *wi, struct widget *current_highligh
// Reached current widget; last widget found is the result.
return RESULT_FOUND;
}
+ // If widget is off-screen, do not recurse into it.
+ if (wi->state & STATE_OFFSCREEN)
+ return NO_RESULT_YET;
if (wi->state & STATE_SENSITIVE)
*result= wi;
GList *l=wi->children;
@@ -3102,12 +3118,14 @@ static struct gui_internal_widget_methods gui_internal_widget_methods = {
gui_internal_set_default_background,
};
-
-/*
- * @brief Displays Route information
+/**
+ * @brief finds the intersection point of 2 lines
+ *
+ * @param coord a1, a2, b1, b2 : coords of the start and
+ * end of the first and the second line
+ * @param coord res, will become the coords of the intersection if found
+ * @return : TRUE if intersection found, otherwise FALSE
*/
-/* FIXME where is the implementation? */
-
int
line_intersection(struct coord* a1, struct coord *a2, struct coord * b1, struct coord *b2, struct coord *res)
{
@@ -3125,18 +3143,19 @@ line_intersection(struct coord* a1, struct coord *a2, struct coord * b1, struct
b = -b;
}
if (a < 0 || b < 0)
- return 0;
+ return FALSE;
if (a > n || b > n)
- return 0;
+ return FALSE;
if (n == 0) {
dbg(lvl_info,"a=%d b=%d n=%d\n", a, b, n);
dbg(lvl_info,"a1=0x%x,0x%x ad %d,%d\n", a1->x, a1->y, adx, ady);
dbg(lvl_info,"b1=0x%x,0x%x bd %d,%d\n", b1->x, b1->y, bdx, bdy);
- dbg_assert(n != 0);
+ dbg(lvl_info,"No intersection found, lines assumed parallel ?\n");
+ return FALSE;
}
res->x = a1->x + a * adx / n;
res->y = a1->y + a * ady / n;
- return 1;
+ return TRUE;
}
struct heightline *
@@ -3166,18 +3185,6 @@ item_get_heightline(struct item *item)
return ret;
}
-
-/*
- * @brief Displays Route Height Profile
- *
- * @li The name of the active vehicle
- * @param wm The button that was pressed.
- * @param v Unused
- */
-/* FIXME where is the implementation? */
-
-
-
/**
* @brief Called when the route is updated.
*/
@@ -3445,5 +3452,5 @@ static struct gui_priv * gui_internal_new(struct navit *nav, struct gui_methods
//##############################################################################################################
void plugin_init(void)
{
- plugin_register_gui_type("internal", gui_internal_new);
+ plugin_register_category_gui("internal", gui_internal_new);
}