summaryrefslogtreecommitdiff
path: root/src/e.c
diff options
context:
space:
mode:
authorMichael Jennings <mej@kainx.org>2001-05-24 07:17:03 +0000
committerMichael Jennings <mej@kainx.org>2001-05-24 07:17:03 +0000
commitd6cf1648376e616941d7f15875be0f48e2da0f6e (patch)
tree8537932fec00aa6ad2436fdb0b4bbbb20e123fca /src/e.c
parentbd1ed42760df07eaec4d99188fb05e3e5e41f7b2 (diff)
downloadeterm-d6cf1648376e616941d7f15875be0f48e2da0f6e.tar.gz
Thu May 24 00:14:54 PDT 2001 Michael Jennings <mej@eterm.org>
Finally got the selection stuff cleaned up. Hopefully this will be the last time I have to deal with it for awhile. While I was at it, I implemented incremental selection transfers. Unfortunately, it doesn't seem like too many people support it. kedit doesn't, and it's broken in Emacs (*grumble*). Works in gvim though. SVN revision: 4784
Diffstat (limited to 'src/e.c')
-rw-r--r--src/e.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/e.c b/src/e.c
index e080932..bc4788c 100644
--- a/src/e.c
+++ b/src/e.c
@@ -41,7 +41,6 @@ static const char cvs_ident[] = "$Id$";
#include "system.h"
Window ipc_win = None, my_ipc_win = None;
-Atom ipc_atom = None;
static unsigned char timeout = 0;
/* Returns true if running under E, false otherwise */
@@ -51,7 +50,7 @@ check_for_enlightenment(void)
static signed char have_e = -1;
if (have_e == -1) {
- if (XInternAtom(Xdisplay, "ENLIGHTENMENT_COMMS", True) != None) {
+ if (props[PROP_ENL_COMMS] != None) {
D_ENL(("Enlightenment detected.\n"));
have_e = 1;
} else {
@@ -67,7 +66,7 @@ enl_ipc_get_win(void)
{
unsigned char *str = NULL;
- Atom prop, prop2;
+ Atom prop;
unsigned long num, after;
int format;
Window dummy_win;
@@ -76,12 +75,11 @@ enl_ipc_get_win(void)
D_ENL(("Searching for IPC window.\n"));
- prop = XInternAtom(Xdisplay, "ENLIGHTENMENT_COMMS", True);
- if (prop == None) {
+ if (props[PROP_ENL_COMMS] == None) {
D_ENL((" -> Enlightenment is not running. You lose!\n"));
return None;
}
- XGetWindowProperty(Xdisplay, Xroot, prop, 0, 14, False, AnyPropertyType, &prop2, &format, &num, &after, &str);
+ XGetWindowProperty(Xdisplay, Xroot, props[PROP_ENL_COMMS], 0, 14, False, AnyPropertyType, &prop, &format, &num, &after, &str);
if (str) {
sscanf((char *) str, "%*s %x", (unsigned int *) &ipc_win);
XFree(str);
@@ -93,7 +91,7 @@ enl_ipc_get_win(void)
}
str = NULL;
if (ipc_win != None) {
- XGetWindowProperty(Xdisplay, ipc_win, prop, 0, 14, False, AnyPropertyType, &prop2, &format, &num, &after, &str);
+ XGetWindowProperty(Xdisplay, ipc_win, props[PROP_ENL_COMMS], 0, 14, False, AnyPropertyType, &prop, &format, &num, &after, &str);
if (str) {
XFree(str);
} else {
@@ -120,7 +118,6 @@ enl_ipc_get_win(void)
void
enl_ipc_send(char *str)
{
-
static char *last_msg = NULL;
char buff[21];
register unsigned short i;
@@ -147,17 +144,12 @@ enl_ipc_send(char *str)
}
}
len = strlen(str);
- ipc_atom = XInternAtom(Xdisplay, "ENL_MSG", False);
- if (ipc_atom == None) {
- D_ENL(("IPC error: Unable to find/create ENL_MSG atom.\n"));
- return;
- }
for (; XCheckTypedWindowEvent(Xdisplay, my_ipc_win, ClientMessage, &ev);); /* Discard any out-of-sync messages */
ev.xclient.type = ClientMessage;
ev.xclient.serial = 0;
ev.xclient.send_event = True;
ev.xclient.window = ipc_win;
- ev.xclient.message_type = ipc_atom;
+ ev.xclient.message_type = props[PROP_ENL_MSG];
ev.xclient.format = 8;
for (i = 0; i < len + 1; i += 12) {