diff options
Diffstat (limited to 'uzbl.h')
-rw-r--r-- | uzbl.h | 111 |
1 files changed, 96 insertions, 15 deletions
@@ -1,9 +1,89 @@ +/* statusbar symbols */ +enum { SYM_TITLE, SYM_URI, SYM_NAME, + SYM_LOADPRGS, SYM_LOADPRGSBAR, + SYM_KEYCMD, SYM_MODE}; +const struct { + gchar *symbol_name; + guint symbol_token; +} symbols[] = { + {"NAME", SYM_NAME}, + {"URI", SYM_URI}, + {"TITLE", SYM_TITLE}, + {"KEYCMD", SYM_KEYCMD}, + {"MODE", SYM_MODE}, + {"LOAD_PROGRESS", SYM_LOADPRGS}, + {"LOAD_PROGRESSBAR", SYM_LOADPRGSBAR}, + {NULL, 0} +}, *symp = symbols; + +/* status bar elements */ +typedef struct { + gint load_progress; +} StatusBar; + +/* gui elements */ +typedef struct { + GtkWidget* main_window; + GtkWidget* mainbar; + GtkWidget* mainbar_label; + GtkScrollbar* scbar_v; // Horizontal and Vertical Scrollbar + GtkScrollbar* scbar_h; // (These are still hidden) + GtkAdjustment* bar_v; // Information about document length + GtkAdjustment* bar_h; // and scrolling position + WebKitWebView* web_view; + gchar* main_title; + + StatusBar sbar; +} GUI; + +/* external communication*/ +typedef struct { + char fifo_path[64]; + char socket_path[108]; +} Communication; + +/* internal state */ +typedef struct { + gchar *uri; + gchar *config_file; + gchar *instance_name; + gchar config_file_path[500]; +} State; + +typedef struct { + SoupSession *soup_session; + SoupLogger *soup_logger; + char *proxy_url; + char *useragent; + gint max_conns; + gint max_conns_host; +} Network; + + +/* main uzbl data structure */ +typedef struct { + GUI gui; + Communication comm; + State state; + Network net; + Window xwin; + GScanner *scan; +} Uzbl; + typedef struct { char* name; char* param; } Action; + +/* Functions */ +static void +setup_scanner(); + +char * +itos(int val); + static gboolean new_window_cb (WebKitWebView *web_view, WebKitWebFrame *frame, WebKitNetworkRequest *request, WebKitWebNavigationAction *navigation_action, WebKitWebPolicyDecision *policy_decision, gpointer user_data); @@ -73,17 +153,21 @@ parse_command(const char *cmd, const char *param); static void parse_line(char *line); +void +build_stream_name(int type); + static void -control_fifo(GIOChannel *fd); +control_fifo(GIOChannel *gio, GIOCondition condition); static void create_fifo(); static void -*control_socket(); - +create_socket(); + static void -setup_threading (); +control_socket(GIOChannel *chan); + static void update_title (void); @@ -106,17 +190,14 @@ add_binding (const gchar *key, const gchar *act); static void settings_init (); -/* static void */ -/* cookie_recieved_action (SoupCookieJar *jar, */ - /* SoupCookie *old_cookie, */ - /* SoupCookie *new_cookie, */ - /* gpointer user_data); */ -/* static void */ -/* catch_cookies (SoupSession *session, */ -/* SoupMessage *msg, */ -/* gpointer user_data); */ -/* /\* SoupSocket *socket, *\/ */ -/* /\* gpointer user_data); *\/ */ +static void +search_text (WebKitWebView *page, const char *param); + +static void +run_js (WebKitWebView * web_view, const gchar *param); + +static char * +str_replace (const char* search, const char* replace, const char* string); static void handle_cookies (SoupSession *session, SoupMessage *msg, |