compositor: Make all non-backend modules use module_init() as entry point

dev
Kristian Høgsberg 12 years ago
parent dd1b3f4c1b
commit b00a9d3cb9
  1. 5
      src/compositor.c
  2. 14
      src/compositor.h
  3. 5
      src/shell.c
  4. 11
      src/tablet-shell.c
  5. 2
      src/xwayland/launcher.c

@ -3091,8 +3091,7 @@ int main(int argc, char *argv[])
module_init = NULL; module_init = NULL;
if (xserver) if (xserver)
module_init = load_module("xwayland.so", module_init = load_module("xwayland.so", "module_init",
"weston_xserver_init",
&xserver_module); &xserver_module);
if (module_init && module_init(ec) < 0) { if (module_init && module_init(ec) < 0) {
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
@ -3104,7 +3103,7 @@ int main(int argc, char *argv[])
if (!shell) if (!shell)
shell = "desktop-shell.so"; shell = "desktop-shell.so";
module_init = load_module(shell, "shell_init", &shell_module); module_init = load_module(shell, "module_init", &shell_module);
if (!module_init || module_init(ec) < 0) { if (!module_init || module_init(ec) < 0) {
ret = EXIT_FAILURE; ret = EXIT_FAILURE;
goto out; goto out;

@ -770,9 +770,6 @@ weston_client_launch(struct weston_compositor *compositor,
void void
weston_watch_process(struct weston_process *process); weston_watch_process(struct weston_process *process);
int
weston_xserver_init(struct weston_compositor *compositor);
struct weston_surface_animation; struct weston_surface_animation;
typedef void (*weston_surface_animation_done_func_t)(struct weston_surface_animation *animation, void *data); typedef void (*weston_surface_animation_done_func_t)(struct weston_surface_animation *animation, void *data);
@ -794,10 +791,6 @@ weston_surface_set_color(struct weston_surface *surface,
void void
weston_surface_destroy(struct weston_surface *surface); weston_surface_destroy(struct weston_surface *surface);
struct weston_compositor *
backend_init(struct wl_display *display, int argc, char *argv[],
const char *config_file);
int int
weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode); weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode);
@ -806,4 +799,11 @@ gles2_renderer_init(struct weston_compositor *ec);
void void
gles2_renderer_destroy(struct weston_compositor *ec); gles2_renderer_destroy(struct weston_compositor *ec);
struct weston_compositor *
backend_init(struct wl_display *display, int argc, char *argv[],
const char *config_file);
int
module_init(struct weston_compositor *compositor);
#endif #endif

@ -3691,11 +3691,8 @@ shell_add_bindings(struct weston_compositor *ec, struct desktop_shell *shell)
} }
} }
int
shell_init(struct weston_compositor *ec);
WL_EXPORT int WL_EXPORT int
shell_init(struct weston_compositor *ec) module_init(struct weston_compositor *ec)
{ {
struct weston_seat *seat; struct weston_seat *seat;
struct desktop_shell *shell; struct desktop_shell *shell;

@ -530,18 +530,15 @@ tablet_shell_destroy(struct wl_listener *listener, void *data)
free(shell); free(shell);
} }
void WL_EXPORT int
shell_init(struct weston_compositor *compositor); module_init(struct weston_compositor *compositor)
WL_EXPORT void
shell_init(struct weston_compositor *compositor)
{ {
struct tablet_shell *shell; struct tablet_shell *shell;
struct wl_event_loop *loop; struct wl_event_loop *loop;
shell = malloc(sizeof *shell); shell = malloc(sizeof *shell);
if (shell == NULL) if (shell == NULL)
return; return -1;
memset(shell, 0, sizeof *shell); memset(shell, 0, sizeof *shell);
shell->compositor = compositor; shell->compositor = compositor;
@ -583,4 +580,6 @@ shell_init(struct weston_compositor *compositor)
launch_ux_daemon(shell); launch_ux_daemon(shell);
tablet_shell_set_state(shell, STATE_STARTING); tablet_shell_set_state(shell, STATE_STARTING);
return 0;
} }

@ -312,7 +312,7 @@ weston_xserver_destroy(struct wl_listener *l, void *data)
} }
WL_EXPORT int WL_EXPORT int
weston_xserver_init(struct weston_compositor *compositor) module_init(struct weston_compositor *compositor)
{ {
struct wl_display *display = compositor->wl_display; struct wl_display *display = compositor->wl_display;
struct weston_xserver *mxs; struct weston_xserver *mxs;

Loading…
Cancel
Save