printing command (patch by Matto Fransen <matto@matto.nl>
[vimprobable2.git] / vimprobable.h
blob4b8308459ea8edf0fba9f92be9d8314da650cd81
1 /*
2 (c) 2009 by Leon Winter
3 (c) 2009, 2010 by Hannes Schueller
4 (c) 2009, 2010 by Matto Fransen
5 see LICENSE file
6 */
8 /* macros */
9 #define LENGTH(x) (sizeof(x)/sizeof(x[0]))
11 /* enums */
12 enum { ModeNormal, ModePassThrough, ModeSendKey, ModeInsert, ModeHints }; /* modes */
13 enum { TargetCurrent, TargetNew }; /* target */
14 /* bitmask,
15 1 << 0: 0 = jumpTo, 1 = scroll
16 1 << 1: 0 = top/down, 1 = left/right
17 1 << 2: 0 = top/left, 1 = bottom/right
18 1 << 3: 0 = paging/halfpage, 1 = line
19 1 << 4: 0 = paging, 1 = halfpage aka buffer
21 enum { ScrollJumpTo, ScrollMove };
22 enum { OrientationVert, OrientationHoriz = (1 << 1) };
23 enum { DirectionTop,
24 DirectionBottom = (1 << 2),
25 DirectionLeft = OrientationHoriz,
26 DirectionRight = OrientationHoriz | (1 << 2)
28 enum { UnitPage,
29 UnitLine = (1 << 3),
30 UnitBuffer = (1 << 4)
32 /* bitmask:
33 1 << 0: 0 = Reload/Cancel 1 = Forward/Back
34 Forward/Back:
35 1 << 1: 0 = Forward 1 = Back
36 Reload/Cancel:
37 1 << 1: 0 = Cancel 1 = Force/Normal Reload
38 1 << 2: 0 = Force Reload 1 = Reload
40 enum { NavigationForwardBack = 1, NavigationReloadActions = (1 << 1) };
41 enum { NavigationCancel,
42 NavigationBack = (NavigationForwardBack | 1 << 1),
43 NavigationForward = (NavigationForwardBack),
44 NavigationReload = (NavigationReloadActions | 1 << 2),
45 NavigationForceReload = NavigationReloadActions
47 /* bitmask:
48 1 << 1: ClipboardPrimary (X11)
49 1 << 2: ClipboardGTK
50 1 << 3: 0 = SourceSelection 1 = SourceURL
52 enum { ClipboardPrimary = 1 << 1, ClipboardGTK = 1 << 2 };
53 enum { SourceSelection, SourceURL = 1 << 3 };
54 /* bitmask:
55 1 << 0: 0 = ZoomReset 1 = ZoomIn/Out
56 1 << 1: 0 = ZoomOut 1 = ZoomIn
57 1 << 2: 0 = TextZoom 1 = FullContentZoom
59 enum { ZoomReset,
60 ZoomOut,
61 ZoomIn = ZoomOut | (1 << 1)
63 enum { ZoomText, ZoomFullContent = (1 << 2) };
64 /* bitmask:
65 0 = Info, 1 = Warning, 2 = Error
66 1 << 2: 0 = AutoHide 1 = NoAutoHide
67 relevant for script:
68 1 << 3: 1 = Silent (no echo)
70 enum { Info, Warning, Error, NoAutoHide = 1 << 2, Silent = 1 << 3 };
71 enum { NthSubdir, Rootdir };
72 enum { InsertCurrentURL = 1 };
73 enum { Increment, Decrement };
74 /* bitmask:
75 1 << 0: 0 = DirectionNext 1 = DirectionPrev (Relative)
76 1 << 0: 0 = DirectionBackwards 1 = DirectionForward (Absolute)
78 1 << 1: 0 = DirectionRelative 1 = DirectionAbsolute
80 1 << 2: 0 = CaseInsensitive 1 = CaseSensitive
81 1 << 3: 0 = No Wrapping 1 = Wrapping
83 enum { DirectionRelative, DirectionAbsolute = 1 << 1 };
84 enum { DirectionNext, DirectionPrev, HideCompletion };
85 enum { DirectionBackwards = DirectionAbsolute, DirectionForward =
86 (1 << 0) | DirectionAbsolute };
87 enum { CaseInsensitive, CaseSensitive = 1 << 2 };
88 enum { Wrapping = 1 << 3 };
90 /* structs here */
91 typedef struct {
92 int i;
93 char *s;
94 } Arg;
96 typedef struct {
97 guint mask;
98 guint modkey;
99 guint key;
100 gboolean(*func) (const Arg * func);
101 Arg arg;
102 } Key;
104 typedef struct {
105 void *next;
106 Key Element;
107 } KeyList;
109 typedef struct {
110 guint mask;
111 guint modkey;
112 guint button;
113 gboolean(*func) (const Arg * arg);
114 const Arg arg;
115 } Mouse;
117 typedef struct {
118 char *name;
119 char (*var);
120 char *webkit;
121 gboolean intval;
122 gboolean boolval;
123 gboolean colourval;
124 gboolean reload;
125 } Setting;
127 typedef struct {
128 char *cmd;
129 gboolean(*func) (const Arg * arg);
130 const Arg arg;
131 } Command;
133 typedef struct {
134 char *handle;
135 char *uri;
136 } Searchengine;
138 struct map_pair {
139 char *line;
140 char what[20];
141 char value[240];
142 } my_pair;
144 /* constants */
145 #define MOUSE_BUTTON_1 1
146 #define MOUSE_BUTTON_2 2
147 #define MOUSE_BUTTON_3 3
148 #define MOUSE_BUTTON_4 4
149 #define MOUSE_BUTTON_5 5
150 #define BUFFERSIZE 255
151 #define MAXTAGSIZE 200
153 /* quickmarks */
154 #define QUICKMARK_FILE "%s/.config/vimprobable/quickmarks", getenv("HOME")