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 File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  CHAR_DISTRIBUTION
 
struct  CHAR_DISTRIBUTION::CHARS
 

Macros

#define TUTOR_RED   "#ff0044"
 
#define TUTOR_RED_LITE   "#eeddbb"
 
#define TUTOR_GREEN   "#228822"
 
#define TUTOR_BLUE   "#0000cc"
 
#define TUTOR_BLUE_LITE   "#3377dd"
 
#define TUTOR_YELLOW   "#ffff00"
 
#define TUTOR_BROWN   "#886600"
 
#define TUTOR_BLACK   "#000000"
 
#define TUTOR_GRAY   "#dddddd"
 
#define TUTOR_GRAY_LITE   "#eeece8"
 
#define TUTOR_CREAM   "#f8f4f2" /* "#f0f2ca" <== "#faf8f8" before */
 
#define TUTOR_WHITE   "#fffefe"
 
#define MAX_ALPHABET_LEN   50
 

Typedefs

typedef struct CHAR_DISTRIBUTION Char_Distribution
 

Enumerations

enum  TutorType { TT_BASIC , TT_ADAPT , TT_VELO , TT_FLUID }
 
enum  TutorQuery { QUERY_INTRO , QUERY_START , QUERY_PROCESS_TOUCHS , QUERY_END }
 

Functions

TutorType tutor_get_type (void)
 
gchar * tutor_get_type_name (void)
 
gboolean tutor_is_tibetan (void)
 
TutorQuery tutor_get_query (void)
 
void tutor_set_query (TutorQuery)
 
gint tutor_get_correcting (void)
 
void tutor_init_timers (void)
 
void tutor_init_goals (void)
 
gdouble tutor_goal_accuracy (void)
 
gdouble tutor_goal_speed (void)
 
gdouble tutor_goal_fluidity (void)
 
gdouble tutor_goal_level (guint n)
 
void tutor_init (TutorType tutor_type)
 
void tutor_update (void)
 
void tutor_update_intro (void)
 
void tutor_update_start (void)
 
void tutor_process_touch (gunichar user_chr)
 
gboolean tutor_eval_forward (gunichar chr)
 
gboolean tutor_eval_forward_backward (gunichar chr)
 
void tutor_calc_stats (void)
 
gboolean tutor_char_distribution_approved (void)
 
void tutor_char_distribution_count (gchar *text, Char_Distribution *dist)
 
void tutor_draw_paragraph (gchar *text)
 
void tutor_load_list_other (gchar *file_name_end, GtkListStore *list)
 
void tutor_other_rename (const gchar *new_tx, const gchar *old_tx)
 
void tutor_message (gchar *mesg)
 
void tutor_beep (void)
 
gboolean tutor_delayed_finger_tip (gpointer unich)
 
void tutor_speak_string (gchar *string, gboolean wait)
 
void tutor_speak_char ()
 
void tutor_speak_word ()
 

Macro Definition Documentation

◆ MAX_ALPHABET_LEN

#define MAX_ALPHABET_LEN   50

Definition at line 53 of file tutor.h.

◆ TUTOR_BLACK

#define TUTOR_BLACK   "#000000"

Definition at line 31 of file tutor.h.

◆ TUTOR_BLUE

#define TUTOR_BLUE   "#0000cc"

Definition at line 27 of file tutor.h.

◆ TUTOR_BLUE_LITE

#define TUTOR_BLUE_LITE   "#3377dd"

Definition at line 28 of file tutor.h.

◆ TUTOR_BROWN

#define TUTOR_BROWN   "#886600"

Definition at line 30 of file tutor.h.

◆ TUTOR_CREAM

#define TUTOR_CREAM   "#f8f4f2" /* "#f0f2ca" <== "#faf8f8" before */

Definition at line 34 of file tutor.h.

◆ TUTOR_GRAY

#define TUTOR_GRAY   "#dddddd"

Definition at line 32 of file tutor.h.

◆ TUTOR_GRAY_LITE

#define TUTOR_GRAY_LITE   "#eeece8"

Definition at line 33 of file tutor.h.

◆ TUTOR_GREEN

#define TUTOR_GREEN   "#228822"

