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;
96 gchar* history_handler;
99 gchar* download_handler;
100 gchar* cookie_handler;
102 gchar* default_font_family;
103 gchar* monospace_font_family;
104 gchar* sans_serif_font_family;
105 gchar* serif_font_family;
106 gchar* fantasy_font_family;
107 gchar* cursive_font_family;
108 gchar* scheme_handler;
109 gboolean always_insert_mode;
110 gboolean show_status;
111 gboolean insert_mode;
113 gboolean reset_command_mode;
118 /* WebKitWebSettings exports */
120 guint monospace_size;
121 guint minimum_font_size;
123 guint disable_plugins;
124 guint disable_scripts;
126 guint autoshrink_img;
127 guint enable_spellcheck;
128 guint enable_private;
132 gchar* default_encoding;
135 guint caret_browsing;
138 gchar* insert_indicator;
139 gchar* cmd_indicator;
140 gboolean print_version;
142 /* command list: name -> Command */
143 GHashTable* commands;
148 gboolean initialized;
149 JSClassDefinition classdef;
153 /* static information */
162 /* main uzbl data structure */
174 /* group bindings: key -> action */
175 GHashTable* bindings;
184 typedef void sigfunc(int);
189 gchar* environmental;
190 gchar* default_value;
195 { "XDG_CONFIG_HOME", "~/.config" },
196 { "XDG_DATA_HOME", "~/.local/share" },
197 { "XDG_CACHE_HOME", "~/.cache" },
198 { "XDG_CONFIG_DIRS", "/etc/xdg" },
199 { "XDG_DATA_DIRS", "/usr/local/share/:/usr/share/" },
207 str_replace (const char* search, const char* replace, const char* string);
210 read_file_by_line (const gchar *path);
213 parseenv (char* string);
219 catch_sigterm(int s);
222 setup_signal(int signe, sigfunc *shandler);
225 set_var_value(const gchar *name, gchar *val);
228 print(WebKitWebView *page, GArray *argv, GString *result);
231 navigation_decision_cb (WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, WebKitWebNavigationAction *navigation_action, WebKitWebPolicyDecision *policy_decision, gpointer user_data);
234 new_window_cb (WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, WebKitWebNavigationAction *navigation_action, WebKitWebPolicyDecision *policy_decision, gpointer user_data);
237 mime_policy_cb(WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, gchar *mime_type, WebKitWebPolicyDecision *policy_decision, gpointer user_data);
239 /*@null@*/ WebKitWebView*
240 create_web_view_cb (WebKitWebView *web_view, WebKitWebFrame *frame, gpointer user_data);
243 download_cb (WebKitWebView *web_view, GObject *download, gpointer user_data);
246 toggle_zoom_type (WebKitWebView* page, GArray *argv, GString *result);
249 toggle_status_cb (WebKitWebView* page, GArray *argv, GString *result);
252 link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data);
255 title_change_cb (WebKitWebView* web_view, GParamSpec param_spec);
258 progress_change_cb (WebKitWebView* page, gint progress, gpointer data);
261 load_commit_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
264 load_start_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
267 load_finish_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
270 destroy_cb (GtkWidget* widget, gpointer data);
279 free_action(gpointer act);
282 new_action(const gchar *name, const gchar *param);
285 file_exists (const char * filename);
291 set_mode_indicator();
297 set_insert_mode(gboolean mode);
300 toggle_insert_mode(WebKitWebView *page, GArray *argv, GString *result);
303 load_uri (WebKitWebView * web_view, GArray *argv, GString *result);
306 new_window_load_uri (const gchar * uri);
309 chain (WebKitWebView *page, GArray *argv, GString *result);
312 keycmd (WebKitWebView *page, GArray *argv, GString *result);
315 keycmd_nl (WebKitWebView *page, GArray *argv, GString *result);
318 keycmd_bs (WebKitWebView *page, GArray *argv, GString *result);
321 close_uzbl (WebKitWebView *page, GArray *argv, GString *result);
324 run_command(const gchar *command, const guint npre,
325 const gchar **args, const gboolean sync, char **output_stdout);
328 build_progressbar_ascii(int percent);
331 talk_to_socket(WebKitWebView *web_view, GArray *argv, GString *result);
334 spawn(WebKitWebView *web_view, GArray *argv, GString *result);
337 spawn_sh(WebKitWebView *web_view, GArray *argv, GString *result);
340 spawn_sync(WebKitWebView *web_view, GArray *argv, GString *result);
343 spawn_sh_sync(WebKitWebView *web_view, GArray *argv, GString *result);
346 parse_command(const char *cmd, const char *param, GString *result);
349 parse_cmd_line(const char *ctl_line, GString *result);
352 build_stream_name(int type, const gchar *dir);
355 control_fifo(GIOChannel *gio, GIOCondition condition);
358 init_fifo(gchar *dir);
361 control_stdin(GIOChannel *gio, GIOCondition condition);
367 init_socket(gchar *dir);
370 control_socket(GIOChannel *chan);
373 control_client_socket(GIOChannel *chan);
379 key_press_cb (GtkWidget* window, GdkEventKey* event);
382 run_keycmd(const gboolean key_ret);
385 exec_paramcmd(const Action* act, const guint i);
388 initialize (int argc, char *argv[]);
403 run_handler (const gchar *act, const gchar *args);
406 add_binding (const gchar *key, const gchar *act);
409 get_xdg_var (XDG_Var xdg);
412 find_xdg_file (int xdg_type, const char* filename);
418 search_text (WebKitWebView *page, GArray *argv, const gboolean forward);
421 search_forward_text (WebKitWebView *page, GArray *argv, GString *result);
424 search_reverse_text (WebKitWebView *page, GArray *argv, GString *result);
427 dehilight (WebKitWebView *page, GArray *argv, GString *result);
430 run_js (WebKitWebView * web_view, GArray *argv, GString *result);
433 run_external_js (WebKitWebView * web_view, GArray *argv, GString *result);
436 eval_js(WebKitWebView * web_view, gchar *script, GString *result);
438 void handle_cookies (SoupSession *session,
442 save_cookies (SoupMessage *msg,
446 set_var(WebKitWebView *page, GArray *argv, GString *result);
449 act_bind(WebKitWebView *page, GArray *argv, GString *result);
455 dump_var_hash(gpointer k, gpointer v, gpointer ud);
458 dump_key_hash(gpointer k, gpointer v, gpointer ud);
467 update_gui(WebKitWebView *page, GArray *argv, GString *result);
470 configure_event_cb(GtkWidget* window, GdkEventConfigure* event);
472 typedef void (*Command)(WebKitWebView*, GArray *argv, GString *result);
478 /* Command callbacks */
492 cmd_cookie_handler();
495 cmd_scheme_handler();
501 cmd_always_insert_mode();
510 cmd_max_conns_host();
512 /* exported WebKitWebSettings properties */
518 cmd_default_font_family();
521 cmd_monospace_font_family();
524 cmd_sans_serif_font_family();
527 cmd_serif_font_family();
530 cmd_cursive_font_family();
533 cmd_fantasy_font_family();
539 cmd_disable_plugins();
542 cmd_disable_scripts();
545 cmd_minimum_font_size();
563 cmd_autoshrink_img();
566 cmd_enable_spellcheck();
569 cmd_enable_private();
581 cmd_default_encoding();
590 cmd_caret_browsing();
595 /* vi: set et ts=4: */