1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
|
diff --unified --recursive --text fvwm-2.6.9/libs/FTips.c fvwm-patched/libs/FTips.c
--- fvwm-2.6.9/libs/FTips.c 2018-05-26 05:35:26.000000000 -0600
+++ fvwm-patched/libs/FTips.c 2020-08-21 16:20:45.638664630 -0600
@@ -504,7 +504,7 @@
if (fc == NULL)
{
fc = default_config;
- }
+ }
current_config = fc;
if (label != NULL)
Only in fvwm-patched/libs: FTips.c.orig
diff --unified --recursive --text fvwm-2.6.9/modules/FvwmButtons/FvwmButtons.c fvwm-patched/modules/FvwmButtons/FvwmButtons.c
--- fvwm-2.6.9/modules/FvwmButtons/FvwmButtons.c 2018-05-26 05:35:26.000000000 -0600
+++ fvwm-patched/modules/FvwmButtons/FvwmButtons.c 2020-08-21 16:28:07.722997146 -0600
@@ -55,6 +55,7 @@
#include "libs/Colorset.h"
#include "libs/vpacket.h"
#include "libs/FRender.h"
+#include "libs/FTips.h"
#include "libs/fsm.h"
#include "libs/ColorUtils.h"
#include "libs/Graphics.h"
@@ -900,6 +901,7 @@
button_info *tmp = ActiveButton;
ActiveButton = b;
RedrawButton(tmp, DRAW_FORCE, NULL);
+
}
if (
b->flags.b_ActiveIcon ||
@@ -1040,6 +1042,9 @@
tmp.name = NULL;
tmp.name_list = NULL;
+
+ FTipsInit(Dpy);
+
while ( !isTerminated )
{
if (My_FNextEvent(Dpy, &Event))
@@ -1166,6 +1171,10 @@
if (!event.xconfigure.send_event &&
Event.xconfigure.window != MyWindow)
continue;
+
+ if(FTipsHandleEvents(Dpy, &event))
+ continue;
+
fev_sanitise_configure_notify(&event.xconfigure);
Event.xconfigure.x = event.xconfigure.x;
Event.xconfigure.y = event.xconfigure.y;
@@ -1209,10 +1218,33 @@
case EnterNotify:
b = handle_new_position(
b, Event.xcrossing.x, Event.xcrossing.y);
+
+ if(Event.xcrossing.mode == NotifyNormal)
+ {
+ b = handle_new_position(
+ b, Event.xcrossing.x, Event.xcrossing.y);
+ FTipsOn(Dpy,MyWindow,UberButton->c->tips_config,
+ (void *)UberButton, b->tipslabel,
+ b->x, b->y, Width,Height);
+ FTipsUpdateLabel(Dpy, b->tipslabel);
+ }
break;
case MotionNotify:
+
b = handle_new_position(b, Event.xmotion.x, Event.xmotion.y);
+
+ x = Event.xbutton.x;
+ y = Event.xbutton.y;
+
+ if(b->tipslabel != NULL)
+ {
+ FTipsOn(Dpy,MyWindow,UberButton->c->tips_config, (void *)UberButton, b->tipslabel, x, y, w, h);
+ FTipsUpdateLabel(Dpy, b->tipslabel);
+ } else {
+ FTipsCancel(Dpy);
+ }
+
break;
case LeaveNotify:
@@ -1235,11 +1267,13 @@
b = ActiveButton;
ActiveButton = NULL;
RedrawButton(b, DRAW_FORCE, NULL);
+
}
if (CurrentButton)
{
RedrawButton(b, DRAW_FORCE, NULL);
}
+ FTipsCancel(Dpy);
}
break;
@@ -1261,8 +1295,8 @@
Window dummy;
XTranslateCoordinates(
- Dpy, Event.xbutton.window, MyWindow, Event.xbutton.x,
- Event.xbutton.y, &x, &y, &dummy);
+ Dpy, Event.xbutton.window, MyWindow, Event.xbutton.x,
+ Event.xbutton.y, &x, &y, &dummy);
}
if (CurrentButton)
{
@@ -1304,7 +1338,10 @@
RedrawButton(tmp, DRAW_FORCE, NULL);
}
else
+ {
RedrawButton(b, DRAW_FORCE, NULL);
+ }
+
if (!act)
{
break;
Only in fvwm-patched/modules/FvwmButtons: FvwmButtons.c.orig
diff --unified --recursive --text fvwm-2.6.9/modules/FvwmButtons/FvwmButtons.h fvwm-patched/modules/FvwmButtons/FvwmButtons.h
--- fvwm-2.6.9/modules/FvwmButtons/FvwmButtons.h 2018-05-26 05:35:26.000000000 -0600
+++ fvwm-patched/modules/FvwmButtons/FvwmButtons.h 2020-08-21 16:20:45.638664630 -0600
@@ -32,6 +32,8 @@
#include "libs/fvwmlib.h"
#include "libs/Picture.h"
#include "libs/Flocale.h"
+#include "libs/FTips.h"
+#define FONT_STRING "-*-fixed-medium-r-normal--13-*"
/* ------------------------------- structs --------------------------------- */
@@ -76,6 +78,7 @@
unsigned b_PressIcon : 1; /* Use alternate Icon on press */
unsigned b_PressColorset : 1; /* Use alternate Colorset on press */
unsigned b_PressTitle : 1; /* Use alternate Title text on press */
+ unsigned b_UseTips : 1; /* Whether to use tips or not. */
} flags_type;
/* Flags for b->swallow */
@@ -125,6 +128,9 @@
int colorset; /* b_Colorset */
int activeColorset; /* b_ActiveColorset */
int pressColorset; /* b_PressColorset */
+ char *tipsfont; /* b_TipsFont*/
+ ftips_config *tips_config; /* Struct that holds tips info.*/
+
Pixel fc; /* b_Fore */
Pixel bc, hc, sc; /* b_Back && !b_IconBack */
FvwmPicture *backicon; /* b_Back && b_IconBack */
@@ -181,6 +187,7 @@
FvwmPicture *pressicon; /* b_PressIcon */
int activeColorset; /* b_ActiveColorset */
int pressColorset; /* b_PressColorset */
+ char *tipslabel; /* b_TipsLabel */
Window IconWin; /* b_Swallow */
Window PanelWin; /* b_Panel */
Window BackIconWin; /* b_Back && b_IconBack */
Only in fvwm-patched/modules/FvwmButtons: FvwmButtons.h.orig
diff --unified --recursive --text fvwm-2.6.9/modules/FvwmButtons/parse.c fvwm-patched/modules/FvwmButtons/parse.c
--- fvwm-2.6.9/modules/FvwmButtons/parse.c 2018-05-26 05:35:26.000000000 -0600
+++ fvwm-patched/modules/FvwmButtons/parse.c 2020-08-21 16:20:45.638664630 -0600
@@ -882,6 +882,7 @@
"presstitle",
"activecolorset",
"presscolorset",
+ "tipslabel",
"top",
NULL
};
@@ -1605,7 +1606,33 @@
b->flags.b_ActiveColorset = 0;
}
break;
+ /* --------- TipsLabel ---------*/
+ case 28:
+ s = trimleft(s);
+ t = seekright(&s);
+ if(ub->c->flags.b_UseTips)
+ {
+ if (*s == '(')
+ {
+ fprintf(stderr,
+ "%s: justification not allowed "
+ "for TipsLabel.\n", MyName);
+ }
+
+
+
+ if (t && *t && (t[0] != '-' || t[1] != 0))
+ {
+ if (b->tipslabel != NULL)
+ {
+ free(b->tipslabel);
+ } else {
+ b->tipslabel = t;
+ }
+ }
+ }
+ break;
/* --------------- --------------- */
case 26: /* PressColorset */
i = strtol(s, &t, 10);
@@ -1777,6 +1804,14 @@
"colorset",
"activecolorset",
"presscolorset",
+ "usetips",
+ "tipsfont",
+ "tipsdelay",
+ "tipscolorset",
+ "tipsborderwidth",
+ "tipsplacement",
+ "tipsjustification",
+ "tipsoffset",
NULL
};
int i, j, k;
@@ -1924,7 +1959,97 @@
ub->c->flags.b_PressColorset = 0;
}
break;
+ case 15: /* UseTips */
+ /* We're using tips.*/
+ ub->c->flags.b_UseTips = 1;
+
+ /* Set the defaults up. */
+ ub->c->tips_config = FTipsNewConfig();
+
+ /* Include fonts. */
+ CopyStringWithQuotes(&ub->c->tipsfont,FONT_STRING);
+ ub->c->tips_config->Ffont = FlocaleLoadFont(Dpy,
+ ub->c->tipsfont, MyName);
+ break;
+ case 16: /* TipsFont */
+ if(ub->c->flags.b_UseTips)
+ {
+ CopyStringWithQuotes(&ub->c->tipsfont,s);
+ ub->c->tips_config->Ffont = FlocaleLoadFont(Dpy, ub->c->tipsfont,
+ MyName);
+ }
+
+ break;
+ case 17: /*TipsDelay */
+ if(ub->c->flags.b_UseTips)
+ {
+ i = sscanf(s, "%d %d", &j, &k);
+ if( i > 0)
+ {
+ /* Then only one value was given. Set the
+ * mapped_delay option to this given value
+ * also since it's optional.
+ */
+ ub->c->tips_config->delay = ub->c->tips_config->mapped_delay = j;
+ }
+ if( i > 1)
+ {
+ /* Two values passed in. We only need to
+ * change the value for mapped_delay here.
+ */
+
+ ub->c->tips_config->mapped_delay = k;
+
+ }
+ }
+ break;
+ case 18: /* TipsColorset */
+ if (ub->c->flags.b_UseTips)
+ {
+ i = sscanf(s, "%d", &j);
+ if (i > 0)
+ {
+ ub->c->tips_config->colorset = j;
+ AllocColorset(j);
+ }
+ }
+ break;
+ case 19: /* TipsBorderWidth */
+ if (ub->c->flags.b_UseTips)
+ {
+ i = sscanf(s, "%d", &j);
+
+ if(i > 0)
+ {
+ ub->c->tips_config->border_width = j;
+ }
+ }
+ break;
+ case 20: /* TipsPlacement */
+ if(ub->c->flags.b_UseTips)
+ {
+ s = trimleft(s);
+
+ /* Options ... */
+ if(!strcasecmp(s, "up"))
+ {
+ i = FTIPS_PLACEMENT_UP;
+ } else if(!strcasecmp(s, "down")) {
+ i = FTIPS_PLACEMENT_DOWN;
+ } else if(!strcasecmp(s, "left")) {
+ i = FTIPS_PLACEMENT_LEFT;
+ } else if(!strcasecmp(s, "right")) {
+ i = FTIPS_PLACEMENT_RIGHT;
+ } else if(!strcasecmp(s, "updown")) {
+ i = FTIPS_PLACEMENT_AUTO_UPDOWN;
+ } else if(!strcasecmp(s, "leftright")) {
+ i = FTIPS_PLACEMENT_AUTO_LEFTRIGHT;
+ }
+
+ ub->c->tips_config->placement = i;
+ }
+ break;
default:
s = trimleft(s);
ParseButton(ubb, s);
Only in fvwm-patched/modules/FvwmButtons: parse.c.orig
|