link following from Jan Kolkmeier (jouz)
[uzbl-00z.git] / uzbl.h
bloba0af6eae5fae123377c5cf1da69ccfbee09a9e99
1 /* status bar elements */
2 typedef struct {
3 gint load_progress;
4 } StatusBar;
6 /* gui elements */
7 typedef struct {
8 GtkWidget* main_window;
9 GtkWidget* mainbar;
10 GtkWidget* mainbar_label;
11 GtkScrollbar* scbar_v; // Horizontal and Vertical Scrollbar
12 GtkScrollbar* scbar_h; // (These are still hidden)
13 GtkAdjustment* bar_v; // Information about document length
14 GtkAdjustment* bar_h; // and scrolling position
15 WebKitWebView* web_view;
16 gchar* main_title;
18 StatusBar sbar;
19 } GUI;
21 /* external communication*/
22 typedef struct {
23 char fifo_path[64];
24 char socket_path[108];
25 } Communication;
27 /* internal state */
28 typedef struct {
29 gchar *uri;
30 gchar *config_file;
31 gchar *instance_name;
32 gchar config_file_path[500];
33 } State;
35 /* main uzbl data structure */
36 typedef struct {
37 GUI gui;
38 Communication comm;
39 State state;
40 int xwin;
41 } Uzbl;
43 typedef struct {
44 char* name;
45 char* param;
46 } Action;
49 void
50 eprint(const char *errstr, ...);
52 char *
53 estrdup(const char *str);
55 char *
56 itos(int val);
58 static gboolean
59 new_window_cb (WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, WebKitWebNavigationAction *navigation_action, WebKitWebPolicyDecision *policy_decision, gpointer user_data);
61 WebKitWebView*
62 create_web_view_cb (WebKitWebView *web_view, WebKitWebFrame *frame, gpointer user_data);
64 static gboolean
65 download_cb (WebKitWebView *web_view, GObject *download, gpointer user_data);
67 static void
68 toggle_status_cb (WebKitWebView* page, const char *param);
70 static void
71 link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data);
73 static void
74 title_change_cb (WebKitWebView* web_view, WebKitWebFrame* web_frame, const gchar* title, gpointer data);
76 static void
77 progress_change_cb (WebKitWebView* page, gint progress, gpointer data);
79 static void
80 load_commit_cb (WebKitWebView* page, WebKitWebFrame* frame, gpointer data);
82 static void
83 destroy_cb (GtkWidget* widget, gpointer data);
85 static void
86 log_history_cb ();
88 static void
89 commands_hash(void);
91 void
92 free_action(gpointer act);
94 Action*
95 new_action(const gchar *name, const gchar *param);
97 static bool
98 file_exists (const char * filename);
100 void
101 set_insert_mode(WebKitWebView *page, const gchar *param);
103 static void
104 load_uri (WebKitWebView * web_view, const gchar *param);
106 static void
107 new_window_load_uri (const gchar * uri);
109 static void
110 close_uzbl (WebKitWebView *page, const char *param);
112 static gboolean
113 run_command(const char *command, const char *args);
115 static void
116 spawn(WebKitWebView *web_view, const char *param);
118 static void
119 parse_command(const char *cmd, const char *param);
121 static void
122 parse_line(char *line);
124 void
125 build_stream_name(int type);
127 static void
128 control_fifo(GIOChannel *gio, GIOCondition condition);
130 static void
131 create_fifo();
133 static void
134 create_socket();
136 static void
137 control_socket(GIOChannel *chan);
140 static void
141 update_title (void);
143 static gboolean
144 key_press_cb (WebKitWebView* page, GdkEventKey* event);
146 static GtkWidget*
147 create_browser ();
149 static GtkWidget*
150 create_mainbar ();
152 static
153 GtkWidget* create_window ();
155 static void
156 add_binding (const gchar *key, const gchar *act);
158 static void
159 settings_init ();
161 static void
162 search_text (WebKitWebView *page, const char *param);
164 static void
165 run_js (WebKitWebView * web_view, const gchar *param);
167 static char *
168 str_replace (const char* search, const char* replace, const char* string);
170 /* vi: set et ts=4: */