X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=uzbl.h;h=00a7814203a0c3f72df7070adc996ea30539e77e;hb=f487c98743446a0b1af600338070afc94ed452ba;hp=5ae8ca54157b10450423c8ad5755294c51906c3a;hpb=f679c8c008361962a330e062789ba6c77683e510;p=uzbl-mobile diff --git a/uzbl.h b/uzbl.h index 5ae8ca5..00a7814 100644 --- a/uzbl.h +++ b/uzbl.h @@ -1,4 +1,4 @@ -/* -*- c-basic-offset: 4; -*- +/* -*- c-basic-offset: 4; -*- * See LICENSE for license details * @@ -17,39 +17,14 @@ enum { SYM_LOADPRGS, SYM_LOADPRGSBAR, SYM_KEYCMD, SYM_MODE, SYM_MSG, SYM_SELECTED_URI, - /* useragent symbols */ - SYM_WK_MAJ, SYM_WK_MIN, SYM_WK_MIC, - SYM_SYSNAME, SYM_NODENAME, - SYM_KERNREL, SYM_KERNVER, - SYM_ARCHSYS, SYM_ARCHUZBL, - SYM_DOMAINNAME, SYM_COMMIT }; const struct { gchar *symbol_name; guint symbol_token; } symbols[] = { - {"NAME", SYM_NAME}, - {"URI", SYM_URI}, - {"TITLE", SYM_TITLE}, - {"SELECTED_URI", SYM_SELECTED_URI}, {"KEYCMD", SYM_KEYCMD}, - {"MODE", SYM_MODE}, - {"MSG", SYM_MSG}, - {"LOAD_PROGRESS", SYM_LOADPRGS}, - {"LOAD_PROGRESSBAR", SYM_LOADPRGSBAR}, - - {"WEBKIT_MAJOR", SYM_WK_MAJ}, - {"WEBKIT_MINOR", SYM_WK_MIN}, - {"WEBKIT_MICRO", SYM_WK_MIC}, - {"SYSNAME", SYM_SYSNAME}, - {"NODENAME", SYM_NODENAME}, - {"KERNREL", SYM_KERNREL}, - {"KERNVER", SYM_KERNVER}, - {"ARCH_SYSTEM", SYM_ARCHSYS}, - {"ARCH_UZBL", SYM_ARCHUZBL}, - {"DOMAINNAME", SYM_DOMAINNAME}, - {"COMMIT", SYM_COMMIT}, + {NULL, 0} }, *symp = symbols; @@ -59,12 +34,15 @@ typedef struct { gchar *msg; gchar *progress_s, *progress_u; int progress_w; + gchar *progress_bar; + gchar *mode_indicator; } StatusBar; /* gui elements */ typedef struct { GtkWidget* main_window; + gchar* geometry; GtkPlug* plug; GtkWidget* scrolled_win; GtkWidget* vbox; @@ -93,6 +71,7 @@ typedef struct { gchar *socket_path; /* stores (key)"variable name" -> (value)"pointer to this var*/ GHashTable *proto_var; + gchar *sync_stdout; } Communication; @@ -105,9 +84,8 @@ typedef struct { char *instance_name; gchar *selected_url; gchar *executable_path; - GString* keycmd; + gchar* keycmd; gchar* searchtx; - struct utsname unameinfo; /* system info */ gboolean verbose; } State; @@ -137,6 +115,13 @@ typedef struct { gchar* socket_dir; gchar* download_handler; gchar* cookie_handler; + gchar* new_window; + gchar* default_font_family; + gchar* monospace_font_family; + gchar* sans_serif_font_family; + gchar* serif_font_family; + gchar* fantasy_font_family; + gchar* cursive_font_family; gboolean always_insert_mode; gboolean show_status; gboolean insert_mode; @@ -153,24 +138,25 @@ typedef struct { gfloat zoom_level; guint disable_plugins; guint disable_scripts; - guint autoload_img; - guint autoshrink_img; + guint autoload_img; + guint autoshrink_img; guint enable_spellcheck; - guint enable_private; - guint print_bg; - gchar* style_uri; - guint resizable_txt; - gchar* default_encoding; - guint enforce_96dpi; + guint enable_private; + guint print_bg; + gchar* style_uri; + guint resizable_txt; + gchar* default_encoding; + guint enforce_96dpi; gchar *inject_html; - guint caret_browsing; - guint mode; + guint caret_browsing; + guint mode; gchar* base_url; gchar* html_endmarker; gchar* insert_indicator; gchar* cmd_indicator; GString* html_buffer; - guint html_timeout; + guint html_timeout; + gboolean print_version; /* command list: name -> Command */ GHashTable* commands; @@ -183,6 +169,15 @@ typedef struct { JSClassRef classref; } Javascript; +/* static information */ +typedef struct { + int webkit_major; + int webkit_minor; + int webkit_micro; + gchar *arch; + gchar *commit; +} Info; + /* main uzbl data structure */ typedef struct { GUI gui; @@ -191,9 +186,9 @@ typedef struct { Behaviour behave; Communication comm; Javascript js; + Info info; Window xwin; - GScanner *scan; /* group bindings: key -> action */ GHashTable* bindings; @@ -214,7 +209,7 @@ typedef struct { gchar* default_value; } XDG_Var; -XDG_Var XDG[] = +XDG_Var XDG[] = { { "XDG_CONFIG_HOME", "~/.config" }, { "XDG_DATA_HOME", "~/.local/share" }, @@ -224,12 +219,6 @@ XDG_Var XDG[] = }; /* Functions */ -gchar * -expand_template(const char *template, gboolean escape_markup); - -void -setup_scanner(); - char * itos(int val); @@ -254,7 +243,7 @@ setup_signal(int signe, sigfunc *shandler); gboolean set_var_value(gchar *name, gchar *val); -static void +void print(WebKitWebView *page, GArray *argv, GString *result); gboolean @@ -269,17 +258,17 @@ create_web_view_cb (WebKitWebView *web_view, WebKitWebFrame *frame, gpointer us gboolean download_cb (WebKitWebView *web_view, GObject *download, gpointer user_data); -static void +void toggle_zoom_type (WebKitWebView* page, GArray *argv, GString *result); -static void +void toggle_status_cb (WebKitWebView* page, GArray *argv, GString *result); void link_hover_cb (WebKitWebView* page, const gchar* title, const gchar* link, gpointer data); void -title_change_cb (WebKitWebView* web_view, WebKitWebFrame* web_frame, const gchar* title, gpointer data); +title_change_cb (WebKitWebView* web_view, GParamSpec param_spec); void progress_change_cb (WebKitWebView* page, gint progress, gpointer data); @@ -311,50 +300,68 @@ new_action(const gchar *name, const gchar *param); bool file_exists (const char * filename); -static void +void +set_keycmd(); + +void +set_mode_indicator(); + +void +update_indicator(); + +void +set_insert_mode(gboolean mode); + +void toggle_insert_mode(WebKitWebView *page, GArray *argv, GString *result); -static void +void load_uri (WebKitWebView * web_view, GArray *argv, GString *result); void new_window_load_uri (const gchar * uri); -static void +void chain (WebKitWebView *page, GArray *argv, GString *result); -static void +void keycmd (WebKitWebView *page, GArray *argv, GString *result); -static void +void keycmd_nl (WebKitWebView *page, GArray *argv, GString *result); -static void +void keycmd_bs (WebKitWebView *page, GArray *argv, GString *result); -static void +void close_uzbl (WebKitWebView *page, GArray *argv, GString *result); gboolean run_command(const gchar *command, const guint npre, const gchar **args, const gboolean sync, char **output_stdout); -static void +char* +build_progressbar_ascii(int percent); + +void +talk_to_socket(WebKitWebView *web_view, GArray *argv, GString *result); + +void spawn(WebKitWebView *web_view, GArray *argv, GString *result); -static void +void spawn_sh(WebKitWebView *web_view, GArray *argv, GString *result); -static void +void spawn_sync(WebKitWebView *web_view, GArray *argv, GString *result); -static void +void spawn_sh_sync(WebKitWebView *web_view, GArray *argv, GString *result); -static void +void parse_command(const char *cmd, const char *param, GString *result); -static void +void parse_cmd_line(const char *ctl_line, GString *result); gchar* @@ -378,10 +385,10 @@ init_socket(gchar *dir); gboolean control_socket(GIOChannel *chan); -static gboolean +gboolean control_client_socket(GIOChannel *chan); -static void +void update_title (void); gboolean @@ -393,7 +400,10 @@ run_keycmd(const gboolean key_ret); void exec_paramcmd(const Action* act, const guint i); -GtkWidget* +void +initialize (); + +void create_browser (); GtkWidget* @@ -402,10 +412,10 @@ create_mainbar (); GtkWidget* create_window (); -static -GtkPlug* create_plug (); +GtkPlug* +create_plug (); -static void +void run_handler (const gchar *act, const gchar *args); void @@ -423,22 +433,22 @@ settings_init (); void search_text (WebKitWebView *page, GArray *argv, const gboolean forward); -static void +void search_forward_text (WebKitWebView *page, GArray *argv, GString *result); -static void +void search_reverse_text (WebKitWebView *page, GArray *argv, GString *result); -static void +void dehilight (WebKitWebView *page, GArray *argv, GString *result); -static void +void run_js (WebKitWebView * web_view, GArray *argv, GString *result); -static void +void run_external_js (WebKitWebView * web_view, GArray *argv, GString *result); -static void +void eval_js(WebKitWebView * web_view, gchar *script, GString *result); void handle_cookies (SoupSession *session, @@ -448,10 +458,10 @@ void save_cookies (SoupMessage *msg, gpointer user_data); -static void +void set_var(WebKitWebView *page, GArray *argv, GString *result); -static void +void act_bind(WebKitWebView *page, GArray *argv, GString *result); void @@ -472,6 +482,15 @@ dump_key_hash(gpointer k, gpointer v, gpointer ud); void dump_config(); +void +retrieve_geometry(); + +void +update_gui(WebKitWebView *page, GArray *argv, GString *result); + +gboolean +configure_event_cb(GtkWidget* window, GdkEventConfigure* event); + typedef void (*Command)(WebKitWebView*, GArray *argv, GString *result); typedef struct { Command function; @@ -495,6 +514,9 @@ void cmd_cookie_handler(); void +cmd_new_window(); + +void move_statusbar(); void @@ -515,6 +537,24 @@ void cmd_font_size(); void +cmd_default_font_family(); + +void +cmd_monospace_font_family(); + +void +cmd_sans_serif_font_family(); + +void +cmd_serif_font_family(); + +void +cmd_cursive_font_family(); + +void +cmd_fantasy_font_family(); + +void cmd_zoom_level(); void @@ -553,22 +593,25 @@ cmd_enable_private(); void cmd_print_bg(); -void +void cmd_style_uri(); -void +void cmd_resizable_txt(); -void +void cmd_default_encoding(); -void +void cmd_enforce_96dpi(); void cmd_inject_html(); -void +void cmd_caret_browsing(); +void +cmd_set_geometry(); + /* vi: set et ts=4: */