X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fmain.c;h=3e560134e0be76c28218265f24d22865b0f68aae;hb=7e472e249c1e35170b6dd00b186288967855573a;hp=164b45b87315c64c28aa47afa55a096a160468d3;hpb=991714fc7f92aea3d07c7225247a821e3461027e;p=src%2Fagl-compositor.git diff --git a/src/main.c b/src/main.c index 164b45b..3e56013 100644 --- a/src/main.c +++ b/src/main.c @@ -57,6 +57,10 @@ #include "remote.h" #endif +#ifdef HAVE_WALTHAM +#include +#endif + static int cached_tm_mday = -1; static struct weston_log_scope *log_scope; @@ -558,6 +562,38 @@ heads_changed(struct wl_listener *listener, void *arg) } } +#ifdef HAVE_WALTHAM +static int +load_waltham_plugin(struct ivi_compositor *ivi, struct weston_config *config) +{ + struct weston_compositor *compositor = ivi->compositor; + int (*module_init)(struct weston_compositor *wc); + + module_init = weston_load_module("waltham-transmitter.so", + "wet_module_init"); + if (!module_init) + return -1; + + if (module_init(compositor) < 0) + return -1; + + ivi->waltham_transmitter_api = weston_get_transmitter_api(compositor); + if (!ivi->waltham_transmitter_api) { + weston_log("Failed to load waltham-transmitter plugin.\n"); + return -1; + } + + weston_log("waltham-transmitter plug-in loaded\n"); + return 0; +} +#else +static int +load_waltham_plugin(struct ivi_compositor *ivi, struct weston_config *config) +{ + return -1; +} +#endif + #ifdef HAVE_REMOTING static int drm_backend_remoted_output_configure(struct weston_output *output, @@ -1346,7 +1382,7 @@ usage(int error_code) " --log=FILE\t\tLog to the given file\n" " -c, --config=FILE\tConfig file to load, defaults to agl-compositor.ini\n" " --no-config\t\tDo not read agl-compositor.ini\n" - " --debug\t\tEnable debug extension\n" + " --debug\t\tEnable debug extension(s)\n" " -h, --help\t\tThis help message\n" "\n"); exit(error_code); @@ -1366,6 +1402,8 @@ int main(int argc, char *argv[]) int help = 0; int version = 0; int no_config = 0; + int debug = 0; + int waltham = 0; char *config_file = NULL; struct weston_log_context *log_ctx = NULL; struct weston_log_subscriber *logger; @@ -1378,6 +1416,8 @@ int main(int argc, char *argv[]) { WESTON_OPTION_BOOLEAN, "help", 'h', &help }, { WESTON_OPTION_BOOLEAN, "version", 0, &version }, { WESTON_OPTION_BOOLEAN, "no-config", 0, &no_config }, + { WESTON_OPTION_BOOLEAN, "debug", 0, &debug }, + { WESTON_OPTION_BOOLEAN, "waltham", 0, &waltham }, { WESTON_OPTION_STRING, "config", 'c', &config_file }, }; @@ -1390,6 +1430,7 @@ int main(int argc, char *argv[]) wl_list_init(&ivi.remote_pending_apps); wl_list_init(&ivi.desktop_clients); + /* Prevent any clients we spawn getting our stdin */ os_fd_set_cloexec(STDIN_FILENO); @@ -1428,6 +1469,8 @@ int main(int argc, char *argv[]) if (!backend) backend = choose_default_backend(); } + /* from [core] */ + weston_config_section_get_bool(section, "hide-cursor", &ivi.hide_cursor, false); display = wl_display_create(); loop = wl_display_get_event_loop(display); @@ -1469,6 +1512,8 @@ int main(int argc, char *argv[]) if (ivi_desktop_init(&ivi) < 0) goto error_compositor; + ivi_seat_init(&ivi); + if (ivi_policy_init(&ivi) < 0) goto error_compositor; @@ -1482,6 +1527,9 @@ int main(int argc, char *argv[]) if (ivi.remoting_api) ivi_enable_remote_outputs(&ivi); + if (waltham) + load_waltham_plugin(&ivi, ivi.config); + ivi_shell_init_black_fs(&ivi); if (create_listening_socket(display, socket_name) < 0) @@ -1493,7 +1541,8 @@ int main(int argc, char *argv[]) ivi_shell_create_global(&ivi); ivi_launch_shell_client(&ivi); - ivi_screenshooter_create(&ivi); + if (debug) + ivi_screenshooter_create(&ivi); ivi_agl_systemd_notify(&ivi); wl_display_run(display);