2 * See LICENSE for license details
7 * (c) 2009 by Robert Manea
8 * - introduced struct concept
13 #define STATUS_DEFAULT "<span background=\"darkblue\" foreground=\"white\"> MODE </span> <span background=\"red\" foreground=\"white\">KEYCMD</span> (LOAD_PROGRESS%) <b>TITLE</b> - Uzbl browser"
15 /* statusbar symbols */
16 enum { SYM_TITLE, SYM_URI, SYM_NAME,
17 SYM_LOADPRGS, SYM_LOADPRGSBAR,
18 SYM_KEYCMD, SYM_MODE, SYM_MSG};
26 {"KEYCMD", SYM_KEYCMD},
29 {"LOAD_PROGRESS", SYM_LOADPRGS},
30 {"LOAD_PROGRESSBAR", SYM_LOADPRGSBAR},
34 /* status bar elements */
43 GtkWidget* main_window;
44 GtkWidget* scrolled_win;
47 GtkWidget* mainbar_label;
48 GtkScrollbar* scbar_v; // Horizontal and Vertical Scrollbar
49 GtkScrollbar* scbar_h; // (These are still hidden)
50 GtkAdjustment* bar_v; // Information about document length
51 GtkAdjustment* bar_h; // and scrolling position
52 WebKitWebView* web_view;
59 /* external communication*/
64 /* stores (key)"variable name" -> (value)"pointer to this var*/
65 GHashTable *proto_var;
66 /* command parsing regexes */
79 gchar config_file_path[500];
80 gchar selected_url[500];
81 char executable_path[500];
84 struct utsname unameinfo; /* system info */
90 SoupSession *soup_session;
91 SoupLogger *soup_logger;
101 gchar* load_finish_handler;
102 gchar* status_format;
103 gchar* status_background;
104 gchar* history_handler;
107 gchar* download_handler;
108 gchar* cookie_handler;
109 gboolean always_insert_mode;
110 gboolean show_status;
111 gboolean insert_mode;
113 gboolean reset_command_mode;
118 /* command list: name -> Command */
119 GHashTable* commands;
123 /* main uzbl data structure */
134 /* group bindings: key -> action */
135 GHashTable* bindings;
144 typedef void sigfunc(int);
157 catch_sigterm(int s);
160 setup_signal(int signe, sigfunc *shandler);
163 new_window_cb (WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, WebKitWebNavigationAction *navigation_action, WebKitWebPolicyDecision *policy_decision, gpointer user_data);
166 create_web_view_cb (WebKitWebView *web_view, WebKitWebFrame *frame, gpointer user_data);
169 download_cb (WebKitWebView *web_view, GObject *download, gpointer user_data);
172 toggle_status_cb (WebKitWebView* page, const char *param);
175 link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data);
178 title_change_cb (WebKitWebView* web_view, WebKitWebFrame* web_frame, const gchar* title, gpointer data);
181 progress_change_cb (WebKitWebView* page, gint progress, gpointer data);
184 load_commit_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
187 load_finish_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
190 destroy_cb (GtkWidget* widget, gpointer data);
199 free_action(gpointer act);
202 new_action(const gchar *name, const gchar *param);
205 file_exists (const char * filename);
208 set_insert_mode(WebKitWebView *page, const gchar *param);
211 load_uri (WebKitWebView * web_view, const gchar *param);
214 new_window_load_uri (const gchar * uri);
217 close_uzbl (WebKitWebView *page, const char *param);
220 run_command_async(const char *command, const char *args);
223 run_command_sync(const char *command, const char *args, char **stdout);
226 spawn(WebKitWebView *web_view, const char *param);
229 parse_command(const char *cmd, const char *param);
232 build_stream_name(int type, const gchar *dir);
235 control_fifo(GIOChannel *gio, GIOCondition condition);
238 init_fifo(gchar *dir);
241 control_stdin(GIOChannel *gio, GIOCondition condition);
247 init_socket(gchar *dir);
250 control_socket(GIOChannel *chan);
257 key_press_cb (WebKitWebView* page, GdkEventKey* event);
266 GtkWidget* create_window ();
269 add_binding (const gchar *key, const gchar *act);
275 search_text (WebKitWebView *page, const char *param);
278 run_js (WebKitWebView * web_view, const gchar *param);
281 str_replace (const char* search, const char* replace, const char* string);
283 static void handle_cookies (SoupSession *session,
287 save_cookies (SoupMessage *msg,
289 /* vi: set et ts=4: */