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>
31 class WindowManager : public QObject
36 explicit WindowManager(QObject *parent = 0);
41 WindowmanagerAdaptor *mp_windowManagerAdaptor;
42 QList<Layout> m_layouts;
43 QList<int> m_appSurfaces;
44 QMap<int, unsigned int> *mp_layoutAreaToSurfaceIdAssignment;
49 unsigned int m_screenWidth;
50 unsigned int m_screenHeight;
54 int getLayerRenderOrder(t_ilm_layer id_array[]);
59 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
60 void createNewLayer(int layerId);
61 void addSurfaceToLayer(int surfaceId, int layerId);
69 #ifdef HAVE_IVI_LAYERMANAGEMENT_API
70 // for general notifications
71 void notificationFunc_non_static(ilmObjectType object,
74 static void notificationFunc_static(ilmObjectType object,
80 // for surface notifications
81 void surfaceCallbackFunction_non_static(t_ilm_surface surface,
82 struct ilmSurfaceProperties* surfaceProperties,
83 t_ilm_notification_mask mask);
84 static void surfaceCallbackFunction_static(t_ilm_surface surface,
85 struct ilmSurfaceProperties* surfaceProperties,
86 t_ilm_notification_mask mask);
92 // from windowmanager_adaptor.h
94 Q_PROPERTY(int layoutId READ layoutId)
97 Q_PROPERTY(QString layoutName READ layoutName)
98 QString layoutName() const;
100 public Q_SLOTS: // METHODS
101 int addLayout(int layoutId, const QString &layoutName, const QList<LayoutArea> &surfaceAreas);
102 int deleteLayoutById(int layoutId);
103 QList<Layout> getAllLayouts();
104 QList<int> getAllSurfacesOfProcess(int pid);
105 QList<int> getAvailableLayouts(int numberOfAppSurfaces);
106 QList<int> getAvailableSurfaces();
107 QString getLayoutName(int layoutId);
108 void hideLayer(int layer);
109 int setLayoutById(int layoutId);
110 int setLayoutByName(const QString &layoutName);
111 int setSurfaceToLayoutArea(int surfaceId, int layoutAreaId);
112 void showLayer(int layer);
114 Q_SIGNALS: // SIGNALS
115 void surfaceVisibilityChanged(int surfaceId, bool visible);
119 #endif // WINDOWMANAGER_HPP