Mercurial > gftp.yaz
annotate src/gtk/gftp-gtk.h @ 14:83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
* Sanity checking on the fdopen() calls. Also make sure that all of them have a + in their open mode. Doesn't affect UNIX, but it does affect Windows
* HTTP fixes when running under Solaris. Read from request->sockfd and write to request->sockfd_write (Solaris doesn't like it when you read/write to the same FILE structure)
* Display major/minor properly for a device when connected with the local protocol
author | masneyb |
---|---|
date | Wed, 04 Sep 2002 11:45:56 +0000 |
parents | 5551ab2301fe |
children | 3b2dcdefc7e9 |
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 | |
20 #ifndef __GFTP_GTK_H | |
21 #define __GFTP_GTK_H | |
22 | |
23 #include "../../lib/gftp.h" | |
24 #include <gtk/gtk.h> | |
25 #include <gdk/gdkkeysyms.h> | |
26 #include <pthread.h> | |
27 | |
28 #define IS_ONE_SELECTED(wdata) (GTK_CLIST ((wdata)->listbox)->selection && GTK_CLIST ((wdata)->listbox)->selection->next == NULL) | |
29 #define IS_NONE_SELECTED(wdata) (GTK_CLIST ((wdata)->listbox)->selection == NULL) | |
30 | |
31 #if GTK_MAJOR_VERSION == 1 && GTK_MINOR_VERSION == 2 | |
32 #define gtk_widget_set_size_request(widget, width, height) \ | |
33 gtk_widget_set_usize (widget, width, height) | |
34 #endif | |
35 | |
36 typedef struct gftp_window_data_tag | |
37 { | |
38 GtkWidget *combo, /* Entry widget/history for the user to enter | |
39 a directory */ | |
40 *hoststxt, /* Show which directory we're in */ | |
41 *listbox; /* Our listbox showing the files */ | |
42 unsigned int sortcol, /* Which column we are sorting by */ | |
43 sortasds : 1, /* Sorted ascending or descending */ | |
44 sorted : 1, /* Is the output sorted? */ | |
45 show_selected : 1, /* Show only selected files */ | |
46 *histlen; /* Pointer to length of history */ | |
47 char *filespec; /* Filespec for the listbox */ | |
48 gftp_request * request; /* The host that we are connected to */ | |
49 GList * files, /* Files in the listbox */ | |
50 ** history; /* History of the directories */ | |
51 GtkItemFactory *ifactory; /* This is for the menus that will | |
52 come up when you right click */ | |
53 pthread_t tid; /* Thread for the stop button */ | |
54 unsigned long gotbytes; | |
55 } gftp_window_data; | |
56 | |
57 | |
58 typedef struct gftp_graphic_tag | |
59 { | |
60 char * filename; | |
61 GdkPixmap * pixmap; | |
62 GdkBitmap * bitmap; | |
63 } gftp_graphic; | |
64 | |
65 | |
66 typedef struct gftp_dialog_data_tag | |
67 { | |
68 GtkWidget * dialog, /* Pointer to the dialog */ | |
69 * checkbox, /* Pointer to the checkbox widget */ | |
70 * edit; /* Pointer to the edit widget */ | |
71 GList * all_buttons; /* All the buttons of this dialog */ | |
72 gpointer data; /* Data pointer we'll pass to the function */ | |
73 } gftp_dialog_data; | |
74 | |
75 | |
76 typedef struct gftp_viewedit_data_tag | |
77 { | |
78 char *filename, /* File we are viewing/editing currently */ | |
79 *remote_filename; /* The filename on the remote computer */ | |
80 struct stat st; /* Vital file statistics */ | |
81 pid_t pid; /* Our process id */ | |
82 char **argv; /* Our arguments we passed to execvp. We will | |
83 free it when the process terminates. This | |
84 is the safest place to free this */ | |
85 unsigned int view : 1, /* View or edit this file */ | |
86 rm : 1, /* Delete this file after we're done with it */ | |
87 dontupload : 1; /* Don't upload this file after we're done | |
88 editing it */ | |
89 gftp_window_data * fromwdata, /* The window we are viewing this file in */ | |
90 * towdata; | |
91 } gftp_viewedit_data; | |
92 | |
93 | |
94 typedef struct gftp_curtrans_data_tag | |
95 { | |
96 gftp_transfer * transfer; | |
97 GList * curfle; | |
98 } gftp_curtrans_data; | |
99 | |
100 | |
14
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
101 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
|
102 { |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
103 GtkWidget * filew; |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
104 gftp_window_data * wdata; |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
105 } gftp_save_dir_struct; |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
106 |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
107 |
1 | 108 extern gftp_window_data window1, window2, * other_wdata, * current_wdata; |
109 extern GtkWidget * stop_btn, * hostedit, * useredit, * passedit, | |
110 * portedit, * logwdw, * dlwdw, * protocol_menu, * optionmenu; | |
111 extern GtkAdjustment * logwdw_vadj; | |
112 #if GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION == 0 | |
113 extern GtkTextMark * logwdw_textmark; | |
114 #endif | |
115 extern int local_start, remote_start, trans_start, log_start, tools_start; | |
116 extern GHashTable * graphic_hash_table; | |
117 extern GtkItemFactoryEntry * menus; | |
118 extern GtkItemFactory * factory; | |
119 extern pthread_mutex_t transfer_mutex, log_mutex; | |
120 | |
121 /* bookmarks.c */ | |
122 void run_bookmark ( gpointer data ); | |
123 | |
124 void add_bookmark ( gpointer data ); | |
125 | |
126 void edit_bookmarks ( gpointer data ); | |
127 | |
128 void build_bookmarks_menu ( void ); | |
129 | |
130 /* chmod_dialog.c */ | |
131 void chmod_dialog ( gpointer data ); | |
132 | |
133 /* delete_dialog.c */ | |
134 void delete_dialog ( gpointer data ); | |
135 | |
136 /* dnd.c */ | |
137 void openurl_get_drag_data ( GtkWidget * widget, | |
138 GdkDragContext * context, | |
139 gint x, | |
140 gint y, | |
141 GtkSelectionData * selection_data, | |
142 guint info, | |
143 guint32 clk_time, | |
144 gpointer data ); | |
145 | |
146 void listbox_drag ( GtkWidget * widget, | |
147 GdkDragContext * context, | |
148 GtkSelectionData * selection_data, | |
149 guint info, | |
150 guint32 clk_time, | |
151 gpointer data ); | |
152 | |
153 void listbox_get_drag_data ( GtkWidget * widget, | |
154 GdkDragContext * context, | |
155 gint x, | |
156 gint y, | |
157 GtkSelectionData * selection_data, | |
158 guint info, | |
159 guint32 clk_time, | |
160 gpointer data ); | |
161 | |
162 /* gftp-gtk.c */ | |
163 void toolbar_hostedit ( GtkWidget * widget, | |
164 gpointer data ); | |
165 | |
166 void sortrows ( GtkCList * clist, | |
167 gint column, | |
168 gpointer data ); | |
169 | |
170 void stop_button ( GtkWidget * widget, | |
171 gpointer data ); | |
172 | |
173 /* menu_items.c */ | |
174 void change_setting ( gftp_window_data *wdata, | |
175 int menuitem, | |
176 GtkWidget * checkmenu ); | |
177 | |
178 void tb_openurl_dialog ( gpointer data ); | |
179 | |
180 void openurl_dialog ( gpointer data ); | |
181 | |
182 void disconnect ( gpointer data ); | |
183 | |
184 void change_filespec ( gpointer data ); | |
185 | |
14
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
186 void save_directory_listing ( gpointer data ); |
83090328581e
* More largefile support. Hopefully all that is left is the configure stuff
masneyb
parents:
7
diff
changeset
|
187 |
1 | 188 void show_selected ( gpointer data ); |
189 | |
190 void selectall ( gpointer data ); | |
191 | |
192 void selectallfiles ( gpointer data ); | |
193 | |
194 void deselectall ( gpointer data ); | |
195 | |
196 void site_dialog ( gpointer data ); | |
197 | |
198 int chdir_edit ( GtkWidget * widget, | |
199 gpointer data ); | |
200 | |
201 int chdir_dialog ( gpointer data ); | |
202 | |
203 void clearlog ( gpointer data ); | |
204 | |
205 void viewlog ( gpointer data ); | |
206 | |
207 void savelog ( gpointer data ); | |
208 | |
209 void clear_cache ( gpointer data ); | |
210 | |
211 void options_dialog (gpointer data); | |
212 void compare_windows (gpointer data); | |
213 void about_dialog (gpointer data); | |
214 | |
215 /* misc-gtk.c */ | |
216 void fix_display ( void ); | |
217 | |
218 void remove_files_window ( gftp_window_data * wdata ); | |
219 | |
220 void ftp_log ( gftp_logging_level level, | |
221 void *ptr, | |
222 const char *string, | |
223 ... ); | |
224 | |
225 void refresh ( gftp_window_data * wdata ); | |
226 | |
227 void update_window_info ( void ); | |
228 | |
229 void update_window ( gftp_window_data * wdata ); | |
230 | |
231 GtkWidget * toolbar_pixmap ( GtkWidget * widget, | |
232 char *filename ); | |
233 | |
234 gftp_graphic * open_xpm ( GtkWidget * widget, | |
235 char *filename ); | |
236 | |
237 void gftp_free_pixmap ( char *filename ); | |
238 | |
239 void gftp_get_pixmap ( GtkWidget * widget, | |
240 char *filename, | |
241 GdkPixmap ** pix, | |
242 GdkBitmap ** bitmap ); | |
243 | |
244 int check_status ( char *name, | |
245 gftp_window_data * wdata, | |
246 int check_other_stop, | |
247 int only_one, | |
248 int at_least_one, | |
249 int func ); | |
250 | |
7 | 251 GtkItemFactory *item_factory_new ( GtkType container_type, |
252 const char *path, | |
253 GtkAccelGroup *accel_group, | |
254 const char *strip_prefix ); | |
255 | |
1 | 256 void create_item_factory ( GtkItemFactory * ifactory, |
257 guint n_entries, | |
258 GtkItemFactoryEntry * entries, | |
259 gpointer callback_data ); | |
260 | |
261 GList * get_next_selection ( GList * selection, | |
262 GList ** list, | |
263 int *curnum ); | |
264 | |
265 void add_history ( GtkWidget * widget, | |
266 GList ** history, | |
267 unsigned int *histlen, | |
268 const char *str ); | |
269 | |
270 int check_reconnect ( gftp_window_data * wdata ); | |
271 | |
272 void add_file_listbox ( gftp_window_data * wdata, | |
273 gftp_file * fle ); | |
274 | |
275 void MakeEditDialog ( char *diagtxt, | |
276 char *infotxt, | |
277 char *deftext, | |
278 int edit_shown, | |
279 int erase, | |
280 char *checktext, | |
281 char *oktxt, | |
282 void (*okfunc) (), | |
283 void *okptr, | |
284 char *canceltxt, | |
285 void (*cancelfunc) (), | |
286 void *cancelptr ); | |
287 | |
288 void MakeYesNoDialog ( char *diagtxt, | |
289 char *infotxt, | |
290 int erase, | |
291 int num, | |
292 ... ); | |
293 | |
294 void update_directory_download_progress ( gftp_transfer * transfer ); | |
295 | |
296 void *generic_thread ( void * (*func) | |
297 (void *), | |
298 gftp_window_data * wdata ); | |
299 | |
300 int progress_timeout ( gpointer data ); | |
301 | |
302 void display_cached_logs ( void ); | |
303 | |
304 /* mkdir_dialog.c */ | |
305 void mkdir_dialog ( gpointer data ); | |
306 | |
307 /* rename_dialog.c */ | |
308 void rename_dialog ( gpointer data ); | |
309 | |
310 /* transfer.c */ | |
311 int ftp_list_files ( gftp_window_data * wdata, | |
312 int usecache ); | |
313 | |
314 int ftp_connect ( gftp_window_data * wdata, | |
315 gftp_request * request, | |
316 int getdir ); | |
317 | |
318 gint update_downloads ( gpointer data ); | |
319 | |
320 void * gftp_gtk_transfer_files ( void *data ); | |
321 | |
322 void get_files ( gpointer data ); | |
323 | |
324 void put_files ( gpointer data ); | |
325 | |
326 void transfer_window_files ( gftp_window_data * fromwdata, | |
327 gftp_window_data * towdata ); | |
328 | |
329 void *do_getdir_thread ( void * data ); | |
330 | |
331 void add_file_transfer ( gftp_request * fromreq, | |
332 gftp_request * toreq, | |
333 gftp_window_data * fromwdata, | |
334 gftp_window_data * towdata, | |
335 GList * files, | |
336 int copy_req ); | |
337 | |
338 void start_transfer ( gpointer data ); | |
339 | |
340 void stop_transfer ( gpointer data ); | |
341 | |
342 void skip_transfer ( gpointer data ); | |
343 | |
344 void remove_file_transfer ( gpointer data ); | |
345 | |
346 void move_transfer_up ( gpointer data ); | |
347 | |
348 void move_transfer_down ( gpointer data ); | |
349 | |
350 void gftp_gtk_ask_transfer ( gftp_transfer * tdata ); | |
351 | |
352 /* view_dialog.c */ | |
353 void edit_dialog ( gpointer data ); | |
354 | |
355 void view_dialog ( gpointer data ); | |
356 | |
357 void view_file ( char *filename, | |
358 int fd, | |
359 int viewedit, | |
360 int del_file, | |
361 int start_pos, | |
362 int dontupload, | |
363 char *remote_filename, | |
364 gftp_window_data * wdata ); | |
365 | |
366 #endif | |
367 |