1 /*
2  * Copyright (C) 2002 Red Hat, Inc.
3  *
4  * Permission is hereby granted, free of charge, to any person
5  * obtaining a copy of this software and associated documentation
6  * files (the "Software"), to deal in the Software without
7  * restriction, including without limitation the rights to use, copy,
8  * modify, merge, publish, distribute, sublicense, and/or sell copies
9  * of the Software, and to permit persons to whom the Software is
10  * furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be
13  * included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22  * SOFTWARE.
23  */
24 
25 #ifndef __SN_XMESSAGES_H__
26 #define __SN_XMESSAGES_H__
27 
28 #include <libsn/sn-common.h>
29 
30 SN_BEGIN_DECLS
31 
32 typedef void (* SnXmessageFunc) (SnDisplay       *display,
33                                  const char      *message_type,
34                                  const char      *message,
35                                  void            *user_data);
36 
37 void sn_internal_add_xmessage_func    (SnDisplay      *display,
38                                        int             screen,
39                                        const char     *message_type,
40                                        const char     *message_type_begin,
41                                        SnXmessageFunc  func,
42                                        void           *func_data,
43                                        SnFreeFunc      free_data_func);
44 void sn_internal_remove_xmessage_func (SnDisplay      *display,
45                                        int             screen,
46                                        const char     *message_type,
47                                        SnXmessageFunc  func,
48                                        void           *func_data);
49 void sn_internal_broadcast_xmessage   (SnDisplay      *display,
50                                        int             screen,
51                                        xcb_atom_t      message_type,
52                                        xcb_atom_t      message_type_begin,
53                                        const char     *message);
54 
55 char*     sn_internal_serialize_message   (const char   *prefix,
56                                            const char  **property_names,
57                                            const char  **property_values);
58 sn_bool_t sn_internal_unserialize_message (const char   *message,
59                                            char        **prefix,
60                                            char       ***property_names,
61                                            char       ***property_values);
62 
63 SN_END_DECLS
64 
65 #endif /* __SN_XMESSAGES_H__ */
66