return weston_compositor_get_user_data(ec);
}
-static struct ivi_output_config *
+struct ivi_output_config *
ivi_init_parsed_options(struct weston_compositor *compositor)
{
struct ivi_compositor *ivi = to_ivi_compositor(compositor);
if (output->fullscreen_view.fs &&
output->fullscreen_view.fs->view) {
- weston_surface_destroy(output->fullscreen_view.fs->view->surface);
+ weston_surface_unref(output->fullscreen_view.fs->view->surface);
+ weston_buffer_destroy_solid(output->fullscreen_view.buffer_ref);
output->fullscreen_view.fs->view = NULL;
}
{
size_t fail_len = 0;
- for (size_t i = 0; i < output->add_len; ++i) {
+ for (size_t i = 1; i < output->add_len; i++) {
if (weston_output_attach_head(output->output, output->add[i]) < 0) {
struct weston_head *tmp = output->add[i];
memmove(&output->add[fail_len + 1], output->add[fail_len],
return fail_len;
}
+/* Place output exactly to the right of the most recently enabled output.
+ *
+ * Historically, we haven't given much thought to output placement,
+ * simply adding outputs in a horizontal line as they're enabled. This
+ * function simply sets an output's x coordinate to the right of the
+ * most recently enabled output, and its y to zero.
+ *
+ * If you're adding new calls to this function, you're also not giving
+ * much thought to output placement, so please consider carefully if
+ * it's really doing what you want.
+ *
+ * You especially don't want to use this for any code that won't
+ * immediately enable the passed output.
+ */
+static void
+weston_output_lazy_align(struct weston_output *output)
+{
+ struct weston_compositor *c;
+ struct weston_output *peer;
+ int next_x = 0;
+
+ /* Put this output to the right of the most recently enabled output */
+ c = output->compositor;
+ if (!wl_list_empty(&c->output_list)) {
+ peer = container_of(c->output_list.prev,
+ struct weston_output, link);
+ next_x = peer->x + peer->width;
+ }
+ output->x = next_x;
+ output->y = 0;
+}
+
+
/*
* Like try_attach_heads, this reorganizes the output's add array into a failed
* and successful section.
for (; i < output->add_len; ++i) {
struct weston_head *head;
+ weston_output_lazy_align(output->output);
+
if (weston_output_enable(output->output) == 0)
break;
weston_rdp_output_get_api(output->compositor);
int width = 640;
int height = 480;
+ struct weston_config_section *section;
+ uint32_t transform = WL_OUTPUT_TRANSFORM_NORMAL;
+ char *transform_string;
assert(parsed_options);
return -1;
}
+ section = weston_config_get_section(ivi->config, "rdp", NULL, NULL);
+
if (parsed_options->width)
width = parsed_options->width;
height = parsed_options->height;
weston_output_set_scale(output, 1);
- weston_output_set_transform(output, WL_OUTPUT_TRANSFORM_NORMAL);
+
+ weston_config_section_get_int(section, "width",
+ &width, width);
+
+ weston_config_section_get_int(section, "height",
+ &height, height);
+
+ if (parsed_options->transform)
+ transform = parsed_options->transform;
+
+ weston_config_section_get_string(section, "transform",
+ &transform_string, "normal");
+
+ if (parse_transform(transform_string, &transform) < 0) {
+ weston_log("Invalid transform \"%s\" for output %s\n",
+ transform_string, output->name);
+ return -1;
+ }
+
+ weston_output_set_transform(output, transform);
if (api->output_set_size(output, width, height) < 0) {
weston_log("Cannot configure output \"%s\" using weston_rdp_output_api.\n",
{
struct weston_rdp_backend_config config = {};
int ret = 0;
+ struct weston_config_section *section;
struct ivi_output_config *parsed_options = ivi_init_parsed_options(ivi->compositor);
if (!parsed_options)
{ WESTON_OPTION_BOOLEAN, "env-socket", 0, &config.env_socket },
{ WESTON_OPTION_INTEGER, "width", 0, &parsed_options->width },
{ WESTON_OPTION_INTEGER, "height", 0, &parsed_options->height },
+ { WESTON_OPTION_INTEGER, "transform", 0, &parsed_options->transform },
+ { WESTON_OPTION_INTEGER, "scale", 0, &parsed_options->scale },
{ WESTON_OPTION_STRING, "address", 0, &config.bind_address },
{ WESTON_OPTION_INTEGER, "port", 0, &config.port },
{ WESTON_OPTION_BOOLEAN, "no-clients-resize", 0, &config.no_clients_resize },
{ WESTON_OPTION_BOOLEAN, "force-no-compression", 0, &config.force_no_compression },
};
+ section = weston_config_get_section(ivi->config, "rdp", NULL, NULL);
+
+ weston_config_section_get_string(section, "tls-cert",
+ &config.server_cert, config.server_cert);
+
+ weston_config_section_get_string(section, "tls-key",
+ &config.server_key, config.server_key);
+
+
parse_options(rdp_options, ARRAY_LENGTH(rdp_options), argc, argv);
ivi->simple_output_configure = rdp_backend_output_configure;