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 gchar* scheme_handler;
108 gboolean always_insert_mode;
109 gboolean show_status;
110 gboolean insert_mode;
112 gboolean reset_command_mode;
117 /* WebKitWebSettings exports */
119 guint monospace_size;
120 guint minimum_font_size;
122 guint disable_plugins;
123 guint disable_scripts;
125 guint autoshrink_img;
126 guint enable_spellcheck;
127 guint enable_private;
131 gchar* default_encoding;
134 guint caret_browsing;
137 gchar* insert_indicator;
138 gchar* cmd_indicator;
139 gboolean print_version;
141 /* command list: name -> Command */
142 GHashTable* commands;
147 gboolean initialized;
148 JSClassDefinition classdef;
152 /* static information */
161 /* main uzbl data structure */
173 /* group bindings: key -> action */
174 GHashTable* bindings;
183 typedef void sigfunc(int);
188 gchar* environmental;
189 gchar* default_value;
194 { "XDG_CONFIG_HOME", "~/.config" },
195 { "XDG_DATA_HOME", "~/.local/share" },
196 { "XDG_CACHE_HOME", "~/.cache" },
197 { "XDG_CONFIG_DIRS", "/etc/xdg" },
198 { "XDG_DATA_DIRS", "/usr/local/share/:/usr/share/" },
206 str_replace (const char* search, const char* replace, const char* string);
209 read_file_by_line (const gchar *path);
212 parseenv (char* string);
218 catch_sigterm(int s);
221 setup_signal(int signe, sigfunc *shandler);
224 set_var_value(const gchar *name, gchar *val);
227 print(WebKitWebView *page, GArray *argv, GString *result);
230 navigation_decision_cb (WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, WebKitWebNavigationAction *navigation_action, WebKitWebPolicyDecision *policy_decision, gpointer user_data);
233 new_window_cb (WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, WebKitWebNavigationAction *navigation_action, WebKitWebPolicyDecision *policy_decision, gpointer user_data);
236 mime_policy_cb(WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, gchar *mime_type, WebKitWebPolicyDecision *policy_decision, gpointer user_data);
238 /*@null@*/ WebKitWebView*
239 create_web_view_cb (WebKitWebView *web_view, WebKitWebFrame *frame, gpointer user_data);
242 download_cb (WebKitWebView *web_view, GObject *download, gpointer user_data);
245 toggle_zoom_type (WebKitWebView* page, GArray *argv, GString *result);
248 toggle_status_cb (WebKitWebView* page, GArray *argv, GString *result);
251 link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data);
254 title_change_cb (WebKitWebView* web_view, GParamSpec param_spec);
257 progress_change_cb (WebKitWebView* page, gint progress, gpointer data);
260 load_commit_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
263 load_start_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
266 load_finish_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
269 destroy_cb (GtkWidget* widget, gpointer data);
275 free_action(gpointer act);
278 new_action(const gchar *name, const gchar *param);
281 file_exists (const char * filename);
287 set_mode_indicator();
293 set_insert_mode(gboolean mode);
296 toggle_insert_mode(WebKitWebView *page, GArray *argv, GString *result);
299 load_uri (WebKitWebView * web_view, GArray *argv, GString *result);
302 new_window_load_uri (const gchar * uri);
305 chain (WebKitWebView *page, GArray *argv, GString *result);
308 keycmd (WebKitWebView *page, GArray *argv, GString *result);
311 keycmd_nl (WebKitWebView *page, GArray *argv, GString *result);
314 keycmd_bs (WebKitWebView *page, GArray *argv, GString *result);
317 close_uzbl (WebKitWebView *page, GArray *argv, GString *result);
320 run_command(const gchar *command, const guint npre,
321 const gchar **args, const gboolean sync, char **output_stdout);
324 build_progressbar_ascii(int percent);
327 talk_to_socket(WebKitWebView *web_view, GArray *argv, GString *result);
330 spawn(WebKitWebView *web_view, GArray *argv, GString *result);
333 spawn_sh(WebKitWebView *web_view, GArray *argv, GString *result);
336 spawn_sync(WebKitWebView *web_view, GArray *argv, GString *result);
339 spawn_sh_sync(WebKitWebView *web_view, GArray *argv, GString *result);
342 parse_command(const char *cmd, const char *param, GString *result);
345 parse_cmd_line(const char *ctl_line, GString *result);
348 build_stream_name(int type, const gchar *dir);
351 control_fifo(GIOChannel *gio, GIOCondition condition);
354 init_fifo(gchar *dir);
357 control_stdin(GIOChannel *gio, GIOCondition condition);
363 init_socket(gchar *dir);
366 control_socket(GIOChannel *chan);
369 control_client_socket(GIOChannel *chan);
375 key_press_cb (GtkWidget* window, GdkEventKey* event);
378 run_keycmd(const gboolean key_ret);
381 exec_paramcmd(const Action* act, const guint i);
384 initialize (int argc, char *argv[]);
399 run_handler (const gchar *act, const gchar *args);
402 add_binding (const gchar *key, const gchar *act);
405 get_xdg_var (XDG_Var xdg);
408 find_xdg_file (int xdg_type, const char* filename);
414 search_text (WebKitWebView *page, GArray *argv, const gboolean forward);
417 search_forward_text (WebKitWebView *page, GArray *argv, GString *result);
420 search_reverse_text (WebKitWebView *page, GArray *argv, GString *result);
423 dehilight (WebKitWebView *page, GArray *argv, GString *result);
426 run_js (WebKitWebView * web_view, GArray *argv, GString *result);
429 run_external_js (WebKitWebView * web_view, GArray *argv, GString *result);
432 eval_js(WebKitWebView * web_view, gchar *script, GString *result);
434 void handle_cookies (SoupSession *session,
438 save_cookies (SoupMessage *msg,
442 set_var(WebKitWebView *page, GArray *argv, GString *result);
445 act_bind(WebKitWebView *page, GArray *argv, GString *result);
451 dump_var_hash(gpointer k, gpointer v, gpointer ud);
454 dump_key_hash(gpointer k, gpointer v, gpointer ud);
463 update_gui(WebKitWebView *page, GArray *argv, GString *result);
466 configure_event_cb(GtkWidget* window, GdkEventConfigure* event);
468 typedef void (*Command)(WebKitWebView*, GArray *argv, GString *result);
474 /* Command callbacks */
488 cmd_cookie_handler();
491 cmd_scheme_handler();
497 cmd_always_insert_mode();
506 cmd_max_conns_host();
508 /* exported WebKitWebSettings properties */
514 cmd_default_font_family();
517 cmd_monospace_font_family();
520 cmd_sans_serif_font_family();
523 cmd_serif_font_family();
526 cmd_cursive_font_family();
529 cmd_fantasy_font_family();
535 cmd_disable_plugins();
538 cmd_disable_scripts();
541 cmd_minimum_font_size();
559 cmd_autoshrink_img();
562 cmd_enable_spellcheck();
565 cmd_enable_private();
577 cmd_default_encoding();
586 cmd_caret_browsing();
591 /* vi: set et ts=4: */