2001-03-06 12:34:58 -08:00
|
|
|
#include "e.h"
|
|
|
|
|
2001-03-11 17:01:10 -08:00
|
|
|
struct _coords {
|
|
|
|
int xid;
|
|
|
|
int x;
|
|
|
|
int y;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _coords coords;
|
|
|
|
|
2001-03-06 12:34:58 -08:00
|
|
|
void e_ipc_init(void);
|
2001-03-11 17:01:10 -08:00
|
|
|
static void e_ipc_get_version(int fd);
|
|
|
|
static void e_ipc_move_window(int fd);
|
2001-03-06 12:34:58 -08:00
|
|
|
|
|
|
|
void
|
|
|
|
e_ipc_init(void)
|
|
|
|
{
|
|
|
|
char buf[4096];
|
|
|
|
|
|
|
|
/* unix domain socket file path */
|
|
|
|
sprintf(buf, "%secom", e_config_user_dir());
|
|
|
|
|
|
|
|
/* init ecore ipc */
|
|
|
|
e_ev_ipc_init(buf);
|
|
|
|
|
|
|
|
/* add ipc services or functions clients can use */
|
|
|
|
e_add_ipc_service(0, e_ipc_get_version);
|
2001-03-11 17:01:10 -08:00
|
|
|
e_add_ipc_service(1, e_ipc_move_window);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
e_ipc_get_version(int fd)
|
|
|
|
{
|
|
|
|
e_ipc_send_data(fd, &VERSION, strlen(VERSION));
|
2001-03-06 12:34:58 -08:00
|
|
|
}
|
|
|
|
|
2001-03-11 17:01:10 -08:00
|
|
|
static void
|
|
|
|
e_ipc_move_window(int fd)
|
2001-03-06 12:34:58 -08:00
|
|
|
{
|
2001-03-11 17:01:10 -08:00
|
|
|
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));
|
2001-03-06 12:34:58 -08:00
|
|
|
}
|