PageRenderTime 106ms CodeModel.GetById 41ms app.highlight 28ms RepoModel.GetById 32ms app.codeStats 0ms

/Build/vimprobable2-git/config.h

https://bitbucket.org/jasonwryan/eeepc
C++ Header | 223 lines | 157 code | 21 blank | 45 comment | 0 complexity | b33d63c38806a829ed4ce6d2ab49d705 MD5 | raw file
  1/*
  2    (c) 2009 by Leon Winter
  3    (c) 2009-2012 by Hannes Schueller
  4    (c) 2009-2010 by Matto Fransen
  5    (c) 2010-2011 by Hans-Peter Deifel
  6    (c) 2010-2011 by Thomas Adam
  7    (c) 2011 by Albert Kim
  8    see LICENSE file
  9*/
 10
 11/* Vimprobable version number */
 12#define VERSION "1.2.0"
 13#define INTERNAL_VERSION "Vimprobable2/"VERSION
 14
 15/* general settings */
 16char startpage[MAX_SETTING_SIZE]      = "https://bbs.archlinux.org/";
 17char useragent[MAX_SETTING_SIZE]      = "Vimprobable2/" VERSION;
 18char acceptlanguage[MAX_SETTING_SIZE] = "";
 19static const gboolean enablePlugins     = TRUE; /* TRUE keeps plugins enabled */
 20static const gboolean enableJava        = TRUE; /* FALSE disables Java applets */
 21static const gboolean enablePagecache   = FALSE; /* TRUE turns on the page cache. */
 22static gboolean escape_input_on_load    = TRUE; /* TRUE will disable automatic focusing of input fields via Javascript*/
 23char temp_dir[MAX_SETTING_SIZE]         = "/tmp"; /* location of temporary files, default will be overridden if TEMPDIR is set */
 24
 25/* appearance */
 26char statusbgcolor[MAX_SETTING_SIZE]    = "#222222";            /* background color for status bar */
 27char statuscolor[MAX_SETTING_SIZE]      = "#696969";            /* color for status bar */
 28char sslbgcolor[MAX_SETTING_SIZE]       = "#222222";            /* background color for status bar with SSL url */
 29char sslinvalidbgcolor[MAX_SETTING_SIZE]= "#8A2F58";            /* background color for status bar with unverified SSL url */
 30char sslcolor[MAX_SETTING_SIZE]         = "#53A6A6";            /* color for status bar with SSL url */
 31
 32                                        /*  normal,                 warning,                error       */
 33static const char *urlboxfont[]         = { "Envy Code R 9",   "Droid Sans Mono Slashed 9",   "Droid Sans Mono Slashed 9"};
 34static const char *urlboxcolor[]        = { "#CCCCCC",              "#CC99CC",              "#FFB6C1" };
 35static const char *urlboxbgcolor[]      = { "#212121",              "#111111",              "#212121" };
 36
 37                                        /*  normal,                 error               */
 38static const char *completionfont[]     = { "Envy Code R 9",   "Droid Sans Mono Slashed 9" };
 39                                                                                        /* topborder color */
 40static const char *completioncolor[]    = { "#899CA1",              "#BF4D80",              "#444444" };
 41                                                                                        /* current row background */
 42static const char *completionbgcolor[]  = { "#3D3D3D",              "#8C4665",              "#5C5C5C" };
 43/* pango markup for prefix highliting:      opening,                closing             */
 44#define             COMPLETION_TAG_OPEN     "<b>"
 45#define             COMPLETION_TAG_CLOSE    "</b>"
 46
 47static const char statusfont[]          = "Envy Code R 9";   /* font for status bar */
 48#define             ENABLE_HISTORY_INDICATOR
 49#define             ENABLE_INCREMENTAL_SEARCH
 50#define             ENABLE_GTK_PROGRESS_BAR
 51#define             ENABLE_WGET_PROGRESS_BAR
 52static const int progressbartick        = 20;
 53static const char progressborderleft    = '[';
 54static const char progressbartickchar   = '=';
 55static const char progressbarcurrent    = '>';
 56static const char progressbarspacer     = ' ';
 57static const char progressborderright   = ']';
 58
 59/* external handlers:
 60 * the handle (first string) contain what the handled links have to start with
 61 * the handlers (second string) contain the external applications which should be called for this sort of link
 62 *    %s can be used as a placeholder for the link argument after the handler
 63 *    e.g.: "mailto:user@example.org
 64 *       "handle" is "mailto:"
 65 *       "%s" will translate to "user@example.org"
 66 */
 67static URIHandler uri_handlers[] = {
 68    { "mailto:",          "urxvtc -e mutt %s" },
 69    { "ftp://",           "urxvt -e wget ftp://%s" },
 70    { "vimprobableedit:", "urxvt -title scratchpad -geometry 84x18+32+50 -e vim %s" },
 71};
 72
 73/* cookies */
 74#define             ENABLE_COOKIE_SUPPORT
 75#define             COOKIES_STORAGE_FILENAME    "%s/vimprobable/cookies", config_base
 76#define             COOKIES_STORAGE_READONLY    FALSE   /* if TRUE new cookies will be lost if you quit */
 77
 78/* downloads directory */
 79#define             DOWNLOADS_PATH              "%s", getenv("HOME")
 80
 81/* font size */
 82#define             DEFAULT_FONT_SIZE           13
 83
 84/* user styles */
 85#define             USER_STYLESHEET             "%s/vimprobable/style.css", config_base
 86
 87/* user javascript */
 88#define             ENABLE_USER_SCRIPTFILE
 89#define             USER_SCRIPTFILE             "%s/vimprobable/scripts.js", config_base
 90
 91/* ssl */
 92static gboolean strict_ssl              = TRUE; /* FALSE will accept any SSL certificate at face value */
 93static char ca_bundle[MAX_SETTING_SIZE] = "/etc/ssl/certs/ca-certificates.crt";
 94
 95/* proxy */
 96static const gboolean use_proxy         = TRUE; /* TRUE if you're going to use a proxy (whose address
 97                                                  is specified in http_proxy environment variable), false otherwise */
 98/* scrolling */
 99static unsigned int scrollstep          = 40;   /* cursor difference in pixel */
