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)  

tutor.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 #ifndef TUTOR_H
19 # define TUTOR_H
20 
21 /*
22  * Special colors
23  */
24 # define TUTOR_RED "#ff0044"
25 # define TUTOR_RED_LITE "#eeddbb"
26 # define TUTOR_GREEN "#228822"
27 # define TUTOR_BLUE "#0000cc"
28 # define TUTOR_BLUE_LITE "#3377dd"
29 # define TUTOR_YELLOW "#ffff00"
30 # define TUTOR_BROWN "#886600"
31 # define TUTOR_BLACK "#000000"
32 # define TUTOR_GRAY "#dddddd"
33 # define TUTOR_GRAY_LITE "#eeece8"
34 # define TUTOR_CREAM "#f8f4f2" /* "#f0f2ca" <== "#faf8f8" before */
35 # define TUTOR_WHITE "#fffefe"
36 
37 typedef enum
38 {
42  TT_FLUID
44 
45 typedef enum
46 {
50  QUERY_END
52 
53 #define MAX_ALPHABET_LEN 50
54 typedef struct CHAR_DISTRIBUTION
55 {
56  struct CHARS
57  {
58  gunichar letter;
59  guint count;
60  gfloat freq;
62  guint size;
63  guint total;
65 
66 /*
67  * Interface functions
68  */
70 
71 gchar *tutor_get_type_name (void);
72 
73 gboolean tutor_is_tibetan (void);
74 
76 
78 
79 gint tutor_get_correcting (void);
80 
81 void tutor_init_timers (void);
82 
83 void tutor_init_goals (void);
84 
85 gdouble tutor_goal_accuracy (void);
86 
87 gdouble tutor_goal_speed (void);
88 
89 gdouble tutor_goal_fluidity (void);
90 
91 gdouble tutor_goal_level (guint n);
92 
93 /*
94  * Auxiliar functions
95  */
96 void tutor_init (TutorType tutor_type);
97 
98 void tutor_update (void);
99 
100 void tutor_update_intro (void);
101 
102 void tutor_update_start (void);
103 
104 void tutor_process_touch (gunichar user_chr);
105 
106 gboolean tutor_eval_forward (gunichar chr);
107 
108 gboolean tutor_eval_forward_backward (gunichar chr);
109 
110 void tutor_calc_stats (void);
111 
112 gboolean tutor_char_distribution_approved (void);
113 
114 void tutor_char_distribution_count (gchar * text, Char_Distribution * dist);
115 
116 void tutor_draw_paragraph (gchar * text);
117 
118 void tutor_load_list_other (gchar * file_name_end, GtkListStore * list);
119 
120 void tutor_other_rename (const gchar *new_tx, const gchar *old_tx);
121 
122 void tutor_message (gchar * mesg);
123 
124 void tutor_beep (void);
125 
126 gboolean tutor_delayed_finger_tip (gpointer unich);
127 
128 void tutor_speak_string (gchar *string, gboolean wait);
129 
130 void tutor_speak_char ();
131 
132 void tutor_speak_word ();
133 
134 #endif
guint total
Definition: tutor.h:63
struct CHAR_DISTRIBUTION::CHARS ch[50]
guint size
Definition: tutor.h:62
TutorType tutor_get_type(void)
Definition: tutor.c:107
void tutor_draw_paragraph(gchar *text)
Definition: tutor.c:1575
void tutor_update_intro(void)
Definition: tutor.c:456
void tutor_char_distribution_count(gchar *text, Char_Distribution *dist)
Definition: tutor.c:1490
gint tutor_get_correcting(void)
Definition: tutor.c:152
void tutor_speak_word()
Definition: tutor.c:1878
void tutor_load_list_other(gchar *file_name_end, GtkListStore *list)
Definition: tutor.c:1611
gboolean tutor_eval_forward_backward(gunichar chr)
Definition: tutor.c:850
void tutor_init_goals(void)
Definition: tutor.c:182
void tutor_init_timers(void)
Definition: tutor.c:160
gdouble tutor_goal_level(guint n)
Definition: tutor.c:279
void tutor_other_rename(const gchar *new_tx, const gchar *old_tx)
Definition: tutor.c:1660
void tutor_beep(void)
Definition: tutor.c:1734
gchar * tutor_get_type_name(void)
Definition: tutor.c:113
void tutor_speak_char()
Definition: tutor.c:1826
TutorQuery tutor_get_query(void)
Definition: tutor.c:140
gboolean tutor_delayed_finger_tip(gpointer unich)
Definition: tutor.c:1799
void tutor_speak_string(gchar *string, gboolean wait)
Definition: tutor.c:1744
void tutor_init(TutorType tutor_type)
Definition: tutor.c:294
void tutor_set_query(TutorQuery)
Definition: tutor.c:146
gdouble tutor_goal_fluidity(void)
Definition: tutor.c:266
void tutor_update(void)
Definition: tutor.c:434
void tutor_update_start(void)
Definition: tutor.c:521
gboolean tutor_char_distribution_approved(void)
Definition: tutor.c:1401
gboolean tutor_is_tibetan(void)
Definition: tutor.c:121
void tutor_process_touch(gunichar user_chr)
Definition: tutor.c:631
struct CHAR_DISTRIBUTION Char_Distribution
void tutor_calc_stats(void)
Definition: tutor.c:976
TutorType
Definition: tutor.h:38
@ TT_VELO
Definition: tutor.h:41
@ TT_FLUID
Definition: tutor.h:42
@ TT_BASIC
Definition: tutor.h:39
@ TT_ADAPT
Definition: tutor.h:40
TutorQuery
Definition: tutor.h:46
@ QUERY_INTRO
Definition: tutor.h:47
@ QUERY_END
Definition: tutor.h:50
@ QUERY_START
Definition: tutor.h:48
@ QUERY_PROCESS_TOUCHS
Definition: tutor.h:49
gdouble tutor_goal_speed(void)
Definition: tutor.c:253
gdouble tutor_goal_accuracy(void)
Definition: tutor.c:240
#define MAX_ALPHABET_LEN
Definition: tutor.h:53
void tutor_message(gchar *mesg)
Definition: tutor.c:1711
gboolean tutor_eval_forward(gunichar chr)
Definition: tutor.c:784
GList * list
Definition: velocity.c:39