2 (c) 2009 by Leon Winter
3 (c) 2009, 2010 by Hannes Schueller
4 (c) 2009, 2010 by Matto Fransen
5 (c) 2010 by Hans-Peter Deifel
6 (c) 2010 by Thomas Adam
10 /* general settings */
11 char startpage
[241] = "http://www.vimprobable.org/";
12 char useragent
[120] = "Vimprobable2/0.9.6.3";
13 static const gboolean enablePlugins
= TRUE
; /* TRUE keeps plugins enabled */
14 static const gboolean enableJava
= TRUE
; /* FALSE disables Java applets */
17 char statusbgcolor
[] = "#000000"; /* background color for status bar */
18 char statuscolor
[] = "#ffffff"; /* color for status bar */
19 char sslbgcolor
[] = "#b0ff00"; /* background color for status bar with SSL url */
20 char sslcolor
[] = "#000000"; /* color for status bar with SSL url */
22 /* normal, warning, error */
23 static const char *urlboxfont
[] = { "monospace normal 8", "monospace normal 8", "monospace bold 8"};
24 static const char *urlboxcolor
[] = { NULL
, "#ff0000", "#ffffff" };
25 static const char *urlboxbgcolor
[] = { NULL
, NULL
, "#ff0000" };
28 static const char *completionfont
[] = { "monospace normal 8", "monospace bold 8" };
30 static const char *completioncolor
[] = { "#000000", "#ff00ff", "#000000" };
31 /* current row background */
32 static const char *completionbgcolor
[] = { "#ffffff", "#ffffff", "#fff000" };
33 /* pango markup for prefix highliting: opening, closing */
34 #define COMPLETION_TAG_OPEN "<b>"
35 #define COMPLETION_TAG_CLOSE "</b>"
37 static const char statusfont
[] = "monospace bold 8"; /* font for status bar */
38 #define ENABLE_HISTORY_INDICATOR
39 #define ENABLE_INCREMENTAL_SEARCH
40 #define ENABLE_GTK_PROGRESS_BAR
41 #define ENABLE_WGET_PROGRESS_BAR
42 static const int progressbartick
= 20;
43 static const char progressborderleft
= '[';
44 static const char progressbartickchar
= '=';
45 static const char progressbarcurrent
= '>';
46 static const char progressbarspacer
= ' ';
47 static const char progressborderright
= ']';
50 #define ENABLE_COOKIE_SUPPORT
51 #define COOKIES_STORAGE_FILENAME "%s/.config/vimprobable/cookies", getenv("HOME")
52 #define COOKIES_STORAGE_READONLY FALSE /* if TRUE new cookies will be lost if you quit */
54 /* downloads directory */
55 #define DOWNLOADS_PATH "%s", getenv("HOME")
58 #define DEFAULT_FONT_SIZE 12
61 #define USER_STYLESHEET "%s/.config/vimprobable/style.css", getenv("HOME")
64 static const gboolean use_proxy
= TRUE
; /* TRUE if you're going to use a proxy (whose address
65 is specified in http_proxy environment variable), false otherwise */
67 static unsigned int scrollstep
= 40; /* cursor difference in pixel */
68 static unsigned int pagingkeep
= 40; /* pixels kept when paging */
69 #define DISABLE_SCROLLBAR
72 #define ENABLE_MATCH_HIGHLITING
73 static const int searchoptions
= CaseInsensitive
| Wrapping
;
74 gboolean complete_case_sensitive
= TRUE
;
77 static Searchengine searchengines
[] = {
78 { "i", "http://ixquick.com/do/metasearch.pl?query=%s" },
79 { "s", "https://ssl.scroogle.org/cgi-bin/nbbwssl.cgi?Gw=%s" },
80 { "w", "https://secure.wikimedia.org/wikipedia/en/w/index.php?title=Special%%3ASearch&search=%s&go=Go" },
81 { "wd", "https://secure.wikimedia.org/wikipedia/de/w/index.php?title=Special%%3ASearch&search=%s&go=Go" },
83 static Searchengine
*defsearch
= &searchengines
[0];
86 Command commands
[] = {
87 /* command, function, argument */
88 { "ba", navigate
, {NavigationBack
} },
89 { "back", navigate
, {NavigationBack
} },
90 { "ec", script
, {Info
} },
91 { "echo", script
, {Info
} },
92 { "echoe", script
, {Error
} },
93 { "echoerr", script
, {Error
} },
94 { "fw", navigate
, {NavigationForward
} },
95 { "fo", navigate
, {NavigationForward
} },
96 { "forward", navigate
, {NavigationForward
} },
97 { "javascript", script
, {Silent
} },
98 { "o", open_arg
, {TargetCurrent
} },
99 { "open", open_arg
, {TargetCurrent
} },
101 { "quit", quit
, {0} },
102 { "re", navigate
, {NavigationReload
} },
103 { "re!", navigate
, {NavigationForceReload
} },
104 { "reload", navigate
, {NavigationReload
} },
105 { "reload!", navigate
, {NavigationForceReload
} },
106 { "qt", search_tag
, {0} },
107 { "st", navigate
, {NavigationCancel
} },
108 { "stop", navigate
, {NavigationCancel
} },
109 { "t", open_arg
, {TargetNew
} },
110 { "tabopen", open_arg
, {TargetNew
} },
111 { "print", print_frame
, {0} },
112 { "bma", bookmark
, {0} },
113 { "bookmark", bookmark
, {0} },
114 { "source", view_source
, {0} },
115 { "set", browser_settings
, {0} },
116 { "map", mappings
, {0} },
117 { "jumpleft", scroll
, {ScrollJumpTo
| DirectionLeft
} },
118 { "jumpright", scroll
, {ScrollJumpTo
| DirectionRight
} },
119 { "jumptop", scroll
, {ScrollJumpTo
| DirectionTop
} },
120 { "jumpbottom", scroll
, {ScrollJumpTo
| DirectionBottom
} },
121 { "pageup", scroll
, {ScrollMove
| DirectionTop
| UnitPage
} },
122 { "pagedown", scroll
, {ScrollMove
| DirectionBottom
| UnitPage
} },
123 { "navigationback", navigate
, {NavigationBack
} },
124 { "navigationforward", navigate
, {NavigationForward
} },
125 { "scrollleft", scroll
, {ScrollMove
| DirectionLeft
| UnitLine
} },
126 { "scrollright", scroll
, {ScrollMove
| DirectionRight
| UnitLine
} },
127 { "scrollup", scroll
, {ScrollMove
| DirectionTop
| UnitLine
} },
128 { "scrolldown", scroll
, {ScrollMove
| DirectionBottom
| UnitLine
} },
132 you can use MOUSE_BUTTON_1 to MOUSE_BUTTON_5
134 static Mouse mouse
[] = {
135 /* modmask, modkey, button, function, argument */
136 { 0, 0, MOUSE_BUTTON_2
, paste
, {TargetCurrent
| ClipboardPrimary
| ClipboardGTK
, rememberedURI
} },
137 { GDK_CONTROL_MASK
, 0, MOUSE_BUTTON_2
, paste
, {TargetNew
| ClipboardPrimary
| ClipboardGTK
} },
138 { GDK_CONTROL_MASK
, 0, MOUSE_BUTTON_1
, open_arg
, {TargetNew
, rememberedURI
} },
141 /* settings (arguments of :set command) */
142 static Setting browsersettings
[] = {
143 /* public name, internal variable webkit setting integer value? boolean value? colour value? reload page? */
144 { "useragent", useragent
, "user-agent", FALSE
, FALSE
, FALSE
, FALSE
},
145 { "scripts", NULL
, "enable-scripts", FALSE
, TRUE
, FALSE
, FALSE
},
146 { "plugins", NULL
, "enable-plugins", FALSE
, TRUE
, FALSE
, FALSE
},
147 { "java", NULL
, "enable-java-applet", FALSE
, TRUE
, FALSE
, FALSE
},
148 { "images", NULL
, "auto-load-images", FALSE
, TRUE
, FALSE
, FALSE
},
149 { "shrinkimages", NULL
, "auto-shrink-images", FALSE
, TRUE
, FALSE
, FALSE
},
150 { "cursivefont", NULL
, "cursive-font-family", FALSE
, FALSE
, FALSE
, FALSE
},
151 { "defaultencoding", NULL
, "default-encoding", FALSE
, FALSE
, FALSE
, FALSE
},
152 { "defaultfont", NULL
, "default-font-family", FALSE
, FALSE
, FALSE
, FALSE
},
153 { "fontsize", NULL
, "default-font-size", TRUE
, FALSE
, FALSE
, FALSE
},
154 { "monofontsize", NULL
, "default-monospace-font-size", TRUE
, FALSE
, FALSE
, FALSE
},
155 { "caret", NULL
, "enable-caret-browsing", FALSE
, TRUE
, FALSE
, FALSE
},
156 { "fantasyfont", NULL
, "fantasy-font-family", FALSE
, FALSE
, FALSE
, FALSE
},
157 { "minimumfontsize", NULL
, "minimum-font-size", TRUE
, FALSE
, FALSE
, FALSE
},
158 { "monofont", NULL
, "monospace-font-family", FALSE
, FALSE
, FALSE
, FALSE
},
159 { "backgrounds", NULL
, "print-backgrounds", FALSE
, TRUE
, FALSE
, FALSE
},
160 { "sansfont", NULL
, "sans-serif-font-family", FALSE
, FALSE
, FALSE
, FALSE
},
161 { "seriffont", NULL
, "serif-font-family", FALSE
, FALSE
, FALSE
, FALSE
},
162 { "stylesheet", NULL
, "user-stylesheet-uri", FALSE
, FALSE
, FALSE
, FALSE
},
163 { "resizetextareas", NULL
, "resizable-text-areas", FALSE
, TRUE
, FALSE
, FALSE
},
164 { "webinspector", NULL
, "enable-developer-extras", FALSE
, TRUE
, FALSE
, FALSE
},
166 { "homepage", startpage
, "", FALSE
, FALSE
, FALSE
, FALSE
},
167 { "statusbgcolor", statusbgcolor
, "", FALSE
, FALSE
, TRUE
, TRUE
},
168 { "statuscolor", statuscolor
, "", FALSE
, FALSE
, TRUE
, TRUE
},
169 { "sslbgcolor", sslbgcolor
, "", FALSE
, FALSE
, TRUE
, TRUE
},
170 { "sslcolor", sslcolor
, "", FALSE
, FALSE
, TRUE
, TRUE
},
171 { "qmark", NULL
, "", FALSE
, FALSE
, FALSE
, FALSE
},
172 { "proxy", NULL
, "", FALSE
, TRUE
, FALSE
, FALSE
},
173 { "scrollbars", NULL
, "", FALSE
, TRUE
, FALSE
, FALSE
},
174 { "completioncase", NULL
, "", FALSE
, TRUE
, FALSE
, FALSE
},