klavaro  3.13
About: Klavaro is a touch typing tutor program.
  Fossies Dox: klavaro-3.13.tar.bz2  ("unofficial" and yet experimental doxygen-generated source code documentation)  

keyboard.h
Go to the documentation of this file.
1 /**************************************************************************/
2 /* Klavaro - a flexible touch typing tutor */
3 /* Copyright (C) 2005-2021 Felipe Emmanuel Ferreira de Castro */
4 /* */
5 /* This file is part of Klavaro, which is a free software: you can */
6 /* redistribute it and/or modify it under the terms of the GNU General */
7 /* Public License as published by the Free Software Foundation, either */
8 /* version 3 of the License, or (at your option) any later version. */
9 /* */
10 /* Klavaro is distributed in the hope that it will be useful, */
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
13 /* GNU General Public License for more details (in the file COPYING). */
14 /* You should have received a copy of the GNU General Public License */
15 /* along with Klavaro. If not, see <https://www.gnu.org/licenses/> */
16 /**************************************************************************/
17 
18 #define KEYB_AUTO_SAVE "tmp_auto"
19 
20 #define MAX_KEYBOARDS 200
21 #define KEY_LINE_LEN (14 + 1) /* 14 keys + 1 NULL char */
22 
23 #define UPSYM ((gunichar) 182)
24 #define URDU_STOP ((gunichar) 0x06D4)
25 #define URDU_COMMA ((gunichar) 0x060C)
26 #define DEVANAGARI_STOP ((gunichar) 0x0964)
27 #define TIBETAN_WORD_DELIMITER ((gunichar) 0x0F0B)
28 #define TIBETAN_STOP ((gunichar) 0x0F0D)
29 #define TIBETAN_COMMA ((gunichar) L' ')
30 #define BO_NARO ((gunichar) 0x0F7C)
31 
32 /* Pretty colors
33  */
34 #define KEYB_GREEN "#aaeebb"
35 #define KEYB_RED "#eeaaaa"
36 #define KEYB_BLUE "#bbbbff"
37 #define KEYB_YELLOW "#eeee88"
38 #define KEYB_ORANGE "#ffcc77" /* "#ffdd88" */
39 #define KEYB_PURPLE "#ccaacc"
40 #define KEYB_BLACK "#000000"
41 
42 typedef struct _KEYBLAYOUT
43 {
44  gchar *name;
45  gchar *country;
46  gchar *variant;
48 
49 /*
50  * Interface
51  */
52 gchar *keyb_get_name (void);
53 
54 gchar * keyb_get_name_last (void);
55 
56 void keyb_set_name (const gchar * name);
57 
58 void keyb_init_name (const gchar * name);
59 
60 gunichar keyb_get_lochars (gint i, gint j);
61 
62 gunichar keyb_get_upchars (gint i, gint j);
63 
64 gboolean keyb_get_modified_status (void);
65 
66 void keyb_set_modified_status (gboolean new_status);
67 
68 /*
69  * Auxiliar
70  */
71 void keyb_create_virtual_keys (void);
72 
73 void keyb_set_chars (void);
74 
75 gboolean keyb_is_vowel (gunichar chr);
76 
77 gboolean keyb_is_diacritic (gunichar chr);
78 
79 gboolean keyb_is_inset (gunichar chr);
80 
81 gint keyb_get_vowels (gunichar * vows);
82 
83 gint keyb_get_consonants (gunichar * consonants);
84 
85 gint keyb_get_symbols (gunichar * symbols);
86 
87 gint keyb_get_altnums (gunichar * altnums);
88 
89 gunichar keyb_unichar_toupper (gunichar uchar);
90 
91 void keyb_save_new_layout (void);
92 
93 void keyb_remove_user_layout (void);
94 
95 void keyb_update_virtual_layout (void);
96 
97 gchar * keyb_get_country_code (const gchar *kbd);
98 
99 gchar * keyb_get_country (const gchar *kbd);
100 
101 gchar * keyb_get_variant (const gchar *kbd);
102 
103 void keyb_set_keyboard_layouts (void);
104 
105 void keyb_update_from_variant (gchar *cmb_country, gchar *cmb_variant);
106 
107 void keyb_set_combo_kbd_variant (gchar *cmb_country, gchar *cmb_variant);
108 
109 void keyb_set_combo_kbd (gchar *cmb_country, gchar *cmb_variant);
110 
111 void keyb_update_combos (gchar *cmb_country, gchar *cmb_variant);
112 
113 void keyb_intro_step_next (void);
114 
115 void keyb_intro_step_previous (void);
116 
117 void keyb_intro_step (gint step);
118 
119 gchar * keyb_mode_get_name (void);
120 
121 void keyb_mode_intro (void);
122 
123 void keyb_mode_hint (void);
124 
125 void keyb_mode_edit (void);
126 
127 void keyb_set_sensitive (gboolean state);
128 
129 gboolean keyb_button_match (GtkButton * button);
130 
131 void keyb_edit_button (GtkButton * button);
132 
133 void keyb_edit_none (void);
134 
135 gboolean keyb_edit_next (void);
136 
137 void keyb_change_key (gunichar real_key);
138 
139 gchar *keyb_get_utf8_paragraph_symbol (void);
140 
141 gboolean keyb_force_edit_tab (gpointer data);
142 
143 /*
144  * Hints
145  */
146 void hints_init (void);
147 
148 gchar * hints_color_from_charcode (gchar charcode);
149 
150 gchar * hints_string_from_charcode (gchar charcode);
151 
152 void hints_set_tips (void);
153 
154 void hints_set_colors (void);
155 
156 void hints_get_from_char (gchar *file_name, gunichar character);
157 
158 void hints_update_from_char (gunichar character);
159 
160 void hints_update_from_button (GtkButton * button);
161 
162 gboolean hints_demo_fingers_move (gpointer data);
163 
164 void hints_demo_fingers (guint msec);
165 
166 gchar * hints_finger_name_from_char (gunichar uch);
guint i
Definition: keyboard.c:55
guint j
Definition: keyboard.c:56
gchar * name
Definition: keyboard.c:45
gchar * hints_finger_name_from_char(gunichar uch)
Definition: keyboard.c:1987
void keyb_remove_user_layout(void)
Definition: keyboard.c:640
void hints_demo_fingers(guint msec)
Definition: keyboard.c:1969
void keyb_mode_edit(void)
Definition: keyboard.c:1446
void keyb_set_sensitive(gboolean state)
Definition: keyboard.c:1489
gboolean hints_demo_fingers_move(gpointer data)
Definition: keyboard.c:1952
gboolean keyb_get_modified_status(void)
Definition: keyboard.c:244
void keyb_intro_step(gint step)
Definition: keyboard.c:1162
void keyb_mode_hint(void)
Definition: keyboard.c:1411
gunichar keyb_unichar_toupper(gunichar uchar)
Definition: keyboard.c:591
gboolean keyb_is_vowel(gunichar chr)
Definition: keyboard.c:462
void hints_set_colors(void)
Definition: keyboard.c:1848
void keyb_intro_step_previous(void)
Definition: keyboard.c:1155
void keyb_update_combos(gchar *cmb_country, gchar *cmb_variant)
Definition: keyboard.c:1101
gint keyb_get_altnums(gunichar *altnums)
Definition: keyboard.c:567
gchar * keyb_mode_get_name(void)
Definition: keyboard.c:1358
void keyb_mode_intro(void)
Definition: keyboard.c:1377
void keyb_edit_button(GtkButton *button)
Definition: keyboard.c:1532
void keyb_set_name(const gchar *name)
Definition: keyboard.c:216
void hints_update_from_char(gunichar character)
Definition: keyboard.c:1911
gint keyb_get_consonants(gunichar *consonants)
Definition: keyboard.c:518
struct _KEYBLAYOUT KeybLayout
gboolean keyb_button_match(GtkButton *button)
Definition: keyboard.c:1506
gunichar keyb_get_lochars(gint i, gint j)
Definition: keyboard.c:232
void hints_set_tips(void)
Definition: keyboard.c:1816
gboolean keyb_is_inset(gunichar chr)
Definition: keyboard.c:442
gchar * keyb_get_utf8_paragraph_symbol(void)
Definition: keyboard.c:1649
void hints_get_from_char(gchar *file_name, gunichar character)
gchar * keyb_get_country_code(const gchar *kbd)
Definition: keyboard.c:740
gchar * keyb_get_name_last(void)
Definition: keyboard.c:210
gint keyb_get_vowels(gunichar *vows)
Definition: keyboard.c:491
gchar * keyb_get_country(const gchar *kbd)
Definition: keyboard.c:758
gboolean keyb_edit_next(void)
Definition: keyboard.c:1563
gchar * keyb_get_name(void)
Definition: keyboard.c:204
void keyb_set_combo_kbd(gchar *cmb_country, gchar *cmb_variant)
Definition: keyboard.c:1049
gunichar keyb_get_upchars(gint i, gint j)
Definition: keyboard.c:238
void keyb_update_virtual_layout(void)
Definition: keyboard.c:671
gboolean keyb_force_edit_tab(gpointer data)
void keyb_create_virtual_keys(void)
Definition: keyboard.c:266
void keyb_init_name(const gchar *name)
Definition: keyboard.c:225
gboolean keyb_is_diacritic(gunichar chr)
Definition: keyboard.c:476
gint keyb_get_symbols(gunichar *symbols)
Definition: keyboard.c:543
void keyb_set_modified_status(gboolean new_status)
Definition: keyboard.c:250
void keyb_intro_step_next(void)
Definition: keyboard.c:1148
void keyb_set_keyboard_layouts(void)
Definition: keyboard.c:797
gchar * hints_color_from_charcode(gchar charcode)
Definition: keyboard.c:1747
void keyb_update_from_variant(gchar *cmb_country, gchar *cmb_variant)
Definition: keyboard.c:853
void keyb_save_new_layout(void)
Definition: keyboard.c:608
gchar * keyb_get_variant(const gchar *kbd)
Definition: keyboard.c:773
gchar * hints_string_from_charcode(gchar charcode)
Definition: keyboard.c:1707
void keyb_set_combo_kbd_variant(gchar *cmb_country, gchar *cmb_variant)
Definition: keyboard.c:914
void keyb_set_chars(void)
Definition: keyboard.c:361
void hints_init(void)
Definition: keyboard.c:1669
void hints_update_from_button(GtkButton *button)
Definition: keyboard.c:1880
void keyb_edit_none(void)
Definition: keyboard.c:1557
void keyb_change_key(gunichar real_key)
Definition: keyboard.c:1609
gchar * data
Definition: main.c:53
gchar * variant
Definition: keyboard.h:46
gchar * name
Definition: keyboard.h:44
gchar * country
Definition: keyboard.h:45