1 /* Gnome Music Player Client (GMPC)
2  * Copyright (C) 2011-2011 Qball Cow <qball@gmpclient.org>
3  * Project homepage: http://gmpclient.org/
4 
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9 
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14 
15  * You should have received a copy of the GNU General Public License along
16  * with this program; if not, write to the Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 
20 #ifndef __IPC_H__
21 #define __IPC_H__
22 
23 #ifdef HAVE_UNIQUE
24 
25 /* Set the define HAVE_IPC.
26  * outside ipc.c|h only check that.
27  * not HAVE_UNIQUE
28  */
29 #define HAVE_IPC
30 
31 /**
32  * Supported commands
33  */
34 typedef enum
35 {
36 	COMMAND_0, /* unused: 0 is an invalid command */
37 	COMMAND_STREAM,
38 	COMMAND_EASYCOMMAND
39 } GmpcToolsIPCCommands;
40 
41 /**
42  * @param ipc: the GmpcToolsIPC object
43  *
44  * Check if gmpc is allready running.
45  *
46  * @returns true if gmpc is allready running
47  */
48 gboolean gmpc_tools_ipc_is_running(GObject *ipc);
49 /**
50  * Create a new GmpcToolsIPC instance
51  *
52  * @returns a new GmpcToolsIPC instance
53  */
54 GObject *gmpc_tools_ipc_new(void);
55 
56 /**
57  * @param ipc: the GmpcToolsIPC object
58  * @param command: The #GmpcToolsIPCCommands to send.
59  * @param command_param: The message to send along the command or NULL
60  *
61  * send a command (with possible message) to the running gmpc.
62  *
63  * @returns TRUE is succesfull.
64  */
65 
66 gboolean gmpc_tools_ipc_send(GObject *ipc, GmpcToolsIPCCommands command,const char *command_param);
67 #ifndef CLIENT_ONLY
68 
69 /**
70  * @param ipc: the GmpcToolsIPC object
71  * @param win: A GtkWindow
72  *
73  * watch a window. (see libunique documentation)
74  *
75  */
76 void gmpc_tools_ipc_watch_window(GObject *ipc, GtkWindow *win);
77 #endif
78 #endif
79 #endif // __IPC_H__
80