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