Mercurial > gftp.yaz
annotate src/gtk/gftp-gtk.h @ 51:33a0ba7f52d1
2002-11-6 Brian Masney <masneyb@gftp.org>
* src/gtk/gftp-gtk.c - connect to the select_row signal in the file
listbox to grab the double click event
author | masneyb |
---|---|
date | Thu, 07 Nov 2002 02:38:34 +0000 |
parents | 311e29c40ed6 |
children | a12bcbc2fce4 |
rev | line source |
---|---|
1 | 1 /*****************************************************************************/ |
2 /* gftp-gtk.h - include file for the gftp gtk+ 1.2 port */ | |
3 /* Copyright (C) 1998-2002 Brian Masney <masneyb@gftp.org> */ | |
4 /* */ | |
5 /* This program is free software; you can redistribute it and/or modify */ | |
6 /* it under the terms of the GNU General Public License as published by */ | |
7 /* the Free Software Foundation; either version 2 of the License, or */ | |
8 /* (at your option) any later version. */ | |
9 /* */ | |
10 /* This program 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. */ | |
14 /* */ | |
15 /* You should have received a copy of the GNU General Public License */ | |
16 /* along with this program; if not, write to the Free Software */ | |
17 /* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
18 /*****************************************************************************/ | |
19 | |
33 | 20 /* $Id$ */ |
21 | |
1 | 22 #ifndef __GFTP_GTK_H |
23 #define __GFTP_GTK_H | |
24 | |
25 #include "../../lib/gftp.h" | |
26 #include <gtk/gtk.h> | |
27 #include <gdk/gdkkeysyms.h> | |
28 #include <pthread.h> | |
29 | |
30 #define IS_ONE_SELECTED(wdata) (GTK_CLIST ((wdata)->listbox)->selection && GTK_CLIST ((wdata)->listbox)->selection->next == NULL) | |
31 #define IS_NONE_SELECTED(wdata) (GTK_CLIST ((wdata)->listbox)->selection == NULL) | |
32 | |
45 | 33 #if GTK_MAJOR_VERSION == 1 |
1 | 34 #define gtk_widget_set_size_request(widget, width, height) \ |
35 gtk_widget_set_usize (widget, width, height) | |
36 #endif | |
37 | |
19 | 38 /* These 2 defines are for creating menu items with stock icons in GTK+ 2.0. |
39 If we are using version 1.2, it will disable the stock items since it's not | |
40 supported */ | |
41 | |
42 #if GTK_MAJOR_VERSION < 2 | |
43 #define MS_(a) NULL | |
44 #define MN_(a) a | |
45 #else | |
46 #define MS_(a) "<StockItem>",a | |
47 #define MN_(a) a,NULL | |
48 #endif | |
49 | |
50 /* These are used for the MakeEditDialog function. I have these types to make | |
51 it easier for creating dialogs with GTK+ 1.2 and GTK+ 2.0 */ | |
52 | |
53 typedef enum gftp_dialog_button_tag | |
54 { | |
55 gftp_dialog_button_create, | |
56 gftp_dialog_button_change, | |
57 gftp_dialog_button_connect, | |
58 gftp_dialog_button_rename, | |
59 gftp_dialog_button_ok | |
60 } gftp_dialog_button; | |
61 | |
1 | 62 typedef struct gftp_window_data_tag |
63 { | |
64 GtkWidget *combo, /* Entry widget/history for the user to enter | |
65 a directory */ | |
66 *hoststxt, /* Show which directory we're in */ | |
67 *listbox; /* Our listbox showing the files */ | |
37 | 68 unsigned int *sortcol, /* Which column we are sorting by */ |
69 *sortasds; /* Sorted ascending or descending */ | |
70 unsigned int sorted : 1, /* Is the output sorted? */ | |
1 | 71 show_selected : 1, /* Show only selected files */ |
72 *histlen; /* Pointer to length of history */ | |
73 char *filespec; /* Filespec for the listbox */ | |
74 gftp_request * request; /* The host that we are connected to */ | |
75 GList * files, /* Files in the listbox */ | |
76 ** history; /* History of the directories */ | |
77 GtkItemFactory *ifactory; /* This is for the menus that will | |
78 come up when you right click */ | |
79 pthread_t tid; /* Thread for the stop button */ | |
80 unsigned long gotbytes; | |
81 } gftp_window_data; | |
82 | |
83 | |
84 typedef struct gftp_graphic_tag | |
85 { | |
86 char * filename; | |
87 GdkPixmap * pixmap; | |
88 GdkBitmap * bitmap; | |
89 } gftp_graphic; | |
90 | |
91 | |
92 typedef struct gftp_dialog_data_tag | |
93 { | |
19 | 94 GtkWidget * dialog, |
95 * checkbox, | |
96 * edit; | |
97 | |
98 void (*yesfunc) (); | |
99 gpointer yespointer; | |
100 | |
101 void (*nofunc) (); | |
102 gpointer nopointer; | |
1 | 103 } gftp_dialog_data; |
104 | |
105 | |
106 typedef struct gftp_viewedit_data_tag | |
107 { | |
108 char *filename, /* File we are viewing/editing currently */ | |
109 *remote_filename; /* The filename on the remote computer */ | |
110 struct stat st; /* Vital file statistics */ | |
111 pid_t pid; /* Our process id */ | |
112 char **argv; /* Our arguments we passed to execvp. We will | |
113 free it when the process terminates. This | |
114 is the safest place to free this */ | |
115 unsigned int view : 1, /* View or edit this file */ | |
116 rm : 1, /* Delete this file after we're done with it */ | |
117 dontupload : 1; /* Don't upload this file after we're done | |
118 editing it */ | |
119 gftp_window_data * fromwdata, /* The window we are viewing this file in */ | |
120 * towdata; | |
121 } gftp_viewedit_data; | |
122 | |
123 | |
124 typedef struct gftp_curtrans_data_tag | |
125 { | |
126 gftp_transfer * transfer; | |
127 GList * curfle; | |
128 } gftp_curtrans_data; | |
129 | |
130 | |
14
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
131 typedef struct gftp_save_dir_struct_tag |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
132 { |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
133 GtkWidget * filew; |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
134 gftp_window_data * wdata; |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
135 } gftp_save_dir_struct; |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
136 |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
137 |
1 | 138 extern gftp_window_data window1, window2, * other_wdata, * current_wdata; |
139 extern GtkWidget * stop_btn, * hostedit, * useredit, * passedit, | |
140 * portedit, * logwdw, * dlwdw, * protocol_menu, * optionmenu; | |
141 extern GtkAdjustment * logwdw_vadj; | |
45 | 142 #if GTK_MAJOR_VERSION > 1 |
1 | 143 extern GtkTextMark * logwdw_textmark; |
144 #endif | |
145 extern int local_start, remote_start, trans_start, log_start, tools_start; | |
146 extern GHashTable * graphic_hash_table; | |
147 extern GtkItemFactoryEntry * menus; | |
148 extern GtkItemFactory * factory; | |
149 extern pthread_mutex_t transfer_mutex, log_mutex; | |
19 | 150 extern gftp_graphic * gftp_icon; |
33 | 151 extern int gftp_is_started; |
42 | 152 extern sigjmp_buf jmp_environment; |
153 extern volatile int use_jmp_environment; | |
1 | 154 |
155 /* bookmarks.c */ | |
156 void run_bookmark ( gpointer data ); | |
157 | |
158 void add_bookmark ( gpointer data ); | |
159 | |
160 void edit_bookmarks ( gpointer data ); | |
161 | |
162 void build_bookmarks_menu ( void ); | |
163 | |
164 /* chmod_dialog.c */ | |
165 void chmod_dialog ( gpointer data ); | |
166 | |
167 /* delete_dialog.c */ | |
168 void delete_dialog ( gpointer data ); | |
169 | |
170 /* dnd.c */ | |
171 void openurl_get_drag_data ( GtkWidget * widget, | |
172 GdkDragContext * context, | |
173 gint x, | |
174 gint y, | |
175 GtkSelectionData * selection_data, | |
176 guint info, | |
177 guint32 clk_time, | |
178 gpointer data ); | |
179 | |
180 void listbox_drag ( GtkWidget * widget, | |
181 GdkDragContext * context, | |
182 GtkSelectionData * selection_data, | |
183 guint info, | |
184 guint32 clk_time, | |
185 gpointer data ); | |
186 | |
187 void listbox_get_drag_data ( GtkWidget * widget, | |
188 GdkDragContext * context, | |
189 gint x, | |
190 gint y, | |
191 GtkSelectionData * selection_data, | |
192 guint info, | |
193 guint32 clk_time, | |
194 gpointer data ); | |
195 | |
196 /* gftp-gtk.c */ | |
197 void toolbar_hostedit ( GtkWidget * widget, | |
198 gpointer data ); | |
199 | |
200 void sortrows ( GtkCList * clist, | |
201 gint column, | |
202 gpointer data ); | |
203 | |
204 void stop_button ( GtkWidget * widget, | |
205 gpointer data ); | |
206 | |
207 /* menu_items.c */ | |
208 void change_setting ( gftp_window_data *wdata, | |
209 int menuitem, | |
210 GtkWidget * checkmenu ); | |
211 | |
212 void tb_openurl_dialog ( gpointer data ); | |
213 | |
214 void openurl_dialog ( gpointer data ); | |
215 | |
216 void disconnect ( gpointer data ); | |
217 | |
218 void change_filespec ( gpointer data ); | |
219 | |
14
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
220 void save_directory_listing ( gpointer data ); |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
221 |
1 | 222 void show_selected ( gpointer data ); |
223 | |
224 void selectall ( gpointer data ); | |
225 | |
226 void selectallfiles ( gpointer data ); | |
227 | |
228 void deselectall ( gpointer data ); | |
229 | |
230 void site_dialog ( gpointer data ); | |
231 | |
232 int chdir_edit ( GtkWidget * widget, | |
233 gpointer data ); | |
234 | |
235 int chdir_dialog ( gpointer data ); | |
236 | |
237 void clearlog ( gpointer data ); | |
238 | |
239 void viewlog ( gpointer data ); | |
240 | |
241 void savelog ( gpointer data ); | |
242 | |
243 void clear_cache ( gpointer data ); | |
244 | |
245 void options_dialog (gpointer data); | |
246 void compare_windows (gpointer data); | |
247 void about_dialog (gpointer data); | |
248 | |
249 /* misc-gtk.c */ | |
250 void fix_display ( void ); | |
251 | |
252 void remove_files_window ( gftp_window_data * wdata ); | |
253 | |
254 void ftp_log ( gftp_logging_level level, | |
255 void *ptr, | |
256 const char *string, | |
257 ... ); | |
258 | |
259 void refresh ( gftp_window_data * wdata ); | |
260 | |
261 void update_window_info ( void ); | |
262 | |
263 void update_window ( gftp_window_data * wdata ); | |
264 | |
265 GtkWidget * toolbar_pixmap ( GtkWidget * widget, | |
266 char *filename ); | |
267 | |
268 gftp_graphic * open_xpm ( GtkWidget * widget, | |
269 char *filename ); | |
270 | |
271 void gftp_free_pixmap ( char *filename ); | |
272 | |
273 void gftp_get_pixmap ( GtkWidget * widget, | |
274 char *filename, | |
275 GdkPixmap ** pix, | |
276 GdkBitmap ** bitmap ); | |
277 | |
278 int check_status ( char *name, | |
279 gftp_window_data * wdata, | |
280 int check_other_stop, | |
281 int only_one, | |
282 int at_least_one, | |
283 int func ); | |
284 | |
7 | 285 GtkItemFactory *item_factory_new ( GtkType container_type, |
286 const char *path, | |
287 GtkAccelGroup *accel_group, | |
288 const char *strip_prefix ); | |
289 | |
1 | 290 void create_item_factory ( GtkItemFactory * ifactory, |
291 guint n_entries, | |
292 GtkItemFactoryEntry * entries, | |
293 gpointer callback_data ); | |
294 | |
295 GList * get_next_selection ( GList * selection, | |
296 GList ** list, | |
297 int *curnum ); | |
298 | |
299 void add_history ( GtkWidget * widget, | |
300 GList ** history, | |
301 unsigned int *histlen, | |
302 const char *str ); | |
303 | |
304 int check_reconnect ( gftp_window_data * wdata ); | |
305 | |
306 void add_file_listbox ( gftp_window_data * wdata, | |
307 gftp_file * fle ); | |
308 | |
309 void MakeEditDialog ( char *diagtxt, | |
310 char *infotxt, | |
311 char *deftext, | |
19 | 312 int passwd_item, |
313 char *checktext, | |
314 gftp_dialog_button okbutton, | |
1 | 315 void (*okfunc) (), |
316 void *okptr, | |
317 void (*cancelfunc) (), | |
318 void *cancelptr ); | |
319 | |
320 void MakeYesNoDialog ( char *diagtxt, | |
321 char *infotxt, | |
19 | 322 void (*yesfunc) (), |
323 gpointer yespointer, | |
324 void (*nofunc) (), | |
325 gpointer nopointer ); | |
1 | 326 |
327 void update_directory_download_progress ( gftp_transfer * transfer ); | |
328 | |
329 void *generic_thread ( void * (*func) | |
330 (void *), | |
331 gftp_window_data * wdata ); | |
332 | |
333 int progress_timeout ( gpointer data ); | |
334 | |
335 void display_cached_logs ( void ); | |
336 | |
42 | 337 RETSIGTYPE signal_handler (int signo); |
338 | |
1 | 339 /* mkdir_dialog.c */ |
340 void mkdir_dialog ( gpointer data ); | |
341 | |
342 /* rename_dialog.c */ | |
343 void rename_dialog ( gpointer data ); | |
344 | |
345 /* transfer.c */ | |
346 int ftp_list_files ( gftp_window_data * wdata, | |
347 int usecache ); | |
348 | |
349 int ftp_connect ( gftp_window_data * wdata, | |
350 gftp_request * request, | |
351 int getdir ); | |
352 | |
353 gint update_downloads ( gpointer data ); | |
354 | |
355 void * gftp_gtk_transfer_files ( void *data ); | |
356 | |
357 void get_files ( gpointer data ); | |
358 | |
359 void put_files ( gpointer data ); | |
360 | |
361 void transfer_window_files ( gftp_window_data * fromwdata, | |
362 gftp_window_data * towdata ); | |
363 | |
364 void *do_getdir_thread ( void * data ); | |
365 | |
366 void add_file_transfer ( gftp_request * fromreq, | |
367 gftp_request * toreq, | |
368 gftp_window_data * fromwdata, | |
369 gftp_window_data * towdata, | |
370 GList * files, | |
371 int copy_req ); | |
372 | |
373 void start_transfer ( gpointer data ); | |
374 | |
375 void stop_transfer ( gpointer data ); | |
376 | |
377 void skip_transfer ( gpointer data ); | |
378 | |
379 void remove_file_transfer ( gpointer data ); | |
380 | |
381 void move_transfer_up ( gpointer data ); | |
382 | |
383 void move_transfer_down ( gpointer data ); | |
384 | |
385 void gftp_gtk_ask_transfer ( gftp_transfer * tdata ); | |
386 | |
387 /* view_dialog.c */ | |
388 void edit_dialog ( gpointer data ); | |
389 | |
390 void view_dialog ( gpointer data ); | |
391 | |
392 void view_file ( char *filename, | |
393 int fd, | |
394 int viewedit, | |
395 int del_file, | |
396 int start_pos, | |
397 int dontupload, | |
398 char *remote_filename, | |
399 gftp_window_data * wdata ); | |
400 | |
401 #endif | |
402 |