forked from enlightenment/enlightenment
parent
41cabbdf27
commit
cf59a01878
34
src/ipc.c
34
src/ipc.c
|
@ -1,7 +1,16 @@
|
|||
#include "e.h"
|
||||
|
||||
struct _coords {
|
||||
int xid;
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
typedef struct _coords coords;
|
||||
|
||||
void e_ipc_init(void);
|
||||
static char *e_ipc_get_version(char *argv);
|
||||
static void e_ipc_get_version(int fd);
|
||||
static void e_ipc_move_window(int fd);
|
||||
|
||||
void
|
||||
e_ipc_init(void)
|
||||
|
@ -16,11 +25,26 @@ e_ipc_init(void)
|
|||
|
||||
/* add ipc services or functions clients can use */
|
||||
e_add_ipc_service(0, e_ipc_get_version);
|
||||
e_add_ipc_service(1, e_ipc_move_window);
|
||||
}
|
||||
|
||||
static char
|
||||
*e_ipc_get_version(char *argv)
|
||||
static void
|
||||
e_ipc_get_version(int fd)
|
||||
{
|
||||
printf("e_ipc_get_version service called\n"); fflush(stdout);
|
||||
return "0.17.0";
|
||||
e_ipc_send_data(fd, &VERSION, strlen(VERSION));
|
||||
}
|
||||
|
||||
static void
|
||||
e_ipc_move_window(int fd)
|
||||
{
|
||||
coords test;
|
||||
int retval = 0;
|
||||
|
||||
/* get window id and coords to move to */
|
||||
e_ipc_get_data(fd, &test);
|
||||
|
||||
/* move window here */
|
||||
|
||||
/* return failure or success */
|
||||
e_ipc_send_data(fd, &retval, sizeof(retval));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue