+
+ new_mode.width = width;
+ new_mode.height = height;
+
+ api->output_set_mode(output, &new_mode);
+ weston_output_set_transform(output, transform);
+
+ return 0;
+}
+
+static int
+load_rdp_backend(struct ivi_compositor *ivi, int *argc, char **argv)
+{
+ struct weston_rdp_backend_config config = {};
+ struct weston_config_section *section;
+
+ struct ivi_output_config *parsed_options = ivi_init_parsed_options(ivi->compositor);
+ if (!parsed_options)
+ return -1;
+
+ weston_rdp_backend_config_init(&config);
+
+ const struct weston_option rdp_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_STRING, "rdp4-key", 0, &config.rdp_key },
+ { WESTON_OPTION_STRING, "rdp-tls-cert", 0, &config.server_cert },
+ { WESTON_OPTION_STRING, "rdp-tls-key", 0, &config.server_key },
+ { 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;
+
+ ivi->heads_changed.notify = simple_heads_changed;
+ weston_compositor_add_heads_changed_listener(ivi->compositor,
+ &ivi->heads_changed);
+
+ if (!weston_compositor_load_backend(ivi->compositor,
+ WESTON_BACKEND_RDP, &config.base))