X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=i3bar%2Finclude%2Fipc.h;h=a0c4970420a768ca4633689b7768d6b939219ecb;hb=659e06a1709e6376c60ffd7b1401c471dce8a02e;hp=45565618bec029f4852a5259d82da82abfb40e57;hpb=02df973564f67edd4a91a0ff8bc74df057860b5b;p=i3%2Fi3 diff --git a/i3bar/include/ipc.h b/i3bar/include/ipc.h index 45565618..a0c49704 100644 --- a/i3bar/include/ipc.h +++ b/i3bar/include/ipc.h @@ -1,14 +1,41 @@ +/* + * vim:ts=4:sw=4:expandtab + * + * i3bar - an xcb-based status- and ws-bar for i3 + * © 2010-2011 Axel Wagner and contributors (see also: LICENSE) + * + * ipc.c: Communicating with i3 + * + */ #ifndef IPC_H_ #define IPC_H_ -#include +#include -ev_io* i3_events; -ev_io* outputs_watcher; -ev_io* workspaces_watcher; +/* + * Initiate a connection to i3. + * socket-path must be a valid path to the ipc_socket of i3 + * + */ +int init_connection(const char *socket_path); -void init_i3(const char* socket_path); -void get_outputs_json(void (*callback)(char*, void*), void* params); -void get_workspaces_json(void (*callback)(char*, void*), void* params); +/* + * Destroy the connection to i3. + * + */ +void destroy_connection(); + +/* + * Sends a Message to i3. + * type must be a valid I3_IPC_MESSAGE_TYPE (see i3/ipc.h for further information) + * + */ +int i3_send_msg(uint32_t type, const char* payload); + +/* + * Subscribe to all the i3-events, we need + * + */ +void subscribe_events(); #endif