viking

webkit based web browser for Enlightenment
Log | Files | Refs | LICENSE

commit 3a040473400629806219182ec7c95dbc68e9bd70
parent 5c0c642e2b38ef18e4c7e915c54daeb9078d002e
Author: Kyle Milz <kmilz@ucalgary.ca>
Date:   Fri,  5 Oct 2012 21:19:57 -0600

get rid of some options that are not needed

Diffstat:
Msrc/main.c | 112++++---------------------------------------------------------------------------
Msrc/viking_state.geneet | 4----
2 files changed, 5 insertions(+), 111 deletions(-)

diff --git a/src/main.c b/src/main.c @@ -102,18 +102,6 @@ static const Ecore_Getopt options = { "WebKit-EFL browser for full keyboard computers.", EINA_TRUE, { - // ECORE_GETOPT_STORE_DEF_BOOL('F', "fullscreen", "start in fullscreen.", 1), - ECORE_GETOPT_STORE_DEF_BOOL('P', "disable-plugins", - "disable plugins (flash, etc).", 1), - // ECORE_GETOPT_STORE_DEF_BOOL('M', "disable-mouse", - // "disable mouse (hide it).", 1), - // ECORE_GETOPT_STORE_DEF_BOOL('T', "disable-touch-interface", - // "disable touch interface handling of mouse events", 1), - ECORE_GETOPT_STORE_STR('U', "user-agent", - "user agent string to use. Special cases=iphone,safari,chrome,firefox,android,ie,ie9,ie8,ie7."), - ECORE_GETOPT_STORE_DEF_STR('B', "backing-store", - "backing store to use. single or tiled.", "single"), - // ECORE_GETOPT_STORE_DEF_UINT('R', "rotate", "Screen Rotation in degrees", 0), ECORE_GETOPT_VERSION('V', "version"), ECORE_GETOPT_COPYRIGHT('C', "copyright"), ECORE_GETOPT_LICENSE('L', "license"), @@ -170,23 +158,10 @@ setup_config(App_Data *ad, int argc, char **argv) size_t dirlen; int args; Ecore_Timer *session_save_timer = NULL; - char *user_agent_option = NULL; - const char *user_agent_str; - Eina_Bool disable_plugins = 0xff; - char *backing_store_option = NULL; - Backing_Store backing_store_enum; Eina_Bool quit_option = EINA_FALSE; char *uri; - Eina_Bool disable_mouse_cursor = 0xff; - Eina_Bool disable_touch_interface = 0xff; Ecore_Getopt_Value values[] = { - ECORE_GETOPT_VALUE_BOOL(disable_plugins), - ECORE_GETOPT_VALUE_BOOL(disable_mouse_cursor), - ECORE_GETOPT_VALUE_BOOL(disable_touch_interface), - ECORE_GETOPT_VALUE_STR(user_agent_option), - ECORE_GETOPT_VALUE_STR(backing_store_option), - // ECORE_GETOPT_VALUE_UINT(ad->rotate), ECORE_GETOPT_VALUE_BOOL(quit_option), ECORE_GETOPT_VALUE_BOOL(quit_option), ECORE_GETOPT_VALUE_BOOL(quit_option), @@ -198,42 +173,6 @@ setup_config(App_Data *ad, int argc, char **argv) if (args < 0) ERR("Could not parse command line options."); - // user_agent_option = "chrome"; - - if (!user_agent_option || (user_agent_option && (strcasecmp(user_agent_option, "viking") == 0))) - user_agent_str = "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3 " PACKAGE_NAME "/" PACKAGE_VERSION; - else - { - /* http://www.useragentstring.com/ */ - if (strcasecmp(user_agent_option, "iphone") == 0) - user_agent_str = "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1A543a Safari/419.3"; - else if (strcasecmp(user_agent_option, "safari") == 0) - user_agent_str = "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.17.8 (KHTML, like Gecko) Version/5.0.1 Safari/533.17.8"; - - else if (strcasecmp(user_agent_option, "chrome") == 0) - user_agent_str = "Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.514.0 Safari/534.7"; - else if (strcasecmp(user_agent_option, "firefox") == 0) - user_agent_str = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.2) Gecko/20121223 Firefox/3.8"; - else if (strcasecmp(user_agent_option, "android") == 0) - user_agent_str = "Mozilla/5.0 (Linux; U; Android 2.1; en-US;) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17"; - - else if (strcasecmp(user_agent_option, "ie") == 0) /* last */ - user_agent_str = "Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)"; - else if (strcasecmp(user_agent_option, "ie9") == 0) - user_agent_str = "Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)"; - else if (strcasecmp(user_agent_option, "ie8") == 0) - user_agent_str = "Mozilla/5.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; SLCC1; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET CLR 1.1.4322)"; - else if (strcasecmp(user_agent_option, "ie7") == 0) - user_agent_str = "Mozilla/4.0 (compatible; MSIE 7.0b; Windows NT 6.0)"; - else - user_agent_str = user_agent_option; - } - - if (backing_store_option && !strcasecmp(backing_store_option, "tiled")) - backing_store_enum = BACKING_STORE_TILED; - else - backing_store_enum = BACKING_STORE_SINGLE; - viking_state_init(); dirlen = snprintf(path, sizeof(path), "%s/viking", efreet_config_home_get()); @@ -244,9 +183,6 @@ setup_config(App_Data *ad, int argc, char **argv) if (!ecore_file_mkpath(path)) ERR("Could not create %s", path); - // if (!ewk_settings_icon_database_path_set(path)) - // ERR("Could not set icon database path to %s", path); - basename = path + dirlen; basename[0] = '/'; basename++; @@ -263,38 +199,23 @@ setup_config(App_Data *ad, int argc, char **argv) config = config_load(path); if (!config) { - Eina_Bool enable_mouse_cursor, enable_touch_interface, enable_plugins; - -#define BOOL_OPT(opt) \ - enable_##opt = ((disable_##opt == 0xff) ? EINA_TRUE : !disable_##opt) - BOOL_OPT(mouse_cursor); - BOOL_OPT(touch_interface); - BOOL_OPT(plugins); -#undef BOOL_OPT - config = config_new(EINA_TRUE /* allow_popup */, EINA_TRUE /* enable_auto_load_images */, EINA_TRUE /* enable_auto_shrink_images */, EINA_TRUE /* enable_javascript */, - enable_mouse_cursor, - enable_plugins, EINA_FALSE /* enable_private_mode */, - enable_touch_interface, EINA_TRUE, /* global history */ DEFAULT_URL /* home_page */, NULL /* proxy */, EINA_TRUE /* restore_state */, - user_agent_str, + NULL, /* user agent string */ EINA_FALSE /* frame_flattening */, EINA_FALSE /* text_only_zoom */, 12 /* minimum_font_size */, - EWK_COOKIE_ACCEPT_POLICY_NO_THIRD_PARTY,//ewk_cookies_policy_get(), - backing_store_enum); + EWK_COOKIE_ACCEPT_POLICY_NO_THIRD_PARTY); if (!config_save(config, path)) ERR("Could not save new configuration at %s", path); } - else - config_backing_store_set(config, backing_store_enum); hist = hist_load(path); if (!hist) { @@ -310,32 +231,9 @@ setup_config(App_Data *ad, int argc, char **argv) ERR("Could not save new session file at %s", path); } - session_save_timer = ecore_timer_loop_add(15, _cb_session_save, NULL); - if (!session_save_timer) - ERR("Could not register session save timer"); - -#define BOOL_OPT(opt) \ - if (disable_##opt != 0xff) { \ - Eina_Bool old = config_enable_##opt##_get(config); \ - Eina_Bool cur = !disable_##opt; \ - if (old != cur) { \ - INF("Changed preferences to "#opt"=%hhu", cur); \ - config_enable_##opt##_set(config, cur); \ - } \ - } - // BOOL_OPT(mouse_cursor); - // BOOL_OPT(touch_interface); - BOOL_OPT(plugins); -#undef BOOL_OPT - - if (user_agent_option) { - const char *old = config_user_agent_get(config); - const char *cur = user_agent_str; - if (strcmp(old, cur) != 0) { - INF("Changed preferences to user_agent=\"%s\"", cur); - config_user_agent_set(config, cur); - } - } + session_save_timer = ecore_timer_loop_add(15, _cb_session_save, NULL); + if (!session_save_timer) + ERR("Could not register session save timer"); if (args < argc) { uri = uri_sanitize(argv[args]); diff --git a/src/viking_state.geneet b/src/viking_state.geneet @@ -3,9 +3,6 @@ Config { enable_auto_load_images : uchar; enable_auto_shrink_images : uchar; enable_javascript : uchar; - enable_mouse_cursor : uchar; - enable_plugins : uchar; - enable_private_mode : uchar; enable_touch_interface : uchar; enable_history : uchar; home_page : str default "http://www.getaddrinfo.net"; @@ -16,7 +13,6 @@ Config { text_zoom : int; minimum_font_size : int; cookie_policy : int; - backing_store : int; } Hist_Item {