PageRenderTime 3ms CodeModel.GetById 2ms app.highlight 25ms RepoModel.GetById 1ms app.codeStats 0ms

/vimprobable/config.h

https://bitbucket.org/jasonwryan/workstation
C++ Header | 194 lines | 140 code | 19 blank | 35 comment | 0 complexity | 9ab353c930388b6a1515e49543491637 MD5 | raw file
  1/*
  2    (c) 2009 by Leon Winter
  3    (c) 2009-2011 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 "0.9.10.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. */
 22
 23/* appearance */
 24char statusbgcolor[MAX_SETTING_SIZE]    = "#333333";            /* background color for status bar */
 25char statuscolor[MAX_SETTING_SIZE]      = "#696969";            /* color for status bar */
 26char sslbgcolor[MAX_SETTING_SIZE]       = "#333333";            /* background color for status bar with SSL url */
 27char sslcolor[MAX_SETTING_SIZE]         = "#959FA7";            /* color for status bar with SSL url */
 28
 29                                        /*  normal,                 warning,                error       */
 30static const char *urlboxfont[]         = { "Envy Code R 9",   "Droid Sans Mono Slashed 9",   "Droid Sans Mono Slashed 9"};
 31static const char *urlboxcolor[]        = { "#CCCCCC",              "#CC99CC",              "#FFB6C1" };
 32static const char *urlboxbgcolor[]      = { "#212121",              "#111111",              "#212121" };
 33
 34                                        /*  normal,                 error               */
 35static const char *completionfont[]     = { "Envy Code R 9",   "Droid Sans Mono Slashed 9" };
 36                                                                                        /* topborder color */
 37static const char *completioncolor[]    = { "#899CA1",              "#BF4D80",              "#444444" };
 38                                                                                        /* current row background */
 39static const char *completionbgcolor[]  = { "#3D3D3D",              "#8C4665",              "#5C5C5C" };
 40/* pango markup for prefix highliting:      opening,                closing             */
 41#define             COMPLETION_TAG_OPEN     "<b>"
 42#define             COMPLETION_TAG_CLOSE    "</b>"
 43
 44static const char statusfont[]          = "Envy Code R 9";   /* font for status bar */
 45#define             ENABLE_HISTORY_INDICATOR
 46#define             ENABLE_INCREMENTAL_SEARCH
 47#define             ENABLE_GTK_PROGRESS_BAR
 48#define             ENABLE_WGET_PROGRESS_BAR
 49static const int progressbartick        = 20;
 50static const char progressborderleft    = '[';
 51static const char progressbartickchar   = '=';
 52static const char progressbarcurrent    = '>';
 53static const char progressbarspacer     = ' ';
 54static const char progressborderright   = ']';
 55
 56static const char *handler_types[]      = { "mailto:", "ftp://" };
 57static const char *handlers[]           = { "urxvtc -e mutt %s", "x-terminal-emulator -e wget ftp://%s" };
 58  
 59/* cookies */
 60#define             ENABLE_COOKIE_SUPPORT
 61#define             COOKIES_STORAGE_FILENAME    "%s/vimprobable/cookies", config_base
 62#define             COOKIES_STORAGE_READONLY    FALSE   /* if TRUE new cookies will be lost if you quit */
 63
 64/* downloads directory */
 65#define             DOWNLOADS_PATH              "%s", getenv("HOME")
 66
 67/* font size */
 68#define             DEFAULT_FONT_SIZE           12
 69
 70/* user styles */
 71#define             USER_STYLESHEET             "%s/vimprobable/style.css", config_base
 72
 73/* proxy */
 74static const gboolean use_proxy         = TRUE; /* TRUE if you're going to use a proxy (whose address
 75                                                  is specified in http_proxy environment variable), false otherwise */
 76/* scrolling */
 77static unsigned int scrollstep          = 40;   /* cursor difference in pixel */
 78static unsigned int pagingkeep          = 40;   /* pixels kept when paging */
 79#define             DISABLE_SCROLLBAR
 80
 81/* searching */
 82#define             ENABLE_MATCH_HIGHLITING
 83static const int searchoptions          = CaseInsensitive | Wrapping;
 84gboolean complete_case_sensitive        = TRUE;
 85
 86/* search engines */
 87static Searchengine searchengines[] = {
 88    { "d",         "http://duckduckgo.com/?q=%s" },
 89    { "g",         "http://www.google.com/search?hl=en&source=hp&ie=ISO-8859-l&q=%s" },
 90    { "a",         "https://wiki.archlinux.org/index.php?title=Special%%3ASearch&search=%s&go=Go" },
 91    { "w",         "https://secure.wikimedia.org/wikipedia/en/w/index.php?title=Special%%3ASearch&search=%s&go=Go" },
 92    { "b",         "http://www.google.com/search?q=site:bbs.archlinux.org+%s" },
 93    /* Hack to shorten urls */
 94    { "s",         "http://api.bit.ly/v3/shorten?login=jasonwryan&apikey=R_b71a9d75eecaed78de197596f35126d9&longUrl=%s&format=txt" },
 95};
 96
 97static char defaultsearch[MAX_SETTING_SIZE] = "d";
 98
 99/* command mapping */
