navit  0.5.3-trunk
gui_internal_keyboard.h File Reference

Go to the source code of this file.

Enumerations

enum  vkbd_mode {
  VKBD_LATIN_UPPER = 0 , VKBD_LATIN_LOWER = 8 , VKBD_NUMERIC = 16 , VKBD_UMLAUT_UPPER = 24 ,
  VKBD_UMLAUT_LOWER = 32 , VKBD_CYRILLIC_UPPER = 40 , VKBD_CYRILLIC_LOWER = 48 , VKBD_DEGREE = 56 ,
  VKBD_GREEK_UPPER = 64 , VKBD_GREEK_LOWER = 72 , VKBD_FLAG_2 = 2 , VKBD_MASK_7 = 7 ,
  VKBD_FLAG_1024 = 1024 , VKBD_LAYOUT_MASK = ~7
}
 

Functions

struct widgetgui_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 widgetgui_internal_keyboard (struct gui_priv *this, int mode)
 Creates a keyboard widget. More...
 
struct widgetgui_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...
 
int gui_internal_keyboard_init_mode (char *lang)
 Returns the default keyboard mode for a country. More...
 
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...
 

Enumeration Type Documentation

◆ vkbd_mode

enum vkbd_mode

Modes for the on-screen keyboard

Enumerator
VKBD_LATIN_UPPER 

Latin uppercase characters

VKBD_LATIN_LOWER 

Latin lowercase characters

VKBD_NUMERIC 

Numeric keyboard

VKBD_UMLAUT_UPPER 

Extended Latin uppercase characters

VKBD_UMLAUT_LOWER 

Extended Latin lowercase characters

VKBD_CYRILLIC_UPPER 

Cyrillic uppercase characters

VKBD_CYRILLIC_LOWER 

Cyrillic lowercase characters

VKBD_DEGREE 

Numeric keyboard with extra characters (NESW, degree, minute) for coordinate input

VKBD_GREEK_UPPER 

Greek uppercase letters

VKBD_GREEK_LOWER 

Greek lowercase letters

VKBD_FLAG_2 
VKBD_MASK_7 
VKBD_FLAG_1024 
VKBD_LAYOUT_MASK 

Function Documentation

◆ gui_internal_keyboard()

struct widget* gui_internal_keyboard ( struct gui_priv this,
int  mode 
)

Creates a keyboard widget.

This function creates a widget to display the internal GUI keyboard.

The

mode

argument specifies the type of keyboard which should initially be displayed. Refer to vkbd_mode for a list of possible modes and their meaning.

Parameters
thisThe internal GUI instance
modeThe mode for the keyboard
Returns
A new keyboard widget

◆ gui_internal_keyboard_do()

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.

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).

Parameters
thisThe internal GUI instance
wkbdbThe existing keyboard widget whose layout is to be switched, or
NULL
to create a new keyboard widget
modeThe new keyboard mode, see gui_internal_keyboard(struct gui_priv *, struct widget *, int) for a description of possible values
Returns
wkbdb
if a non-NULL value was passed, else a new keyboard widget will be returned.

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().

◆ gui_internal_keyboard_init_mode()

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.

Parameters
langThe two-letter country code
Returns
@ VKBD_CYRILLIC_UPPER
Definition: gui_internal_keyboard.h:11
for countries using the Cyrillic alphabet,
@ VKBD_LATIN_UPPER
Definition: gui_internal_keyboard.h:6
otherwise

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().

◆ gui_internal_keyboard_show_native()

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

NULL

.

The widget's

wfree

function, to be called when the widget is destroyed, will be used to hide the platform keyboard when it is no longer needed.

Parameters
thisThe internal GUI instance
wThe parent of the widget requiring text input
modeThe requested keyboard mode
langThe language for text input, used to select a keyboard layout
Returns
The placeholder widget for the on-screen keyboard, may be
NULL

◆ gui_internal_keyboard_to_lower_case()

void gui_internal_keyboard_to_lower_case ( struct gui_priv this)

Switch keyboard mode to lowercase if it's in uppercase mode and.

VKBD_MODE_2

is set.

Called on each alphanumeric input.

Parameters
thisThe 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().

◆ gui_internal_keyboard_to_upper_case()

void gui_internal_keyboard_to_upper_case ( struct gui_priv this)

Switch keyboard mode to uppercase if it's in lowercase mode and.

VKBD_MODE_2

is set.

Called when there's no input left in the input field.

Parameters
thisThe 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().