aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/backend/drm.h3
-rw-r--r--include/backend/libinput.h2
-rw-r--r--include/backend/multi.h2
-rw-r--r--include/backend/session/direct-ipc.h2
-rw-r--r--include/backend/udev.h29
-rw-r--r--include/wlr/backend/drm.h3
-rw-r--r--include/wlr/backend/libinput.h3
-rw-r--r--include/wlr/backend/multi.h4
-rw-r--r--include/wlr/backend/session.h24
-rw-r--r--include/wlr/backend/session/interface.h4
-rw-r--r--include/wlr/backend/udev.h9
11 files changed, 27 insertions, 58 deletions
diff --git a/include/backend/drm.h b/include/backend/drm.h
index 25bbd1f7..342a980c 100644
--- a/include/backend/drm.h
+++ b/include/backend/drm.h
@@ -7,7 +7,6 @@
#include <wayland-server.h>
#include <xf86drmMode.h>
#include <EGL/egl.h>
-#include <libudev.h>
#include <gbm.h>
#include <wlr/backend/session.h>
@@ -16,7 +15,6 @@
#include <wlr/egl.h>
#include <wlr/util/list.h>
-#include <backend/udev.h>
#include "drm-properties.h"
struct wlr_drm_plane {
@@ -124,7 +122,6 @@ struct wlr_drm_backend {
struct wlr_drm_renderer renderer;
struct wlr_session *session;
- struct wlr_udev *udev;
};
enum wlr_drm_output_state {
diff --git a/include/backend/libinput.h b/include/backend/libinput.h
index e0f762a7..f484ea8d 100644
--- a/include/backend/libinput.h
+++ b/include/backend/libinput.h
@@ -6,13 +6,11 @@
#include <wlr/backend/interface.h>
#include <wlr/interfaces/wlr_input_device.h>
#include <wlr/util/list.h>
-#include "backend/udev.h"
struct wlr_libinput_backend {
struct wlr_backend backend;
struct wlr_session *session;
- struct wlr_udev *udev;
struct wl_display *display;
struct libinput *libinput_context;
diff --git a/include/backend/multi.h b/include/backend/multi.h
index af747332..c7a2198e 100644
--- a/include/backend/multi.h
+++ b/include/backend/multi.h
@@ -3,7 +3,6 @@
#include <wlr/backend/interface.h>
#include <wlr/backend/multi.h>
-#include <wlr/backend/udev.h>
#include <wlr/util/list.h>
#include <wlr/backend/session.h>
@@ -11,7 +10,6 @@ struct wlr_multi_backend {
struct wlr_backend backend;
struct wlr_session *session;
- struct wlr_udev *udev;
list_t *backends;
};
diff --git a/include/backend/session/direct-ipc.h b/include/backend/session/direct-ipc.h
index 96504f04..2189d6fa 100644
--- a/include/backend/session/direct-ipc.h
+++ b/include/backend/session/direct-ipc.h
@@ -7,6 +7,6 @@ int direct_ipc_open(int sock, const char *path);
void direct_ipc_setmaster(int sock, int fd);
void direct_ipc_dropmaster(int sock, int fd);
void direct_ipc_finish(int sock, pid_t pid);
-int direct_ipc_start(pid_t *pid_out);
+int direct_ipc_init(pid_t *pid_out);
#endif
diff --git a/include/backend/udev.h b/include/backend/udev.h
deleted file mode 100644
index 080422c0..00000000
--- a/include/backend/udev.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef _WLR_INTERNAL_UDEV_H
-#define _WLR_INTERNAL_UDEV_H
-
-#include <sys/types.h>
-#include <libudev.h>
-#include <wlr/backend/session.h>
-#include <wayland-server.h>
-#include <wlr/backend/udev.h>
-
-struct wlr_udev_dev {
- dev_t dev;
- struct wl_signal invalidate;
-
- struct wl_list link;
-};
-
-struct wlr_udev {
- struct udev *udev;
- struct udev_monitor *mon;
- struct wl_event_source *event;
-
- struct wl_list devices;
-};
-
-int wlr_udev_find_gpu(struct wlr_udev *udev, struct wlr_session *session);
-bool wlr_udev_signal_add(struct wlr_udev *udev, dev_t dev, struct wl_listener *listener);
-void wlr_udev_signal_remove(struct wlr_udev *udev, struct wl_listener *listener);
-
-#endif
diff --git a/include/wlr/backend/drm.h b/include/wlr/backend/drm.h
index fe1cc5a7..fa63df0a 100644
--- a/include/wlr/backend/drm.h
+++ b/include/wlr/backend/drm.h
@@ -4,10 +4,9 @@
#include <wayland-server.h>
#include <wlr/backend/session.h>
#include <wlr/backend.h>
-#include <wlr/backend/udev.h>
struct wlr_backend *wlr_drm_backend_create(struct wl_display *display,
- struct wlr_session *session, struct wlr_udev *udev, int gpu_fd);
+ struct wlr_session *session, int gpu_fd);
bool wlr_backend_is_drm(struct wlr_backend *backend);
diff --git a/include/wlr/backend/libinput.h b/include/wlr/backend/libinput.h
index b227a7ad..95b8829d 100644
--- a/include/wlr/backend/libinput.h
+++ b/include/wlr/backend/libinput.h
@@ -5,11 +5,10 @@
#include <wayland-server.h>
#include <wlr/backend/session.h>
#include <wlr/backend.h>
-#include <wlr/backend/udev.h>
#include <wlr/types/wlr_input_device.h>
struct wlr_backend *wlr_libinput_backend_create(struct wl_display *display,
- struct wlr_session *session, struct wlr_udev *udev);
+ struct wlr_session *session);
struct libinput_device *wlr_libinput_get_device_handle(struct wlr_input_device *dev);
bool wlr_backend_is_libinput(struct wlr_backend *backend);
diff --git a/include/wlr/backend/multi.h b/include/wlr/backend/multi.h
index e8e46bed..3fcaaf1e 100644
--- a/include/wlr/backend/multi.h
+++ b/include/wlr/backend/multi.h
@@ -2,11 +2,9 @@
#define _WLR_BACKEND_MULTI_H
#include <wlr/backend.h>
-#include <wlr/backend/udev.h>
#include <wlr/backend/session.h>
-struct wlr_backend *wlr_multi_backend_create(struct wlr_session *session,
- struct wlr_udev *udev);
+struct wlr_backend *wlr_multi_backend_create(struct wlr_session *session);
void wlr_multi_backend_add(struct wlr_backend *multi,
struct wlr_backend *backend);
diff --git a/include/wlr/backend/session.h b/include/wlr/backend/session.h
index 7961e620..04e701b0 100644
--- a/include/wlr/backend/session.h
+++ b/include/wlr/backend/session.h
@@ -3,10 +3,19 @@
#include <stdbool.h>
#include <wayland-server.h>
+#include <libudev.h>
#include <sys/types.h>
struct session_impl;
+struct wlr_device {
+ int fd;
+ dev_t dev;
+ struct wl_signal signal;
+
+ struct wl_list link;
+};
+
struct wlr_session {
const struct session_impl *impl;
/*
@@ -16,9 +25,14 @@ struct wlr_session {
struct wl_signal session_signal;
bool active;
- int drm_fd;
unsigned vtnr;
char seat[8];
+
+ struct udev *udev;
+ struct udev_monitor *mon;
+ struct wl_event_source *udev_event;
+
+ struct wl_list devices;
};
/*
@@ -31,14 +45,14 @@ struct wlr_session {
*
* Returns NULL on error.
*/
-struct wlr_session *wlr_session_start(struct wl_display *disp);
+struct wlr_session *wlr_session_create(struct wl_display *disp);
/*
* Closes a previously opened session and restores the virtual terminal.
* You should call wlr_session_close_file on each files you opened
* with wlr_session_open_file before you call this.
*/
-void wlr_session_finish(struct wlr_session *session);
+void wlr_session_destroy(struct wlr_session *session);
/*
* Opens the file at path.
@@ -57,9 +71,13 @@ int wlr_session_open_file(struct wlr_session *session, const char *path);
*/
void wlr_session_close_file(struct wlr_session *session, int fd);
+void wlr_session_signal_add(struct wlr_session *session, int fd,
+ struct wl_listener *listener);
/*
* Changes the virtual terminal.
*/
bool wlr_session_change_vt(struct wlr_session *session, unsigned vt);
+int wlr_session_find_gpu(struct wlr_session *session);
+
#endif
diff --git a/include/wlr/backend/session/interface.h b/include/wlr/backend/session/interface.h
index 16814446..1a029c54 100644
--- a/include/wlr/backend/session/interface.h
+++ b/include/wlr/backend/session/interface.h
@@ -4,8 +4,8 @@
#include <wlr/backend/session.h>
struct session_impl {
- struct wlr_session *(*start)(struct wl_display *disp);
- void (*finish)(struct wlr_session *session);
+ struct wlr_session *(*create)(struct wl_display *disp);
+ void (*destroy)(struct wlr_session *session);
int (*open)(struct wlr_session *session, const char *path);
void (*close)(struct wlr_session *session, int fd);
bool (*change_vt)(struct wlr_session *session, unsigned vt);
diff --git a/include/wlr/backend/udev.h b/include/wlr/backend/udev.h
deleted file mode 100644
index 387a63e6..00000000
--- a/include/wlr/backend/udev.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef _WLR_BACKEND_UDEV_H
-#define _WLR_BACKEND_UDEV_H
-
-struct wlr_udev;
-
-struct wlr_udev *wlr_udev_create(struct wl_display *display);
-void wlr_udev_destroy(struct wlr_udev *udev);
-
-#endif