1 #ifndef __DALI_INTERNAL_ADAPTOR_COMPOSITOR_OUTPUT_H__
2 #define __DALI_INTERNAL_ADAPTOR_COMPOSITOR_OUTPUT_H__
5 * Copyright (c) 2016 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
36 * An output is typically a monitor with Wayland.
37 * The output is required to view a region of the compositor space.
38 * E.g. a monitor may be display the entire compositor space, or just a
39 * region of that space.
40 * The output interface is published as global during start up, or when a monitor is
43 * Information available from the output includes
45 * - monitor dimensions in millimetres
46 * - monitor resolution
48 * We can use this information to calculate DPI for displaying text
51 class CompositorOutput
59 * @param[in] inputInterface input interface
60 * @param[in] seatInterface Wayland seat interface
65 * @brief non virtual destructor, not intended as base class
70 * @brief listen to output callbacks
71 * @param outputInterface[in] output interface
73 void AddListener( WlOutput* outputInterface );
77 * @param[out] dpiHorizontal set to the horizontal DPI
78 * @param[out] dpiVertical set to the vertical DPI
80 static void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical );
84 * @brief return true if all information about the compositor output has been received
85 * and is ready to be read
86 * @return true if ready
88 bool DataReady() const;
92 * @brief Set monitor size in millimetres
93 * @param[in] width width
94 * @param[in] height height
96 void SetMonitorDimensions( unsigned int width, unsigned int height );
99 * @brief Set monitor resolution in pixels
100 * @param[in] width width
101 * @param[in] height height
103 void SetMonitorResolution( unsigned int width, unsigned int height );
107 * @brief Called when all callbacks have finished
108 * at this point we calculate DPI
110 void CallbacksDone();
114 // @brief Undefined copy constructor.
115 CompositorOutput( const CompositorOutput& );
117 // @brief Undefined assignment operator.
118 CompositorOutput& operator=( const CompositorOutput& );
120 WlOutput* mOutput; ///< Compositor output ( info for attached monitor)
121 unsigned int mXresolution; ///< Monitor resolution in pixel
122 unsigned int mYresolution; ///< Monitor resolution in pixel
123 float mMonitorWidth; ///< width in inches
124 float mMonitorHeight; ///< height in inches
133 #endif //__DALI_INTERNAL_ADAPTOR_COMPOSITOR_OUTPUT_H__