Definition at line 26 of file tutor.h.

◆ TUTOR_RED

#define TUTOR_RED   "#ff0044"

Definition at line 24 of file tutor.h.

◆ TUTOR_RED_LITE

#define TUTOR_RED_LITE   "#eeddbb"

Definition at line 25 of file tutor.h.

◆ TUTOR_WHITE

#define TUTOR_WHITE   "#fffefe"

Definition at line 35 of file tutor.h.

◆ TUTOR_YELLOW

#define TUTOR_YELLOW   "#ffff00"

Definition at line 29 of file tutor.h.

Typedef Documentation

◆ Char_Distribution

Enumeration Type Documentation

◆ TutorQuery

enum TutorQuery
Enumerator
QUERY_INTRO 
QUERY_START 
QUERY_PROCESS_TOUCHS 
QUERY_END 

Definition at line 45 of file tutor.h.

◆ TutorType

enum TutorType
Enumerator
TT_BASIC 
TT_ADAPT 
TT_VELO 
TT_FLUID 

Definition at line 37 of file tutor.h.

Function Documentation

◆ tutor_beep()

void tutor_beep ( void  )

Beeps (or not) at the user, in the tutor window

Definition at line 1734 of file tutor.c.

References main_preferences_get_boolean().

Referenced by tutor_eval_forward(), tutor_eval_forward_backward(), and tutor_process_touch().

◆ tutor_calc_stats()

◆ tutor_char_distribution_approved()

gboolean tutor_char_distribution_approved ( void  )

◆ tutor_char_distribution_count()

void tutor_char_distribution_count ( gchar *  text,
Char_Distribution dist 
)

◆ tutor_delayed_finger_tip()

gboolean tutor_delayed_finger_tip ( gpointer  unich)

Control delayed tips for the finger to be used

Definition at line 1799 of file tutor.c.

References hints_finger_name_from_char(), and tutor_speak_string().

Referenced by tutor_speak_char().

◆ tutor_draw_paragraph()

void tutor_draw_paragraph ( gchar *  utf8_text)

Formats and draws one paragraph at the tutor window

Definition at line 1575 of file tutor.c.

References get_wg(), and keyb_get_utf8_paragraph_symbol().

Referenced by adapt_draw_random_pattern(), fluid_draw_random_paragraphs(), and velo_draw_random_words().

◆ tutor_eval_forward()

gboolean tutor_eval_forward ( gunichar  user_chr)

Advances the cursor one position and test for correctness, in the shared tutor window. Updates the variables: cursor_pos, n_touchs and n_errors.

Definition at line 784 of file tutor.c.

References accur_correct(), accur_wrong(), cursor_advance(), cursor_get_char(), cursor_paint_char(), MAX_TOUCH_TICS, n_touchs, TT_BASIC, tutor, tutor_beep(), and UPSYM.

Referenced by tutor_process_touch().

◆ tutor_eval_forward_backward()

gboolean tutor_eval_forward_backward ( gunichar  user_chr)

Like the previous, but allows to go back and forth.

Definition at line 850 of file tutor.c.

References accur_correct(), accur_wrong(), cursor_advance(), cursor_get_char(), cursor_paint_char(), MAX_TOUCH_TICS, n_touchs, tutor, tutor_beep(), and UPSYM.

Referenced by tutor_process_touch().

◆ tutor_get_correcting()

gint tutor_get_correcting ( void  )

Definition at line 152 of file tutor.c.

References TT_FLUID, and tutor.

Referenced by cursor_switch_off(), and cursor_switch_on().

◆ tutor_get_query()

TutorQuery tutor_get_query ( void  )

Definition at line 140 of file tutor.c.

References tutor.

Referenced by cb_quick_restart().

◆ tutor_get_type()

◆ tutor_get_type_name()

gchar* tutor_get_type_name ( void  )

◆ tutor_goal_accuracy()

gdouble tutor_goal_accuracy ( void  )

◆ tutor_goal_fluidity()

gdouble tutor_goal_fluidity ( void  )

Definition at line 266 of file tutor.c.

References goal, TT_ADAPT, TT_BASIC, TT_FLUID, TT_VELO, and tutor.

