1 /* -*- c-basic-offset: 4; -*-
3 * See LICENSE for license details
8 * (c) 2009 by Robert Manea
9 * - introduced struct concept
10 * - statusbar template
14 /* status bar elements */
18 gchar *progress_s, *progress_u;
21 gchar *mode_indicator;
27 GtkWidget* main_window;
30 GtkWidget* scrolled_win;
33 GtkWidget* mainbar_label;
34 GtkScrollbar* scbar_v; // Horizontal and Vertical Scrollbar
35 GtkScrollbar* scbar_h; // (These are still hidden)
36 GtkAdjustment* bar_v; // Information about document length
37 GtkAdjustment* bar_h; // and scrolling position
38 WebKitWebView* web_view;
43 GtkWidget *inspector_window;
44 WebKitWebInspector *inspector;
50 /* external communication*/
55 /* stores (key)"variable name" -> (value)"pointer to this var*/
56 GHashTable *proto_var;
69 gchar *executable_path;
78 SoupSession *soup_session;
79 SoupLogger *soup_logger;
89 gchar* load_finish_handler;
90 gchar* load_start_handler;
91 gchar* load_commit_handler;
93 gchar* title_format_short;
94 gchar* title_format_long;
95 gchar* status_background;
98 gchar* download_handler;
99 gchar* cookie_handler;
101 gchar* default_font_family;
102 gchar* monospace_font_family;
103 gchar* sans_serif_font_family;
104 gchar* serif_font_family;
105 gchar* fantasy_font_family;
106 gchar* cursive_font_family;
107 gboolean always_insert_mode;
108 gboolean show_status;
109 gboolean insert_mode;
111 gboolean reset_command_mode;
116 /* WebKitWebSettings exports */
118 guint monospace_size;
119 guint minimum_font_size;
121 guint disable_plugins;
122 guint disable_scripts;
124 guint autoshrink_img;
125 guint enable_spellcheck;
126 guint enable_private;
130 gchar* default_encoding;
133 guint caret_browsing;
136 gchar* insert_indicator;
137 gchar* cmd_indicator;
138 gboolean print_version;
140 /* command list: name -> Command */
141 GHashTable* commands;
146 gboolean initialized;
147 JSClassDefinition classdef;
151 /* static information */
160 /* main uzbl data structure */
172 /* group bindings: key -> action */
173 GHashTable* bindings;
182 typedef void sigfunc(int);
187 gchar* environmental;
188 gchar* default_value;
193 { "XDG_CONFIG_HOME", "~/.config" },
194 { "XDG_DATA_HOME", "~/.local/share" },
195 { "XDG_CACHE_HOME", "~/.cache" },
196 { "XDG_CONFIG_DIRS", "/etc/xdg" },
197 { "XDG_DATA_DIRS", "/usr/local/share/:/usr/share/" },
205 str_replace (const char* search, const char* replace, const char* string);
208 read_file_by_line (const gchar *path);
211 parseenv (char* string);
217 catch_sigterm(int s);
220 setup_signal(int signe, sigfunc *shandler);
223 set_var_value(const gchar *name, gchar *val);
226 print(WebKitWebView *page, GArray *argv, GString *result);
229 new_window_cb (WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, WebKitWebNavigationAction *navigation_action, WebKitWebPolicyDecision *policy_decision, gpointer user_data);
232 mime_policy_cb(WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, gchar *mime_type, WebKitWebPolicyDecision *policy_decision, gpointer user_data);
234 /*@null@*/ WebKitWebView*
235 create_web_view_cb (WebKitWebView *web_view, WebKitWebFrame *frame, gpointer user_data);
238 download_cb (WebKitWebView *web_view, GObject *download, gpointer user_data);
241 toggle_zoom_type (WebKitWebView* page, GArray *argv, GString *result);
244 toggle_status_cb (WebKitWebView* page, GArray *argv, GString *result);
247 link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data);
250 title_change_cb (WebKitWebView* web_view, GParamSpec param_spec);
253 progress_change_cb (WebKitWebView* page, gint progress, gpointer data);
256 load_commit_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
259 load_start_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
262 load_finish_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
265 destroy_cb (GtkWidget* widget, gpointer data);
271 free_action(gpointer act);
274 new_action(const gchar *name, const gchar *param);
277 file_exists (const char * filename);
283 set_mode_indicator();
289 set_insert_mode(gboolean mode);
292 toggle_insert_mode(WebKitWebView *page, GArray *argv, GString *result);
295 load_uri (WebKitWebView * web_view, GArray *argv, GString *result);
298 new_window_load_uri (const gchar * uri);
301 chain (WebKitWebView *page, GArray *argv, GString *result);
304 keycmd (WebKitWebView *page, GArray *argv, GString *result);
307 keycmd_nl (WebKitWebView *page, GArray *argv, GString *result);
310 keycmd_bs (WebKitWebView *page, GArray *argv, GString *result);
313 close_uzbl (WebKitWebView *page, GArray *argv, GString *result);
316 run_command(const gchar *command, const guint npre,
317 const gchar **args, const gboolean sync, char **output_stdout);
320 build_progressbar_ascii(int percent);
323 talk_to_socket(WebKitWebView *web_view, GArray *argv, GString *result);
326 spawn(WebKitWebView *web_view, GArray *argv, GString *result);
329 spawn_sh(WebKitWebView *web_view, GArray *argv, GString *result);
332 spawn_sync(WebKitWebView *web_view, GArray *argv, GString *result);
335 spawn_sh_sync(WebKitWebView *web_view, GArray *argv, GString *result);
338 parse_command(const char *cmd, const char *param, GString *result);
341 parse_cmd_line(const char *ctl_line, GString *result);
344 build_stream_name(int type, const gchar *dir);
347 control_fifo(GIOChannel *gio, GIOCondition condition);
350 init_fifo(gchar *dir);
353 control_stdin(GIOChannel *gio, GIOCondition condition);
359 init_socket(gchar *dir);
362 control_socket(GIOChannel *chan);
365 control_client_socket(GIOChannel *chan);
371 key_press_cb (GtkWidget* window, GdkEventKey* event);
374 run_keycmd(const gboolean key_ret);
377 exec_paramcmd(const Action* act, const guint i);
380 initialize (int argc, char *argv[]);
395 run_handler (const gchar *act, const gchar *args);
398 add_binding (const gchar *key, const gchar *act);
401 get_xdg_var (XDG_Var xdg);
404 find_xdg_file (int xdg_type, const char* filename);
410 search_text (WebKitWebView *page, GArray *argv, const gboolean forward);
413 search_forward_text (WebKitWebView *page, GArray *argv, GString *result);
416 search_reverse_text (WebKitWebView *page, GArray *argv, GString *result);
419 dehilight (WebKitWebView *page, GArray *argv, GString *result);
422 run_js (WebKitWebView * web_view, GArray *argv, GString *result);
425 run_external_js (WebKitWebView * web_view, GArray *argv, GString *result);
428 eval_js(WebKitWebView * web_view, gchar *script, GString *result);
430 void handle_cookies (SoupSession *session,
434 save_cookies (SoupMessage *msg,
438 set_var(WebKitWebView *page, GArray *argv, GString *result);
441 act_bind(WebKitWebView *page, GArray *argv, GString *result);
447 dump_var_hash(gpointer k, gpointer v, gpointer ud);
450 dump_key_hash(gpointer k, gpointer v, gpointer ud);
459 update_gui(WebKitWebView *page, GArray *argv, GString *result);
462 configure_event_cb(GtkWidget* window, GdkEventConfigure* event);
464 typedef void (*Command)(WebKitWebView*, GArray *argv, GString *result);
470 /* Command callbacks */
484 cmd_cookie_handler();
493 cmd_always_insert_mode();
502 cmd_max_conns_host();
504 /* exported WebKitWebSettings properties */
510 cmd_default_font_family();
513 cmd_monospace_font_family();
516 cmd_sans_serif_font_family();
519 cmd_serif_font_family();
522 cmd_cursive_font_family();
525 cmd_fantasy_font_family();
531 cmd_disable_plugins();
534 cmd_disable_scripts();
537 cmd_minimum_font_size();
555 cmd_autoshrink_img();
558 cmd_enable_spellcheck();
561 cmd_enable_private();
573 cmd_default_encoding();
582 cmd_caret_browsing();
587 /* vi: set et ts=4: */