"Fossies" - the Fresh Open Source Software Archive

Member "klavaro-3.13/src/tutor.h" (18 Apr 2021, 3413 Bytes) of package /linux/privat/klavaro-3.13.tar.bz2:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "tutor.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 3.12_vs_3.13.

    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 {
   39     TT_BASIC,
   40     TT_ADAPT,
   41     TT_VELO,
   42     TT_FLUID
   43 } TutorType;
   44 
   45 typedef enum
   46 {
   47     QUERY_INTRO,
   48     QUERY_START,
   49     QUERY_PROCESS_TOUCHS,
   50     QUERY_END
   51 } TutorQuery;
   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;
   61     } ch[MAX_ALPHABET_LEN];
   62     guint size;
   63     guint total;
   64 } Char_Distribution;
   65 
   66 /*
   67  * Interface functions
   68  */
   69 TutorType tutor_get_type (void);
   70 
   71 gchar *tutor_get_type_name (void);
   72 
   73 gboolean tutor_is_tibetan (void);
   74 
   75 TutorQuery tutor_get_query (void);
   76 
   77 void tutor_set_query (TutorQuery);
   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