17 "title" :
"Window Property",
18 "description" :
"A window setting, such as its title, or whether it is full-screen.",
30 "VuoList_VuoWindowProperty"
47 VuoWindowProperty value = { -1, NULL,
false, {-1, -1, -1, NULL,
false, {0,0}, 0, 0, 0, 0}, -1, 0, 0, 0, 0, 0,
false, -1, {{
"",
""}, {0,0},
false, -1, {0,0}, 0, 0} };
51 if (json_object_object_get_ex(js,
"unit", &o))
54 if (json_object_object_get_ex(js,
"title", &o))
56 value.type = VuoWindowProperty_Title;
60 else if (json_object_object_get_ex(js,
"fullScreen", &o))
62 value.type = VuoWindowProperty_FullScreen;
64 if (json_object_object_get_ex(js,
"screen", &o))
68 else if (json_object_object_get_ex(js,
"left", &o))
70 value.type = VuoWindowProperty_Position;
72 if (json_object_object_get_ex(js,
"top", &o))
76 else if (json_object_object_get_ex(js,
"width", &o))
78 value.type = VuoWindowProperty_Size;
80 if (json_object_object_get_ex(js,
"height", &o))
84 else if (json_object_object_get_ex(js,
"aspectRatio", &o))
86 value.type = VuoWindowProperty_AspectRatio;
90 else if (json_object_object_get_ex(js,
"aspectRatioReset", &o))
92 value.type = VuoWindowProperty_AspectRatioReset;
95 else if (json_object_object_get_ex(js,
"resizable", &o))
97 value.type = VuoWindowProperty_Resizable;
101 else if (json_object_object_get_ex(js,
"cursor", &o))
103 value.type = VuoWindowProperty_Cursor;
107 else if (json_object_object_get_ex(js,
"interaction", &o))
109 value.type = VuoWindowProperty_Interaction;
124 if (value.type == VuoWindowProperty_Title)
126 else if (value.type == VuoWindowProperty_FullScreen)
131 else if (value.type == VuoWindowProperty_Position)
137 else if (value.type == VuoWindowProperty_Size)
143 else if (value.type == VuoWindowProperty_AspectRatio)
144 json_object_object_add(js,
"aspectRatio",
VuoReal_getJson(value.aspectRatio));
145 else if (value.type == VuoWindowProperty_AspectRatioReset)
147 else if (value.type == VuoWindowProperty_Resizable)
149 else if (value.type == VuoWindowProperty_Cursor)
151 else if (value.type == VuoWindowProperty_Interaction)
162 if (value.type == VuoWindowProperty_Title)
163 return VuoText_format(
"Change Window Title: \"%s\"", value.title);
164 else if (value.type == VuoWindowProperty_FullScreen)
166 if (value.fullScreen)
169 char *summary =
VuoText_format(
"<div>Change to Fullscreen</div><div>%s</div>", screenSummary);
174 return strdup(
"Change to Windowed");
176 else if (value.type == VuoWindowProperty_Position)
179 char *t =
VuoText_format(
"Change Window Position: (%lld, %lld) %s", value.left, value.top, unit);
183 else if (value.type == VuoWindowProperty_Size)
186 char *t =
VuoText_format(
"Change Window Size: %lldx%lld %s", value.width, value.height, unit);
190 else if (value.type == VuoWindowProperty_AspectRatio)
191 return VuoText_format(
"Change Window Aspect Ratio: %g", value.aspectRatio);
192 else if (value.type == VuoWindowProperty_AspectRatioReset)
194 else if (value.type == VuoWindowProperty_Resizable)
195 return value.resizable ? strdup(
"Enable Window Resizing") : strdup(
"Disable Window Resizing");
196 else if (value.type == VuoWindowProperty_Cursor)
199 char *summary =
VuoText_format(
"Change mouse cursor to %s", cursorSummary);
203 else if (value.type == VuoWindowProperty_Interaction)
206 return strdup(
"Unknown window property");
221 if(prop.type == windowPropertyType)