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"
27 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
28 #include <ilm/ilm_control.h>
30 class WindowManager : public QObject
35 explicit WindowManager(QObject *parent = 0);
40 WindowmanagerAdaptor *mp_windowManagerAdaptor;
41 QList<Layout> m_layouts;
42 QMap<int, unsigned int> *mp_layoutAreaToSurfaceIdAssignment;
47 unsigned int m_screenWidth;
48 unsigned int m_screenHeight;
52 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
53 t_ilm_layer* m_showLayers;
54 QMap<pid_t, t_ilm_layer> m_appLayers;
55 int getLayerRenderOrder(t_ilm_layer* id_array);
56 void createNewLayer(const int layerId);
58 t_ilm_layer getAppLayerID(const pid_t pid);
60 pid_t m_pending_to_show;
62 void addSurfaceToAppLayer(const int surfaceID);
63 void addSurfaceToLayer(const int surfaceId, const int layerId);
71 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
72 // for general notifications
73 void notificationFunc_non_static(ilmObjectType object,
76 static void notificationFunc_static(ilmObjectType object,
82 // for surface notifications
83 void surfaceCallbackFunction_non_static(t_ilm_surface surface,
84 struct ilmSurfaceProperties* surfaceProperties,
85 t_ilm_notification_mask mask);
86 static void surfaceCallbackFunction_static(t_ilm_surface surface,
87 struct ilmSurfaceProperties* surfaceProperties,
88 t_ilm_notification_mask mask);
94 // from windowmanager_adaptor.h
96 Q_PROPERTY(int layoutId READ layoutId)
99 Q_PROPERTY(QString layoutName READ layoutName)
100 QString layoutName() const;
102 public Q_SLOTS: // METHODS
103 int addLayout(int layoutId, const QString &layoutName, const QList<LayoutArea> &surfaceAreas);
104 int deleteLayoutById(int layoutId);
105 QList<Layout> getAllLayouts();
106 // QList<int> getAllSurfacesOfProcess(int pid);
107 QList<int> getAvailableLayouts(int numberOfAppSurfaces);
108 // QList<int> getAvailableSurfaces();
109 QString getLayoutName(int layoutId);
110 void hideLayer(int layer);
111 int setLayoutById(int layoutId);
112 int setLayoutByName(const QString &layoutName);
113 int setSurfaceToLayoutArea(int surfaceId, int layoutAreaId);
114 void showLayer(int layer);
115 void showAppLayer(int pid);
117 Q_SIGNALS: // SIGNALS
118 void surfaceVisibilityChanged(int surfaceId, bool visible);
122 #endif // WINDOWMANAGER_HPP