| 1 |
/* |
| 2 |
* Copyright © 2016 Red Hat, Inc |
| 3 |
* |
| 4 |
* This library is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU Library General Public |
| 6 |
* License as published by the Free Software Foundation; either |
| 7 |
* version 2 of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This library is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 |
* Library General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU Library General Public |
| 15 |
* License along with this library. If not, see <http://www.gnu.org/licenses/>. |
| 16 |
*/ |
| 17 |
|
| 18 |
#ifndef __GDK_WIN32_MONITOR_PRIVATE_H__ |
| 19 |
#define __GDK_WIN32_MONITOR_PRIVATE_H__ |
| 20 |
|
| 21 |
#include <windows.h> |
| 22 |
#include <glib.h> |
| 23 |
#include <gio/gio.h> |
| 24 |
|
| 25 |
#include "gdkmonitorprivate.h" |
| 26 |
|
| 27 |
#include "gdkwin32monitor.h" |
| 28 |
|
| 29 |
/* |
| 30 |
* The number is the degrees the display is rotated clockwise |
| 31 |
* from its natural position. |
| 32 |
* I.e. most displays will have 0. A normal display |
| 33 |
* that is rotated by 90 degrees will |
| 34 |
* have 90. The same display rotated counter-clockwise |
| 35 |
* will have 270. The same display |
| 36 |
* rotated by 180 degrees (i.e. upside-down) |
| 37 |
* will have 180. |
| 38 |
* Accordingly, 0 mode |
| 39 |
* fontsmoothing is used as-is - i.e. it is assumed that |
| 40 |
* subpixel structure is horizontal (ClearType does not support |
| 41 |
* vertical subpixels; if the display has naturally vertical |
| 42 |
* subpixel structure, ClearType should be disabled altogether). |
| 43 |
* In 90 subpixel structure has |
| 44 |
* its verticality flipped (rgb -> vrgb; bgr -> vbgr). |
| 45 |
* In 180 subpixel structure is |
| 46 |
* horizontally flipped (rgb -> bgr; bgr -> rgb). |
| 47 |
* In 270 subpixel structure is |
| 48 |
* flipped both horizontally and vertically |
| 49 |
* (rgb -> vbgr; bgr -> vrgb). |
| 50 |
*/ |
| 51 |
typedef enum _GdkWin32MonitorRotation { |
| 52 |
GDK_WIN32_MONITOR_ROTATION_UNKNOWN = 0, |
| 53 |
GDK_WIN32_MONITOR_ROTATION_0 = 1, |
| 54 |
GDK_WIN32_MONITOR_ROTATION_90 = 2, |
| 55 |
GDK_WIN32_MONITOR_ROTATION_180 = 3, |
| 56 |
GDK_WIN32_MONITOR_ROTATION_270 = 4, |
| 57 |
} GdkWin32MonitorRotation; |
| 58 |
|
| 59 |
struct _GdkWin32Monitor |
| 60 |
{ |
| 61 |
GdkMonitor parent; |
| 62 |
|
| 63 |
/* work area */ |
| 64 |
GdkRectangle work_rect; |
| 65 |
|
| 66 |
/* Device instance path (used to match GdkWin32Monitor to monitor device) */ |
| 67 |
gchar *instance_path; |
| 68 |
|
| 69 |
/* Indicates display rotation and its normal proportions. |
| 70 |
* Used to determine pixel structure for subpixel smoothing. |
| 71 |
*/ |
| 72 |
GdkWin32MonitorRotation orientation; |
| 73 |
|
| 74 |
/* TRUE if monitor is made up by us |
| 75 |
* (this happens when system has logical monitors, but no physical ones). |
| 76 |
*/ |
| 77 |
guint madeup : 1; |
| 78 |
|
| 79 |
/* TRUE if we should notify GDK about this monitor being added */ |
| 80 |
guint add : 1; |
| 81 |
|
| 82 |
/* TRUE if we should notify GDK about this monitor being removed */ |
| 83 |
guint remove : 1; |
| 84 |
}; |
| 85 |
|
| 86 |
struct _GdkWin32MonitorClass { |
| 87 |
GdkMonitorClass parent_class; |
| 88 |
}; |
| 89 |
|
| 90 |
int _gdk_win32_monitor_compare (GdkWin32Monitor *a, GdkWin32Monitor *b); |
| 91 |
|
| 92 |
const gchar *_gdk_win32_monitor_get_pixel_structure (GdkMonitor *monitor); |
| 93 |
|
| 94 |
#endif |