100Command commands[COMMANDSIZE] = {
101    /* command,                                        	function,         argument */
102    { "ba",                                            	navigate,         {NavigationBack} },
103    { "back",                                          	navigate,         {NavigationBack} },
104    { "ec",                                            	script,           {Info} },
105    { "echo",                                          	script,           {Info} },
106    { "echoe",                                         	script,           {Error} },
107    { "echoerr",                                       	script,           {Error} },
108    { "fw",                                            	navigate,         {NavigationForward} },
109    { "fo",                                            	navigate,         {NavigationForward} },
110    { "forward",                                       	navigate,         {NavigationForward} },
111    { "javascript",                                    	script,           {Silent} },
112    { "o",                                             	open_arg,         {TargetCurrent} },
113    { "open",                                          	open_arg,         {TargetCurrent} },
114    { "q",                                             	quit,             {0} },
115    { "quit",                                          	quit,             {0} },
116    { "re",                                            	navigate,         {NavigationReload} },
117    { "re!",                                           	navigate,         {NavigationForceReload} },
118    { "reload",                                        	navigate,         {NavigationReload} },
119    { "reload!",                                       	navigate,         {NavigationForceReload} },
120    { "qt",                                             search_tag,       {0} },
121    { "st",                                            	navigate,         {NavigationCancel} },
122    { "stop",                                          	navigate,         {NavigationCancel} },
123    { "t",                                             	open_arg,         {TargetNew} },
124    { "tabopen",                                       	open_arg,         {TargetNew} },
125    { "print",                                         	print_frame,      {0} },
126    { "bma",                                           	bookmark,         {0} },
127    { "bookmark",                                      	bookmark,         {0} },
128    { "source",                                        	view_source,      {0} },
129    { "set",                                           	browser_settings, {0} },
130    { "map",                                           	mappings,         {0} },
131    { "jumpleft",                                       scroll,           {ScrollJumpTo   | DirectionLeft} },
132    { "jumpright",                                      scroll,           {ScrollJumpTo   | DirectionRight} },
133    { "jumptop",                                        scroll,           {ScrollJumpTo   | DirectionTop} },
134    { "jumpbottom",                                     scroll,           {ScrollJumpTo   | DirectionBottom} },
135    { "pageup",                                         scroll,           {ScrollMove     | DirectionTop      | UnitPage} },	
136    { "pagedown",                                       scroll,           {ScrollMove     | DirectionBottom   | UnitPage} },
137    { "navigationback",   	                            navigate,         {NavigationBack} },
138    { "navigationforward",	                            navigate,         {NavigationForward} },
139    { "scrollleft",                                     scroll,           {ScrollMove     | DirectionLeft     | UnitLine} },
140    { "scrollright",                                    scroll,           {ScrollMove     | DirectionRight    | UnitLine} },
141    { "scrollup",                                       scroll,           {ScrollMove     | DirectionTop      | UnitLine} },
142    { "scrolldown",                                     scroll,           {ScrollMove     | DirectionBottom   | UnitLine} },
143};
144
145/* mouse bindings
146   you can use MOUSE_BUTTON_1 to MOUSE_BUTTON_5
147*/
148static Mouse mouse[] = {
149    /* modmask,             modkey,         button,            function,        argument */
150    { 0,                    0,              MOUSE_BUTTON_2,    paste,           {TargetCurrent  | ClipboardPrimary  | ClipboardGTK, rememberedURI} },
151    { GDK_CONTROL_MASK,     0,              MOUSE_BUTTON_2,    paste,           {TargetNew  | ClipboardPrimary  | ClipboardGTK} },
152    { GDK_CONTROL_MASK,     0,              MOUSE_BUTTON_1,    open_remembered, {TargetNew} },
153};
154
155/* settings (arguments of :set command) */
156static Setting browsersettings[] = {
157    /* public name,      internal variable   webkit setting                 integer value?  boolean value?   colour value?   reload page? */
158    { "useragent",       useragent,          "user-agent",                  FALSE,          FALSE,           FALSE,          FALSE  },
159    { "scripts",         NULL,               "enable-scripts",              FALSE,          TRUE,            FALSE,          FALSE  },
160    { "plugins",         NULL,               "enable-plugins",              FALSE,          TRUE,            FALSE,          FALSE  },
161    { "pagecache",       NULL,               "enable-page-cache",           FALSE,          TRUE,            FALSE,          FALSE  },
162    { "java",            NULL,               "enable-java-applet",          FALSE,          TRUE,            FALSE,          FALSE  },
163    { "images",          NULL,               "auto-load-images",            FALSE,          TRUE,            FALSE,          FALSE  },
164    { "shrinkimages",    NULL,               "auto-shrink-images",          FALSE,          TRUE,            FALSE,          FALSE  },
165    { "cursivefont",     NULL,               "cursive-font-family",         FALSE,          FALSE,           FALSE,          FALSE  },
166    { "defaultencoding", NULL,               "default-encoding",            FALSE,          FALSE,           FALSE,          FALSE  },
167    { "defaultfont",     NULL,               "default-font-family",         FALSE,          FALSE,           FALSE,          FALSE  },
168    { "fontsize",        NULL,               "default-font-size",           TRUE,           FALSE,           FALSE,          FALSE  },
169    { "monofontsize",    NULL,               "default-monospace-font-size", TRUE,           FALSE,           FALSE,          FALSE  },
170    { "caret",           NULL,               "enable-caret-browsing",       FALSE,          TRUE,            FALSE,          FALSE  },
171    { "fantasyfont",     NULL,               "fantasy-font-family",         FALSE,          FALSE,           FALSE,          FALSE  },
172    { "minimumfontsize", NULL,               "minimum-font-size",           TRUE,           FALSE,           FALSE,          FALSE  },
173    { "monofont",        NULL,               "monospace-font-family",       FALSE,          FALSE,           FALSE,          FALSE  },
174    { "backgrounds",     NULL,               "print-backgrounds",           FALSE,          TRUE,            FALSE,          FALSE  },
175    { "sansfont",        NULL,               "sans-serif-font-family",      FALSE,          FALSE,           FALSE,          FALSE  },
176    { "seriffont",       NULL,               "serif-font-family",           FALSE,          FALSE,           FALSE,          FALSE  },
177    { "stylesheet",      NULL,               "user-stylesheet-uri",         FALSE,          FALSE,           FALSE,          FALSE  },
178    { "resizetextareas", NULL,               "resizable-text-areas",        FALSE,          TRUE,            FALSE,          FALSE  },
179    { "webinspector",    NULL,               "enable-developer-extras",     FALSE,          TRUE,            FALSE,          FALSE  },
180
181    { "homepage",        startpage,          "",                            FALSE,          FALSE,           FALSE,          FALSE  },
182    { "statusbgcolor",   statusbgcolor,      "",                            FALSE,          FALSE,           TRUE,           TRUE   },
183    { "statuscolor",     statuscolor,        "",                            FALSE,          FALSE,           TRUE,           TRUE   },
184    { "sslbgcolor",      sslbgcolor,         "",                            FALSE,          FALSE,           TRUE,           TRUE   },
185    { "sslcolor",        sslcolor,           "",                            FALSE,          FALSE,           TRUE,           TRUE   },
186    { "acceptlanguage",  acceptlanguage,     "",                            FALSE,          FALSE,           FALSE,          FALSE  },
187    { "defaultsearch",   defaultsearch,      "",                            FALSE,          FALSE,           FALSE,          FALSE  },
188    { "qmark",           NULL,               "",                            FALSE,          FALSE,           FALSE,          FALSE  },
189    { "proxy",           NULL,               "",                            FALSE,          TRUE,            FALSE,          FALSE  },
190    { "scrollbars",      NULL,               "",                            FALSE,          TRUE,            FALSE,          FALSE  },
191    { "statusbar",       NULL,               "",                            FALSE,          TRUE,            FALSE,          FALSE  },
192    { "inputbox",        NULL,               "",                            FALSE,          TRUE,            FALSE,          FALSE  },
193    { "completioncase",  NULL,               "",                            FALSE,          TRUE,            FALSE,          FALSE  },
194};