Mercurial > gftp.yaz
annotate src/gtk/gftp-gtk.h @ 984:40c901033079
added telugu [te] entry
author | kkrothap |
---|---|
date | Fri, 20 Mar 2009 09:23:33 +0000 |
parents | 1f9c6baa458c |
children |
rev | line source |
---|---|
1 | 1 /*****************************************************************************/ |
2 /* gftp-gtk.h - include file for the gftp gtk+ 1.2 port */ | |
255 | 3 /* Copyright (C) 1998-2003 Brian Masney <masneyb@gftp.org> */ |
1 | 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" | |
341 | 26 #include "../uicommon/gftpui.h" |
1 | 27 #include <gtk/gtk.h> |
28 #include <gdk/gdkkeysyms.h> | |
29 #include <pthread.h> | |
30 | |
505 | 31 #define GFTP_MENU_ITEM_ASCII 1 |
32 #define GFTP_MENU_ITEM_BINARY 2 | |
33 #define GFTP_MENU_ITEM_WIN1 3 | |
34 #define GFTP_MENU_ITEM_WIN2 4 | |
35 | |
1 | 36 #define IS_ONE_SELECTED(wdata) (GTK_CLIST ((wdata)->listbox)->selection && GTK_CLIST ((wdata)->listbox)->selection->next == NULL) |
37 #define IS_NONE_SELECTED(wdata) (GTK_CLIST ((wdata)->listbox)->selection == NULL) | |
525 | 38 #define gftp_gtk_get_list_selection(wdata) (GTK_CLIST ((wdata)->listbox)->selection) |
1 | 39 |
297 | 40 #define GFTP_IS_SAME_HOST_START_TRANS(wdata,trequest) \ |
41 ((wdata) != NULL && (wdata)->request != NULL && \ | |
42 (wdata)->request->datafd > 0 && !(wdata)->request->always_connected && \ | |
43 !(wdata)->request->stopable && \ | |
44 compare_request (trequest, (wdata)->request, 0)) | |
45 | |
46 #define GFTP_IS_SAME_HOST_STOP_TRANS(wdata,trequest) \ | |
47 ((wdata) != NULL && (wdata)->request != NULL && \ | |
48 (wdata)->request->datafd < 0 && !(wdata)->request->always_connected && \ | |
49 (wdata)->request->cached && !(wdata)->request->stopable && \ | |
50 trequest->datafd > 0 && !trequest->always_connected && \ | |
51 compare_request (trequest, (wdata)->request, 0)) | |
52 | |
45 | 53 #if GTK_MAJOR_VERSION == 1 |
1 | 54 #define gtk_widget_set_size_request(widget, width, height) \ |
55 gtk_widget_set_usize (widget, width, height) | |
56 #endif | |
57 | |
19 | 58 /* These 2 defines are for creating menu items with stock icons in GTK+ 2.0. |
59 If we are using version 1.2, it will disable the stock items since it's not | |
60 supported */ | |
61 | |
62 #if GTK_MAJOR_VERSION < 2 | |
63 #define MS_(a) NULL | |
64 #define MN_(a) a | |
65 #else | |
66 #define MS_(a) "<StockItem>",a | |
67 #define MN_(a) a,NULL | |
68 #endif | |
69 | |
70 /* These are used for the MakeEditDialog function. I have these types to make | |
71 it easier for creating dialogs with GTK+ 1.2 and GTK+ 2.0 */ | |
72 | |
73 typedef enum gftp_dialog_button_tag | |
74 { | |
75 gftp_dialog_button_create, | |
76 gftp_dialog_button_change, | |
77 gftp_dialog_button_connect, | |
78 gftp_dialog_button_rename, | |
79 gftp_dialog_button_ok | |
80 } gftp_dialog_button; | |
81 | |
1 | 82 typedef struct gftp_window_data_tag |
83 { | |
84 GtkWidget *combo, /* Entry widget/history for the user to enter | |
85 a directory */ | |
86 *hoststxt, /* Show which directory we're in */ | |
87 *listbox; /* Our listbox showing the files */ | |
37 | 88 unsigned int sorted : 1, /* Is the output sorted? */ |
1 | 89 show_selected : 1, /* Show only selected files */ |
90 *histlen; /* Pointer to length of history */ | |
91 char *filespec; /* Filespec for the listbox */ | |
92 gftp_request * request; /* The host that we are connected to */ | |
93 GList * files, /* Files in the listbox */ | |
94 ** history; /* History of the directories */ | |
95 GtkItemFactory *ifactory; /* This is for the menus that will | |
96 come up when you right click */ | |
97 pthread_t tid; /* Thread for the stop button */ | |
129 | 98 char *prefix_col_str; |
1 | 99 } gftp_window_data; |
100 | |
101 | |
355 | 102 typedef struct _gftpui_gtk_thread_data |
103 { | |
104 void * (*func) (void *); | |
105 gftpui_callback_data * cdata; | |
106 } gftpui_gtk_thread_data; | |
107 | |
108 | |
1 | 109 typedef struct gftp_graphic_tag |
110 { | |
111 char * filename; | |
112 GdkPixmap * pixmap; | |
113 GdkBitmap * bitmap; | |
114 } gftp_graphic; | |
115 | |
116 | |
117 typedef struct gftp_dialog_data_tag | |
118 { | |
19 | 119 GtkWidget * dialog, |
120 * checkbox, | |
121 * edit; | |
122 | |
123 void (*yesfunc) (); | |
124 gpointer yespointer; | |
125 | |
126 void (*nofunc) (); | |
127 gpointer nopointer; | |
1 | 128 } gftp_dialog_data; |
129 | |
130 | |
131 typedef struct gftp_viewedit_data_tag | |
132 { | |
133 char *filename, /* File we are viewing/editing currently */ | |
134 *remote_filename; /* The filename on the remote computer */ | |
135 struct stat st; /* Vital file statistics */ | |
136 pid_t pid; /* Our process id */ | |
137 char **argv; /* Our arguments we passed to execvp. We will | |
138 free it when the process terminates. This | |
139 is the safest place to free this */ | |
140 unsigned int view : 1, /* View or edit this file */ | |
141 rm : 1, /* Delete this file after we're done with it */ | |
142 dontupload : 1; /* Don't upload this file after we're done | |
143 editing it */ | |
144 gftp_window_data * fromwdata, /* The window we are viewing this file in */ | |
145 * towdata; | |
294 | 146 gftp_request * torequest; |
1 | 147 } gftp_viewedit_data; |
148 | |
149 | |
14
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
150 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
|
151 { |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
152 GtkWidget * filew; |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
153 gftp_window_data * wdata; |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
154 } gftp_save_dir_struct; |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
155 |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
156 |
136 | 157 typedef struct gftp_textcomboedt_widget_data_tag |
158 { | |
159 GtkWidget * combo, | |
160 * text; | |
161 gftp_config_vars * cv; | |
139 | 162 char * custom_edit_value; |
136 | 163 } gftp_textcomboedt_widget_data; |
164 | |
165 | |
166 typedef struct gftp_options_dialog_data_tag | |
167 { | |
168 GtkWidget * dialog, | |
169 * notebook, | |
170 * box, | |
171 * table; | |
767 | 172 unsigned int tbl_col_num, |
173 tbl_row_num; | |
136 | 174 gftp_option_type_enum last_option; |
229 | 175 gftp_bookmarks_var * bm; |
136 | 176 } gftp_options_dialog_data; |
177 | |
178 | |
1 | 179 extern gftp_window_data window1, window2, * other_wdata, * current_wdata; |
180 extern GtkWidget * stop_btn, * hostedit, * useredit, * passedit, | |
789 | 181 * portedit, * logwdw, * dlwdw, * optionmenu, |
587 | 182 * gftpui_command_widget, * download_left_arrow, |
604 | 183 * upload_right_arrow, * openurl_btn; |
184 extern GtkTooltips * openurl_tooltip; | |
1 | 185 extern GtkAdjustment * logwdw_vadj; |
45 | 186 #if GTK_MAJOR_VERSION > 1 |
1 | 187 extern GtkTextMark * logwdw_textmark; |
188 #endif | |
788 | 189 extern int local_start, remote_start, trans_start; |
1 | 190 extern GHashTable * graphic_hash_table; |
191 extern GtkItemFactoryEntry * menus; | |
192 extern GtkItemFactory * factory; | |
367 | 193 extern pthread_mutex_t log_mutex; |
19 | 194 extern gftp_graphic * gftp_icon; |
56 | 195 extern pthread_t main_thread_id; |
129 | 196 extern GList * viewedit_processes; |
197 | |
1 | 198 |
199 /* bookmarks.c */ | |
200 void run_bookmark ( gpointer data ); | |
201 | |
202 void add_bookmark ( gpointer data ); | |
203 | |
204 void edit_bookmarks ( gpointer data ); | |
205 | |
206 void build_bookmarks_menu ( void ); | |
207 | |
208 /* chmod_dialog.c */ | |
209 void chmod_dialog ( gpointer data ); | |
210 | |
211 /* delete_dialog.c */ | |
212 void delete_dialog ( gpointer data ); | |
213 | |
214 /* dnd.c */ | |
215 void openurl_get_drag_data ( GtkWidget * widget, | |
216 GdkDragContext * context, | |
217 gint x, | |
218 gint y, | |
219 GtkSelectionData * selection_data, | |
220 guint info, | |
221 guint32 clk_time, | |
222 gpointer data ); | |
223 | |
224 void listbox_drag ( GtkWidget * widget, | |
225 GdkDragContext * context, | |
226 GtkSelectionData * selection_data, | |
227 guint info, | |
228 guint32 clk_time, | |
229 gpointer data ); | |
230 | |
231 void listbox_get_drag_data ( GtkWidget * widget, | |
232 GdkDragContext * context, | |
233 gint x, | |
234 gint y, | |
235 GtkSelectionData * selection_data, | |
236 guint info, | |
237 guint32 clk_time, | |
238 gpointer data ); | |
239 | |
240 /* gftp-gtk.c */ | |
912 | 241 void gftp_gtk_init_request ( gftp_window_data * wdata ); |
242 | |
1 | 243 void toolbar_hostedit ( GtkWidget * widget, |
244 gpointer data ); | |
245 | |
246 void sortrows ( GtkCList * clist, | |
247 gint column, | |
248 gpointer data ); | |
249 | |
250 void stop_button ( GtkWidget * widget, | |
251 gpointer data ); | |
252 | |
341 | 253 void gftpui_show_or_hide_command ( void ); |
254 | |
255 /* gtkui.c */ | |
256 void gftpui_run_command ( GtkWidget * widget, | |
257 gpointer data ); | |
258 | |
259 void gftpui_run_function_callback ( gftp_window_data * wdata, | |
260 gftp_dialog_data * ddata ); | |
261 | |
262 void gftpui_run_function_cancel_callback ( gftp_window_data * wdata, | |
263 gftp_dialog_data * ddata ); | |
264 | |
265 void gftpui_mkdir_dialog ( gpointer data ); | |
266 | |
267 void gftpui_rename_dialog ( gpointer data ); | |
268 | |
269 void gftpui_site_dialog ( gpointer data ); | |
270 | |
271 int gftpui_run_chdir ( gpointer uidata, | |
272 char *directory ); | |
273 | |
274 void gftpui_chdir_dialog ( gpointer data ); | |
275 | |
397 | 276 char * gftpui_gtk_get_utf8_file_pos ( gftp_file * fle ); |
277 | |
1 | 278 /* menu_items.c */ |
279 void change_filespec ( gpointer data ); | |
280 | |
14
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
281 void save_directory_listing ( gpointer data ); |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
282 |
1 | 283 void show_selected ( gpointer data ); |
284 | |
285 void selectall ( gpointer data ); | |
286 | |
287 void selectallfiles ( gpointer data ); | |
288 | |
289 void deselectall ( gpointer data ); | |
290 | |
291 int chdir_edit ( GtkWidget * widget, | |
292 gpointer data ); | |
293 | |
294 void clearlog ( gpointer data ); | |
295 | |
296 void viewlog ( gpointer data ); | |
297 | |
298 void savelog ( gpointer data ); | |
299 | |
300 void clear_cache ( gpointer data ); | |
301 | |
227 | 302 void compare_windows ( gpointer data ); |
303 | |
304 void about_dialog ( gpointer data ); | |
1 | 305 |
306 /* misc-gtk.c */ | |
307 void fix_display ( void ); | |
308 | |
309 void remove_files_window ( gftp_window_data * wdata ); | |
310 | |
311 void ftp_log ( gftp_logging_level level, | |
186 | 312 gftp_request * request, |
1 | 313 const char *string, |
338 | 314 ... ) GFTP_LOG_FUNCTION_ATTRIBUTES; |
1 | 315 |
316 void update_window_info ( void ); | |
317 | |
318 void update_window ( gftp_window_data * wdata ); | |
319 | |
320 GtkWidget * toolbar_pixmap ( GtkWidget * widget, | |
321 char *filename ); | |
322 | |
323 gftp_graphic * open_xpm ( GtkWidget * widget, | |
324 char *filename ); | |
325 | |
326 void gftp_free_pixmap ( char *filename ); | |
327 | |
328 void gftp_get_pixmap ( GtkWidget * widget, | |
329 char *filename, | |
330 GdkPixmap ** pix, | |
331 GdkBitmap ** bitmap ); | |
332 | |
333 int check_status ( char *name, | |
334 gftp_window_data * wdata, | |
767 | 335 unsigned int check_other_stop, |
336 unsigned int only_one, | |
337 unsigned int at_least_one, | |
338 unsigned int func ); | |
1 | 339 |
7 | 340 GtkItemFactory *item_factory_new ( GtkType container_type, |
341 const char *path, | |
342 GtkAccelGroup *accel_group, | |
343 const char *strip_prefix ); | |
344 | |
1 | 345 void create_item_factory ( GtkItemFactory * ifactory, |
767 | 346 gint n_entries, |
1 | 347 GtkItemFactoryEntry * entries, |
348 gpointer callback_data ); | |
349 | |
350 void add_history ( GtkWidget * widget, | |
351 GList ** history, | |
352 unsigned int *histlen, | |
353 const char *str ); | |
354 | |
355 int check_reconnect ( gftp_window_data * wdata ); | |
356 | |
357 void add_file_listbox ( gftp_window_data * wdata, | |
358 gftp_file * fle ); | |
359 | |
425 | 360 void destroy_dialog ( gftp_dialog_data * ddata ); |
361 | |
1 | 362 void MakeEditDialog ( char *diagtxt, |
363 char *infotxt, | |
364 char *deftext, | |
19 | 365 int passwd_item, |
366 char *checktext, | |
367 gftp_dialog_button okbutton, | |
1 | 368 void (*okfunc) (), |
369 void *okptr, | |
370 void (*cancelfunc) (), | |
371 void *cancelptr ); | |
372 | |
373 void MakeYesNoDialog ( char *diagtxt, | |
374 char *infotxt, | |
19 | 375 void (*yesfunc) (), |
376 gpointer yespointer, | |
377 void (*nofunc) (), | |
378 gpointer nopointer ); | |
1 | 379 |
380 void update_directory_download_progress ( gftp_transfer * transfer ); | |
381 | |
382 int progress_timeout ( gpointer data ); | |
383 | |
384 void display_cached_logs ( void ); | |
385 | |
201 | 386 char * get_xpm_path ( char *filename, |
387 int quit_on_err ); | |
388 | |
227 | 389 /* options_dialog.c */ |
390 void options_dialog ( gpointer data ); | |
391 | |
229 | 392 void gftp_gtk_setup_bookmark_options ( GtkWidget * notebook, |
393 gftp_bookmarks_var * bm ); | |
227 | 394 |
767 | 395 void gftp_gtk_save_bookmark_options ( void ); |
227 | 396 |
1 | 397 /* transfer.c */ |
496 | 398 int ftp_list_files ( gftp_window_data * wdata ); |
1 | 399 |
400 int ftp_connect ( gftp_window_data * wdata, | |
767 | 401 gftp_request * request ); |
1 | 402 |
403 gint update_downloads ( gpointer data ); | |
404 | |
405 void get_files ( gpointer data ); | |
406 | |
407 void put_files ( gpointer data ); | |
408 | |
409 void transfer_window_files ( gftp_window_data * fromwdata, | |
410 gftp_window_data * towdata ); | |
411 | |
767 | 412 int gftp_gtk_get_subdirs ( gftp_transfer * transfer ); |
506 | 413 |
1 | 414 void *do_getdir_thread ( void * data ); |
415 | |
416 void start_transfer ( gpointer data ); | |
417 | |
418 void stop_transfer ( gpointer data ); | |
419 | |
420 void skip_transfer ( gpointer data ); | |
421 | |
422 void remove_file_transfer ( gpointer data ); | |
423 | |
424 void move_transfer_up ( gpointer data ); | |
425 | |
426 void move_transfer_down ( gpointer data ); | |
427 | |
428 /* view_dialog.c */ | |
429 void edit_dialog ( gpointer data ); | |
430 | |
431 void view_dialog ( gpointer data ); | |
432 | |
433 void view_file ( char *filename, | |
434 int fd, | |
767 | 435 unsigned int viewedit, |
436 unsigned int del_file, | |
437 unsigned int start_pos, | |
438 unsigned int dontupload, | |
1 | 439 char *remote_filename, |
440 gftp_window_data * wdata ); | |
441 | |
442 #endif | |
443 |