libweston: use enum to choose the backend

Change weston_compositor_load_backend() to use an enum to choose the
backend.

The caller no longer needs to know what the backend DSO is called in the
file system. Custom backends cannot be laoded anymore, as the loading
path is now always either LIBWESTON_MODULEDIR, or formed from
$WESTON_BUILD_DIR.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Reviewed-by: Giulio Camuffo <giuliocamuffo@gmail.com>
diff --git a/src/main.c b/src/main.c
index 27276ff..9e970d6 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1003,7 +1003,8 @@
 	config.configure_output = drm_configure_output;
 	config.configure_device = configure_input_device;
 
-	ret = weston_compositor_load_backend(c, backend, &config.base);
+	ret = weston_compositor_load_backend(c, WESTON_BACKEND_DRM,
+					     &config.base);
 
 	free(config.gbm_format);
 	free(config.seat_id);
@@ -1042,7 +1043,8 @@
 	config.base.struct_size = sizeof(struct weston_headless_backend_config);
 
 	/* load the actual wayland backend and configure it */
-	ret = weston_compositor_load_backend(c, backend, &config.base);
+	ret = weston_compositor_load_backend(c, WESTON_BACKEND_HEADLESS,
+					     &config.base);
 
 	return ret;
 }
@@ -1087,7 +1089,8 @@
 
 	parse_options(rdp_options, ARRAY_LENGTH(rdp_options), argc, argv);
 
-	ret = weston_compositor_load_backend(c, backend, &config.base);
+	ret = weston_compositor_load_backend(c, WESTON_BACKEND_RDP,
+					     &config.base);
 
 	free(config.bind_address);
 	free(config.rdp_key);
@@ -1127,7 +1130,8 @@
 	config.configure_device = configure_input_device;
 
 	/* load the actual wayland backend and configure it */
-	ret = weston_compositor_load_backend(c, backend, &config.base);
+	ret = weston_compositor_load_backend(c, WESTON_BACKEND_FBDEV,
+					     &config.base);
 
 	free(config.device);
 
@@ -1263,7 +1267,8 @@
 	config.base.struct_size = sizeof(struct weston_x11_backend_config);
 
 	/* load the actual backend and configure it */
-	ret = weston_compositor_load_backend(c, backend, &config.base);
+	ret = weston_compositor_load_backend(c, WESTON_BACKEND_X11,
+					     &config.base);
 
 out:
 	for (j = 0; j < config.num_outputs; ++j)
@@ -1483,7 +1488,8 @@
 	}
 
 	/* load the actual wayland backend and configure it */
-	ret = weston_compositor_load_backend(c, backend, &config.base);
+	ret = weston_compositor_load_backend(c, WESTON_BACKEND_WAYLAND,
+					     &config.base);
 	weston_wayland_backend_config_release(&config);
 	return ret;
 }