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)
167 char *summary =
VuoText_format(
"<div>Change to %s</div><div>%s</div>",
168 value.fullScreen ?
"Fullscreen" :
"Windowed",
173 else if (value.type == VuoWindowProperty_Position)
176 char *t =
VuoText_format(
"Change Window Position: (%lld, %lld) %s", value.left, value.top, unit);
180 else if (value.type == VuoWindowProperty_Size)
183 char *t =
VuoText_format(
"Change Window Size: %lldx%lld %s", value.width, value.height, unit);
187 else if (value.type == VuoWindowProperty_AspectRatio)
188 return VuoText_format(
"Change Window Aspect Ratio: %g", value.aspectRatio);
189 else if (value.type == VuoWindowProperty_AspectRatioReset)
191 else if (value.type == VuoWindowProperty_Resizable)
192 return value.resizable ? strdup(
"Enable Window Resizing") : strdup(
"Disable Window Resizing");
193 else if (value.type == VuoWindowProperty_Cursor)
196 char *summary =
VuoText_format(
"Change mouse cursor to %s", cursorSummary);
200 else if (value.type == VuoWindowProperty_Interaction)
203 return strdup(
"Unknown window property");
218 if(prop.type == windowPropertyType)