100static unsigned int pagingkeep          = 40;   /* pixels kept when paging */
101#define             DISABLE_SCROLLBAR
102
103/* searching */
104#define             ENABLE_MATCH_HIGHLITING
105static const int searchoptions          = CaseInsensitive | Wrapping;
106gboolean complete_case_sensitive        = TRUE;
107
108/* search engines */
109static Searchengine searchengines[] = {
110    { "d",         "https://duckduckgo.com/html/?q=%s&t=Vimprobable" },
111    { "g",         "http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l&q=%s" },
112    { "a",         "https://wiki.archlinux.org/index.php?title=Special%%3ASearch&search=%s&go=Go" },
113    { "w",         "https://secure.wikimedia.org/wikipedia/en/w/index.php?title=Special%%3ASearch&search=%s&go=Go" },
114    { "b",         "http://www.google.com/search?q=site:bbs.archlinux.org+%s" },
115    /* Hack to shorten urls */
116    { "B",         "http://api.bit.ly/v3/shorten?login=jasonwryan&apikey=R_b71a9d75eecaed78de197596f35126d9&longUrl=%s&format=txt" },
117};
118
119static char defaultsearch[MAX_SETTING_SIZE] = "d";
120
121/* command mapping */
122Command commands[COMMANDSIZE] = {
123    /* command,                                        	function,         argument */
124    { "ba",                                            	navigate,         {NavigationBack} },
125    { "back",                                          	navigate,         {NavigationBack} },
126    { "ec",                                            	script,           {Info} },
127    { "echo",                                          	script,           {Info} },
128    { "echoe",                                         	script,           {Error} },
129    { "echoerr",                                       	script,           {Error} },
130    { "fw",                                            	navigate,         {NavigationForward} },
131    { "fo",                                            	navigate,         {NavigationForward} },
132    { "forward",                                       	navigate,         {NavigationForward} },
133    { "javascript",                                    	script,           {Silent} },
134    { "o",                                             	open_arg,         {TargetCurrent} },
135    { "open",                                          	open_arg,         {TargetCurrent} },
136    { "q",                                             	quit,             {0} },
137    { "quit",                                          	quit,             {0} },
138    { "re",                                            	navigate,         {NavigationReload} },
139    { "re!",                                           	navigate,         {NavigationForceReload} },
140    { "reload",                                        	navigate,         {NavigationReload} },
141    { "reload!",                                       	navigate,         {NavigationForceReload} },
142    { "qt",                                             search_tag,       {0} },
143    { "st",                                            	navigate,         {NavigationCancel} },
144    { "stop",                                          	navigate,         {NavigationCancel} },
145    { "t",                                             	open_arg,         {TargetNew} },
146    { "tabopen",                                       	open_arg,         {TargetNew} },
147    { "print",                                         	print_frame,      {0} },
148    { "bma",                                           	bookmark,         {0} },
149    { "bookmark",                                      	bookmark,         {0} },
150    { "source",                                        	view_source,      {0} },
151    { "openeditor",                                   	open_editor,      {0} },
152    { "set",                                           	browser_settings, {0} },
153    { "map",                                           	mappings,         {0} },
154    { "inspect",                                        open_inspector,   {0} },
155    { "jumpleft",                                       scroll,           {ScrollJumpTo   | DirectionLeft} },
156    { "jumpright",                                      scroll,           {ScrollJumpTo   | DirectionRight} },
157    { "jumptop",                                        scroll,           {ScrollJumpTo   | DirectionTop} },
158    { "jumpbottom",                                     scroll,           {ScrollJumpTo   | DirectionBottom} },
159    { "pageup",                                         scroll,           {ScrollMove     | DirectionTop      | UnitPage} },	
160    { "pagedown",                                       scroll,           {ScrollMove     | DirectionBottom   | UnitPage} },
161    { "navigationback",   	                            navigate,         {NavigationBack} },
162    { "navigationforward",	                            navigate,         {NavigationForward} },
163    { "scrollleft",                                     scroll,           {ScrollMove     | DirectionLeft     | UnitLine} },
164    { "scrollright",                                    scroll,           {ScrollMove     | DirectionRight    | UnitLine} },
165    { "scrollup",                                       scroll,           {ScrollMove     | DirectionTop      | UnitLine} },
166    { "scrolldown",                                     scroll,           {ScrollMove     | DirectionBottom   | UnitLine} },
167};
168
169/* mouse bindings
170   you can use MOUSE_BUTTON_1 to MOUSE_BUTTON_5
171*/
172static Mouse mouse[] = {
173    /* modmask,             modkey,         button,            function,        argument */
174    { 0,                    0,              MOUSE_BUTTON_2,    paste,           {TargetCurrent  | ClipboardPrimary  | ClipboardGTK, rememberedURI} },
175    { GDK_CONTROL_MASK,     0,              MOUSE_BUTTON_2,    paste,           {TargetNew  | ClipboardPrimary  | ClipboardGTK} },
176    { GDK_CONTROL_MASK,     0,              MOUSE_BUTTON_1,    open_remembered, {TargetNew} },
177};
178
179/* settings (arguments of :set command) */
180static Setting browsersettings[] = {
181    /* public name,      internal variable   webkit setting                 integer value?  boolean value?   colour value?   reload page? */
182    { "useragent",       useragent,          "user-agent",                  FALSE,          FALSE,           FALSE,          FALSE  },
183    { "scripts",         NULL,               "enable-scripts",              FALSE,          TRUE,            FALSE,          FALSE  },
184    { "plugins",         NULL,               "enable-plugins",              FALSE,          TRUE,            FALSE,          FALSE  },
185    { "pagecache",       NULL,               "enable-page-cache",           FALSE,          TRUE,            FALSE,          FALSE  },
186    { "java",            NULL,               "enable-java-applet",          FALSE,          TRUE,            FALSE,          FALSE  },
187    { "images",          NULL,               "auto-load-images",            FALSE,          TRUE,            FALSE,          FALSE  },
188    { "shrinkimages",    NULL,               "auto-shrink-images",          FALSE,          TRUE,            FALSE,          FALSE  },
189    { "cursivefont",     NULL,               "cursive-font-family",         FALSE,          FALSE,           FALSE,          FALSE  },
190    { "defaultencoding", NULL,               "default-encoding",            FALSE,          FALSE,           FALSE,          FALSE  },
191    { "defaultfont",     NULL,               "default-font-family",         FALSE,          FALSE,           FALSE,          FALSE  },
192    { "fontsize",        NULL,               "default-font-size",           TRUE,           FALSE,           FALSE,          FALSE  },
193    { "monofontsize",    NULL,               "default-monospace-font-size", TRUE,           FALSE,           FALSE,          FALSE  },
194    { "caret",           NULL,               "enable-caret-browsing",       FALSE,          TRUE,            FALSE,          FALSE  },
195    { "fantasyfont",     NULL,               "fantasy-font-family",         FALSE,          FALSE,           FALSE,          FALSE  },
196    { "minimumfontsize", NULL,               "minimum-font-size",           TRUE,           FALSE,           FALSE,          FALSE  },
197    { "monofont",        NULL,               "monospace-font-family",       FALSE,          FALSE,           FALSE,          FALSE  },
198    { "backgrounds",     NULL,               "print-backgrounds",           FALSE,          TRUE,            FALSE,          FALSE  },
199    { "sansfont",        NULL,               "sans-serif-font-family",      FALSE,          FALSE,           FALSE,          FALSE  },
200    { "seriffont",       NULL,               "serif-font-family",           FALSE,          FALSE,           FALSE,          FALSE  },
201    { "stylesheet",      NULL,               "user-stylesheet-uri",         FALSE,          FALSE,           FALSE,          FALSE  },
202    { "resizetextareas", NULL,               "resizable-text-areas",        FALSE,          TRUE,            FALSE,          FALSE  },
203    { "webinspector",    NULL,               "enable-developer-extras",     FALSE,          TRUE,            FALSE,          FALSE  },
204
205    { "homepage",        startpage,          "",                            FALSE,          FALSE,           FALSE,          FALSE  },
206    { "statusbgcolor",   statusbgcolor,      "",                            FALSE,          FALSE,           TRUE,           TRUE   },
207    { "statuscolor",     statuscolor,        "",                            FALSE,          FALSE,           TRUE,           TRUE   },
208    { "sslbgcolor",      sslbgcolor,         "",                            FALSE,          FALSE,           TRUE,           TRUE   },
209    { "sslcolor",        sslcolor,           "",                            FALSE,          FALSE,           TRUE,           TRUE   },
210    { "acceptlanguage",  acceptlanguage,     "",                            FALSE,          FALSE,           FALSE,          FALSE  },
211    { "defaultsearch",   defaultsearch,      "",                            FALSE,          FALSE,           FALSE,          FALSE  },
212    { "qmark",           NULL,               "",                            FALSE,          FALSE,           FALSE,          FALSE  },
213    { "proxy",           NULL,               "",                            FALSE,          TRUE,            FALSE,          FALSE  },
214    { "windowsize",      NULL,               "",                            FALSE,          FALSE,           FALSE,          FALSE  },
215    { "scrollbars",      NULL,               "",                            FALSE,          TRUE,            FALSE,          FALSE  },
216    { "statusbar",       NULL,               "",                            FALSE,          TRUE,            FALSE,          FALSE  },
217    { "inputbox",        NULL,               "",                            FALSE,          TRUE,            FALSE,          FALSE  },
218    { "completioncase",  NULL,               "",                            FALSE,          TRUE,            FALSE,          FALSE  },
219    { "escapeinput",     NULL,               "",                           FALSE,          TRUE,            FALSE,          FALSE  },
220    { "strictssl",       NULL,               "",                            FALSE,          TRUE,            FALSE,          FALSE  },
221    { "cabundle",        ca_bundle,          "",                            FALSE,          FALSE,           FALSE,          FALSE  },
222    { "tempdir",         temp_dir,           "",                            FALSE,          FALSE,           FALSE,          FALSE  },
223};