about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-11 18:19:01 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-11 18:19:01 +0200
commitb1669b5c48f71c9a7a919dbf09a1af527c62f69a (patch)
treef94f1018357afe5abef9cde46a80d16a9676010f
parent586f66331d1105be03c42e6faeae1672b974a98a (diff)
downloaddwm-b1669b5c48f71c9a7a919dbf09a1af527c62f69a.tar.gz
removed unnecessary sel stuff
-rw-r--r--Makefile10
-rw-r--r--gridsel.c47
-rw-r--r--util.c38
-rw-r--r--util.h2
4 files changed, 2 insertions, 95 deletions
diff --git a/Makefile b/Makefile
index b38889b..e324e5b 100644
--- a/Makefile
+++ b/Makefile
@@ -7,12 +7,10 @@ WMSRC = bar.c client.c cmd.c draw.c event.c key.c util.c wm.c
 WMOBJ = ${WMSRC:.c=.o}
 MENSRC = menu.c draw.c util.c
 MENOBJ = ${MENSRC:.c=.o}
-SELSRC = gridsel.c util.c
-SELOBJ = ${SELSRC:.c=.o}
 MAN1 = gridwm.1 gridmenu.1
-BIN = gridwm gridmenu gridsel 
+BIN = gridwm gridmenu
 
-all: config gridwm gridmenu gridsel
+all: config gridwm gridmenu
 	@echo finished
 
 config:
@@ -36,10 +34,6 @@ gridwm: ${WMOBJ}
 	@echo LD $@
 	@${CC} -o $@ ${WMOBJ} ${LDFLAGS}
 
-gridsel: ${SELOBJ}
-	@echo LD $@
-	@${CC} -o $@ ${SELOBJ} ${LDFLAGS}
-
 clean:
 	rm -f gridwm gridmenu *.o core
 
diff --git a/gridsel.c b/gridsel.c
deleted file mode 100644
index c76105e..0000000
--- a/gridsel.c
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
- * See LICENSE file for license details.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-
-#include <util.h>
-
-static char version[] = "gridsel - " VERSION ", (C)opyright MMVI Anselm R. Garbe\n";
-
-static void
-usage()
-{
-	fprintf(stderr, "%s\n", "usage: gridsel [-v]\n");
-	exit(1);
-}
-
-int
-main(int argc, char **argv)
-{
-	unsigned char *data;
-	unsigned long i, offset, len, remain;
-
-	/* command line args */
-	if(argc > 1) {
-		if(!strncmp(argv[1], "-v", 3)) {
-			fprintf(stdout, "%s", version);
-			exit(0);
-		} else
-			usage();
-	}
-	len = offset = remain = 0;
-	do {
-		data = getselection(offset, &len, &remain);
-		for(i = 0; i < len; i++)
-			putchar(data[i]);
-		offset += len;
-		free(data);
-	}
-	while(remain);
-	if(offset)
-		putchar('\n');
-	return 0;
-}
diff --git a/util.c b/util.c
index 2cc2d4d..76ba5ab 100644
--- a/util.c
+++ b/util.c
@@ -10,7 +10,6 @@
 #include <sys/types.h>
 #include <sys/wait.h>
 #include <unistd.h>
-#include <X11/Xatom.h>
 
 #include "util.h"
 
@@ -139,40 +138,3 @@ pipe_spawn(char *buf, unsigned int len, Display *dpy, char *argv[])
 	}
 	wait(0);
 }
-
-
-unsigned char *
-getselection(unsigned long offset, unsigned long *len, unsigned long *remain)
-{
-	Display *dpy;
-	Atom xa_clip_string;
-	Window w;
-	XEvent ev;
-	Atom typeret;
-	int format;
-	unsigned char *data;
-	unsigned char *result = NULL;
-
-	dpy = XOpenDisplay(0);
-	if(!dpy)
-		return NULL;
-	xa_clip_string = XInternAtom(dpy, "_SEL_STRING", False);
-	w = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10, 200, 200,
-			1, CopyFromParent, CopyFromParent);
-	XConvertSelection(dpy, XA_PRIMARY, XA_STRING, xa_clip_string,
-			w, CurrentTime);
-	XFlush(dpy);
-	XNextEvent(dpy, &ev);
-	if(ev.type == SelectionNotify && ev.xselection.property != None) {
-		XGetWindowProperty(dpy, w, ev.xselection.property, offset, 4096L, False,
-				AnyPropertyType, &typeret, &format, len, remain, &data);
-		if(*len) {
-			result = emalloc(sizeof(unsigned char) * *len);
-			memcpy(result, data, *len);
-		}
-		XDeleteProperty(dpy, w, ev.xselection.property);
-	}
-	XDestroyWindow(dpy, w);
-	XCloseDisplay(dpy);
-	return result;
-}
diff --git a/util.h b/util.h
index 00f0714..76fc09f 100644
--- a/util.h
+++ b/util.h
@@ -18,7 +18,5 @@ extern void failed_assert(char *a, char *file, int line);
 extern void pipe_spawn(char *buf, unsigned int len, Display *dpy, char *argv[]);
 extern void spawn(Display *dpy, char *argv[]);
 extern void swap(void **p1, void **p2);
-extern unsigned char *getselection(unsigned long offset, unsigned long *len,
-		unsigned long *remain);
 extern unsigned int tokenize(char **result, unsigned int reslen,
 		char *str, char delim);
d=3c60e387223a8cbf1ceac1a5cc9f158e42eb6fdf'>^
4b62edd8 ^
33d602db ^

954dd99d ^






33d602db ^

954dd99d ^



d2db5af7 ^
954dd99d ^

b5794d2f ^
33d602db ^

d2db5af7 ^
33d602db ^

d2db5af7 ^
954dd99d ^

773d01c8 ^
a03b8aea ^







8577d177 ^
4d1f6bd7 ^
845a989f ^
a27dfba3 ^



845a989f ^



bee53b4b ^
a27dfba3 ^

















4d1f6bd7 ^
5b698455 ^
7d2c2d55 ^

a03b8aea ^

93d5dce6 ^
7d2c2d55 ^


98e6a592 ^


3f29fba8 ^
98e6a592 ^
a27dfba3 ^

a03b8aea ^
a27dfba3 ^








4d1f6bd7 ^
5b698455 ^
93d5dce6 ^
7d2c2d55 ^


a27dfba3 ^













10c5eed0 ^
a27dfba3 ^

bee53b4b ^
a27dfba3 ^

4d1f6bd7 ^
5b698455 ^
93d5dce6 ^
a27dfba3 ^


a03b8aea ^

ce3518f3 ^
d1c12218 ^
ce3518f3 ^



ce3518f3 ^
ce3518f3 ^

e605597d ^

e605597d ^
e605597d ^


445a1494 ^
ce3518f3 ^


16a83577 ^
d1c12218 ^
33d602db ^







732964be ^
a1f2f613 ^
93d5dce6 ^
4d1f6bd7 ^
83a43e63 ^
09e2e533 ^

8ab4b12c ^
7d2c2d55 ^

5249b0ff ^
0d2c3387 ^
d2db5af7 ^
0d2c3387 ^
7d2c2d55 ^
0d2c3387 ^
7d2c2d55 ^
0d2c3387 ^
7d2c2d55 ^
09e2e533 ^
bee53b4b ^
7d2c2d55 ^



4ca73eb6 ^
bee53b4b ^
98e6a592 ^
5249b0ff ^


16a83577 ^




954dd99d ^
308e1146 ^
445a1494 ^
308e1146 ^
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