Vuo
2.4.2
Loading...
Searching...
No Matches
type
VuoScreen.h
Go to the documentation of this file.
1
10
#pragma once
11
20
#include "
VuoInteger.h
"
21
#include "
VuoPoint2d.h
"
22
#include "
VuoText.h
"
23
24
#ifdef __cplusplus
25
extern
"C"
26
{
27
#endif
28
32
typedef
enum
33
{
34
VuoScreenType_Active,
35
VuoScreenType_Primary,
36
VuoScreenType_Secondary,
37
VuoScreenType_MatchId,
38
VuoScreenType_MatchName
39
}
VuoScreenType
;
40
44
typedef
struct
45
{
46
VuoScreenType
type;
47
VuoInteger
id
;
48
VuoInteger
displayMask
;
49
VuoText
name
;
50
51
bool
isRealized
;
52
53
VuoPoint2d topLeft;
// In points (not pixels).
54
55
VuoInteger
width;
// In points (not pixels).
56
VuoInteger
height;
57
58
VuoInteger
dpiHorizontal;
// Pixels per inch horizontally — e.g., 72 for typical displays, 144 for retina
59
VuoInteger
dpiVertical;
60
}
VuoScreen
;
61
62
VuoScreen
VuoScreen_makeFromJson
(
struct
json_object
* js);
63
struct
json_object
*
VuoScreen_getJson
(
const
VuoScreen
value);
64
char
*
VuoScreen_getSummary
(
const
VuoScreen
value);
65
66
#define VuoScreen_SUPPORTS_COMPARISON
67
bool
VuoScreen_areEqual
(
VuoScreen
value1,
VuoScreen
value2);
68
bool
VuoScreen_isLessThan
(
const
VuoScreen
a,
const
VuoScreen
b);
69
70
bool
VuoScreen_realize
(
VuoScreen
screen,
VuoScreen
*realizedScreen);
71
76
char
*
VuoScreen_getString
(
const
VuoScreen
value);
77
void
VuoScreen_retain
(
VuoScreen
value);
78
void
VuoScreen_release
(
VuoScreen
value);
80
84
static
inline
VuoScreen
VuoScreen_makeFromName
(
VuoText
name) __attribute__((
const
));
85
static
inline
VuoScreen
VuoScreen_makeFromName
(
VuoText
name)
86
{
87
VuoScreen
s = {VuoScreenType_MatchName,-1,-1,name,
false
,{0,0},0,0,0,0};
88
return
s;
89
}
90
94
static
inline
const
char
*
VuoScreen_cStringForType
(
VuoScreenType
type)
95
{
96
switch
(type)
97
{
98
case
VuoScreenType_Active:
99
return
"active"
;
100
case
VuoScreenType_Primary:
101
return
"primary"
;
102
case
VuoScreenType_Secondary:
103
return
"secondary"
;
104
case
VuoScreenType_MatchId:
105
return
"match-id"
;
106
case
VuoScreenType_MatchName:
107
return
"match-name"
;
108
// -Wunreachable-code doesn't like it if we cover all possible enum values *and* specify a default.
109
//default:
110
// return "primary";
111
}
112
}
113
117
static
inline
VuoScreenType
VuoScreen_typeFromCString
(
const
char
*typeString)
118
{
119
if
(strcmp(typeString,
"active"
)==0)
120
return
VuoScreenType_Active;
121
else
if
(strcmp(typeString,
"primary"
)==0)
122
return
VuoScreenType_Primary;
123
else
if
(strcmp(typeString,
"secondary"
)==0)
124
return
VuoScreenType_Secondary;
125
else
if
(strcmp(typeString,
"match-id"
)==0)
126
return
VuoScreenType_MatchId;
127
else
if
(strcmp(typeString,
"match-name"
)==0)
128
return
VuoScreenType_MatchName;
129
130
return
VuoScreenType_Active;
131
}
132
133
#ifdef __cplusplus
134
}
135
#endif
136
Generated on Tue Sep 27 2022 20:46:22 for Vuo by
1.9.5