Main Page Alphabetical List Compound List File List Compound Members File Members

# functions.h

Go to the documentation of this file.

    00001 /***************************************************************************
    00002                           functions.h  -  description
    00003                              -------------------
    00004     begin                : Wed Apr 10 2002
    00005     copyright            : (C) 2002 by Sheldon Lee Wen
    00006     email                : tormak@rogers.com
    00007  ***************************************************************************/
    00008
    00009 /***************************************************************************
    00010  *                                                                         *
    00011  *   This program is free software; you can redistribute it and/or modify  *
    00012  *   it under the terms of the GNU General Public License as published by  *
    00013  *   the Free Software Foundation; either version 2 of the License, or     *
    00014  *   (at your option) any later version.                                   *
    00015  *                                                                         *
    00016  ***************************************************************************/
    00017
    00018 #include <klineakconfig.h>
    00019 #include <kstddirs.h>
    00020 #include "klineakconfigui.h"
    00021
    00022 extern "C" {
    00023 #include "defines.h"
    00024 #include "supportpriv.h"
    00025 #include <sys/types.h>
    00026 #include <sys/stat.h>
    00027 #include <stdio.h>
    00028 #include <stdlib.h>
    00029 #include <unistd.h>
    00030 #include <string.h>
    00031 #include <X11/Xlib.h>
    00032 #include <X11/XKBlib.h>
    00033 #include <X11/extensions/XKBfile.h>
    00034 #define NR_SPECIALS 5
    00035 #define EAK_EJECT "EAK_EJECT"
    00036 #define EAK_VOLUP "EAK_VOLUP"
    00037 #define EAK_VOLDOWN "EAK_VOLDOWN"
    00038 #define EAK_MUTE "EAK_MUTE"
    00039 #define EAK_SLEEP "EAK_SLEEP"
    00040
    00041 extern int nrkeyboards;
    00042 extern char **longkbname;
    00043 extern char *kbtype;
    00044 extern char *cdromdev;
    00045 extern gboolean changing_text_from_signal;
    00046 //gboolean ApplyUsed;
    00047 extern char *DUMMY_STRING;
    00048 extern int selected_key;
    00049
    00050 int parseconffile(void);
    00051 int parsedeffile(void);
    00052 int initEAK (void);
    00053 void cleanKeylist (void);
    00054 int cleanexit(void);
    00055 gboolean backup_conffile (void);
    00056 gboolean restore_conffile (void);
    00057 gboolean save_conffile (void);
    00058 gint get_lineakd_pid(void);
    00059
    00060 char *cfgSectionNumberToName(int num);
    00061 /* constants for recognized value types */
    00062 typedef enum {
    00063     CFG_END,
    00064     CFG_BOOL,
    00065     CFG_STRING,
    00066     CFG_INT,
    00067     CFG_UINT,
    00068     CFG_LONG,
    00069     CFG_ULONG,
    00070     CFG_STRING_LIST,
    00071     CFG_FLOAT,
    00072     CFG_DOUBLE
    00073 } cfgValueType;
    00074
    00075 /* type of the configuration file */
    00076 typedef enum {
    00077     CFG_SIMPLE,
    00078     CFG_INI
    00079 } cfgFileType;
    00080
    00081 typedef struct {
    00082     char *parameterName;
    00083     cfgValueType type;
    00084     void *value;
    00085 } cfgStruct;
    00086
    00087 typedef struct cfgList_tag {
    00088     char *str;
    00089     struct cfgList_tag *next;
    00090 } cfgList;
    00091
    00092 /* EAKey as member of list */
    00093 typedef struct strEAkey {
    00094   struct strEAkey *next;
    00095   char *EAkeyname;
    00096   int EAkeycode;
    00097   KeySym EAkeysym;
    00098   char *EAcommand;
    00099 } EAkey;
    00100
    00101 /* the EAK we will use.. */
    00102 typedef struct {
    00103   int EAKnr;
    00104   char *EAKtype;
    00105   char *EAKname;
    00106   EAkey *EAKeylist;
    00107 } EAKeyboard;
    00108
    00109 /* provides indexes etc of the actions for the gui ( 0 - (n-1) ) */
    00110 //typedef struct {
    00111 //  char *action;
    00112 //  char *longname;
    00113 //} specialact;
    00114
    00115 //extern specialact specialacts[NR_SPECIALS];
    00116 extern cfgStruct confdata;
    00117 extern cfgStruct defdata;
    00118 extern EAKeyboard myEAK;
    00119 }
    00120
    00121 /* refresh *ALL* the data on the GUI (this is called on startup) */
    00122 int refreshGUIdata(QWidget *widget);
    00123 /* refresh EAK types */
    00124 int refresh_kbtypes (QWidget *widget);
    00125 /* refresh CD-ROM entry */
    00126 int refresh_cdromdev (QWidget *widget);
    00127 /* refresh keyboard image */
    00128 int refresh_kbimage (QWidget *widget);
    00129 /* refresh key list */
    00130 int refresh_keylist (QWidget *widget);
    00131 /* refresh command/action */
    00132 int refresh_keycommand (QWidget *widget, int i);
    00133 int refresh_specials (QWidget *widget);
    00134 QWidget *add_specmenu_item (QWidget *menu, char *act, char *name, int add_callback);
    00135 int is_special_action (char *command);
    00136 /* select a new keyboard */
    00137 void select_new_keyboard(QWidget *widget, gpointer data);
    00138 /* change the key command data to the users input */
    00139 void change_key_command(EAkey *thiskey, gchar *entrytext);
    00140 /* wrapper for change_key_command, lookups the selected key */
    00141 void change_selectedkey_command(gchar *entrytext);