Package: osdsh / 0.7.0-10.2

01-outline.dpatch Patch series | download
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
From: Joachim Breitner <nomeata@debian.org>
Subject: Adds outline border and color

--- a/src/config.h
+++ b/src/config.h
@@ -2,10 +2,12 @@
 #define FONT "-*-lucidatypewriter-bold-*-*-*-*-240-*-*-*-*-*-*"
 #define TIMEOUT 5
 #define COLOR "green"
+#define OCOLOR "black"
 #define OSD_ALIGNMENT XOSD_left
 #define OSD_POSITION XOSD_top
 #define MIXER "/dev/mixer"
 #define SHADOW_OFFSET 0
+#define OUTLINE_OFFSET 0
 #define DEFAULT_OFFSET 0
 #define CLOCK_FORMAT "%a %b %e %G - %H : %M : %S"
 #define OSD_FIFO_PATH "/tmp/osdsh"
--- a/src/osdsh/osdsh.c
+++ b/src/osdsh/osdsh.c
@@ -56,9 +56,11 @@
 	{"help", 0, 0, 'h'},
 	{"position", 1, 0, 'p'},
 	{"soffset", 1, 0, 'o'},
+	{"ooffset", 1, 0, 'O'},
 	{"mixer", 1, 0, 'm'},
 	{"font", 1, 0, 'f'},
 	{"color", 1, 0, 'c'},
+	{"ocolor", 1, 0, 'k'},
 	{"delay", 1, 0, 'd'},
 	{"align", 1, 0, 'a'},
 	{"nice", 1, 0, 'n'}
@@ -76,6 +78,10 @@
 	    strncpy(settings->color, optarg, BUFSIZ);
 	    settings->color[BUFSIZ] = '\0';
 	    break;
+	case 'k':
+	    strncpy(settings->ocolor, optarg, BUFSIZ);
+	    settings->ocolor[BUFSIZ] = '\0';
+	    break;
 	case 'p':
 		settings->position = atoi(optarg);
 	    break;
@@ -94,6 +100,9 @@
 	case 'o':
 	    settings->soffset = atoi(optarg);
 	    break;
+	case 'O':
+	    settings->ooffset = atoi(optarg);
+	    break;
 	case 'n':
 	    nice(atoi(optarg));
 	    break;
--- a/src/osdsh/osdsh.h
+++ b/src/osdsh/osdsh.h
@@ -23,7 +23,9 @@
     xosd *myosd;
     char font[BUFSIZ + 1];
     char color[BUFSIZ + 1];
+    char ocolor[BUFSIZ + 1];
     int soffset;
+    int ooffset;
     int xoffset;
     int yoffset;
     xosd_align align;
--- a/src/osdsh/utils.c
+++ b/src/osdsh/utils.c
@@ -53,6 +53,16 @@
 	    if (setts->displaying&&xosd_set_shadow_offset(setts->myosd, setts->soffset))
 		fprintf(stderr, "Couldn't change Shadow Offset\n");
 	break;
+	case 'O':
+	    setts->ooffset = atoi(argument);
+	    if (setts->displaying&&xosd_set_outline_offset(setts->myosd, setts->ooffset))
+		fprintf(stderr, "Couldn't change Outline Width\n");
+	break;
+	case 'k':
+	    strncpy(setts->ocolor, argument, BUFSIZ);
+	    if (setts->displaying&&xosd_set_outline_colour(setts->myosd, argument))
+		fprintf(stderr, "Couldn't change outline color\n");
+	break;
 	case 'y':
 	    setts->yoffset = atoi(argument);
 	    if (setts->displaying&&xosd_set_vertical_offset(setts->myosd, setts->yoffset))
@@ -77,6 +87,8 @@
 	xosd_set_horizontal_offset(setts->myosd, setts->xoffset);
 	xosd_set_vertical_offset(setts->myosd, setts->yoffset);
 	xosd_set_shadow_offset(setts->myosd, setts->soffset);
+	xosd_set_outline_offset(setts->myosd, setts->ooffset);
+	xosd_set_outline_colour(setts->myosd, setts->ocolor);
 	xosd_set_timeout(setts->myosd, setts->delay);
 }
 /* ============================ set_defaults () ============================ */ 
