00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
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
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
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
00093 typedef struct strEAkey {
00094 struct strEAkey *next;
00095 char *EAkeyname;
00096 int EAkeycode;
00097 KeySym EAkeysym;
00098 char *EAcommand;
00099 } EAkey;
00100
00101
00102 typedef struct {
00103 int EAKnr;
00104 char *EAKtype;
00105 char *EAKname;
00106 EAkey *EAKeylist;
00107 } EAKeyboard;
00108
00109
00110
00111
00112
00113
00114
00115
00116 extern cfgStruct confdata;
00117 extern cfgStruct defdata;
00118 extern EAKeyboard myEAK;
00119 }
00120
00121
00122 int refreshGUIdata(QWidget *widget);
00123
00124 int refresh_kbtypes (QWidget *widget);
00125
00126 int refresh_cdromdev (QWidget *widget);
00127
00128 int refresh_kbimage (QWidget *widget);
00129
00130 int refresh_keylist (QWidget *widget);
00131
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
00137 void select_new_keyboard(QWidget *widget, gpointer data);
00138
00139 void change_key_command(EAkey *thiskey, gchar *entrytext);
00140
00141 void change_selectedkey_command(gchar *entrytext);