2 * See LICENSE for license details
7 * (c) 2009 by Robert Manea
8 * - introduced struct concept
13 /* statusbar symbols */
14 enum { SYM_TITLE
, SYM_URI
, SYM_NAME
,
15 SYM_LOADPRGS
, SYM_LOADPRGSBAR
,
16 SYM_KEYCMD
, SYM_MODE
};
24 {"KEYCMD", SYM_KEYCMD
},
26 {"LOAD_PROGRESS", SYM_LOADPRGS
},
27 {"LOAD_PROGRESSBAR", SYM_LOADPRGSBAR
},
31 /* status bar elements */
39 GtkWidget
* main_window
;
41 GtkWidget
* mainbar_label
;
42 GtkScrollbar
* scbar_v
; // Horizontal and Vertical Scrollbar
43 GtkScrollbar
* scbar_h
; // (These are still hidden)
44 GtkAdjustment
* bar_v
; // Information about document length
45 GtkAdjustment
* bar_h
; // and scrolling position
46 WebKitWebView
* web_view
;
53 /* external communication*/
57 char socket_path
[108];
66 gchar config_file_path
[500];
67 gchar selected_url
[500];
68 char executable_path
[500];
71 struct utsname unameinfo
; /* system info */
77 SoupSession
*soup_session
;
78 SoupLogger
*soup_logger
;
89 gchar
* history_handler
;
92 gchar
* download_handler
;
93 gchar
* cookie_handler
;
94 gboolean always_insert_mode
;
102 /* command list: name -> Command */
103 GHashTable
* commands
;
107 /* main uzbl data structure */
118 /* group bindings: key -> action */
119 GHashTable
* bindings
;
128 typedef void sigfunc(int);
141 catch_sigterm(int s
);
144 setup_signal(int signe
, sigfunc
*shandler
);
147 new_window_cb (WebKitWebView
*web_view
, WebKitWebFrame
*frame
, WebKitNetworkRequest
*request
, WebKitWebNavigationAction
*navigation_action
, WebKitWebPolicyDecision
*policy_decision
, gpointer user_data
);
150 create_web_view_cb (WebKitWebView
*web_view
, WebKitWebFrame
*frame
, gpointer user_data
);
153 download_cb (WebKitWebView
*web_view
, GObject
*download
, gpointer user_data
);
156 toggle_status_cb (WebKitWebView
* page
, const char *param
);
159 link_hover_cb (WebKitWebView
* page
, const gchar
* title
, const gchar
* link
, gpointer data
);
162 title_change_cb (WebKitWebView
* web_view
, WebKitWebFrame
* web_frame
, const gchar
* title
, gpointer data
);
165 progress_change_cb (WebKitWebView
* page
, gint progress
, gpointer data
);
168 load_commit_cb (WebKitWebView
* page
, WebKitWebFrame
* frame
, gpointer data
);
171 destroy_cb (GtkWidget
* widget
, gpointer data
);
180 free_action(gpointer act
);
183 new_action(const gchar
*name
, const gchar
*param
);
186 file_exists (const char * filename
);
189 set_insert_mode(WebKitWebView
*page
, const gchar
*param
);
192 load_uri (WebKitWebView
* web_view
, const gchar
*param
);
195 new_window_load_uri (const gchar
* uri
);
198 close_uzbl (WebKitWebView
*page
, const char *param
);
201 run_command_async(const char *command
, const char *args
);
204 run_command_sync(const char *command
, const char *args
, char **stdout
);
207 spawn(WebKitWebView
*web_view
, const char *param
);
210 parse_command(const char *cmd
, const char *param
);
213 parse_line(char *line
);
216 build_stream_name(int type
);
219 control_fifo(GIOChannel
*gio
, GIOCondition condition
);
228 control_socket(GIOChannel
*chan
);
235 key_press_cb (WebKitWebView
* page
, GdkEventKey
* event
);
244 GtkWidget
* create_window ();
247 add_binding (const gchar
*key
, const gchar
*act
);
253 search_text (WebKitWebView
*page
, const char *param
);
256 run_js (WebKitWebView
* web_view
, const gchar
*param
);
259 str_replace (const char* search
, const char* replace
, const char* string
);
261 static void handle_cookies (SoupSession
*session
,
265 save_cookies (SoupMessage
*msg
,
267 /* vi: set et ts=4: */