annotate src/uicommon/gftpui.h @ 341:eedc2c5727fa

2003-12-28 Brian Masney <masneyb@gftp.org> **** NOTE: this commit breaks a lot of functionality in gftp. I **** **** still have more work to do on this. Please don't email me **** **** saying that the CVS code is broken. **** * lib/bookmark.c lib/gftp.h lib/local.c lib/options.h lib/rfc2068.c lib/rfc959.c lib/sshv2.c - moved the use_threads option from the request structure over to the protocol declaration in options.h. * lib/options.h src/gtk/gftp-gtk.c - added cmd_in_gui option. When this option is enabled, a new toolbar will be shown in the GTK+ port that will allow you to control the GUI by entering manual commands. * src/Makefile.am - added uicommon directory * src/gtk/Makefile.am src/text/Makefile.am - link in the uicommon library. * src/uicommon/* src/text/gftp-text.c - moved most of the functionality of the text port over to the uicommon directory. Made this code a little more generic so that the GTK+ port can have a text interface associated with it. * src/gtk/gtkui.c src/gtk/gftp-gtk.c src/gtk/mkdir_dialog.c src/gtk/rename_dialog.c src/gtk/menu-items.c src/gtk/misc-gtk.c - started to clean up the callback functions and make them more tightly integrated with the uicommon code. * src/gtk/bookmarks.c src/gtk/chmod_dialog.c src/gtk/delete_dialog.c src/gtk/gftp-gtk.c src/gtk/menu-items.c src/gtk/misc-gtk.c src/gtk/transfer.c - s/refresh/gftpui_refresh/g s/jmp_environment/gftpui_common_jmp_environment/g s/request->use_threads/gftpui_common_use_threads (request)/g * src/gtk/options_dialog.c (apply_changes) - whenever the options are saved, check to see if the command entry needs to be shown or hidden.
author masneyb
date Sun, 28 Dec 2003 16:02:07 +0000
parents
children e5ad008e7ea8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
341
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
1 /*****************************************************************************/
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
2 /* gftpui.h - UI related functions for gFTP */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
3 /* Copyright (C) 1998-2003 Brian Masney <masneyb@gftp.org> */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
4 /* */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
5 /* This program is free software; you can redistribute it and/or modify */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
6 /* it under the terms of the GNU General Public License as published by */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
7 /* the Free Software Foundation; either version 2 of the License, or */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
8 /* (at your option) any later version. */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
9 /* */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
10 /* This program is distributed in the hope that it will be useful, */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
13 /* GNU General Public License for more details. */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
14 /* */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
15 /* You should have received a copy of the GNU General Public License */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
16 /* along with this program; if not, write to the Free Software */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
17 /* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
18 /*****************************************************************************/
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
19
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
20 /* $Id$ */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
21
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
22 #ifndef __GFTPUI_H
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
23 #define __GFTPUI_H
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
24
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
25 #include "../../lib/gftp.h"
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
26
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
27 typedef struct _gftpui_callback_data gftpui_callback_data;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
28
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
29 struct _gftpui_callback_data
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
30 {
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
31 gftp_request * request;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
32 void *uidata;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
33 char *input_string,
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
34 *source_string;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
35 int (*run_function) (gftpui_callback_data * cdata);
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
36 };
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
37
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
38
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
39 typedef enum _gftpui_common_request_type
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
40 {
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
41 gftpui_common_request_none,
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
42 gftpui_common_request_local,
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
43 gftpui_common_request_remote
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
44 } gftpui_common_request_type;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
45
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
46
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
47 typedef struct _gftpui_common_methods
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
48 {
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
49 char *command;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
50 int minlen;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
51 int (*func)(void *uidata, gftp_request * request, char *command);
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
52 gftpui_common_request_type reqtype;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
53 char *cmd_description;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
54 int (*subhelp_func) (char *topic);
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
55 } gftpui_common_methods;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
56
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
57 #define gftpui_common_use_threads(request) (gftp_protocols[(request)->protonum].use_threads)
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
58
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
59 #define GFTPUI_COMMON_COLOR_BLACK "\033[30m"
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
60 #define GFTPUI_COMMON_COLOR_RED "\033[31m"
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
61 #define GFTPUI_COMMON_COLOR_GREEN "\033[32m"
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
62 #define GFTPUI_COMMON_COLOR_YELLOW "\033[33m"
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
63 #define GFTPUI_COMMON_COLOR_BLUE "\033[34m"
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
64 #define GFTPUI_COMMON_COLOR_MAGENTA "\033[35m"
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
65 #define GFTPUI_COMMON_COLOR_CYAN "\033[36m"
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
66 #define GFTPUI_COMMON_COLOR_WHITE "\033[37m"
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
67 #define GFTPUI_COMMON_COLOR_GREY "\033[38m"
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
68 #define GFTPUI_COMMON_COLOR_DEFAULT "\033[39m"
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
69 #define GFTPUI_COMMON_COLOR_NONE ""
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
70
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
71 extern sigjmp_buf gftpui_common_jmp_environment;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
72 extern volatile int gftpui_common_use_jmp_environment;
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
73 extern gftpui_common_methods gftpui_common_commands[];
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
74
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
75 /* gftpui.c */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
76 int gftpui_run_callback_function ( gftpui_callback_data * cdata );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
77
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
78 int gftpui_common_run_callback_function ( gftpui_callback_data * cdata );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
79
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
80 RETSIGTYPE gftpui_common_signal_handler ( int signo );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
81
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
82 void gftpui_common_about ( gftp_logging_func logging_function,
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
83 gpointer logdata );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
84
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
85 int gftpui_common_init ( void *locui,
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
86 gftp_request * locreq,
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
87 void *remui,
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
88 gftp_request * remreq );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
89
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
90 int gftpui_common_process_command ( const char *command );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
91
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
92 /* gftpuicallback.c */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
93 int gftpui_common_run_mkdir ( gftpui_callback_data * cdata );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
94
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
95 int gftpui_common_run_rename ( gftpui_callback_data * cdata );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
96
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
97 int gftpui_common_run_site ( gftpui_callback_data * cdata );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
98
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
99 int gftpui_common_run_chdir ( gftpui_callback_data * cdata );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
100
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
101 /* UI Functions that must be implemented by each distinct UI */
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
102 void gftpui_lookup_file_colors ( gftp_file * fle,
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
103 char **start_color,
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
104 char ** end_color );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
105
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
106 int gftpui_check_reconnect ( gftpui_callback_data * cdata );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
107
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
108 void gftpui_refresh ( void *uidata );
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
109
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
110 void *gftpui_generic_thread ( void *(*run_function)(void *data),
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
111 void *data);
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
112
eedc2c5727fa 2003-12-28 Brian Masney <masneyb@gftp.org>
masneyb
parents:
diff changeset
113 #endif