yawmppp: Add version 2.0.2 to the repository.
[dockapps.git] / yawmppp / src / gtksetup / applet.h
blobd8e52ecbaf7d706b88bf81a871752dfc142f7481
2 #ifndef YAWMPPP_APPLET_H
3 #define YAWMPPP_APPLET_H
5 #include <gtk/gtk.h>
6 #include "isprc.h"
8 /* not less than the dock applet */
9 #define MAX_ISPS 40
11 #define ERR_MAX_ISPS "You can't have more than 40 entries."
13 #define ERR_CANT_MKDIR "Unable to create directory ~/.yawmppp\n"\
14 "Current configuration could not be\n"\
15 "written."
17 #define ERR_CANT_WRITE "Unable to create configuration files\n"\
18 "in directory ~/.yawmppp. Current configuration\n"\
19 "may not have been only partially written."
21 #define ERR_DIDNT_WRITE "There were errors when saving the configuration.\n"\
22 "Do you still wish to close wmppp.pref and [maybe] lose\n"\
23 "current data ?"
25 #define INFO_CANT_APPLY_NOW "The dock applet will update itself only when\n"\
26 "the current connection is over."
28 #define ERR_CANT_SU "Script didn't run properly. Bad password ?"
30 #define MAX_EXPECT_PAIRS 16
32 struct PREF_ISP_INFO {
33 char LongName[128];
34 char ShortName[16];
35 char Device[64];
36 char Username[32];
37 char Password[32];
38 char Phone[32];
39 char ModemInit1[256];
40 char ModemInit2[256];
41 char UserString[32];
42 char PassString[32];
43 char PulseDial[8];
44 char ModemSpeed[16];
46 /* appended in 1.1.0 */
47 int nExpectPairs;
48 char s_expect[MAX_EXPECT_PAIRS][32];
49 char s_send[MAX_EXPECT_PAIRS][32];
51 struct ISP_PPP ppp; /* defined in ../isprc.h */
53 /* appended in 1.1.2 */
54 int nologin;
57 struct PREF_PPP_OPT {
58 int defaultroute;
59 int lock;
60 int passive;
61 int debug;
62 int kdebug;
63 int noauth;
64 int noipdefault;
65 int linectl; /* 0=modem 1=local */
66 int flowctl; /* 0=crtscts 1=xonxoff 2=nocrtscts 3=DC */
67 int mtu;
68 int mru;
69 int lcp[5]; /* in the same order as in the dialog */
71 int chap;
72 int pap;
74 int usepeerdns;
77 void create_preferences_panel(void);
78 void clear_and_disable_right_pane(void);
79 void load_rc_entries(void);
80 void update_right_pane(void);
81 void commit_back_to_db(void);
82 void fill_list(void);
83 int write_and_apply_data(void);
84 void check_client(void);
85 int file_exists(char *s);
86 void find_out_paths(void);
87 void test_set_path(char *,char *);
89 void xlate_ppp_to_pref(struct YAWMPPP_ISP_INFO *wii,
90 struct PREF_ISP_INFO *pii);
92 GtkWidget *hlabel_new(char *);
94 GtkWidget *make_ppp_pane(void);
95 void get_ppp_pane(void);
96 void set_ppp_pane(void);
97 char *mk_ppp_string(struct PREF_PPP_OPT *modi,char *sep);
98 void read_ppp_options_from_rc(char *p);
100 char *wrapped_strtok(char *a,char *b);
102 gint applet_kill (GtkWidget * widget, GdkEvent * event, gpointer data);
103 void applet_destroy (GtkWidget * widget, gpointer data);
104 void applet_apply (GtkWidget * widget, gpointer data);
105 void applet_save_and_quit (GtkWidget * widget, gpointer data);
107 void list_select(GtkCList *cl,gint row,gint column,
108 GdkEventButton *geb,gpointer data);
109 void list_unselect(GtkCList *cl,gint row,gint column,
110 GdkEventButton *geb,gpointer data);
112 void list_moveup(GtkWidget *gw,gpointer data);
113 void list_movedown(GtkWidget *gw,gpointer data);
114 void list_remove(GtkWidget *gw,gpointer data);
115 void list_duplicate(GtkWidget *gw,gpointer data);
116 void list_add(GtkWidget *gw,gpointer data);
118 /* more settings dialog */
120 void pop_advanced(GtkWidget *gw,gpointer data);
121 void adv_ok (GtkWidget * widget, gpointer data);
122 void adv_cancel (GtkWidget * widget, gpointer data);
123 void adv_destroy (GtkWidget * widget, gpointer data);
125 void enable_local_ppp(gboolean e);
126 void ppp_override_toggle(GtkToggleButton *gtb,gpointer data);
128 /* more settings dialog */
130 void isp_rename(GtkEditable *ge,gpointer data);
132 void make_ppp_default(GtkWidget *w,gpointer data);
134 /* expect/send */
136 void pop_expect(GtkWidget *w,gpointer data);
137 void exp_ok (GtkWidget * widget, gpointer data);
138 void exp_cancel (GtkWidget * widget, gpointer data);
139 void exp_destroy (GtkWidget * widget, gpointer data);
140 void exp_update(void);
141 void exp_up(GtkWidget *widget,gpointer data);
142 void exp_down(GtkWidget *widget,gpointer data);
143 void exp_disable(void);
144 void exp_enable(void);
145 void exp_select(GtkCList *cl,gint row,gint column,
146 GdkEventButton *geb,gpointer data);
147 void exp_unselect(GtkCList *cl,gint row,gint column,
148 GdkEventButton *geb,gpointer data);
149 void exp_add_delay(void);
150 void exp_remove(void);
151 void exp_add(void);
152 void expa_destroy (GtkWidget * widget, gpointer data);
153 void expa_ok (GtkWidget * widget, gpointer data);
154 void expa_cancel (GtkWidget * widget, gpointer data);
156 /* expect/send */
158 void extract_delimited_string(char *dest,char *src,int count,char delim,int max);
160 /* help */
161 void pop_help (GtkWidget * widget, gpointer data);
162 void help_dead (GtkWidget * widget, gpointer data);
163 void help_die (GtkWidget * widget, gpointer data);
165 void unman(char *s);
166 void add_man(char *manpage,GtkWidget *text,int index);
167 void add_docfile(char *source,GtkWidget *text,int index);
170 /* misc */
171 void run_as_root(char *what);
172 gint pwd_kill (GtkWidget * widget, GdkEvent * event, gpointer data);
174 void pwd_cancel(GtkWidget *gw,gpointer data);
175 void pwd_ok(GtkWidget *gw,gpointer data);
176 void pwd_view(GtkWidget *gw,gpointer data);
178 void spwd_destroy (GtkWidget * widget, gpointer data);
179 void spwd_close(GtkWidget *gw,gpointer data);
180 int try_run_script(char *cmd);
182 #endif