@@ -86,7 +98,10 @@
     setts->font[BUFSIZ] = '\0';
     strncpy(setts->color, COLOR, BUFSIZ);
     setts->color[BUFSIZ] = '\0';
+    strncpy(setts->ocolor, OCOLOR, BUFSIZ);
+    setts->ocolor[BUFSIZ] = '\0';
     setts->soffset = SHADOW_OFFSET;
+    setts->ooffset = OUTLINE_OFFSET;
     setts->yoffset = DEFAULT_OFFSET;
     setts->xoffset = DEFAULT_OFFSET;
     setts->align= OSD_ALIGNMENT;
--- a/tkosdshconfig
+++ b/tkosdshconfig
@@ -39,6 +39,8 @@
 		xside "Left"
 		yside "Top"
 		shad "0"
+		outline "0"
+		ocolor "black"
 		extra ""
 		extra2 ""
 		extra3 ""
@@ -59,15 +61,19 @@
 	label .$a.ypos -text "Y edge:"
 	label .$a.yoff -text "Y distance:"
 	label .$a.shad -text "Shadow offset:"
+	label .$a.outline -text "Outline width:"
+	label .$a.ocolor -text "Outline color:"
 	
 	grid .$a.delay -row 1 -column 0 -sticky nsew
 	grid .$a.color -row 2 -column 0 -sticky nsew
 	grid .$a.font -row 3 -column 0 -sticky nsew
 	grid .$a.shad -row 4 -column 0 -sticky nsew
+	grid .$a.outline -row 5 -column 0 -sticky nsew
 	grid .$a.xpos -row 1 -column 2 -sticky nsew
 	grid .$a.xoff -row 2 -column 2 -sticky nsew
 	grid .$a.ypos -row 3 -column 2 -sticky nsew
 	grid .$a.yoff -row 4 -column 2 -sticky nsew
+	grid .$a.ocolor -row 5 -column 2 -sticky nsew
 
 	entry .$a.delayent -textvariable $a\(delay)
 	entry .$a.colorent -textvariable $a\(color)
@@ -75,6 +81,8 @@
 	entry .$a.shadent -textvariable $a\(shad)
 	entry .$a.xoffent -textvariable $a\(xoffset)
 	entry .$a.yoffent -textvariable $a\(yoffset)
+	entry .$a.outlineent -textvariable $a\(outline)
+	entry .$a.ocolorent -textvariable $a\(ocolor)
 	tk_optionMenu .$a.xside $a\(xside) Left Center Right
 	tk_optionMenu .$a.yside $a\(yside) Top Bottom
 	
@@ -82,10 +90,12 @@
 	grid .$a.colorent -row 2 -column 1 -sticky nsew
 	grid .$a.fontent -row 3 -column 1 -sticky nsew
 	grid .$a.shadent -row 4 -column 1 -sticky nsew
+	grid .$a.outlineent -row 5 -column 1 -sticky nsew
 	grid .$a.xside -row 1 -column 3 -sticky nsew
 	grid .$a.xoffent -row 2 -column 3 -sticky nsew
 	grid .$a.yside -row 3 -column 3 -sticky nsew
 	grid .$a.yoffent -row 4 -column 3 -sticky nsew
+	grid .$a.ocolorent -row 5 -column 3 -sticky nsew
 	
 }
 
@@ -146,6 +156,7 @@
 			set argument [lindex $separate 2]
 			switch $option {
 				C {set option color}
+				k {set option ocolor}
 				f {set option font}
 				d {set option delay}
 				x {set option xoffset}
@@ -156,6 +167,7 @@
 				c {set option xside;set argument Center}
 				r {set option xside;set argument Right}
 				o {set option shad}
+				O {set option outline}
 			}
 			switch $command {
 				mixr {set command smix
@@ -208,7 +220,9 @@
 			puts $id $a\(d\,[expr \$$a\(delay)])
 			puts $id $a\(f\,[expr \$$a\(font)])
 			puts $id $a\(C\,[expr \$$a\(color)])
+			puts $id $a\(k\,[expr \$$a\(ocolor)])
 			puts $id $a\(o\,[expr \$$a\(shad)])
+			puts $id $a\(O\,[expr \$$a\(outline)])
 			puts $id $a\(x\,[expr \$$a\(xoffset)])
 			puts $id $a\(y\,[expr \$$a\(yoffset)])
 			if {[expr \$$a\(xside)=="Right"]} {