navit
0.5.3-trunk
|
#include <glib.h>
#include <stdlib.h>
#include "color.h"
#include "coord.h"
#include "point.h"
#include "callback.h"
#include "graphics.h"
#include "debug.h"
#include "gui_internal.h"
#include "gui_internal_widget.h"
#include "gui_internal_priv.h"
#include "gui_internal_menu.h"
#include "gui_internal_keyboard.h"
Data Structures | |
struct | gui_internal_keyb_mode |
Describes a keyboard mode. More... | |
Functions | |
void | gui_internal_keyboard_to_upper_case (struct gui_priv *this) |
Switch keyboard mode to uppercase if it's in lowercase mode and. More... | |
void | gui_internal_keyboard_to_lower_case (struct gui_priv *this) |
Switch keyboard mode to lowercase if it's in uppercase mode and. More... | |
static void | gui_internal_cmd_keypress (struct gui_priv *this, struct widget *wm, void *data) |
Processes a key press on the internal GUI keyboard. More... | |
static struct widget * | gui_internal_keyboard_key_data (struct gui_priv *this, struct widget *wkbd, char *text, int font, void(*func)(struct gui_priv *priv, struct widget *widget, void *data), void *data, void(*data_free)(void *data), int w, int h) |
static struct widget * | gui_internal_keyboard_key (struct gui_priv *this, struct widget *wkbd, char *text, char *key, int w, int h) |
static void | gui_internal_keyboard_change (struct gui_priv *this, struct widget *key, void *data) |
static void | gui_internal_keyboard_topbox_resize (struct gui_priv *this, struct widget *w, void *data, int neww, int newh) |
struct widget * | gui_internal_keyboard_do (struct gui_priv *this, struct widget *wkbdb, int mode) |
Creates a new keyboard widget or switches the layout of an existing widget. More... | |
struct widget * | gui_internal_keyboard (struct gui_priv *this, int mode) |
Creates a keyboard widget. More... | |
int | gui_internal_keyboard_init_mode (char *lang) |
Returns the default keyboard mode for a country. More... | |
static void | gui_internal_keyboard_hide_native (struct gui_priv *this_, struct widget *w) |
Hides the platform's native on-screen keyboard or other input method. More... | |
struct widget * | gui_internal_keyboard_show_native (struct gui_priv *this, struct widget *w, int mode, char *lang) |
Shows the platform's native on-screen keyboard or other input method. More... | |
Variables | |
struct gui_internal_keyb_mode | gui_internal_keyb_modes [] |
A list of all available keyboard modes. More... | |
|
static |
Processes a key press on the internal GUI keyboard.
If the keyboard is currently in uppercase mode and
is set, it is tswitched to the corresponding lowercase mode in
.
this | The internal GUI instance |
wm | |
data | Not used |
References widget::data, and gui_internal_keypress_do().
Referenced by gui_internal_keyboard_key().
Creates a keyboard widget.
This function creates a widget to display the internal GUI keyboard.
The
argument specifies the type of keyboard which should initially be displayed. Refer to vkbd_mode for a list of possible modes and their meaning.
this | The internal GUI instance |
mode | The mode for the keyboard |
References gui_internal_keyboard_do().
Referenced by gui_internal_cmd_add_bookmark2(), gui_internal_cmd_add_bookmark_folder2(), gui_internal_cmd_enter_coord(), gui_internal_cmd_log(), gui_internal_cmd_pois_filter(), gui_internal_cmd_rename_bookmark(), gui_internal_html_menu(), and gui_internal_search().
|
static |
References gui_internal_keyboard_do(), and key.
Referenced by gui_internal_keyboard_do().
Creates a new keyboard widget or switches the layout of an existing widget.
This is an internal helper function that is not normally called directly. To create a new keyboard widget, GUI widgets should call gui_internal_keyboard(struct gui_priv *, struct widget *, int).
this | The internal GUI instance |
wkbdb | The existing keyboard widget whose layout is to be switched, or NULL
|
mode | The new keyboard mode, see gui_internal_keyboard(struct gui_priv *, struct widget *, int) for a description of possible values |
References widget::background, widget::bb, widget::bl, widget::br, widget::bt, scroll_buttons::button_box_hide, widget::cols, widget::data, widget::datai, flags_fill, gui_internal_keyb_mode::font, widget::func, gravity_center, gui_internal_box_new(), gui_internal_highlight(), gui_internal_keyb_modes, gui_internal_keyboard_change(), gui_internal_keyboard_key(), gui_internal_keyboard_key_data(), gui_internal_keyboard_topbox_resize(), gui_internal_label_font_new(), gui_internal_label_new(), gui_internal_menu_data(), gui_internal_menu_render(), gui_internal_menu_reset_pack(), gui_internal_widget_append(), gui_internal_widget_children_destroy(), gui_internal_widget_pack(), gui_internal_widget_render(), gui_internal_widget_reset_pack(), widget::h, menu_data::keyboard, menu_data::keyboard_mode, widget::on_resize, orientation_horizontal, orientation_horizontal_vertical, widget::p, table_data::scroll_buttons, menu_data::search_list, widget::spx, widget::spy, widget::state, STATE_SENSITIVE, widget::text, gui_internal_keyb_mode::title, widget::type, VKBD_CYRILLIC_LOWER, VKBD_CYRILLIC_UPPER, VKBD_DEGREE, VKBD_FLAG_1024, VKBD_GREEK_LOWER, VKBD_GREEK_UPPER, VKBD_LATIN_LOWER, VKBD_LATIN_UPPER, VKBD_LAYOUT_MASK, VKBD_MASK_7, VKBD_NUMERIC, VKBD_UMLAUT_LOWER, VKBD_UMLAUT_UPPER, widget::w, widget_table, and point::y.
Referenced by gui_internal_keyboard(), gui_internal_keyboard_change(), gui_internal_keyboard_to_lower_case(), gui_internal_keyboard_to_upper_case(), and gui_internal_keyboard_topbox_resize().
Hides the platform's native on-screen keyboard or other input method.
This function is called as the
method of the placeholder widget for the platform's native on-screen keyboard. It is a wrapper around the corresponding method of the graphics plugin, which takes care of all platform-specific actions to hide the on-screen input method it previously displayed.
A call to this function indicates that Navit no longer needs the input method and is about to destroy its placeholder widget. Navit will subsequently reclaim any screen real estate it may have previously reserved for the input method.
This function will free the
pointed to by
this | The internal GUI instance |
w | The placeholder widget |
References dbg, gui_priv::gra, graphics_hide_native_keyboard(), graphics_keyboard::gui_priv, graphics_keyboard::lang, lvl_warning, and graphics_keyboard::w.
Referenced by gui_internal_keyboard_show_native().
int gui_internal_keyboard_init_mode | ( | char * | lang | ) |
Returns the default keyboard mode for a country.
The return value can be passed to gui_internal_keyboard(struct gui_priv *, int) and related functions.
lang | The two-letter country code |
References VKBD_CYRILLIC_UPPER, VKBD_GREEK_UPPER, and VKBD_LATIN_UPPER.
Referenced by gui_internal_cmd_add_bookmark2(), gui_internal_cmd_add_bookmark_folder2(), gui_internal_cmd_log(), gui_internal_cmd_pois_filter(), gui_internal_cmd_rename_bookmark(), gui_internal_html_menu(), and gui_internal_search().
|
static |
References g_free_func, gui_internal_cmd_keypress(), gui_internal_keyboard_key_data(), widget::h, key, widget::text, and widget::w.
Referenced by gui_internal_keyboard_do().
|
static |
References widget::background, widget::bb, widget::bl, widget::br, widget::bt, data, widget::data_free, widget::func, gravity_center, gui_internal_button_font_new_with_callback(), gui_internal_widget_append(), widget::h, orientation_vertical, widget::text, and widget::w.
Referenced by gui_internal_keyboard_do(), and gui_internal_keyboard_key().
struct widget* gui_internal_keyboard_show_native | ( | struct gui_priv * | this, |
struct widget * | w, | ||
int | mode, | ||
char * | lang | ||
) |
Shows the platform's native on-screen keyboard or other input method.
This method is a wrapper around the corresponding method of the graphics plugin, which takes care of all platform-specific details. In particular, it is up to the graphics plugin to determine how to handle the request: it may show its on-screen keyboard or another input method (such as stroke recognition). It may choose to simply ignore the request, which will typically occur when a hardware keyboard (or other hardware input) is available.
The platform's native input method may obstruct parts of Navit's UI. To prevent parts of the UI from becoming unreachable, this method will insert an empty box widget in the appropriate size at the appropriate position, provided the graphics plugin reports the correct values. Otherwise a zero-size widget is inserted. If the graphics driver decides not to display an on-screen input method, no widget will be created and the return value will be
.
The widget's
function, to be called when the widget is destroyed, will be used to hide the platform keyboard when it is no longer needed.
this | The internal GUI instance |
w | The parent of the widget requiring text input |
mode | The requested keyboard mode |
lang | The language for text input, used to select a keyboard layout |
References widget::data, dbg, flags_fill, graphics_show_native_keyboard(), gravity_center, gui_internal_box_new(), gui_internal_keyboard_hide_native(), gui_internal_menu_data(), gui_internal_widget_append(), graphics_keyboard::h, widget::h, widget::hmin, menu_data::keyboard, menu_data::keyboard_mode, graphics_keyboard::lang, lvl_error, graphics_keyboard::mode, orientation_horizontal_vertical, graphics_keyboard::w, widget::w, widget::wfree, and widget::wmin.
Referenced by gui_internal_cmd_add_bookmark2(), gui_internal_cmd_add_bookmark_folder2(), gui_internal_cmd_enter_coord(), gui_internal_cmd_log(), gui_internal_cmd_pois_filter(), gui_internal_cmd_rename_bookmark(), gui_internal_html_menu(), and gui_internal_search().
void gui_internal_keyboard_to_lower_case | ( | struct gui_priv * | this | ) |
Switch keyboard mode to lowercase if it's in uppercase mode and.
is set.
Called on each alphanumeric input.
this | The internal GUI instance |
References gui_internal_keyboard_do(), gui_internal_menu_data(), menu_data::keyboard, menu_data::keyboard_mode, VKBD_CYRILLIC_LOWER, VKBD_CYRILLIC_UPPER, VKBD_FLAG_2, VKBD_GREEK_LOWER, VKBD_GREEK_UPPER, VKBD_LATIN_LOWER, VKBD_LATIN_UPPER, VKBD_UMLAUT_LOWER, and VKBD_UMLAUT_UPPER.
Referenced by gui_internal_keypress_do().
void gui_internal_keyboard_to_upper_case | ( | struct gui_priv * | this | ) |
Switch keyboard mode to uppercase if it's in lowercase mode and.
is set.
Called when there's no input left in the input field.
this | The internal GUI instance |
References gui_internal_keyboard_do(), gui_internal_menu_data(), menu_data::keyboard, menu_data::keyboard_mode, VKBD_CYRILLIC_LOWER, VKBD_CYRILLIC_UPPER, VKBD_FLAG_2, VKBD_GREEK_LOWER, VKBD_GREEK_UPPER, VKBD_LATIN_LOWER, VKBD_LATIN_UPPER, VKBD_UMLAUT_LOWER, and VKBD_UMLAUT_UPPER.
Referenced by gui_internal_keypress_do().
|
static |
References dbg, gui_internal_keyboard_do(), gui_internal_menu_data(), menu_data::keyboard, menu_data::keyboard_mode, lvl_debug, and widget::w.
Referenced by gui_internal_keyboard_do().
gui_internal_keyb_modes |
A list of all available keyboard modes.
Referenced by gui_internal_keyboard_do().