Adapt the AIL filter used to new ones
[profile/ivi/ico-uxf-homescreen.git] / lib / system-controller / CicoSCWayland.h
1 /*
2  * Copyright (c) 2013, TOYOTA MOTOR CORPORATION.
3  *
4  * This program is licensed under the terms and conditions of the
5  * Apache License, version 2.0.  The full text of the Apache License is at
6  * http://www.apache.org/licenses/LICENSE-2.0
7  *
8  */
9
10 //==========================================================================
11 /**
12  *  @file   CicoSCWayland.h
13  *
14  *  @brief  This file is definition of CicoSCWayland class
15  */
16 //==========================================================================
17 #ifndef __CICO_SC_WAYLAND_H__
18 #define __CICO_SC_WAYLAND_H__
19
20 #include <string>
21 #include <map>
22
23 #include <Ecore.h>
24
25 #include <wayland-client.h>
26
27 //==========================================================================
28 //  Forward declaration
29 //==========================================================================
30 class CicoSCWaylandIF;
31
32 //==========================================================================
33 /*
34  *  @brief  This class controls wayland
35  */
36 //==========================================================================
37 class CicoSCWayland {
38 public:
39     // get instance of CicoSCWayland
40     static CicoSCWayland* getInstance();
41
42     // initialize wayland connection
43     int initialize(void);
44
45     // flush display
46     void flushDisplay(void);
47
48     // dispatch display
49     void dispatchDisplay(void);
50
51     // get wayland error
52     int getError(void);
53
54     // get wayland file descriptor
55     int getWlFd(void);
56
57     // app ecore main wayland file descriptor handler
58     int addEcoreMainWlFdHandler(void);
59
60     // add wayland interface
61     void addWaylandIF(const char *name, CicoSCWaylandIF* interface);
62
63     // waylnad file descriptor handler
64     static Eina_Bool waylandFdHandler(void *data, Ecore_Fd_Handler *handler);
65
66     // wayland global callback function
67     void globalCB(void               *data,
68                   struct wl_registry *registry,
69                   uint32_t           name,
70                   const char         *interface,
71                   uint32_t           version);
72
73 private:
74     // wayland standard callback function
75     static void wlGlobalCB(void               *data,
76                            struct wl_registry *registry,
77                            uint32_t           name,
78                            const char         *interface,
79                            uint32_t           version);
80
81 private:
82     // default constructor
83     CicoSCWayland();
84
85     // destructor
86     ~CicoSCWayland();
87
88     // assignment operator
89     CicoSCWayland& operator=(const CicoSCWayland &object);
90
91     // copy constructor
92     CicoSCWayland(const CicoSCWayland &object);
93
94 private:
95     /// my instance
96     static CicoSCWayland *ms_myInstance;
97
98     /// wayland's display
99     struct wl_display *m_wlDisplay;
100
101     /// wayland's registry
102     struct wl_registry *m_wlRegistry;
103
104     /// wayland's file descriptor
105     int m_wlFd;
106
107     /// ecore file descriptor handler
108     Ecore_Fd_Handler *m_ecoreFdHandler;
109
110     /// interface list
111     std::map<std::string, CicoSCWaylandIF*> m_wlInterfaceList;
112
113     // wayland common callbacks
114     struct wl_registry_listener m_wlListener;
115 };
116 #endif  // __CICO_SC_WAYLAND_H__
117 // vim:set expandtab ts=4 sw=4: