2 * Copyright (C) 2016 Mentor Graphics Development (Deutschland) GmbH
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #ifndef WINDOWMANAGER_HPP
18 #define WINDOWMANAGER_HPP
24 #include "windowmanager_adaptor.h"
26 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
27 #include <ilm/ilm_control.h>
29 class WindowManager : public QObject
34 explicit WindowManager(int displayId, QObject *parent = 0);
39 WindowmanagerAdaptor *mp_windowManagerAdaptor;
40 QList<Layout> m_layouts;
41 QMap<int, unsigned int> *mp_layoutAreaToSurfaceIdAssignment;
46 unsigned int m_screenWidth;
47 unsigned int m_screenHeight;
51 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
52 t_ilm_layer* m_showLayers;
53 QMap<pid_t, t_ilm_surface> m_appSurfaces;
54 QMap<pid_t, t_ilm_layer> m_appLayers;
55 int getLayerRenderOrder(t_ilm_layer* id_array);
57 void createNewLayer(const int layerId);
59 t_ilm_layer getAppLayerID(const pid_t pid);
61 pid_t m_pending_to_show;
63 void addSurface(const t_ilm_surface surfaceId);
64 t_ilm_layer addSurfaceToAppLayer(pid_t pid, const int surfaceId);
65 void addSurfaceToLayer(const int surfaceId, const int layerId);
67 void configureHomeScreenMainSurface(const t_ilm_surface surface, const t_ilm_int width, const t_ilm_int height);
68 void configureAppSurface(const pid_t pid, const t_ilm_surface surface, const t_ilm_int width, const t_ilm_int height);
76 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
77 // for general notifications
78 void notificationFunc_non_static(ilmObjectType object,
81 static void notificationFunc_static(ilmObjectType object,
87 // for surface notifications
88 void surfaceCallbackFunction_non_static(t_ilm_surface surface,
89 struct ilmSurfaceProperties* surfaceProperties,
90 t_ilm_notification_mask mask);
91 static void surfaceCallbackFunction_static(t_ilm_surface surface,
92 struct ilmSurfaceProperties* surfaceProperties,
93 t_ilm_notification_mask mask);
99 // from windowmanager_adaptor.h
100 public: // PROPERTIES
101 Q_PROPERTY(int layoutId READ layoutId)
102 int layoutId() const;
104 Q_PROPERTY(QString layoutName READ layoutName)
105 QString layoutName() const;
107 public Q_SLOTS: // METHODS
108 int addLayout(int layoutId, const QString &layoutName, const QList<LayoutArea> &surfaceAreas);
109 int deleteLayoutById(int layoutId);
110 QList<Layout> getAllLayouts();
111 // QList<int> getAllSurfacesOfProcess(int pid);
112 QList<int> getAvailableLayouts(int numberOfAppSurfaces);
113 // QList<int> getAvailableSurfaces();
114 QString getLayoutName(int layoutId);
115 void hideLayer(int layer);
116 int setLayoutById(int layoutId);
117 int setLayoutByName(const QString &layoutName);
118 int setSurfaceToLayoutArea(int surfaceId, int layoutAreaId);
119 void showLayer(int layer);
120 void showAppLayer(int pid);
122 Q_SIGNALS: // SIGNALS
123 void surfaceVisibilityChanged(int surfaceId, bool visible);
126 #endif // WINDOWMANAGER_HPP