Referenced by fluid_comment(), plot_draw_chart(), and tutor_calc_stats().

◆ tutor_goal_level()

gdouble tutor_goal_level ( guint  n)

Definition at line 279 of file tutor.c.

References goal, TT_ADAPT, TT_FLUID, TT_VELO, and tutor.

Referenced by adapt_comment(), fluid_comment(), and velo_comment().

◆ tutor_goal_speed()

gdouble tutor_goal_speed ( void  )

Definition at line 253 of file tutor.c.

References goal, TT_ADAPT, TT_BASIC, TT_FLUID, TT_VELO, and tutor.

Referenced by fluid_comment(), plot_draw_chart(), tutor_calc_stats(), and velo_comment().

◆ tutor_init()

void tutor_init ( TutorType  tt_type)

Initialize the course

Set the layout for each exercise type

Set decoration texts and tips

Set tooltips of tutor entry (drag and drop)

Set specific variables

Definition at line 294 of file tutor.c.

References _, basic_get_lesson(), basic_init(), callbacks_shield_set(), cursor_set_blink(), fluid_init(), get_wg(), get_win(), MAX_BASIC_LESSONS, QUERY_INTRO, TT_ADAPT, TT_BASIC, TT_FLUID, TT_VELO, tutor, tutor_process_touch(), tutor_update(), and velo_init().

Referenced by on_button_adapt_clicked(), on_button_basic_clicked(), on_button_fluid_clicked(), on_button_velo_clicked(), on_combobox_stat_module_changed(), and on_combobox_top10_language_changed().

◆ tutor_init_goals()

◆ tutor_init_timers()

void tutor_init_timers ( void  )

Definition at line 160 of file tutor.c.

References tutor.

Referenced by main_initialize_global_variables().

◆ tutor_is_tibetan()

◆ tutor_load_list_other()

void tutor_load_list_other ( gchar *  file_name_end,
GtkListStore *  list 
)

Load the list of files to include in the set of "other exercises"

Definition at line 1611 of file tutor.c.

References assert_user_dir(), get_wg(), list, main_path_user(), and OTHER_DEFAULT.

Referenced by on_button_filechooser_open_clicked(), on_button_other_paste_clicked(), and on_button_tutor_other_clicked().

◆ tutor_message()

void tutor_message ( gchar *  mesg)

Put 'mesg' in the message entry line of the shared tutor window

Definition at line 1711 of file tutor.c.

References callbacks_shield_set(), get_wg(), and pos.

Referenced by tutor_process_touch(), tutor_update(), tutor_update_intro(), and tutor_update_start().

◆ tutor_other_rename()

void tutor_other_rename ( const gchar *  new_tx,
const gchar *  old_tx 
)

◆ tutor_process_touch()

◆ tutor_set_query()

◆ tutor_speak_char()

void tutor_speak_char ( )

Speak the current character to be typed

Definition at line 1826 of file tutor.c.

References _, cursor_get_char(), TT_BASIC, tutor, tutor_delayed_finger_tip(), tutor_speak_string(), and UPSYM.

Referenced by tutor_process_touch().

◆ tutor_speak_string()

void tutor_speak_string ( gchar *  string,
gboolean  wait 
)

Speak some phrase

Definition at line 1744 of file tutor.c.

References _, get_wg(), TT_VELO, and tutor.

Referenced by tutor_delayed_finger_tip(), tutor_speak_char(), and tutor_speak_word().

◆ tutor_speak_word()

void tutor_speak_word ( )

Speak the next word to be typed

Definition at line 1878 of file tutor.c.

References cursor_advance(), cursor_get_char(), i, tutor_speak_string(), and UPSYM.

Referenced by tutor_process_touch().

◆ tutor_update()

void tutor_update ( void  )

Update what is shown in the tutor window.

Definition at line 434 of file tutor.c.

References _, QUERY_END, QUERY_INTRO, QUERY_PROCESS_TOUCHS, QUERY_START, tutor, tutor_message(), tutor_update_intro(), and tutor_update_start().

Referenced by on_togglebutton_tutor_intro_toggled(), tutor_init(), and tutor_process_touch().

◆ tutor_update_intro()

◆ tutor_update_start()