summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rw-r--r--clients/Makefile.am12
-rw-r--r--compositor/compositor.h470
-rw-r--r--configure.ac2
-rw-r--r--data/Makefile.am4
-rw-r--r--src/.gitignore (renamed from compositor/.gitignore)0
-rw-r--r--src/Makefile.am (renamed from compositor/Makefile.am)12
-rw-r--r--src/compositor-drm.c (renamed from compositor/compositor-drm.c)62
-rw-r--r--src/compositor-openwfd.c (renamed from compositor/compositor-openwfd.c)0
-rw-r--r--src/compositor-wayland.c (renamed from compositor/compositor-wayland.c)48
-rw-r--r--src/compositor-x11.c (renamed from compositor/compositor-x11.c)66
-rw-r--r--src/compositor.c (renamed from compositor/compositor.c)519
-rw-r--r--src/compositor.h471
-rw-r--r--src/data-device.c (renamed from compositor/data-device.c)82
-rw-r--r--src/evdev.c (renamed from compositor/evdev.c)24
-rw-r--r--src/evdev.h (renamed from compositor/evdev.h)8
-rw-r--r--src/hash.c (renamed from compositor/hash.c)0
-rw-r--r--src/hash.h (renamed from compositor/hash.h)0
-rw-r--r--src/image-loader.c (renamed from compositor/image-loader.c)0
-rw-r--r--src/screenshooter.c (renamed from compositor/screenshooter.c)6
-rw-r--r--src/shell.c (renamed from compositor/shell.c)198
-rw-r--r--src/switcher.c (renamed from compositor/switcher.c)52
-rw-r--r--src/tablet-shell.c (renamed from compositor/tablet-shell.c)106
-rw-r--r--src/tty.c (renamed from compositor/tty.c)4
-rw-r--r--src/util.c (renamed from compositor/util.c)116
-rw-r--r--src/xserver-launcher.c (renamed from compositor/xserver-launcher.c)278
26 files changed, 1273 insertions, 1269 deletions
diff --git a/Makefile.am b/Makefile.am
index b52af26..299987b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1 +1 @@
-SUBDIRS = shared compositor clients data
+SUBDIRS = shared src clients data
diff --git a/clients/Makefile.am b/clients/Makefile.am
index b54cc5c..ea98965 100644
--- a/clients/Makefile.am
+++ b/clients/Makefile.am
@@ -29,8 +29,8 @@ clients_programs = \
wscreensaver \
eventdemo
-desktop_shell = wayland-desktop-shell
-tablet_shell = wayland-tablet-shell
+desktop_shell = weston-desktop-shell
+tablet_shell = weston-tablet-shell
noinst_LIBRARIES = libtoytoolkit.a
@@ -84,18 +84,18 @@ wscreensaver_LDADD = $(toolkit_libs) -lGLU
eventdemo_SOURCES = eventdemo.c
eventdemo_LDADD = $(toolkit_libs)
-wayland_desktop_shell_SOURCES = \
+weston_desktop_shell_SOURCES = \
desktop-shell.c \
desktop-shell-client-protocol.h \
desktop-shell-protocol.c
-wayland_desktop_shell_LDADD = $(toolkit_libs) \
+weston_desktop_shell_LDADD = $(toolkit_libs) \
../shared/libconfig-parser.la
-wayland_tablet_shell_SOURCES = \
+weston_tablet_shell_SOURCES = \
tablet-shell.c \
tablet-shell-client-protocol.h \
tablet-shell-protocol.c
-wayland_tablet_shell_LDADD = $(toolkit_libs) \
+weston_tablet_shell_LDADD = $(toolkit_libs) \
../shared/libconfig-parser.la
BUILT_SOURCES = \
diff --git a/compositor/compositor.h b/compositor/compositor.h
deleted file mode 100644
index 4c011f0..0000000
--- a/compositor/compositor.h
+++ /dev/null
@@ -1,470 +0,0 @@
-/*
- * Copyright © 2008-2011 Kristian Høgsberg
- *
- * Permission to use, copy, modify, distribute, and sell this software and
- * its documentation for any purpose is hereby granted without fee, provided
- * that the above copyright notice appear in all copies and that both that
- * copyright notice and this permission notice appear in supporting
- * documentation, and that the name of the copyright holders not be used in
- * advertising or publicity pertaining to distribution of the software
- * without specific, written prior permission. The copyright holders make
- * no representations about the suitability of this software for any
- * purpose. It is provided "as is" without express or implied warranty.
- *
- * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
- * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
- * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _WAYLAND_SYSTEM_COMPOSITOR_H_
-#define _WAYLAND_SYSTEM_COMPOSITOR_H_
-
-#include <libudev.h>
-#include <pixman.h>
-#include <wayland-server.h>
-
-#include <GLES2/gl2.h>
-#include <GLES2/gl2ext.h>
-#include <EGL/egl.h>
-#include <EGL/eglext.h>
-
-struct wlsc_matrix {
- GLfloat d[16];
-};
-
-struct wlsc_vector {
- GLfloat f[4];
-};
-
-void
-wlsc_matrix_init(struct wlsc_matrix *matrix);
-void
-wlsc_matrix_scale(struct wlsc_matrix *matrix, GLfloat x, GLfloat y, GLfloat z);
-void
-wlsc_matrix_translate(struct wlsc_matrix *matrix,
- GLfloat x, GLfloat y, GLfloat z);
-void
-wlsc_matrix_transform(struct wlsc_matrix *matrix, struct wlsc_vector *v);
-
-struct wlsc_transform {
- struct wlsc_matrix matrix;
- struct wlsc_matrix inverse;
-};
-
-struct wlsc_surface;
-struct wlsc_input_device;
-
-struct wlsc_mode {
- uint32_t flags;
- int32_t width, height;
- uint32_t refresh;
- struct wl_list link;
-};
-
-struct wlsc_output {
- struct wl_list link;
- struct wlsc_compositor *compositor;
- struct wlsc_matrix matrix;
- struct wl_list frame_callback_list;
- int32_t x, y, mm_width, mm_height;
- pixman_region32_t region;
- pixman_region32_t previous_damage;
- uint32_t flags;
- int repaint_needed;
- int repaint_scheduled;
-
- char *make, *model;
- uint32_t subpixel;
-
- struct wlsc_mode *current;
- struct wl_list mode_list;
- struct wl_buffer *scanout_buffer;
- struct wl_listener scanout_buffer_destroy_listener;
- struct wl_buffer *pending_scanout_buffer;
- struct wl_listener pending_scanout_buffer_destroy_listener;
-
- int (*prepare_render)(struct wlsc_output *output);
- int (*present)(struct wlsc_output *output);
- int (*prepare_scanout_surface)(struct wlsc_output *output,
- struct wlsc_surface *es);
- int (*set_hardware_cursor)(struct wlsc_output *output,
- struct wlsc_input_device *input);
- void (*destroy)(struct wlsc_output *output);
-};
-
-struct wlsc_input_device {
- struct wl_input_device input_device;
- struct wlsc_compositor *compositor;
- struct wlsc_surface *sprite;
- int32_t hotspot_x, hotspot_y;
- struct wl_list link;
- uint32_t modifier_state;
- struct wl_selection *selection;
-
- struct wl_list drag_resource_list;
- struct wlsc_data_source *drag_data_source;
- struct wl_surface *drag_focus;
- struct wl_resource *drag_focus_resource;
- struct wl_listener drag_focus_listener;
-
- struct wlsc_data_source *selection_data_source;
- struct wl_listener selection_data_source_listener;
- struct wl_grab grab;
-
- uint32_t num_tp;
- struct wl_surface *touch_focus;
- struct wl_listener touch_focus_listener;
- struct wl_resource *touch_focus_resource;
- struct wl_listener touch_focus_resource_listener;
-};
-
-enum wlsc_visual {
- WLSC_NONE_VISUAL,
- WLSC_ARGB_VISUAL,
- WLSC_PREMUL_ARGB_VISUAL,
- WLSC_RGB_VISUAL
-};
-
-struct wlsc_shader {
- GLuint program;
- GLuint vertex_shader, fragment_shader;
- GLuint proj_uniform;
- GLuint tex_uniform;
- GLuint alpha_uniform;
- GLuint color_uniform;
-};
-
-struct wlsc_animation {
- void (*frame)(struct wlsc_animation *animation,
- struct wlsc_output *output, uint32_t msecs);
- struct wl_list link;
-};
-
-struct wlsc_spring {
- double k;
- double friction;
- double current;
- double target;
- double previous;
- uint32_t timestamp;
-};
-
-struct wlsc_shell {
- void (*lock)(struct wlsc_shell *shell);
- void (*unlock)(struct wlsc_shell *shell);
- void (*map)(struct wlsc_shell *shell, struct wlsc_surface *surface,
- int32_t width, int32_t height);
- void (*configure)(struct wlsc_shell *shell,
- struct wlsc_surface *surface,
- int32_t x, int32_t y, int32_t width, int32_t height);
-};
-
-enum {
- WLSC_COMPOSITOR_ACTIVE,
- WLSC_COMPOSITOR_IDLE, /* shell->unlock called on activity */
- WLSC_COMPOSITOR_SLEEPING /* no rendering, no frame events */
-};
-
-struct wlsc_compositor {
- struct wl_shm *shm;
- struct wlsc_xserver *wxs;
-
- EGLDisplay display;
- EGLContext context;
- EGLConfig config;
- GLuint fbo;
- GLuint proj_uniform, tex_uniform, alpha_uniform;
- uint32_t current_alpha;
- struct wlsc_shader texture_shader;
- struct wlsc_shader solid_shader;
- struct wl_display *wl_display;
-
- struct wlsc_shell *shell;
-
- /* There can be more than one, but not right now... */
- struct wl_input_device *input_device;
-
- struct wl_list output_list;
- struct wl_list input_device_list;
- struct wl_list surface_list;
- struct wl_list binding_list;
- struct wl_list animation_list;
- struct {
- struct wlsc_spring spring;
- struct wlsc_animation animation;
- } fade;
-
- uint32_t state;
- struct wl_event_source *idle_source;
- uint32_t idle_inhibit;
- int option_idle_time; /* default timeout, s */
- int idle_time; /* effective timeout, s */
-
- /* Repaint state. */
- struct timespec previous_swap;
- struct wl_array vertices, indices;
-
- struct wlsc_surface *overlay;
- struct wlsc_switcher *switcher;
- uint32_t focus;
-
- PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC
- image_target_renderbuffer_storage;
- PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d;
- PFNEGLCREATEIMAGEKHRPROC create_image;
- PFNEGLDESTROYIMAGEKHRPROC destroy_image;
- PFNEGLBINDWAYLANDDISPLAYWL bind_display;
- PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display;
- int has_bind_display;
-
- void (*destroy)(struct wlsc_compositor *ec);
- int (*authenticate)(struct wlsc_compositor *c, uint32_t id);
- EGLImageKHR (*create_cursor_image)(struct wlsc_compositor *c,
- int32_t *width, int32_t *height);
-};
-
-#define MODIFIER_CTRL (1 << 8)
-#define MODIFIER_ALT (1 << 9)
-#define MODIFIER_SUPER (1 << 10)
-
-enum wlsc_output_flags {
- WL_OUTPUT_FLIPPED = 0x01
-};
-
-struct wlsc_surface {
- struct wl_surface surface;
- struct wlsc_compositor *compositor;
- GLuint texture, saved_texture;
- pixman_region32_t damage;
- pixman_region32_t opaque;
- int32_t x, y, width, height;
- int32_t pitch;
- struct wl_list link;
- struct wl_list buffer_link;
- struct wlsc_transform *transform;
- uint32_t alpha;
- uint32_t visual;
-
- /*
- * Which output to vsync this surface to.
- * Used to determine, whether to send or queue frame events.
- * Must be NULL, if 'link' is not in wlsc_compositor::surface_list.
- */
- struct wlsc_output *output;
-
- struct wlsc_output *fullscreen_output;
- struct wl_list frame_callback_list;
-
- EGLImageKHR image;
-
- struct wl_buffer *buffer;
- struct wl_listener buffer_destroy_listener;
-};
-
-struct wlsc_data_source {
- struct wl_resource resource;
- struct wl_array mime_types;
- int refcount;
- void *data;
-
- struct wl_resource *(*create_offer)(struct wlsc_data_source *source,
- struct wl_resource *target);
-
- void (*cancel)(struct wlsc_data_source *source);
-};
-
-void
-wlsc_data_source_unref(struct wlsc_data_source *source);
-
-void
-wlsc_input_device_set_selection(struct wlsc_input_device *device,
- struct wlsc_data_source *source,
- uint32_t time);
-
-void
-wlsc_spring_init(struct wlsc_spring *spring,
- double k, double current, double target);
-void
-wlsc_spring_update(struct wlsc_spring *spring, uint32_t msec);
-int
-wlsc_spring_done(struct wlsc_spring *spring);
-
-void
-wlsc_surface_activate(struct wlsc_surface *surface,
- struct wlsc_input_device *device, uint32_t time);
-
-void
-notify_motion(struct wl_input_device *device,
- uint32_t time, int x, int y);
-void
-notify_button(struct wl_input_device *device,
- uint32_t time, int32_t button, int32_t state);
-void
-notify_key(struct wl_input_device *device,
- uint32_t time, uint32_t key, uint32_t state);
-
-void
-notify_pointer_focus(struct wl_input_device *device,
- uint32_t time,
- struct wlsc_output *output,
- int32_t x, int32_t y);
-
-void
-notify_keyboard_focus(struct wl_input_device *device,
- uint32_t time, struct wlsc_output *output,
- struct wl_array *keys);
-
-void
-notify_touch(struct wl_input_device *device, uint32_t time, int touch_id,
- int x, int y, int touch_type);
-
-void
-wlsc_output_finish_frame(struct wlsc_output *output, int msecs);
-void
-wlsc_output_damage(struct wlsc_output *output);
-void
-wlsc_compositor_repick(struct wlsc_compositor *compositor);
-void
-wlsc_compositor_schedule_repaint(struct wlsc_compositor *compositor);
-void
-wlsc_compositor_fade(struct wlsc_compositor *compositor, float tint);
-void
-wlsc_compositor_damage_all(struct wlsc_compositor *compositor);
-void
-wlsc_compositor_unlock(struct wlsc_compositor *compositor);
-void
-wlsc_compositor_wake(struct wlsc_compositor *compositor);
-void
-wlsc_compositor_activity(struct wlsc_compositor *compositor);
-
-struct wlsc_binding;
-typedef void (*wlsc_binding_handler_t)(struct wl_input_device *device,
- uint32_t time, uint32_t key,
- uint32_t button,
- uint32_t state, void *data);
-struct wlsc_binding *
-wlsc_compositor_add_binding(struct wlsc_compositor *compositor,
- uint32_t key, uint32_t button, uint32_t modifier,
- wlsc_binding_handler_t binding, void *data);
-void
-wlsc_binding_destroy(struct wlsc_binding *binding);
-
-void
-wlsc_compositor_run_binding(struct wlsc_compositor *compositor,
- struct wlsc_input_device *device,
- uint32_t time,
- uint32_t key, uint32_t button, int32_t state);
-
-struct wlsc_surface *
-wlsc_surface_create(struct wlsc_compositor *compositor,
- int32_t x, int32_t y, int32_t width, int32_t height);
-
-void
-wlsc_surface_configure(struct wlsc_surface *surface,
- int x, int y, int width, int height);
-
-void
-wlsc_surface_assign_output(struct wlsc_surface *surface);
-
-void
-wlsc_surface_damage(struct wlsc_surface *surface);
-
-void
-wlsc_surface_damage_below(struct wlsc_surface *surface);
-
-void
-wlsc_surface_damage_rectangle(struct wlsc_surface *surface,
- int32_t x, int32_t y,
- int32_t width, int32_t height);
-
-struct wlsc_surface *
-pick_surface(struct wl_input_device *device, int32_t *sx, int32_t *sy);
-
-uint32_t
-wlsc_compositor_get_time(void);
-
-int
-wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display);
-void
-wlsc_compositor_shutdown(struct wlsc_compositor *ec);
-void
-wlsc_output_move(struct wlsc_output *output, int x, int y);
-void
-wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c,
- int x, int y, int width, int height, uint32_t flags);
-void
-wlsc_output_destroy(struct wlsc_output *output);
-
-void
-wlsc_input_device_init(struct wlsc_input_device *device,
- struct wlsc_compositor *ec);
-
-void
-wlsc_switcher_init(struct wlsc_compositor *compositor);
-
-enum {
- TTY_ENTER_VT,
- TTY_LEAVE_VT
-};
-
-typedef void (*tty_vt_func_t)(struct wlsc_compositor *compositor, int event);
-
-struct tty *
-tty_create(struct wlsc_compositor *compositor, tty_vt_func_t vt_func,
- int tty_nr);
-
-void
-tty_destroy(struct tty *tty);
-
-void
-screenshooter_create(struct wlsc_compositor *ec);
-
-uint32_t *
-wlsc_load_image(const char *filename,
- int32_t *width_arg, int32_t *height_arg, uint32_t *stride_arg);
-
-struct wlsc_process;
-typedef void (*wlsc_process_cleanup_func_t)(struct wlsc_process *process,
- int status);
-
-struct wlsc_process {
- pid_t pid;
- wlsc_process_cleanup_func_t cleanup;
- struct wl_list link;
-};
-
-struct wl_client *
-wlsc_client_launch(struct wlsc_compositor *compositor,
- struct wlsc_process *proc,
- const char *path,
- wlsc_process_cleanup_func_t cleanup);
-
-int
-wlsc_data_device_manager_init(struct wlsc_compositor *compositor);
-void
-wlsc_data_device_set_keyboard_focus(struct wlsc_input_device *device);
-
-void
-wlsc_watch_process(struct wlsc_process *process);
-
-int
-wlsc_xserver_init(struct wlsc_compositor *compositor);
-void
-wlsc_xserver_destroy(struct wlsc_compositor *compositor);
-void
-wlsc_xserver_surface_activate(struct wlsc_surface *surface);
-void
-wlsc_xserver_set_selection(struct wlsc_input_device *device);
-
-struct wlsc_zoom;
-typedef void (*wlsc_zoom_done_func_t)(struct wlsc_zoom *zoom, void *data);
-
-struct wlsc_zoom *
-wlsc_zoom_run(struct wlsc_surface *surface, GLfloat start, GLfloat stop,
- wlsc_zoom_done_func_t done, void *data);
-
-#endif
diff --git a/configure.ac b/configure.ac
index 0d0d749..41d36f2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,7 +141,7 @@ WAYLAND_SCANNER_RULES(['$(top_srcdir)/protocol'])
AC_CONFIG_FILES([Makefile
shared/Makefile
- compositor/Makefile
+ src/Makefile
clients/Makefile
data/Makefile])
AC_OUTPUT
diff --git a/data/Makefile.am b/data/Makefile.am
index fbafceb..c919381 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,6 +1,6 @@
-waylanddatadir = $(datadir)/wayland
+westondatadir = $(datadir)/weston
-dist_waylanddata_DATA = \
+dist_westondata_DATA = \
bottom_left_corner.png \
bottom_right_corner.png \
bottom_side.png \
diff --git a/compositor/.gitignore b/src/.gitignore
index 0a6ccbb..0a6ccbb 100644
--- a/compositor/.gitignore
+++ b/src/.gitignore
diff --git a/compositor/Makefile.am b/src/Makefile.am
index 48b9c34..4c7aeb8 100644
--- a/compositor/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-bin_PROGRAMS = wayland-compositor
+bin_PROGRAMS = weston
AM_CPPFLAGS = \
-DDATADIR='"$(datadir)"' \
@@ -7,12 +7,12 @@ AM_CPPFLAGS = \
-DXSERVER_PATH='"@XSERVER_PATH@"' \
$(COMPOSITOR_CFLAGS)
-wayland_compositor_LDFLAGS = -export-dynamic
-wayland_compositor_CFLAGS = $(GCC_CFLAGS)
-wayland_compositor_LDADD = \
+weston_LDFLAGS = -export-dynamic
+weston_CFLAGS = $(GCC_CFLAGS)
+weston_LDADD = \
$(COMPOSITOR_LIBS) $(DLOPEN_LIBS) $(XSERVER_LAUNCHER_LIBS)
-wayland_compositor_SOURCES = \
+weston_SOURCES = \
compositor.c \
compositor.h \
image-loader.c \
@@ -32,7 +32,7 @@ xserver_launcher_sources = \
hash.h
endif
-moduledir = @libdir@/wayland
+moduledir = @libdir@/weston
module_LTLIBRARIES = \
$(desktop_shell) \
$(tablet_shell) \
diff --git a/compositor/compositor-drm.c b/src/compositor-drm.c
index f1047ee..a6cedd5 100644
--- a/compositor/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -38,7 +38,7 @@
#include "evdev.h"
struct drm_compositor {
- struct wlsc_compositor base;
+ struct weston_compositor base;
struct udev *udev;
struct wl_event_source *drm_source;
@@ -58,12 +58,12 @@ struct drm_compositor {
};
struct drm_mode {
- struct wlsc_mode base;
+ struct weston_mode base;
drmModeModeInfo mode_info;
};
struct drm_output {
- struct wlsc_output base;
+ struct weston_output base;
uint32_t crtc_id;
uint32_t connector_id;
@@ -79,7 +79,7 @@ struct drm_output {
};
static int
-drm_output_prepare_render(struct wlsc_output *output_base)
+drm_output_prepare_render(struct weston_output *output_base)
{
struct drm_output *output = (struct drm_output *) output_base;
@@ -95,7 +95,7 @@ drm_output_prepare_render(struct wlsc_output *output_base)
}
static int
-drm_output_present(struct wlsc_output *output_base)
+drm_output_present(struct weston_output *output_base)
{
struct drm_output *output = (struct drm_output *) output_base;
struct drm_compositor *c =
@@ -139,12 +139,12 @@ page_flip_handler(int fd, unsigned int frame,
}
msecs = sec * 1000 + usec / 1000;
- wlsc_output_finish_frame(&output->base, msecs);
+ weston_output_finish_frame(&output->base, msecs);
}
static int
-drm_output_prepare_scanout_surface(struct wlsc_output *output_base,
- struct wlsc_surface *es)
+drm_output_prepare_scanout_surface(struct weston_output *output_base,
+ struct weston_surface *es)
{
struct drm_output *output = (struct drm_output *) output_base;
struct drm_compositor *c =
@@ -188,8 +188,8 @@ drm_output_prepare_scanout_surface(struct wlsc_output *output_base,
}
static int
-drm_output_set_cursor(struct wlsc_output *output_base,
- struct wlsc_input_device *eid)
+drm_output_set_cursor(struct weston_output *output_base,
+ struct weston_input_device *eid)
{
struct drm_output *output = (struct drm_output *) output_base;
struct drm_compositor *c =
@@ -259,7 +259,7 @@ out:
}
static void
-drm_output_destroy(struct wlsc_output *output_base)
+drm_output_destroy(struct weston_output *output_base)
{
struct drm_output *output = (struct drm_output *) output_base;
struct drm_compositor *c =
@@ -294,7 +294,7 @@ drm_output_destroy(struct wlsc_output *output_base)
c->crtc_allocator &= ~(1 << output->crtc_id);
c->connector_allocator &= ~(1 << output->connector_id);
- wlsc_output_destroy(&output->base);
+ weston_output_destroy(&output->base);
wl_list_remove(&output->base.link);
free(output);
@@ -542,7 +542,7 @@ create_output_for_connector(struct drm_compositor *ec,
goto err_fb;
}
- wlsc_output_init(&output->base, &ec->base, x, y,
+ weston_output_init(&output->base, &ec->base, x, y,
connector->mmWidth, connector->mmHeight, 0);
wl_list_insert(ec->base.output_list.prev, &output->base.link);
@@ -619,7 +619,7 @@ create_outputs(struct drm_compositor *ec, int option_connector)
}
x += container_of(ec->base.output_list.prev,
- struct wlsc_output,
+ struct weston_output,
link)->current->width;
}
@@ -669,9 +669,9 @@ update_outputs(struct drm_compositor *ec)
connected |= (1 << connector_id);
if (!(ec->connector_allocator & (1 << connector_id))) {
- struct wlsc_output *last =
+ struct weston_output *last =
container_of(ec->base.output_list.prev,
- struct wlsc_output, link);
+ struct weston_output, link);
/* XXX: not yet needed, we die with 0 outputs */
if (!wl_list_empty(&ec->base.output_list))
@@ -693,7 +693,7 @@ update_outputs(struct drm_compositor *ec)
wl_list_for_each_safe(output, next, &ec->base.output_list,
base.link) {
if (x_offset != 0 || y_offset != 0) {
- wlsc_output_move(&output->base,
+ weston_output_move(&output->base,
output->base.x - x_offset,
output->base.y - y_offset);
}
@@ -744,7 +744,7 @@ udev_drm_event(int fd, uint32_t mask, void *data)
}
static EGLImageKHR
-drm_compositor_create_cursor_image(struct wlsc_compositor *ec,
+drm_compositor_create_cursor_image(struct weston_compositor *ec,
int32_t *width, int32_t *height)
{
struct drm_compositor *c = (struct drm_compositor *) ec;
@@ -770,12 +770,12 @@ drm_compositor_create_cursor_image(struct wlsc_compositor *ec,
}
static void
-drm_destroy(struct wlsc_compositor *ec)
+drm_destroy(struct weston_compositor *ec)
{
struct drm_compositor *d = (struct drm_compositor *) ec;
- struct wlsc_input_device *input, *next;
+ struct weston_input_device *input, *next;
- wlsc_compositor_shutdown(ec);
+ weston_compositor_shutdown(ec);
gbm_device_destroy(d->gbm);
tty_destroy(d->tty);
@@ -786,25 +786,25 @@ drm_destroy(struct wlsc_compositor *ec)
}
static void
-vt_func(struct wlsc_compositor *compositor, int event)
+vt_func(struct weston_compositor *compositor, int event)
{
struct drm_compositor *ec = (struct drm_compositor *) compositor;
- struct wlsc_output *output;
- struct wlsc_input_device *input;
+ struct weston_output *output;
+ struct weston_input_device *input;
switch (event) {
case TTY_ENTER_VT:
compositor->focus = 1;
drmSetMaster(ec->drm.fd);
compositor->state = ec->prev_state;
- wlsc_compositor_damage_all(compositor);
+ weston_compositor_damage_all(compositor);
wl_list_for_each(input, &compositor->input_device_list, link)
evdev_add_devices(ec->udev, input);
break;
case TTY_LEAVE_VT:
compositor->focus = 0;
ec->prev_state = compositor->state;
- compositor->state = WLSC_COMPOSITOR_SLEEPING;
+ compositor->state = WESTON_COMPOSITOR_SLEEPING;
wl_list_for_each(input, &compositor->input_device_list, link)
evdev_remove_devices(input);
@@ -818,7 +818,7 @@ vt_func(struct wlsc_compositor *compositor, int event)
static const char default_seat[] = "seat0";
-static struct wlsc_compositor *
+static struct weston_compositor *
drm_compositor_create(struct wl_display *display,
int connector, const char *seat, int tty)
{
@@ -878,13 +878,13 @@ drm_compositor_create(struct wl_display *display,
ec->base.focus = 1;
- ec->prev_state = WLSC_COMPOSITOR_ACTIVE;
+ ec->prev_state = WESTON_COMPOSITOR_ACTIVE;
glGenFramebuffers(1, &ec->base.fbo);
glBindFramebuffer(GL_FRAMEBUFFER, ec->base.fbo);
/* Can't init base class until we have a current egl context */
- if (wlsc_compositor_init(&ec->base, display) < 0)
+ if (weston_compositor_init(&ec->base, display) < 0)
return NULL;
if (create_outputs(ec, connector) < 0) {
@@ -923,10 +923,10 @@ drm_compositor_create(struct wl_display *display,
return &ec->base;
}
-struct wlsc_compositor *
+struct weston_compositor *
backend_init(struct wl_display *display, char *options);
-WL_EXPORT struct wlsc_compositor *
+WL_EXPORT struct weston_compositor *
backend_init(struct wl_display *display, char *options)
{
int connector = 0, i;
diff --git a/compositor/compositor-openwfd.c b/src/compositor-openwfd.c
index 8fb671a..8fb671a 100644
--- a/compositor/compositor-openwfd.c
+++ b/src/compositor-openwfd.c
diff --git a/compositor/compositor-wayland.c b/src/compositor-wayland.c
index a99ca3a..4fa9df1 100644
--- a/compositor/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -43,7 +43,7 @@
#include "compositor.h"
struct wayland_compositor {
- struct wlsc_compositor base;
+ struct weston_compositor base;
struct {
struct wl_display *display;
@@ -63,7 +63,7 @@ struct wayland_compositor {
};
struct wayland_output {
- struct wlsc_output base;
+ struct weston_output base;
struct {
struct wl_surface *surface;
@@ -71,7 +71,7 @@ struct wayland_output {
struct wl_egl_window *egl_window;
} parent;
EGLSurface egl_surface;
- struct wlsc_mode mode;
+ struct weston_mode mode;
};
struct wayland_input {
@@ -83,14 +83,14 @@ struct wayland_input {
static int
wayland_input_create(struct wayland_compositor *c)
{
- struct wlsc_input_device *input;
+ struct weston_input_device *input;
input = malloc(sizeof *input);
if (input == NULL)
return -1;
memset(input, 0, sizeof *input);
- wlsc_input_device_init(input, &c->base);
+ weston_input_device_init(input, &c->base);
c->base.input_device = &input->input_device;
@@ -162,10 +162,10 @@ wayland_compositor_init_egl(struct wayland_compositor *c)
}
static int
-wayland_output_prepare_render(struct wlsc_output *output_base)
+wayland_output_prepare_render(struct weston_output *output_base)
{
struct wayland_output *output = (struct wayland_output *) output_base;
- struct wlsc_compositor *ec = output->base.compositor;
+ struct weston_compositor *ec = output->base.compositor;
if (!eglMakeCurrent(ec->display, output->egl_surface,
output->egl_surface, ec->context)) {
@@ -179,9 +179,9 @@ wayland_output_prepare_render(struct wlsc_output *output_base)
static void
frame_done(void *data, struct wl_callback *wl_callback, uint32_t time)
{
- struct wlsc_output *output = data;
+ struct weston_output *output = data;
- wlsc_output_finish_frame(output, time);
+ weston_output_finish_frame(output, time);
}
static const struct wl_callback_listener frame_listener = {
@@ -189,7 +189,7 @@ static const struct wl_callback_listener frame_listener = {
};
static int
-wayland_output_present(struct wlsc_output *output_base)
+wayland_output_present(struct weston_output *output_base)
{
struct wayland_output *output = (struct wayland_output *) output_base;
struct wayland_compositor *c =
@@ -207,24 +207,24 @@ wayland_output_present(struct wlsc_output *output_base)
}
static int
-wayland_output_prepare_scanout_surface(struct wlsc_output *output_base,
- struct wlsc_surface *es)
+wayland_output_prepare_scanout_surface(struct weston_output *output_base,
+ struct weston_surface *es)
{
return -1;
}
static int
-wayland_output_set_cursor(struct wlsc_output *output_base,
- struct wlsc_input_device *input)
+wayland_output_set_cursor(struct weston_output *output_base,
+ struct weston_input_device *input)
{
return -1;
}
static void
-wayland_output_destroy(struct wlsc_output *output_base)
+wayland_output_destroy(struct weston_output *output_base)
{
struct wayland_output *output = (struct wayland_output *) output_base;
- struct wlsc_compositor *ec = output->base.compositor;
+ struct weston_compositor *ec = output->base.compositor;
eglDestroySurface(ec->display, output->egl_surface);
wl_egl_window_destroy(output->parent.egl_window);
@@ -253,7 +253,7 @@ wayland_compositor_create_output(struct wayland_compositor *c,
wl_list_insert(&output->base.mode_list, &output->mode.link);
output->base.current = &output->mode;
- wlsc_output_init(&output->base, &c->base, 0, 0, width, height,
+ weston_output_init(&output->base, &c->base, 0, 0, width, height,
WL_OUTPUT_FLIPPED);
output->parent.surface =
@@ -306,7 +306,7 @@ cleanup_surface:
cleanup_window:
wl_egl_window_destroy(output->parent.egl_window);
cleanup_output:
- /* FIXME: cleanup wlsc_output */
+ /* FIXME: cleanup weston_output */
free(output);
return -1;
@@ -499,14 +499,14 @@ wayland_compositor_handle_event(int fd, uint32_t mask, void *data)
}
static void
-wayland_destroy(struct wlsc_compositor *ec)
+wayland_destroy(struct weston_compositor *ec)
{
- wlsc_compositor_shutdown(ec);
+ weston_compositor_shutdown(ec);
free(ec);
}
-static struct wlsc_compositor *
+static struct weston_compositor *
wayland_compositor_create(struct wl_display *display, int width, int height)
{
struct wayland_compositor *c;
@@ -539,7 +539,7 @@ wayland_compositor_create(struct wl_display *display, int width, int height)
c->base.destroy = wayland_destroy;
/* Can't init base class until we have a current egl context */
- if (wlsc_compositor_init(&c->base, display) < 0)
+ if (weston_compositor_init(&c->base, display) < 0)
return NULL;
if (wayland_compositor_create_output(c, width, height) < 0)
@@ -560,10 +560,10 @@ wayland_compositor_create(struct wl_display *display, int width, int height)
return &c->base;
}
-struct wlsc_compositor *
+struct weston_compositor *
backend_init(struct wl_display *display, char *options);
-WL_EXPORT struct wlsc_compositor *
+WL_EXPORT struct weston_compositor *
backend_init(struct wl_display *display, char *options)
{
int width = 1024, height = 640, i;
diff --git a/compositor/compositor-x11.c b/src/compositor-x11.c
index 5aa1ebf..ad5b587 100644
--- a/compositor/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -45,7 +45,7 @@
#include "compositor.h"
struct x11_compositor {
- struct wlsc_compositor base;
+ struct weston_compositor base;
Display *dpy;
xcb_connection_t *conn;
@@ -70,16 +70,16 @@ struct x11_compositor {
};
struct x11_output {
- struct wlsc_output base;
+ struct weston_output base;
xcb_window_t window;
EGLSurface egl_surface;
- struct wlsc_mode mode;
+ struct weston_mode mode;
struct wl_event_source *finish_frame_timer;
};
struct x11_input {
- struct wlsc_input_device base;
+ struct weston_input_device base;
};
@@ -93,7 +93,7 @@ x11_input_create(struct x11_compositor *c)
return -1;
memset(input, 0, sizeof *input);
- wlsc_input_device_init(&input->base, &c->base);
+ weston_input_device_init(&input->base, &c->base);
c->base.input_device = &input->base.input_device;
@@ -164,10 +164,10 @@ x11_compositor_init_egl(struct x11_compositor *c)
}
static int
-x11_output_prepare_render(struct wlsc_output *output_base)
+x11_output_prepare_render(struct weston_output *output_base)
{
struct x11_output *output = (struct x11_output *) output_base;
- struct wlsc_compositor *ec = output->base.compositor;
+ struct weston_compositor *ec = output->base.compositor;
if (!eglMakeCurrent(ec->display, output->egl_surface,
output->egl_surface, ec->context)) {
@@ -187,16 +187,16 @@ finish_frame_handler(void *data)
gettimeofday(&tv, NULL);
msec = tv.tv_sec * 1000 + tv.tv_usec / 1000;
- wlsc_output_finish_frame(&output->base, msec);
+ weston_output_finish_frame(&output->base, msec);
return 1;
}
static int
-x11_output_present(struct wlsc_output *output_base)
+x11_output_present(struct weston_output *output_base)
{
struct x11_output *output = (struct x11_output *) output_base;
- struct wlsc_compositor *ec = output->base.compositor;
+ struct weston_compositor *ec = output->base.compositor;
if (x11_output_prepare_render(&output->base))
return -1;
@@ -209,21 +209,21 @@ x11_output_present(struct wlsc_output *output_base)
}
static int
-x11_output_prepare_scanout_surface(struct wlsc_output *output_base,
- struct wlsc_surface *es)
+x11_output_prepare_scanout_surface(struct weston_output *output_base,
+ struct weston_surface *es)
{
return -1;
}
static int
-x11_output_set_cursor(struct wlsc_output *output_base,
- struct wlsc_input_device *input)
+x11_output_set_cursor(struct weston_output *output_base,
+ struct weston_input_device *input)
{
return -1;
}
static void
-x11_output_destroy(struct wlsc_output *output_base)
+x11_output_destroy(struct weston_output *output_base)
{
return;
}
@@ -300,7 +300,7 @@ x11_output_set_icon(struct x11_compositor *c,
uint32_t *icon, *pixels, stride;
int32_t width, height;
- pixels = wlsc_load_image(filename, &width, &height, &stride);
+ pixels = weston_load_image(filename, &width, &height, &stride);
if (!pixels)
return;
icon = malloc(width * height * 4 + 8);
@@ -360,7 +360,7 @@ x11_compositor_create_output(struct x11_compositor *c, int x, int y,
wl_list_insert(&output->base.mode_list, &output->mode.link);
output->base.current = &output->mode;
- wlsc_output_init(&output->base, &c->base, x, y, width, height,
+ weston_output_init(&output->base, &c->base, x, y, width, height,
WL_OUTPUT_FLIPPED);
values[1] = c->null_cursor;
@@ -482,7 +482,7 @@ x11_compositor_deliver_button_event(struct x11_compositor *c,
}
notify_button(c->base.input_device,
- wlsc_compositor_get_time(), button, state);
+ weston_compositor_get_time(), button, state);
}
static int
@@ -538,7 +538,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data)
* and fall through and handle the new
* event below. */
notify_key(c->base.input_device,
- wlsc_compositor_get_time(),
+ weston_compositor_get_time(),
key_release->detail - 8, 0);
free(prev);
prev = NULL;
@@ -561,7 +561,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data)
output = x11_compositor_find_output(c, focus_in->event);
notify_keyboard_focus(c->base.input_device,
- wlsc_compositor_get_time(),
+ weston_compositor_get_time(),
&output->base, &c->keys);
free(prev);
@@ -577,7 +577,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data)
case XCB_KEY_PRESS:
key_press = (xcb_key_press_event_t *) event;
notify_key(c->base.input_device,
- wlsc_compositor_get_time(),
+ weston_compositor_get_time(),
key_press->detail - 8, 1);
break;
case XCB_KEY_RELEASE:
@@ -593,7 +593,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data)
motion_notify = (xcb_motion_notify_event_t *) event;
output = x11_compositor_find_output(c, motion_notify->event);
notify_motion(c->base.input_device,
- wlsc_compositor_get_time(),
+ weston_compositor_get_time(),
output->base.x + motion_notify->event_x,
output->base.y + motion_notify->event_y);
break;
@@ -602,7 +602,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data)
/* FIXME: schedule output repaint */
/* output = x11_compositor_find_output(c, expose->window); */
- wlsc_compositor_schedule_repaint(&c->base);
+ weston_compositor_schedule_repaint(&c->base);
break;
case XCB_ENTER_NOTIFY:
@@ -611,7 +611,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data)
break;
output = x11_compositor_find_output(c, enter_notify->event);
notify_pointer_focus(c->base.input_device,
- wlsc_compositor_get_time(),
+ weston_compositor_get_time(),
&output->base,
output->base.x + enter_notify->event_x,
output->base.y + enter_notify->event_y);
@@ -623,7 +623,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data)
break;
output = x11_compositor_find_output(c, enter_notify->event);
notify_pointer_focus(c->base.input_device,
- wlsc_compositor_get_time(),
+ weston_compositor_get_time(),
NULL,
output->base.x + enter_notify->event_x,
output->base.y + enter_notify->event_y);
@@ -650,7 +650,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data)
focus_in->mode == XCB_NOTIFY_MODE_UNGRAB)
break;
notify_keyboard_focus(c->base.input_device,
- wlsc_compositor_get_time(),
+ weston_compositor_get_time(),
NULL, NULL);
break;
@@ -666,7 +666,7 @@ x11_compositor_handle_event(int fd, uint32_t mask, void *data)
case XCB_KEY_RELEASE:
key_release = (xcb_key_press_event_t *) prev;
notify_key(c->base.input_device,
- wlsc_compositor_get_time(),
+ weston_compositor_get_time(),
key_release->detail - 8, 0);
free(prev);
prev = NULL;
@@ -730,14 +730,14 @@ x11_compositor_get_resources(struct x11_compositor *c)
}
static void
-x11_destroy(struct wlsc_compositor *ec)
+x11_destroy(struct weston_compositor *ec)
{
- wlsc_compositor_shutdown(ec);
+ weston_compositor_shutdown(ec);
free(ec);
}
-static struct wlsc_compositor *
+static struct weston_compositor *
x11_compositor_create(struct wl_display *display,
int width, int height, int count, int fullscreen)
{
@@ -775,7 +775,7 @@ x11_compositor_create(struct wl_display *display,
c->base.destroy = x11_destroy;
/* Can't init base class until we have a current egl context */
- if (wlsc_compositor_init(&c->base, display) < 0)
+ if (weston_compositor_init(&c->base, display) < 0)
return NULL;
for (i = 0, x = 0; i < count; i++) {
@@ -799,10 +799,10 @@ x11_compositor_create(struct wl_display *display,
return &c->base;
}
-struct wlsc_compositor *
+struct weston_compositor *
backend_init(struct wl_display *display, char *options);
-WL_EXPORT struct wlsc_compositor *
+WL_EXPORT struct weston_compositor *
backend_init(struct wl_display *display, char *options)
{
int width = 1024, height = 640, fullscreen = 0, count = 1, i;
diff --git a/compositor/compositor.c b/src/compositor.c
index 0fa9ed8..b1353f4 100644
--- a/compositor/compositor.c
+++ b/src/compositor.c
@@ -54,7 +54,7 @@ static struct wl_list child_process_list;
static int
sigchld_handler(int signal_number, void *data)
{
- struct wlsc_process *p;
+ struct weston_process *p;
int status;
pid_t pid;
@@ -76,7 +76,7 @@ sigchld_handler(int signal_number, void *data)
}
WL_EXPORT void
-wlsc_watch_process(struct wlsc_process *process)
+weston_watch_process(struct weston_process *process)
{
wl_list_insert(&child_process_list, &process->link);
}
@@ -109,17 +109,17 @@ child_client_exec(int sockfd, const char *path)
}
WL_EXPORT struct wl_client *
-wlsc_client_launch(struct wlsc_compositor *compositor,
- struct wlsc_process *proc,
- const char *path,
- wlsc_process_cleanup_func_t cleanup)
+weston_client_launch(struct weston_compositor *compositor,
+ struct weston_process *proc,
+ const char *path,
+ weston_process_cleanup_func_t cleanup)
{
int sv[2];
pid_t pid;
struct wl_client *client;
if (socketpair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0, sv) < 0) {
- fprintf(stderr, "wlsc_client_launch: "
+ fprintf(stderr, "weston_client_launch: "
"socketpair failed while launching '%s': %m\n",
path);
return NULL;
@@ -129,7 +129,7 @@ wlsc_client_launch(struct wlsc_compositor *compositor,
if (pid == -1) {
close(sv[0]);
close(sv[1]);
- fprintf(stderr, "wlsc_client_launch: "
+ fprintf(stderr, "weston_client_launch: "
"fork failed while launching '%s': %m\n", path);
return NULL;
}
@@ -144,7 +144,7 @@ wlsc_client_launch(struct wlsc_compositor *compositor,
client = wl_client_create(compositor->wl_display, sv[0]);
if (!client) {
close(sv[0]);
- fprintf(stderr, "wlsc_client_launch: "
+ fprintf(stderr, "weston_client_launch: "
"wl_client_create failed while launching '%s'.\n",
path);
return NULL;
@@ -152,7 +152,7 @@ wlsc_client_launch(struct wlsc_compositor *compositor,
proc->pid = pid;
proc->cleanup = cleanup;
- wlsc_watch_process(proc);
+ weston_watch_process(proc);
return client;
}
@@ -161,8 +161,9 @@ static void
surface_handle_buffer_destroy(struct wl_listener *listener,
struct wl_resource *resource, uint32_t time)
{
- struct wlsc_surface *es = container_of(listener, struct wlsc_surface,
- buffer_destroy_listener);
+ struct weston_surface *es =
+ container_of(listener, struct weston_surface,
+ buffer_destroy_listener);
es->buffer = NULL;
}
@@ -172,14 +173,14 @@ output_handle_scanout_buffer_destroy(struct wl_listener *listener,
struct wl_resource *resource,
uint32_t time)
{
- struct wlsc_output *output =
- container_of(listener, struct wlsc_output,
+ struct weston_output *output =
+ container_of(listener, struct weston_output,
scanout_buffer_destroy_listener);
output->scanout_buffer = NULL;
if (!output->pending_scanout_buffer)
- wlsc_compositor_schedule_repaint(output->compositor);
+ weston_compositor_schedule_repaint(output->compositor);
}
static void
@@ -187,21 +188,21 @@ output_handle_pending_scanout_buffer_destroy(struct wl_listener *listener,
struct wl_resource *resource,
uint32_t time)
{
- struct wlsc_output *output =
- container_of(listener, struct wlsc_output,
+ struct weston_output *output =
+ container_of(listener, struct weston_output,
pending_scanout_buffer_destroy_listener);
output->pending_scanout_buffer = NULL;
- wlsc_compositor_schedule_repaint(output->compositor);
+ weston_compositor_schedule_repaint(output->compositor);
}
-WL_EXPORT struct wlsc_surface *
-wlsc_surface_create(struct wlsc_compositor *compositor,
- int32_t x, int32_t y, int32_t width, int32_t height)
+WL_EXPORT struct weston_surface *
+weston_surface_create(struct weston_compositor *compositor,
+ int32_t x, int32_t y, int32_t width, int32_t height)
{
- struct wlsc_surface *surface;
+ struct weston_surface *surface;
surface = calloc(1, sizeof *surface);
if (surface == NULL)
@@ -218,7 +219,7 @@ wlsc_surface_create(struct wlsc_compositor *compositor,
surface->surface.resource.client = NULL;
surface->compositor = compositor;
- surface->visual = WLSC_NONE_VISUAL;
+ surface->visual = WESTON_NONE_VISUAL;
surface->image = EGL_NO_IMAGE_KHR;
surface->saved_texture = 0;
surface->x = x;
@@ -243,30 +244,30 @@ wlsc_surface_create(struct wlsc_compositor *compositor,
}
WL_EXPORT void
-wlsc_surface_damage_rectangle(struct wlsc_surface *surface,
+weston_surface_damage_rectangle(struct weston_surface *surface,
int32_t x, int32_t y,
int32_t width, int32_t height)
{
- struct wlsc_compositor *compositor = surface->compositor;
+ struct weston_compositor *compositor = surface->compositor;
pixman_region32_union_rect(&surface->damage,
&surface->damage,
surface->x + x, surface->y + y,
width, height);
- wlsc_compositor_schedule_repaint(compositor);
+ weston_compositor_schedule_repaint(compositor);
}
WL_EXPORT void
-wlsc_surface_damage(struct wlsc_surface *surface)
+weston_surface_damage(struct weston_surface *surface)
{
- wlsc_surface_damage_rectangle(surface, 0, 0,
+ weston_surface_damage_rectangle(surface, 0, 0,
surface->width, surface->height);
}
WL_EXPORT void
-wlsc_surface_damage_below(struct wlsc_surface *surface)
+weston_surface_damage_below(struct weston_surface *surface)
{
- struct wlsc_surface *below;
+ struct weston_surface *below;
if (surface->output == NULL)
return;
@@ -274,31 +275,31 @@ wlsc_surface_damage_below(struct wlsc_surface *surface)
if (surface->link.next == &surface->compositor->surface_list)
return;
- below = container_of(surface->link.next, struct wlsc_surface, link);
+ below = container_of(surface->link.next, struct weston_surface, link);
pixman_region32_union_rect(&below->damage,
&below->damage,
surface->x, surface->y,
surface->width, surface->height);
- wlsc_compositor_schedule_repaint(surface->compositor);
+ weston_compositor_schedule_repaint(surface->compositor);
}
WL_EXPORT void
-wlsc_surface_configure(struct wlsc_surface *surface,
- int x, int y, int width, int height)
+weston_surface_configure(struct weston_surface *surface,
+ int x, int y, int width, int height)
{
- wlsc_surface_damage_below(surface);
+ weston_surface_damage_below(surface);
surface->x = x;
surface->y = y;
surface->width = width;
surface->height = height;
- wlsc_surface_assign_output(surface);
- wlsc_surface_damage(surface);
+ weston_surface_assign_output(surface);
+ weston_surface_damage(surface);
pixman_region32_fini(&surface->opaque);
- if (surface->visual == WLSC_RGB_VISUAL)
+ if (surface->visual == WESTON_RGB_VISUAL)
pixman_region32_init_rect(&surface->opaque,
surface->x, surface->y,
surface->width, surface->height);
@@ -307,7 +308,7 @@ wlsc_surface_configure(struct wlsc_surface *surface,
}
WL_EXPORT uint32_t
-wlsc_compositor_get_time(void)
+weston_compositor_get_time(void)
{
struct timeval tv;
@@ -317,17 +318,17 @@ wlsc_compositor_get_time(void)
}
WL_EXPORT void
-wlsc_compositor_repick(struct wlsc_compositor *compositor)
+weston_compositor_repick(struct weston_compositor *compositor)
{
- struct wlsc_input_device *device;
- struct wlsc_surface *surface;
+ struct weston_input_device *device;
+ struct weston_surface *surface;
int32_t sx, sy;
uint32_t time;
if (!compositor->focus)
return;
- time = wlsc_compositor_get_time();
+ time = weston_compositor_get_time();
wl_list_for_each(device, &compositor->input_device_list, link) {
if (device->input_device.grab)
continue;
@@ -344,14 +345,15 @@ wlsc_compositor_repick(struct wlsc_compositor *compositor)
static void
destroy_surface(struct wl_resource *resource)
{
- struct wlsc_surface *surface =
- container_of(resource, struct wlsc_surface, surface.resource);
- struct wlsc_compositor *compositor = surface->compositor;
+ struct weston_surface *surface =
+ container_of(resource,
+ struct weston_surface, surface.resource);
+ struct weston_compositor *compositor = surface->compositor;
- wlsc_surface_damage_below(surface);
+ weston_surface_damage_below(surface);
wl_list_remove(&surface->link);
- wlsc_compositor_repick(compositor);
+ weston_compositor_repick(compositor);
if (surface->saved_texture == 0)
glDeleteTextures(1, &surface->texture);
@@ -371,10 +373,10 @@ destroy_surface(struct wl_resource *resource)
}
static void
-wlsc_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface)
+weston_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface)
{
- struct wlsc_surface *es = (struct wlsc_surface *) surface;
- struct wlsc_compositor *ec = es->compositor;
+ struct weston_surface *es = (struct weston_surface *) surface;
+ struct weston_compositor *ec = es->compositor;
struct wl_list *surfaces_attached_to;
if (es->saved_texture != 0)
@@ -395,13 +397,13 @@ wlsc_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface)
switch (wl_shm_buffer_get_format(buffer)) {
case WL_SHM_FORMAT_ARGB32:
- es->visual = WLSC_ARGB_VISUAL;
+ es->visual = WESTON_ARGB_VISUAL;
break;
case WL_SHM_FORMAT_PREMULTIPLIED_ARGB32:
- es->visual = WLSC_PREMUL_ARGB_VISUAL;
+ es->visual = WESTON_PREMUL_ARGB_VISUAL;
break;
case WL_SHM_FORMAT_XRGB32:
- es->visual = WLSC_RGB_VISUAL;
+ es->visual = WESTON_RGB_VISUAL;
break;
}
@@ -419,15 +421,15 @@ wlsc_buffer_attach(struct wl_buffer *buffer, struct wl_surface *surface)
ec->image_target_texture_2d(GL_TEXTURE_2D, es->image);
/* FIXME: we need to get the visual from the wl_buffer */
- es->visual = WLSC_PREMUL_ARGB_VISUAL;
+ es->visual = WESTON_PREMUL_ARGB_VISUAL;
es->pitch = es->width;
}
}
static int
-texture_region(struct wlsc_surface *es, pixman_region32_t *region)
+texture_region(struct weston_surface *es, pixman_region32_t *region)
{
- struct wlsc_compositor *ec = es->compositor;
+ struct weston_compositor *ec = es->compositor;
GLfloat *v, inv_width, inv_height;
pixman_box32_t *rectangles;
unsigned int *p;
@@ -472,17 +474,17 @@ texture_region(struct wlsc_surface *es, pixman_region32_t *region)
}
static void
-transform_vertex(struct wlsc_surface *surface,
+transform_vertex(struct weston_surface *surface,
GLfloat x, GLfloat y, GLfloat u, GLfloat v, GLfloat *r)
{
- struct wlsc_vector t;
+ struct weston_vector t;
t.f[0] = x;
t.f[1] = y;
t.f[2] = 0.0;
t.f[3] = 1.0;
- wlsc_matrix_transform(&surface->transform->matrix, &t);
+ weston_matrix_transform(&surface->transform->matrix, &t);
r[ 0] = t.f[0];
r[ 1] = t.f[1];
@@ -491,9 +493,9 @@ transform_vertex(struct wlsc_surface *surface,
}
static int
-texture_transformed_surface(struct wlsc_surface *es)
+texture_transformed_surface(struct weston_surface *es)
{
- struct wlsc_compositor *ec = es->compositor;
+ struct weston_compositor *ec = es->compositor;
GLfloat *v;
unsigned int *p;
@@ -517,10 +519,10 @@ texture_transformed_surface(struct wlsc_surface *es)
}
static void
-wlsc_surface_draw(struct wlsc_surface *es,
- struct wlsc_output *output, pixman_region32_t *clip)
+weston_surface_draw(struct weston_surface *es,
+ struct weston_output *output, pixman_region32_t *clip)
{
- struct wlsc_compositor *ec = es->compositor;
+ struct weston_compositor *ec = es->compositor;
GLfloat *v;
pixman_region32_t repaint;
GLint filter;
@@ -533,15 +535,15 @@ wlsc_surface_draw(struct wlsc_surface *es,
return;
switch (es->visual) {
- case WLSC_ARGB_VISUAL:
+ case WESTON_ARGB_VISUAL:
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
break;
- case WLSC_PREMUL_ARGB_VISUAL:
+ case WESTON_PREMUL_ARGB_VISUAL:
glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
glEnable(GL_BLEND);
break;
- case WLSC_RGB_VISUAL:
+ case WESTON_RGB_VISUAL:
glDisable(GL_BLEND);
break;
default:
@@ -580,27 +582,27 @@ wlsc_surface_draw(struct wlsc_surface *es,
}
static void
-wlsc_surface_raise(struct wlsc_surface *surface)
+weston_surface_raise(struct weston_surface *surface)
{
- struct wlsc_compositor *compositor = surface->compositor;
+ struct weston_compositor *compositor = surface->compositor;
wl_list_remove(&surface->link);
wl_list_insert(&compositor->surface_list, &surface->link);
- wlsc_compositor_repick(compositor);
- wlsc_surface_damage(surface);
+ weston_compositor_repick(compositor);
+ weston_surface_damage(surface);
}
WL_EXPORT void
-wlsc_compositor_damage_all(struct wlsc_compositor *compositor)
+weston_compositor_damage_all(struct weston_compositor *compositor)
{
- struct wlsc_output *output;
+ struct weston_output *output;
wl_list_for_each(output, &compositor->output_list, link)
- wlsc_output_damage(output);
+ weston_output_damage(output);
}
static inline void
-wlsc_buffer_post_release(struct wl_buffer *buffer)
+weston_buffer_post_release(struct wl_buffer *buffer)
{
if (--buffer->busy_count > 0)
return;
@@ -610,50 +612,50 @@ wlsc_buffer_post_release(struct wl_buffer *buffer)
}
WL_EXPORT void
-wlsc_output_damage(struct wlsc_output *output)
+weston_output_damage(struct weston_output *output)
{
- struct wlsc_compositor *compositor = output->compositor;
- struct wlsc_surface *es;
+ struct weston_compositor *compositor = output->compositor;
+ struct weston_surface *es;
if (wl_list_empty(&compositor->surface_list))
return;
es = container_of(compositor->surface_list.next,
- struct wlsc_surface, link);
+ struct weston_surface, link);
pixman_region32_union(&es->damage, &es->damage, &output->region);
- wlsc_compositor_schedule_repaint(compositor);
+ weston_compositor_schedule_repaint(compositor);
}
static void
-fade_frame(struct wlsc_animation *animation,
- struct wlsc_output *output, uint32_t msecs)
+fade_frame(struct weston_animation *animation,
+ struct weston_output *output, uint32_t msecs)
{
- struct wlsc_compositor *compositor =
+ struct weston_compositor *compositor =
container_of(animation,
- struct wlsc_compositor, fade.animation);
+ struct weston_compositor, fade.animation);
- wlsc_spring_update(&compositor->fade.spring, msecs);
- if (wlsc_spring_done(&compositor->fade.spring)) {
+ weston_spring_update(&compositor->fade.spring, msecs);
+ if (weston_spring_done(&compositor->fade.spring)) {
compositor->fade.spring.current =
compositor->fade.spring.target;
wl_list_remove(&animation->link);
wl_list_init(&animation->link);
if (compositor->fade.spring.current > 0.999) {
- compositor->state = WLSC_COMPOSITOR_SLEEPING;
+ compositor->state = WESTON_COMPOSITOR_SLEEPING;
compositor->shell->lock(compositor->shell);
}
}
- wlsc_output_damage(output);
+ weston_output_damage(output);
}
static void
-fade_output(struct wlsc_output *output,
+fade_output(struct weston_output *output,
GLfloat tint, pixman_region32_t *region)
{
- struct wlsc_compositor *compositor = output->compositor;
- struct wlsc_surface surface;
+ struct weston_compositor *compositor = output->compositor;
+ struct weston_surface surface;
GLfloat color[4] = { 0.0, 0.0, 0.0, tint };
surface.compositor = compositor;
@@ -667,23 +669,24 @@ fade_output(struct wlsc_output *output,
surface.alpha = compositor->current_alpha;
if (tint <= 1.0)
- surface.visual = WLSC_PREMUL_ARGB_VISUAL;
+ surface.visual = WESTON_PREMUL_ARGB_VISUAL;
else
- surface.visual = WLSC_RGB_VISUAL;
+ surface.visual = WESTON_RGB_VISUAL;
glUseProgram(compositor->solid_shader.program);
glUniformMatrix4fv(compositor->solid_shader.proj_uniform,
1, GL_FALSE, output->matrix.d);
glUniform4fv(compositor->solid_shader.color_uniform, 1, color);
- wlsc_surface_draw(&surface, output, region);
+ weston_surface_draw(&surface, output, region);
}
static void
-wlsc_output_set_cursor(struct wlsc_output *output,
- struct wl_input_device *dev, int force_sw)
+weston_output_set_cursor(struct weston_output *output,
+ struct wl_input_device *dev, int force_sw)
{
- struct wlsc_compositor *ec = output->compositor;
- struct wlsc_input_device *device = (struct wlsc_input_device *) dev;
+ struct weston_compositor *ec = output->compositor;
+ struct weston_input_device *device =
+ (struct weston_input_device *) dev;
pixman_region32_t cursor_region;
int use_hardware_cursor = 1, prior_was_hardware;
@@ -705,12 +708,12 @@ wlsc_output_set_cursor(struct wlsc_output *output,
prior_was_hardware = wl_list_empty(&device->sprite->link);
if (force_sw || output->set_hardware_cursor(output, device) < 0) {
if (prior_was_hardware) {
- wlsc_surface_damage(device->sprite);
+ weston_surface_damage(device->sprite);
output->set_hardware_cursor(output, NULL);
}
use_hardware_cursor = 0;
} else if (!prior_was_hardware) {
- wlsc_surface_damage_below(device->sprite);
+ weston_surface_damage_below(device->sprite);
}
/* Remove always to be on top. */
@@ -728,9 +731,9 @@ out:
}
static int
-setup_scanout_surface(struct wlsc_output *output, struct wlsc_surface *es)
+setup_scanout_surface(struct weston_output *output, struct weston_surface *es)
{
- if (es->visual != WLSC_RGB_VISUAL ||
+ if (es->visual != WESTON_RGB_VISUAL ||
output->prepare_scanout_surface(output, es) != 0)
return -1;
@@ -745,10 +748,10 @@ setup_scanout_surface(struct wlsc_output *output, struct wlsc_surface *es)
}
static void
-wlsc_output_repaint(struct wlsc_output *output)
+weston_output_repaint(struct weston_output *output)
{
- struct wlsc_compositor *ec = output->compositor;
- struct wlsc_surface *es;
+ struct weston_compositor *ec = output->compositor;
+ struct weston_surface *es;
pixman_region32_t opaque, new_damage, total_damage, repaint;
output->prepare_render(output);
@@ -760,7 +763,7 @@ wlsc_output_repaint(struct wlsc_output *output)
1, GL_FALSE, output->matrix.d);
glUniform1i(ec->texture_shader.tex_uniform, 0);
- wlsc_output_set_cursor(output, ec->input_device,
+ weston_output_set_cursor(output, ec->input_device,
ec->fade.spring.current >= 0.001);
pixman_region32_init(&new_damage);
@@ -781,7 +784,7 @@ wlsc_output_repaint(struct wlsc_output *output)
pixman_region32_fini(&opaque);
pixman_region32_fini(&new_damage);
- es = container_of(ec->surface_list.next, struct wlsc_surface, link);
+ es = container_of(ec->surface_list.next, struct weston_surface, link);
if (setup_scanout_surface(output, es) == 0)
/* We're drawing nothing, just let the damage accumulate */
@@ -791,7 +794,7 @@ wlsc_output_repaint(struct wlsc_output *output)
if (es->width < output->current->width ||
es->height < output->current->height)
glClear(GL_COLOR_BUFFER_BIT);
- wlsc_surface_draw(es, output, &total_damage);
+ weston_surface_draw(es, output, &total_damage);
} else {
wl_list_for_each(es, &ec->surface_list, link) {
pixman_region32_copy(&es->damage, &total_damage);
@@ -802,7 +805,7 @@ wlsc_output_repaint(struct wlsc_output *output)
pixman_region32_init(&repaint);
pixman_region32_intersect(&repaint, &output->region,
&es->damage);
- wlsc_surface_draw(es, output, &repaint);
+ weston_surface_draw(es, output, &repaint);
pixman_region32_subtract(&es->damage,
&es->damage, &output->region);
}
@@ -812,7 +815,7 @@ wlsc_output_repaint(struct wlsc_output *output)
fade_output(output, ec->fade.spring.current, &total_damage);
}
-struct wlsc_frame_callback {
+struct weston_frame_callback {
struct wl_resource resource;
struct wl_list link;
};
@@ -820,12 +823,12 @@ struct wlsc_frame_callback {
static void
repaint(void *data, int msecs)
{
- struct wlsc_output *output = data;
- struct wlsc_compositor *compositor = output->compositor;
- struct wlsc_animation *animation, *next;
- struct wlsc_frame_callback *cb, *cnext;
+ struct weston_output *output = data;
+ struct weston_compositor *compositor = output->compositor;
+ struct weston_animation *animation, *next;
+ struct weston_frame_callback *cb, *cnext;
- wlsc_output_repaint(output);
+ weston_output_repaint(output);
output->repaint_needed = 0;
output->repaint_scheduled = 1;
output->present(output);
@@ -843,14 +846,14 @@ repaint(void *data, int msecs)
static void
idle_repaint(void *data)
{
- repaint(data, wlsc_compositor_get_time());
+ repaint(data, weston_compositor_get_time());
}
WL_EXPORT void
-wlsc_output_finish_frame(struct wlsc_output *output, int msecs)
+weston_output_finish_frame(struct weston_output *output, int msecs)
{
if (output->scanout_buffer) {
- wlsc_buffer_post_release(output->scanout_buffer);
+ weston_buffer_post_release(output->scanout_buffer);
wl_list_remove(&output->scanout_buffer_destroy_listener.link);
output->scanout_buffer = NULL;
}
@@ -870,12 +873,12 @@ wlsc_output_finish_frame(struct wlsc_output *output, int msecs)
}
WL_EXPORT void
-wlsc_compositor_schedule_repaint(struct wlsc_compositor *compositor)
+weston_compositor_schedule_repaint(struct weston_compositor *compositor)
{
- struct wlsc_output *output;
+ struct weston_output *output;
struct wl_event_loop *loop;
- if (compositor->state == WLSC_COMPOSITOR_SLEEPING)
+ if (compositor->state == WESTON_COMPOSITOR_SLEEPING)
return;
loop = wl_display_get_event_loop(compositor->wl_display);
@@ -890,20 +893,20 @@ wlsc_compositor_schedule_repaint(struct wlsc_compositor *compositor)
}
WL_EXPORT void
-wlsc_compositor_fade(struct wlsc_compositor *compositor, float tint)
+weston_compositor_fade(struct weston_compositor *compositor, float tint)
{
int done;
- done = wlsc_spring_done(&compositor->fade.spring);
+ done = weston_spring_done(&compositor->fade.spring);
compositor->fade.spring.target = tint;
- if (wlsc_spring_done(&compositor->fade.spring))
+ if (weston_spring_done(&compositor->fade.spring))
return;
if (done)
compositor->fade.spring.timestamp =
- wlsc_compositor_get_time();
+ weston_compositor_get_time();
- wlsc_compositor_damage_all(compositor);
+ weston_compositor_damage_all(compositor);
if (wl_list_empty(&compositor->fade.animation.link))
wl_list_insert(compositor->animation_list.prev,
&compositor->fade.animation.link);
@@ -912,14 +915,14 @@ wlsc_compositor_fade(struct wlsc_compositor *compositor, float tint)
static void
surface_destroy(struct wl_client *client, struct wl_resource *resource)
{
- wl_resource_destroy(resource, wlsc_compositor_get_time());
+ wl_resource_destroy(resource, weston_compositor_get_time());
}
WL_EXPORT void
-wlsc_surface_assign_output(struct wlsc_surface *es)
+weston_surface_assign_output(struct weston_surface *es)
{
- struct wlsc_compositor *ec = es->compositor;
- struct wlsc_output *output, *new_output;
+ struct weston_compositor *ec = es->compositor;
+ struct weston_output *output, *new_output;
pixman_region32_t region;
uint32_t max, area;
pixman_box32_t *e;
@@ -953,12 +956,12 @@ surface_attach(struct wl_client *client,
struct wl_resource *resource,
struct wl_resource *buffer_resource, int32_t x, int32_t y)
{
- struct wlsc_surface *es = resource->data;
- struct wlsc_shell *shell = es->compositor->shell;
+ struct weston_surface *es = resource->data;
+ struct weston_shell *shell = es->compositor->shell;
struct wl_buffer *buffer = buffer_resource->data;
if (es->buffer) {
- wlsc_buffer_post_release(es->buffer);
+ weston_buffer_post_release(es->buffer);
wl_list_remove(&es->buffer_destroy_listener.link);
}
@@ -967,7 +970,7 @@ surface_attach(struct wl_client *client,
wl_list_insert(es->buffer->resource.destroy_listener_list.prev,
&es->buffer_destroy_listener.link);
- if (es->visual == WLSC_NONE_VISUAL) {
+ if (es->visual == WESTON_NONE_VISUAL) {
shell->map(shell, es, buffer->width, buffer->height);
} else if (x != 0 || y != 0 ||
es->width != buffer->width ||
@@ -976,7 +979,7 @@ surface_attach(struct wl_client *client,
buffer->width, buffer->height);
}
- wlsc_buffer_attach(buffer, &es->surface);
+ weston_buffer_attach(buffer, &es->surface);
}
static void
@@ -984,15 +987,15 @@ surface_damage(struct wl_client *client,
struct wl_resource *resource,
int32_t x, int32_t y, int32_t width, int32_t height)
{
- struct wlsc_surface *es = resource->data;
+ struct weston_surface *es = resource->data;
- wlsc_surface_damage_rectangle(es, x, y, width, height);
+ weston_surface_damage_rectangle(es, x, y, width, height);
}
static void
destroy_frame_callback(struct wl_resource *resource)
{
- struct wlsc_frame_callback *cb = resource->data;
+ struct weston_frame_callback *cb = resource->data;
wl_list_remove(&cb->link);
free(cb);
@@ -1002,8 +1005,8 @@ static void
surface_frame(struct wl_client *client,
struct wl_resource *resource, uint32_t callback)
{
- struct wlsc_frame_callback *cb;
- struct wlsc_surface *es = resource->data;
+ struct weston_frame_callback *cb;
+ struct weston_surface *es = resource->data;
cb = malloc(sizeof *cb);
if (cb == NULL) {
@@ -1038,10 +1041,10 @@ static void
compositor_create_surface(struct wl_client *client,
struct wl_resource *resource, uint32_t id)
{
- struct wlsc_compositor *ec = resource->data;
- struct wlsc_surface *surface;
+ struct weston_compositor *ec = resource->data;
+ struct weston_surface *surface;
- surface = wlsc_surface_create(ec, 0, 0, 0, 0);
+ surface = weston_surface_create(ec, 0, 0, 0, 0);
if (surface == NULL) {
wl_resource_post_no_memory(resource);
return;
@@ -1063,23 +1066,23 @@ const static struct wl_compositor_interface compositor_interface = {
};
static void
-wlsc_surface_transform(struct wlsc_surface *surface,
+weston_surface_transform(struct weston_surface *surface,
int32_t x, int32_t y, int32_t *sx, int32_t *sy)
{
*sx = x - surface->x;
*sy = y - surface->y;
}
-static struct wlsc_surface *
-wlsc_compositor_pick_surface(struct wlsc_compositor *compositor,
- int32_t x, int32_t y, int32_t *sx, int32_t *sy)
+static struct weston_surface *
+weston_compositor_pick_surface(struct weston_compositor *compositor,
+ int32_t x, int32_t y, int32_t *sx, int32_t *sy)
{
- struct wlsc_surface *surface;
+ struct weston_surface *surface;
wl_list_for_each(surface, &compositor->surface_list, link) {
if (surface->surface.resource.client == NULL)
continue;
- wlsc_surface_transform(surface, x, y, sx, sy);
+ weston_surface_transform(surface, x, y, sx, sy);
if (0 <= *sx && *sx < surface->width &&
0 <= *sy && *sy < surface->height)
return surface;
@@ -1088,12 +1091,12 @@ wlsc_compositor_pick_surface(struct wlsc_compositor *compositor,
return NULL;
}
-WL_EXPORT struct wlsc_surface *
+WL_EXPORT struct weston_surface *
pick_surface(struct wl_input_device *device, int32_t *sx, int32_t *sy)
{
- struct wlsc_input_device *wd = (struct wlsc_input_device *) device;
+ struct weston_input_device *wd = (struct weston_input_device *) device;
- return wlsc_compositor_pick_surface(wd->compositor,
+ return weston_compositor_pick_surface(wd->compositor,
device->x, device->y, sx, sy);
}
@@ -1102,16 +1105,16 @@ static void
implicit_grab_motion(struct wl_grab *grab,
uint32_t time, int32_t x, int32_t y)
{
- struct wlsc_input_device *device =
- (struct wlsc_input_device *) grab->input_device;
- struct wlsc_surface *es =
- (struct wlsc_surface *) device->input_device.pointer_focus;
+ struct weston_input_device *device =
+ (struct weston_input_device *) grab->input_device;
+ struct weston_surface *es =
+ (struct weston_surface *) device->input_device.pointer_focus;
int32_t sx, sy;
struct wl_resource *resource;
resource = grab->input_device->pointer_focus_resource;
if (resource) {
- wlsc_surface_transform(es, x, y, &sx, &sy);
+ weston_surface_transform(es, x, y, &sx, &sy);
wl_resource_post_event(resource, WL_INPUT_DEVICE_MOTION,
time, x, y, sx, sy);
}
@@ -1141,48 +1144,48 @@ static const struct wl_grab_interface implicit_grab_interface = {
};
WL_EXPORT void
-wlsc_compositor_wake(struct wlsc_compositor *compositor)
+weston_compositor_wake(struct weston_compositor *compositor)
{
- compositor->state = WLSC_COMPOSITOR_ACTIVE;
- wlsc_compositor_fade(compositor, 0.0);
+ compositor->state = WESTON_COMPOSITOR_ACTIVE;
+ weston_compositor_fade(compositor, 0.0);
wl_event_source_timer_update(compositor->idle_source,
compositor->idle_time * 1000);
}
WL_EXPORT void
-wlsc_compositor_activity(struct wlsc_compositor *compositor)
+weston_compositor_activity(struct weston_compositor *compositor)
{
- if (compositor->state == WLSC_COMPOSITOR_ACTIVE) {
- wlsc_compositor_wake(compositor);
+ if (compositor->state == WESTON_COMPOSITOR_ACTIVE) {
+ weston_compositor_wake(compositor);
} else {
compositor->shell->unlock(compositor->shell);
}
}
static void
-wlsc_compositor_idle_inhibit(struct wlsc_compositor *compositor)
+weston_compositor_idle_inhibit(struct weston_compositor *compositor)
{
- wlsc_compositor_activity(compositor);
+ weston_compositor_activity(compositor);
compositor->idle_inhibit++;
}
static void
-wlsc_compositor_idle_release(struct wlsc_compositor *compositor)
+weston_compositor_idle_release(struct weston_compositor *compositor)
{
compositor->idle_inhibit--;
- wlsc_compositor_activity(compositor);
+ weston_compositor_activity(compositor);
}
static int
idle_handler(void *data)
{
- struct wlsc_compositor *compositor = data;
+ struct weston_compositor *compositor = data;
if (compositor->idle_inhibit)
return 1;
- wlsc_compositor_fade(compositor, 1.0);
+ weston_compositor_fade(compositor, 1.0);
return 1;
}
@@ -1190,16 +1193,16 @@ idle_handler(void *data)
WL_EXPORT void
notify_motion(struct wl_input_device *device, uint32_t time, int x, int y)
{
- struct wlsc_surface *es;
- struct wlsc_output *output;
+ struct weston_surface *es;
+ struct weston_output *output;
const struct wl_grab_interface *interface;
- struct wlsc_input_device *wd = (struct wlsc_input_device *) device;
- struct wlsc_compositor *ec = wd->compositor;
+ struct weston_input_device *wd = (struct weston_input_device *) device;
+ struct weston_compositor *ec = wd->compositor;
int32_t sx, sy;
int x_valid = 0, y_valid = 0;
int min_x = INT_MAX, min_y = INT_MAX, max_x = INT_MIN, max_y = INT_MIN;
- wlsc_compositor_activity(ec);
+ weston_compositor_activity(ec);
wl_list_for_each(output, &ec->output_list, link) {
if (output->x <= x && x <= output->x + output->current->width)
@@ -1251,41 +1254,41 @@ notify_motion(struct wl_input_device *device, uint32_t time, int x, int y)
}
if (wd->sprite) {
- wlsc_surface_damage_below(wd->sprite);
+ weston_surface_damage_below(wd->sprite);
wd->sprite->x = device->x - wd->hotspot_x;
wd->sprite->y = device->y - wd->hotspot_y;
- wlsc_surface_damage(wd->sprite);
+ weston_surface_damage(wd->sprite);
}
}
WL_EXPORT void
-wlsc_surface_activate(struct wlsc_surface *surface,
- struct wlsc_input_device *device, uint32_t time)
+weston_surface_activate(struct weston_surface *surface,
+ struct weston_input_device *device, uint32_t time)
{
- wlsc_surface_raise(surface);
+ weston_surface_raise(surface);
wl_input_device_set_keyboard_focus(&device->input_device,
&surface->surface, time);
- wlsc_data_device_set_keyboard_focus(device);
+ weston_data_device_set_keyboard_focus(device);
}
WL_EXPORT void
notify_button(struct wl_input_device *device,
uint32_t time, int32_t button, int32_t state)
{
- struct wlsc_input_device *wd = (struct wlsc_input_device *) device;
- struct wlsc_compositor *compositor = wd->compositor;
- struct wlsc_surface *surface =
- (struct wlsc_surface *) device->pointer_focus;
+ struct weston_input_device *wd = (struct weston_input_device *) device;
+ struct weston_compositor *compositor = wd->compositor;
+ struct weston_surface *surface =
+ (struct weston_surface *) device->pointer_focus;
int32_t sx, sy;
if (state)
- wlsc_compositor_idle_inhibit(compositor);
+ weston_compositor_idle_inhibit(compositor);
else
- wlsc_compositor_idle_release(compositor);
+ weston_compositor_idle_release(compositor);
- wlsc_compositor_run_binding(compositor, wd, time, 0, button, state);
+ weston_compositor_run_binding(compositor, wd, time, 0, button, state);
if (state && surface && device->grab == NULL) {
wl_input_device_start_grab(device,
@@ -1307,7 +1310,7 @@ notify_button(struct wl_input_device *device,
}
static void
-update_modifier_state(struct wlsc_input_device *device,
+update_modifier_state(struct weston_input_device *device,
uint32_t key, uint32_t state)
{
uint32_t modifier;
@@ -1343,16 +1346,16 @@ WL_EXPORT void
notify_key(struct wl_input_device *device,
uint32_t time, uint32_t key, uint32_t state)
{
- struct wlsc_input_device *wd = (struct wlsc_input_device *) device;
- struct wlsc_compositor *compositor = wd->compositor;
+ struct weston_input_device *wd = (struct weston_input_device *) device;
+ struct weston_compositor *compositor = wd->compositor;
uint32_t *k, *end;
if (state)
- wlsc_compositor_idle_inhibit(compositor);
+ weston_compositor_idle_inhibit(compositor);
else
- wlsc_compositor_idle_release(compositor);
+ weston_compositor_idle_release(compositor);
- wlsc_compositor_run_binding(compositor, wd, time, key, 0, state);
+ weston_compositor_run_binding(compositor, wd, time, key, 0, state);
update_modifier_state(wd, key, state);
end = device->keys.data + device->keys.size;
@@ -1373,12 +1376,12 @@ notify_key(struct wl_input_device *device,
WL_EXPORT void
notify_pointer_focus(struct wl_input_device *device,
- uint32_t time, struct wlsc_output *output,
+ uint32_t time, struct weston_output *output,
int32_t x, int32_t y)
{
- struct wlsc_input_device *wd = (struct wlsc_input_device *) device;
- struct wlsc_compositor *compositor = wd->compositor;
- struct wlsc_surface *es;
+ struct weston_input_device *wd = (struct weston_input_device *) device;
+ struct weston_compositor *compositor = wd->compositor;
+ struct weston_surface *es;
int32_t sx, sy;
if (output) {
@@ -1399,18 +1402,18 @@ notify_pointer_focus(struct wl_input_device *device,
WL_EXPORT void
notify_keyboard_focus(struct wl_input_device *device,
- uint32_t time, struct wlsc_output *output,
+ uint32_t time, struct weston_output *output,
struct wl_array *keys)
{
- struct wlsc_input_device *wd =
- (struct wlsc_input_device *) device;
- struct wlsc_compositor *compositor = wd->compositor;
- struct wlsc_surface *es;
+ struct weston_input_device *wd =
+ (struct weston_input_device *) device;
+ struct weston_compositor *compositor = wd->compositor;
+ struct weston_surface *es;
uint32_t *k, *end;
if (!wl_list_empty(&compositor->surface_list))
es = container_of(compositor->surface_list.next,
- struct wlsc_surface, link);
+ struct weston_surface, link);
else
es = NULL;
@@ -1419,7 +1422,7 @@ notify_keyboard_focus(struct wl_input_device *device,
wd->modifier_state = 0;
end = device->keys.data + device->keys.size;
for (k = device->keys.data; k < end; k++) {
- wlsc_compositor_idle_inhibit(compositor);
+ weston_compositor_idle_inhibit(compositor);
update_modifier_state(wd, *k, 1);
}
@@ -1429,7 +1432,7 @@ notify_keyboard_focus(struct wl_input_device *device,
} else {
end = device->keys.data + device->keys.size;
for (k = device->keys.data; k < end; k++)
- wlsc_compositor_idle_release(compositor);
+ weston_compositor_idle_release(compositor);
wd->modifier_state = 0;
wl_input_device_set_keyboard_focus(&wd->input_device,
@@ -1458,8 +1461,8 @@ static void
lose_touch_focus_resource(struct wl_listener *listener,
struct wl_resource *resource, uint32_t time)
{
- struct wlsc_input_device *device =
- container_of(listener, struct wlsc_input_device,
+ struct weston_input_device *device =
+ container_of(listener, struct weston_input_device,
touch_focus_resource_listener);
device->touch_focus_resource = NULL;
@@ -1469,15 +1472,15 @@ static void
lose_touch_focus(struct wl_listener *listener,
struct wl_resource *resource, uint32_t time)
{
- struct wlsc_input_device *device =
- container_of(listener, struct wlsc_input_device,
+ struct weston_input_device *device =
+ container_of(listener, struct weston_input_device,
touch_focus_listener);
device->touch_focus = NULL;
}
static void
-touch_set_focus(struct wlsc_input_device *device,
+touch_set_focus(struct weston_input_device *device,
struct wl_surface *surface, uint32_t time)
{
struct wl_input_device *input_device = &device->input_device;
@@ -1527,14 +1530,14 @@ WL_EXPORT void
notify_touch(struct wl_input_device *device, uint32_t time, int touch_id,
int x, int y, int touch_type)
{
- struct wlsc_input_device *wd = (struct wlsc_input_device *) device;
- struct wlsc_compositor *ec = wd->compositor;
- struct wlsc_surface *es;
+ struct weston_input_device *wd = (struct weston_input_device *) device;
+ struct weston_compositor *ec = wd->compositor;
+ struct weston_surface *es;
int32_t sx, sy;
switch (touch_type) {
case WL_INPUT_DEVICE_TOUCH_DOWN:
- wlsc_compositor_idle_inhibit(ec);
+ weston_compositor_idle_inhibit(ec);
wd->num_tp++;
@@ -1542,11 +1545,11 @@ notify_touch(struct wl_input_device *device, uint32_t time, int touch_id,
* to that surface for the remainder of the touch session i.e.
* until all touch points are up again. */
if (wd->num_tp == 1) {
- es = wlsc_compositor_pick_surface(ec, x, y, &sx, &sy);
+ es = weston_compositor_pick_surface(ec, x, y, &sx, &sy);
touch_set_focus(wd, &es->surface, time);
} else if (wd->touch_focus) {
- es = (struct wlsc_surface *) wd->touch_focus;
- wlsc_surface_transform(es, x, y, &sx, &sy);
+ es = (struct weston_surface *) wd->touch_focus;
+ weston_surface_transform(es, x, y, &sx, &sy);
}
if (wd->touch_focus_resource && wd->touch_focus)
@@ -1556,18 +1559,18 @@ notify_touch(struct wl_input_device *device, uint32_t time, int touch_id,
touch_id, sx, sy);
break;
case WL_INPUT_DEVICE_TOUCH_MOTION:
- es = (struct wlsc_surface *) wd->touch_focus;
+ es = (struct weston_surface *) wd->touch_focus;
if (!es)
break;
- wlsc_surface_transform(es, x, y, &sx, &sy);
+ weston_surface_transform(es, x, y, &sx, &sy);
if (wd->touch_focus_resource)
wl_resource_post_event(wd->touch_focus_resource,
touch_type, time,
touch_id, sx, sy);
break;
case WL_INPUT_DEVICE_TOUCH_UP:
- wlsc_compositor_idle_release(ec);
+ weston_compositor_idle_release(ec);
wd->num_tp--;
if (wd->touch_focus_resource)
@@ -1585,8 +1588,8 @@ input_device_attach(struct wl_client *client,
uint32_t time,
struct wl_resource *buffer_resource, int32_t x, int32_t y)
{
- struct wlsc_input_device *device = resource->data;
- struct wlsc_compositor *compositor = device->compositor;
+ struct weston_input_device *device = resource->data;
+ struct weston_compositor *compositor = device->compositor;
struct wl_buffer *buffer;
if (time < device->input_device.pointer_focus_time)
@@ -1597,7 +1600,7 @@ input_device_attach(struct wl_client *client,
return;
if (device->sprite)
- wlsc_surface_damage_below(device->sprite);
+ weston_surface_damage_below(device->sprite);
if (!buffer_resource) {
destroy_surface(&device->sprite->surface.resource);
@@ -1607,14 +1610,14 @@ input_device_attach(struct wl_client *client,
if (!device->sprite) {
device->sprite =
- wlsc_surface_create(compositor,
+ weston_surface_create(compositor,
device->input_device.x,
device->input_device.y, 32, 32);
wl_list_init(&device->sprite->link);
}
buffer = buffer_resource->data;
- wlsc_buffer_attach(buffer, &device->sprite->surface);
+ weston_buffer_attach(buffer, &device->sprite->surface);
device->hotspot_x = x;
device->hotspot_y = y;
@@ -1623,7 +1626,7 @@ input_device_attach(struct wl_client *client,
device->sprite->x = device->input_device.x - device->hotspot_x;
device->sprite->y = device->input_device.y - device->hotspot_y;
- wlsc_surface_damage(device->sprite);
+ weston_surface_damage(device->sprite);
}
const static struct wl_input_device_interface input_device_interface = {
@@ -1650,8 +1653,8 @@ bind_input_device(struct wl_client *client,
}
WL_EXPORT void
-wlsc_input_device_init(struct wlsc_input_device *device,
- struct wlsc_compositor *ec)
+weston_input_device_init(struct weston_input_device *device,
+ struct weston_compositor *ec)
{
wl_input_device_init(&device->input_device);
wl_list_init(&device->drag_resource_list);
@@ -1678,8 +1681,8 @@ static void
bind_output(struct wl_client *client,
void *data, uint32_t version, uint32_t id)
{
- struct wlsc_output *output = data;
- struct wlsc_mode *mode;
+ struct weston_output *output = data;
+ struct weston_mode *mode;
struct wl_resource *resource;
resource = wl_client_add_object(client,
@@ -1755,8 +1758,8 @@ compile_shader(GLenum type, const char *source)
}
static int
-wlsc_shader_init(struct wlsc_shader *shader,
- const char *vertex_source, const char *fragment_source)
+weston_shader_init(struct weston_shader *shader,
+ const char *vertex_source, const char *fragment_source)
{
char msg[512];
GLint status;
@@ -1788,7 +1791,7 @@ wlsc_shader_init(struct wlsc_shader *shader,
}
static int
-init_solid_shader(struct wlsc_shader *shader,
+init_solid_shader(struct weston_shader *shader,
GLuint vertex_shader, const char *fragment_source)
{
GLint status;
@@ -1819,14 +1822,14 @@ init_solid_shader(struct wlsc_shader *shader,
}
WL_EXPORT void
-wlsc_output_destroy(struct wlsc_output *output)
+weston_output_destroy(struct weston_output *output)
{
pixman_region32_fini(&output->region);
pixman_region32_fini(&output->previous_damage);
}
WL_EXPORT void
-wlsc_output_move(struct wlsc_output *output, int x, int y)
+weston_output_move(struct weston_output *output, int x, int y)
{
int flip;
@@ -1838,22 +1841,22 @@ wlsc_output_move(struct wlsc_output *output, int x, int y)
output->current->width,
output->current->height);
- wlsc_matrix_init(&output->matrix);
- wlsc_matrix_translate(&output->matrix,
+ weston_matrix_init(&output->matrix);
+ weston_matrix_translate(&output->matrix,
-output->x - output->current->width / 2.0,
-output->y - output->current->height / 2.0, 0);
flip = (output->flags & WL_OUTPUT_FLIPPED) ? -1 : 1;
- wlsc_matrix_scale(&output->matrix,
+ weston_matrix_scale(&output->matrix,
2.0 / output->current->width,
flip * 2.0 / output->current->height, 1);
- wlsc_output_damage(output);
+ weston_output_damage(output);
}
WL_EXPORT void
-wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c,
- int x, int y, int width, int height, uint32_t flags)
+weston_output_init(struct weston_output *output, struct weston_compositor *c,
+ int x, int y, int width, int height, uint32_t flags)
{
output->compositor = c;
output->x = x;
@@ -1862,7 +1865,7 @@ wlsc_output_init(struct wlsc_output *output, struct wlsc_compositor *c,
output->mm_height = height;
output->flags = flags;
- wlsc_output_move(output, x, y);
+ weston_output_move(output, x, y);
output->scanout_buffer_destroy_listener.func =
output_handle_scanout_buffer_destroy;
@@ -1896,7 +1899,7 @@ shm_buffer_damaged(struct wl_buffer *buffer,
int32_t x, int32_t y, int32_t width, int32_t height)
{
struct wl_list *surfaces_attached_to = buffer->user_data;
- struct wlsc_surface *es;
+ struct weston_surface *es;
GLsizei tex_width = wl_shm_buffer_get_stride(buffer) / 4;
wl_list_for_each(es, surfaces_attached_to, buffer_link) {
@@ -1914,7 +1917,7 @@ static void
shm_buffer_destroyed(struct wl_buffer *buffer)
{
struct wl_list *surfaces_attached_to = buffer->user_data;
- struct wlsc_surface *es, *next;
+ struct weston_surface *es, *next;
wl_list_for_each_safe(es, next, surfaces_attached_to, buffer_link) {
wl_list_remove(&es->buffer_link);
@@ -1934,14 +1937,14 @@ static void
compositor_bind(struct wl_client *client,
void *data, uint32_t version, uint32_t id)
{
- struct wlsc_compositor *compositor = data;
+ struct weston_compositor *compositor = data;
wl_client_add_object(client, &wl_compositor_interface,
&compositor_interface, id, compositor);
}
WL_EXPORT int
-wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display)
+weston_compositor_init(struct weston_compositor *ec, struct wl_display *display)
{
struct wl_event_loop *loop;
const char *extensions;
@@ -1984,17 +1987,17 @@ wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display)
wl_list_init(&ec->output_list);
wl_list_init(&ec->binding_list);
wl_list_init(&ec->animation_list);
- wlsc_spring_init(&ec->fade.spring, 30.0, 1.0, 1.0);
+ weston_spring_init(&ec->fade.spring, 30.0, 1.0, 1.0);
ec->fade.animation.frame = fade_frame;
wl_list_init(&ec->fade.animation.link);
screenshooter_create(ec);
- wlsc_data_device_manager_init(ec);
+ weston_data_device_manager_init(ec);
glActiveTexture(GL_TEXTURE0);
- if (wlsc_shader_init(&ec->texture_shader,
+ if (weston_shader_init(&ec->texture_shader,
vertex_shader, texture_fragment_shader) < 0)
return -1;
if (init_solid_shader(&ec->solid_shader,
@@ -2006,15 +2009,15 @@ wlsc_compositor_init(struct wlsc_compositor *ec, struct wl_display *display)
ec->idle_source = wl_event_loop_add_timer(loop, idle_handler, ec);
wl_event_source_timer_update(ec->idle_source, ec->idle_time * 1000);
- wlsc_compositor_schedule_repaint(ec);
+ weston_compositor_schedule_repaint(ec);
return 0;
}
WL_EXPORT void
-wlsc_compositor_shutdown(struct wlsc_compositor *ec)
+weston_compositor_shutdown(struct weston_compositor *ec)
{
- struct wlsc_output *output, *next;
+ struct weston_output *output, *next;
/* Destroy all outputs associated with this compositor */
wl_list_for_each_safe(output, next, &ec->output_list, link)
@@ -2062,12 +2065,12 @@ load_module(const char *name, const char *entrypoint, void **handle)
int main(int argc, char *argv[])
{
struct wl_display *display;
- struct wlsc_compositor *ec;
+ struct weston_compositor *ec;
struct wl_event_loop *loop;
int o, xserver = 0;
void *shell_module, *backend_module;
- int (*shell_init)(struct wlsc_compositor *ec);
- struct wlsc_compositor
+ int (*shell_init)(struct weston_compositor *ec);
+ struct weston_compositor
*(*backend_init)(struct wl_display *display, char *options);
char *backend = NULL;
char *backend_options = "";
@@ -2160,7 +2163,7 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
if (xserver)
- wlsc_xserver_init(ec);
+ weston_xserver_init(ec);
if (wl_display_add_socket(display, option_socket_name)) {
fprintf(stderr, "failed to add socket: %m\n");
@@ -2170,7 +2173,7 @@ int main(int argc, char *argv[])
wl_display_run(display);
if (xserver)
- wlsc_xserver_destroy(ec);
+ weston_xserver_destroy(ec);
if (ec->has_bind_display)
ec->unbind_display(ec->display, display);
diff --git a/src/compositor.h b/src/compositor.h
new file mode 100644
index 0000000..209c21d
--- /dev/null
+++ b/src/compositor.h
@@ -0,0 +1,471 @@
+/*
+ * Copyright © 2008-2011 Kristian Høgsberg
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and
+ * its documentation for any purpose is hereby granted without fee, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the copyright holders not be used in
+ * advertising or publicity pertaining to distribution of the software
+ * without specific, written prior permission. The copyright holders make
+ * no representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ *
+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _WAYLAND_SYSTEM_COMPOSITOR_H_
+#define _WAYLAND_SYSTEM_COMPOSITOR_H_
+
+#include <libudev.h>
+#include <pixman.h>
+#include <wayland-server.h>
+
+#include <GLES2/gl2.h>
+#include <GLES2/gl2ext.h>
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
+struct weston_matrix {
+ GLfloat d[16];
+};
+
+struct weston_vector {
+ GLfloat f[4];
+};
+
+void
+weston_matrix_init(struct weston_matrix *matrix);
+void
+weston_matrix_scale(struct weston_matrix *matrix, GLfloat x, GLfloat y, GLfloat z);
+void
+weston_matrix_translate(struct weston_matrix *matrix,
+ GLfloat x, GLfloat y, GLfloat z);
+void
+weston_matrix_transform(struct weston_matrix *matrix, struct weston_vector *v);
+
+struct weston_transform {
+ struct weston_matrix matrix;
+ struct weston_matrix inverse;
+};
+
+struct weston_surface;
+struct weston_input_device;
+
+struct weston_mode {
+ uint32_t flags;
+ int32_t width, height;
+ uint32_t refresh;
+ struct wl_list link;
+};
+
+struct weston_output {
+ struct wl_list link;
+ struct weston_compositor *compositor;
+ struct weston_matrix matrix;
+ struct wl_list frame_callback_list;
+ int32_t x, y, mm_width, mm_height;
+ pixman_region32_t region;
+ pixman_region32_t previous_damage;
+ uint32_t flags;
+ int repaint_needed;
+ int repaint_scheduled;
+
+ char *make, *model;
+ uint32_t subpixel;
+
+ struct weston_mode *current;
+ struct wl_list mode_list;
+ struct wl_buffer *scanout_buffer;
+ struct wl_listener scanout_buffer_destroy_listener;
+ struct wl_buffer *pending_scanout_buffer;
+ struct wl_listener pending_scanout_buffer_destroy_listener;
+
+ int (*prepare_render)(struct weston_output *output);
+ int (*present)(struct weston_output *output);
+ int (*prepare_scanout_surface)(struct weston_output *output,
+ struct weston_surface *es);
+ int (*set_hardware_cursor)(struct weston_output *output,
+ struct weston_input_device *input);
+ void (*destroy)(struct weston_output *output);
+};
+
+struct weston_input_device {
+ struct wl_input_device input_device;
+ struct weston_compositor *compositor;
+ struct weston_surface *sprite;
+ int32_t hotspot_x, hotspot_y;
+ struct wl_list link;
+ uint32_t modifier_state;
+ struct wl_selection *selection;
+
+ struct wl_list drag_resource_list;
+ struct weston_data_source *drag_data_source;
+ struct wl_surface *drag_focus;
+ struct wl_resource *drag_focus_resource;
+ struct wl_listener drag_focus_listener;
+
+ struct weston_data_source *selection_data_source;
+ struct wl_listener selection_data_source_listener;
+ struct wl_grab grab;
+
+ uint32_t num_tp;
+ struct wl_surface *touch_focus;
+ struct wl_listener touch_focus_listener;
+ struct wl_resource *touch_focus_resource;
+ struct wl_listener touch_focus_resource_listener;
+};
+
+enum weston_visual {
+ WESTON_NONE_VISUAL,
+ WESTON_ARGB_VISUAL,
+ WESTON_PREMUL_ARGB_VISUAL,
+ WESTON_RGB_VISUAL
+};
+
+struct weston_shader {
+ GLuint program;
+ GLuint vertex_shader, fragment_shader;
+ GLuint proj_uniform;
+ GLuint tex_uniform;
+ GLuint alpha_uniform;
+ GLuint color_uniform;
+};
+
+struct weston_animation {
+ void (*frame)(struct weston_animation *animation,
+ struct weston_output *output, uint32_t msecs);
+ struct wl_list link;
+};
+
+struct weston_spring {
+ double k;
+ double friction;
+ double current;
+ double target;
+ double previous;
+ uint32_t timestamp;
+};
+
+struct weston_shell {
+ void (*lock)(struct weston_shell *shell);
+ void (*unlock)(struct weston_shell *shell);
+ void (*map)(struct weston_shell *shell, struct weston_surface *surface,
+ int32_t width, int32_t height);
+ void (*configure)(struct weston_shell *shell,
+ struct weston_surface *surface,
+ int32_t x, int32_t y, int32_t width, int32_t height);
+};
+
+enum {
+ WESTON_COMPOSITOR_ACTIVE,
+ WESTON_COMPOSITOR_IDLE, /* shell->unlock called on activity */
+ WESTON_COMPOSITOR_SLEEPING /* no rendering, no frame events */
+};
+
+struct weston_compositor {
+ struct wl_shm *shm;
+ struct weston_xserver *wxs;
+
+ EGLDisplay display;
+ EGLContext context;
+ EGLConfig config;
+ GLuint fbo;
+ GLuint proj_uniform, tex_uniform, alpha_uniform;
+ uint32_t current_alpha;
+ struct weston_shader texture_shader;
+ struct weston_shader solid_shader;
+ struct wl_display *wl_display;
+
+ struct weston_shell *shell;
+
+ /* There can be more than one, but not right now... */
+ struct wl_input_device *input_device;
+
+ struct wl_list output_list;
+ struct wl_list input_device_list;
+ struct wl_list surface_list;
+ struct wl_list binding_list;
+ struct wl_list animation_list;
+ struct {
+ struct weston_spring spring;
+ struct weston_animation animation;
+ } fade;
+
+ uint32_t state;
+ struct wl_event_source *idle_source;
+ uint32_t idle_inhibit;
+ int option_idle_time; /* default timeout, s */
+ int idle_time; /* effective timeout, s */
+
+ /* Repaint state. */
+ struct timespec previous_swap;
+ struct wl_array vertices, indices;
+
+ struct weston_surface *overlay;
+ struct weston_switcher *switcher;
+ uint32_t focus;
+
+ PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC
+ image_target_renderbuffer_storage;
+ PFNGLEGLIMAGETARGETTEXTURE2DOESPROC image_target_texture_2d;
+ PFNEGLCREATEIMAGEKHRPROC create_image;
+ PFNEGLDESTROYIMAGEKHRPROC destroy_image;
+ PFNEGLBINDWAYLANDDISPLAYWL bind_display;
+ PFNEGLUNBINDWAYLANDDISPLAYWL unbind_display;
+ int has_bind_display;
+
+ void (*destroy)(struct weston_compositor *ec);
+ int (*authenticate)(struct weston_compositor *c, uint32_t id);
+ EGLImageKHR (*create_cursor_image)(struct weston_compositor *c,
+ int32_t *width, int32_t *height);
+};
+
+#define MODIFIER_CTRL (1 << 8)
+#define MODIFIER_ALT (1 << 9)
+#define MODIFIER_SUPER (1 << 10)
+
+enum weston_output_flags {
+ WL_OUTPUT_FLIPPED = 0x01
+};
+
+struct weston_surface {
+ struct wl_surface surface;
+ struct weston_compositor *compositor;
+ GLuint texture, saved_texture;
+ pixman_region32_t damage;
+ pixman_region32_t opaque;
+ int32_t x, y, width, height;
+ int32_t pitch;
+ struct wl_list link;
+ struct wl_list buffer_link;
+ struct weston_transform *transform;
+ uint32_t alpha;
+ uint32_t visual;
+
+ /*
+ * Which output to vsync this surface to.
+ * Used to determine, whether to send or queue frame events.
+ * Must be NULL, if 'link' is not in weston_compositor::surface_list.
+ */
+ struct weston_output *output;
+
+ struct weston_output *fullscreen_output;
+ struct wl_list frame_callback_list;
+
+ EGLImageKHR image;
+
+ struct wl_buffer *buffer;
+ struct wl_listener buffer_destroy_listener;
+};
+
+struct weston_data_source {
+ struct wl_resource resource;
+ struct wl_array mime_types;
+ int refcount;
+ void *data;
+
+ struct wl_resource *(*create_offer)(struct weston_data_source *source,
+ struct wl_resource *target);
+
+ void (*cancel)(struct weston_data_source *source);
+};
+
+void
+weston_data_source_unref(struct weston_data_source *source);
+
+void
+weston_input_device_set_selection(struct weston_input_device *device,
+ struct weston_data_source *source,
+ uint32_t time);
+
+void
+weston_spring_init(struct weston_spring *spring,
+ double k, double current, double target);
+void
+weston_spring_update(struct weston_spring *spring, uint32_t msec);
+int
+weston_spring_done(struct weston_spring *spring);
+
+void
+weston_surface_activate(struct weston_surface *surface,
+ struct weston_input_device *device, uint32_t time);
+
+void
+notify_motion(struct wl_input_device *device,
+ uint32_t time, int x, int y);
+void
+notify_button(struct wl_input_device *device,
+ uint32_t time, int32_t button, int32_t state);
+void
+notify_key(struct wl_input_device *device,
+ uint32_t time, uint32_t key, uint32_t state);
+
+void
+notify_pointer_focus(struct wl_input_device *device,
+ uint32_t time,
+ struct weston_output *output,
+ int32_t x, int32_t y);
+
+void
+notify_keyboard_focus(struct wl_input_device *device,
+ uint32_t time, struct weston_output *output,
+ struct wl_array *keys);
+
+void
+notify_touch(struct wl_input_device *device, uint32_t time, int touch_id,
+ int x, int y, int touch_type);
+
+void
+weston_output_finish_frame(struct weston_output *output, int msecs);
+void
+weston_output_damage(struct weston_output *output);
+void
+weston_compositor_repick(struct weston_compositor *compositor);
+void
+weston_compositor_schedule_repaint(struct weston_compositor *compositor);
+void
+weston_compositor_fade(struct weston_compositor *compositor, float tint);
+void
+weston_compositor_damage_all(struct weston_compositor *compositor);
+void
+weston_compositor_unlock(struct weston_compositor *compositor);
+void
+weston_compositor_wake(struct weston_compositor *compositor);
+void
+weston_compositor_activity(struct weston_compositor *compositor);
+
+struct weston_binding;
+typedef void (*weston_binding_handler_t)(struct wl_input_device *device,
+ uint32_t time, uint32_t key,
+ uint32_t button,
+ uint32_t state, void *data);
+struct weston_binding *
+weston_compositor_add_binding(struct weston_compositor *compositor,
+ uint32_t key, uint32_t button, uint32_t modifier,
+ weston_binding_handler_t binding, void *data);
+void
+weston_binding_destroy(struct weston_binding *binding);
+
+void
+weston_compositor_run_binding(struct weston_compositor *compositor,
+ struct weston_input_device *device,
+ uint32_t time,
+ uint32_t key, uint32_t button, int32_t state);
+
+struct weston_surface *
+weston_surface_create(struct weston_compositor *compositor,
+ int32_t x, int32_t y, int32_t width, int32_t height);
+
+void
+weston_surface_configure(struct weston_surface *surface,
+ int x, int y, int width, int height);
+
+void
+weston_surface_assign_output(struct weston_surface *surface);
+
+void
+weston_surface_damage(struct weston_surface *surface);
+
+void
+weston_surface_damage_below(struct weston_surface *surface);
+
+void
+weston_surface_damage_rectangle(struct weston_surface *surface,
+ int32_t x, int32_t y,
+ int32_t width, int32_t height);
+
+struct weston_surface *
+pick_surface(struct wl_input_device *device, int32_t *sx, int32_t *sy);
+
+uint32_t
+weston_compositor_get_time(void);
+
+int
+weston_compositor_init(struct weston_compositor *ec, struct wl_display *display);
+void
+weston_compositor_shutdown(struct weston_compositor *ec);
+void
+weston_output_move(struct weston_output *output, int x, int y);
+void
+weston_output_init(struct weston_output *output, struct weston_compositor *c,
+ int x, int y, int width, int height, uint32_t flags);
+void
+weston_output_destroy(struct weston_output *output);
+
+void
+weston_input_device_init(struct weston_input_device *device,
+ struct weston_compositor *ec);
+
+void
+weston_switcher_init(struct weston_compositor *compositor);
+
+enum {
+ TTY_ENTER_VT,
+ TTY_LEAVE_VT
+};
+
+typedef void (*tty_vt_func_t)(struct weston_compositor *compositor, int event);
+
+struct tty *
+tty_create(struct weston_compositor *compositor,
+ tty_vt_func_t vt_func, int tty_nr);
+
+void
+tty_destroy(struct tty *tty);
+
+void
+screenshooter_create(struct weston_compositor *ec);
+
+uint32_t *
+weston_load_image(const char *filename,
+ int32_t *width_arg, int32_t *height_arg,
+ uint32_t *stride_arg);
+
+struct weston_process;
+typedef void (*weston_process_cleanup_func_t)(struct weston_process *process,
+ int status);
+
+struct weston_process {
+ pid_t pid;
+ weston_process_cleanup_func_t cleanup;
+ struct wl_list link;
+};
+
+struct wl_client *
+weston_client_launch(struct weston_compositor *compositor,
+ struct weston_process *proc,
+ const char *path,
+ weston_process_cleanup_func_t cleanup);
+
+int
+weston_data_device_manager_init(struct weston_compositor *compositor);
+void
+weston_data_device_set_keyboard_focus(struct weston_input_device *device);
+
+void
+weston_watch_process(struct weston_process *process);
+
+int
+weston_xserver_init(struct weston_compositor *compositor);
+void
+weston_xserver_destroy(struct weston_compositor *compositor);
+void
+weston_xserver_surface_activate(struct weston_surface *surface);
+void
+weston_xserver_set_selection(struct weston_input_device *device);
+
+struct weston_zoom;
+typedef void (*weston_zoom_done_func_t)(struct weston_zoom *zoom, void *data);
+
+struct weston_zoom *
+weston_zoom_run(struct weston_surface *surface, GLfloat start, GLfloat stop,
+ weston_zoom_done_func_t done, void *data);
+
+#endif
diff --git a/compositor/data-device.c b/src/data-device.c
index c772246..4568a6c 100644
--- a/compositor/data-device.c
+++ b/src/data-device.c
@@ -28,7 +28,7 @@
#include "compositor.h"
void
-wlsc_data_source_unref(struct wlsc_data_source *source)
+weston_data_source_unref(struct weston_data_source *source)
{
source->refcount--;
if (source->refcount == 0)
@@ -39,7 +39,7 @@ static void
data_offer_accept(struct wl_client *client, struct wl_resource *resource,
uint32_t time, const char *mime_type)
{
- struct wlsc_data_source *source = resource->data;
+ struct weston_data_source *source = resource->data;
/* FIXME: Check that client is currently focused by the input
* device that is currently dragging this data source. Should
@@ -53,7 +53,7 @@ static void
data_offer_receive(struct wl_client *client, struct wl_resource *resource,
const char *mime_type, int32_t fd)
{
- struct wlsc_data_source *source = resource->data;
+ struct weston_data_source *source = resource->data;
wl_resource_post_event(&source->resource,
WL_DATA_SOURCE_SEND, mime_type, fd);
@@ -63,15 +63,15 @@ data_offer_receive(struct wl_client *client, struct wl_resource *resource,
static void
data_offer_destroy(struct wl_client *client, struct wl_resource *resource)
{
- wl_resource_destroy(resource, wlsc_compositor_get_time());
+ wl_resource_destroy(resource, weston_compositor_get_time());
}
static void
destroy_data_offer(struct wl_resource *resource)
{
- struct wlsc_data_source *source = resource->data;
+ struct weston_data_source *source = resource->data;
- wlsc_data_source_unref(source);
+ weston_data_source_unref(source);
free(resource);
}
@@ -82,7 +82,7 @@ static const struct wl_data_offer_interface data_offer_interface = {
};
static struct wl_resource *
-data_source_create_offer(struct wlsc_data_source *source,
+data_source_create_offer(struct weston_data_source *source,
struct wl_resource *target)
{
struct wl_resource *resource;
@@ -96,13 +96,13 @@ data_source_create_offer(struct wlsc_data_source *source,
}
static void
-data_source_cancel(struct wlsc_data_source *source)
+data_source_cancel(struct weston_data_source *source)
{
wl_resource_post_event(&source->resource, WL_DATA_SOURCE_CANCELLED);
}
static struct wl_resource *
-wlsc_data_source_send_offer(struct wlsc_data_source *source,
+weston_data_source_send_offer(struct weston_data_source *source,
struct wl_resource *target)
{
struct wl_resource *resource;
@@ -125,7 +125,7 @@ data_source_offer(struct wl_client *client,
struct wl_resource *resource,
const char *type)
{
- struct wlsc_data_source *source = resource->data;
+ struct weston_data_source *source = resource->data;
char **p;
p = wl_array_add(&source->mime_types, sizeof *p);
@@ -138,7 +138,7 @@ data_source_offer(struct wl_client *client,
static void
data_source_destroy(struct wl_client *client, struct wl_resource *resource)
{
- wl_resource_destroy(resource, wlsc_compositor_get_time());
+ wl_resource_destroy(resource, weston_compositor_get_time());
}
static struct wl_data_source_interface data_source_interface = {
@@ -163,15 +163,15 @@ static void
destroy_drag_focus(struct wl_listener *listener,
struct wl_resource *resource, uint32_t time)
{
- struct wlsc_input_device *device =
- container_of(listener, struct wlsc_input_device,
+ struct weston_input_device *device =
+ container_of(listener, struct weston_input_device,
drag_focus_listener);
device->drag_focus_resource = NULL;
}
static void
-drag_set_focus(struct wlsc_input_device *device,
+drag_set_focus(struct weston_input_device *device,
struct wl_surface *surface, uint32_t time,
int32_t x, int32_t y)
{
@@ -192,7 +192,7 @@ drag_set_focus(struct wlsc_input_device *device,
resource = find_resource(&device->drag_resource_list,
surface->resource.client);
if (surface && resource) {
- offer = wlsc_data_source_send_offer(device->drag_data_source,
+ offer = weston_data_source_send_offer(device->drag_data_source,
resource);
wl_resource_post_event(resource,
@@ -211,9 +211,9 @@ static void
drag_grab_motion(struct wl_grab *grab,
uint32_t time, int32_t x, int32_t y)
{
- struct wlsc_input_device *device =
- container_of(grab, struct wlsc_input_device, grab);
- struct wlsc_surface *es;
+ struct weston_input_device *device =
+ container_of(grab, struct weston_input_device, grab);
+ struct weston_surface *es;
es = pick_surface(&device->input_device, &x, &y);
drag_set_focus(device, &es->surface, time, x, y);
@@ -232,15 +232,15 @@ drag_grab_button(struct wl_grab *grab,
static void
drag_grab_end(struct wl_grab *grab, uint32_t time)
{
- struct wlsc_input_device *device =
- container_of(grab, struct wlsc_input_device, grab);
+ struct weston_input_device *device =
+ container_of(grab, struct weston_input_device, grab);
if (device->drag_focus_resource)
wl_resource_post_event(device->drag_focus_resource,
WL_DATA_DEVICE_DROP);
drag_set_focus(device, NULL, time, 0, 0);
- wlsc_data_source_unref(device->drag_data_source);
+ weston_data_source_unref(device->drag_data_source);
device->drag_data_source = NULL;
}
@@ -255,9 +255,9 @@ data_device_start_drag(struct wl_client *client, struct wl_resource *resource,
struct wl_resource *source_resource,
struct wl_resource *surface_resource, uint32_t time)
{
- struct wlsc_input_device *device = resource->data;
- struct wlsc_surface *surface = surface_resource->data;
- struct wlsc_surface *target;
+ struct weston_input_device *device = resource->data;
+ struct weston_surface *surface = surface_resource->data;
+ struct weston_surface *target;
int32_t sx, sy;
/* FIXME: Check that client has implicit grab on the surface
@@ -290,8 +290,8 @@ static void
destroy_selection_data_source(struct wl_listener *listener,
struct wl_resource *resource, uint32_t time)
{
- struct wlsc_input_device *device =
- container_of(listener, struct wlsc_input_device,
+ struct weston_input_device *device =
+ container_of(listener, struct weston_input_device,
selection_data_source_listener);
struct wl_resource *data_device, *focus;
@@ -307,8 +307,8 @@ destroy_selection_data_source(struct wl_listener *listener,
}
void
-wlsc_input_device_set_selection(struct wlsc_input_device *device,
- struct wlsc_data_source *source, uint32_t time)
+weston_input_device_set_selection(struct weston_input_device *device,
+ struct weston_data_source *source, uint32_t time)
{
struct wl_resource *data_device, *focus, *offer;
@@ -319,7 +319,7 @@ wlsc_input_device_set_selection(struct wlsc_input_device *device,
* won't get destroyed until every client has been
* activated and seen the new selection event. */
wl_list_remove(&device->selection_data_source_listener.link);
- wlsc_data_source_unref(device->selection_data_source);
+ weston_data_source_unref(device->selection_data_source);
device->selection_data_source = NULL;
}
@@ -331,7 +331,7 @@ wlsc_input_device_set_selection(struct wlsc_input_device *device,
data_device = find_resource(&device->drag_resource_list,
focus->client);
if (data_device) {
- offer = wlsc_data_source_send_offer(device->selection_data_source,
+ offer = weston_data_source_send_offer(device->selection_data_source,
data_device);
wl_resource_post_event(data_device,
WL_DATA_DEVICE_SELECTION,
@@ -339,7 +339,7 @@ wlsc_input_device_set_selection(struct wlsc_input_device *device,
}
}
- wlsc_xserver_set_selection(device);
+ weston_xserver_set_selection(device);
device->selection_data_source_listener.func =
destroy_selection_data_source;
@@ -355,7 +355,7 @@ data_device_set_selection(struct wl_client *client,
if (!source_resource)
return;
- wlsc_input_device_set_selection(resource->data,
+ weston_input_device_set_selection(resource->data,
source_resource->data, time);
}
@@ -368,8 +368,8 @@ static const struct wl_data_device_interface data_device_interface = {
static void
destroy_data_source(struct wl_resource *resource)
{
- struct wlsc_data_source *source =
- container_of(resource, struct wlsc_data_source, resource);
+ struct weston_data_source *source =
+ container_of(resource, struct weston_data_source, resource);
char **p, **end;
end = source->mime_types.data + source->mime_types.size;
@@ -379,14 +379,14 @@ destroy_data_source(struct wl_resource *resource)
wl_array_release(&source->mime_types);
source->resource.object.id = 0;
- wlsc_data_source_unref(source);
+ weston_data_source_unref(source);
}
static void
create_data_source(struct wl_client *client,
struct wl_resource *resource, uint32_t id)
{
- struct wlsc_data_source *source;
+ struct weston_data_source *source;
source = malloc(sizeof *source);
if (source == NULL) {
@@ -419,7 +419,7 @@ get_data_device(struct wl_client *client,
struct wl_resource *manager_resource,
uint32_t id, struct wl_resource *input_device)
{
- struct wlsc_input_device *device = input_device->data;
+ struct weston_input_device *device = input_device->data;
struct wl_resource *resource;
resource =
@@ -444,10 +444,10 @@ bind_manager(struct wl_client *client,
}
WL_EXPORT void
-wlsc_data_device_set_keyboard_focus(struct wlsc_input_device *device)
+weston_data_device_set_keyboard_focus(struct weston_input_device *device)
{
struct wl_resource *data_device, *focus, *offer;
- struct wlsc_data_source *source;
+ struct weston_data_source *source;
focus = device->input_device.keyboard_focus_resource;
if (!focus)
@@ -460,14 +460,14 @@ wlsc_data_device_set_keyboard_focus(struct wlsc_input_device *device)
source = device->selection_data_source;
if (source) {
- offer = wlsc_data_source_send_offer(source, data_device);
+ offer = weston_data_source_send_offer(source, data_device);
wl_resource_post_event(data_device,
WL_DATA_DEVICE_SELECTION, offer);
}
}
WL_EXPORT int
-wlsc_data_device_manager_init(struct wlsc_compositor *compositor)
+weston_data_device_manager_init(struct weston_compositor *compositor)
{
if (wl_display_add_global(compositor->wl_display,
&wl_data_device_manager_interface,
diff --git a/compositor/evdev.c b/src/evdev.c
index 08fef66..0b2fdfa 100644
--- a/compositor/evdev.c
+++ b/src/evdev.c
@@ -31,7 +31,7 @@
#include "evdev.h"
struct evdev_input {
- struct wlsc_input_device base;
+ struct weston_input_device base;
struct wl_list devices_list;
struct udev_monitor *udev_monitor;
char *seat_id;
@@ -43,7 +43,7 @@ struct evdev_input_device {
struct evdev_input *master;
struct wl_list link;
struct wl_event_source *source;
- struct wlsc_output *output;
+ struct weston_output *output;
char *devnode;
int fd;
struct {
@@ -324,7 +324,7 @@ evdev_flush_motion(struct evdev_input_device *device, uint32_t time)
static int
evdev_input_device_data(int fd, uint32_t mask, void *data)
{
- struct wlsc_compositor *ec;
+ struct weston_compositor *ec;
struct evdev_input_device *device = data;
struct input_event ev[8], *e, *end;
int len;
@@ -436,7 +436,7 @@ evdev_input_device_create(struct evdev_input *master,
{
struct evdev_input_device *device;
struct wl_event_loop *loop;
- struct wlsc_compositor *ec;
+ struct weston_compositor *ec;
device = malloc(sizeof *device);
if (device == NULL)
@@ -444,7 +444,7 @@ evdev_input_device_create(struct evdev_input *master,
ec = master->base.compositor;
device->output =
- container_of(ec->output_list.next, struct wlsc_output, link);
+ container_of(ec->output_list.next, struct weston_output, link);
device->master = master;
device->is_touchpad = 0;
@@ -485,7 +485,7 @@ static const char default_seat[] = "seat0";
static void
device_added(struct udev_device *udev_device, struct evdev_input *master)
{
- struct wlsc_compositor *c;
+ struct weston_compositor *c;
const char *devnode;
const char *device_seat;
@@ -522,7 +522,7 @@ device_removed(struct udev_device *udev_device, struct evdev_input *master)
}
void
-evdev_add_devices(struct udev *udev, struct wlsc_input_device *input_base)
+evdev_add_devices(struct udev *udev, struct weston_input_device *input_base)
{
struct evdev_input *input = (struct evdev_input *) input_base;
struct udev_enumerate *e;
@@ -578,7 +578,7 @@ static int
evdev_config_udev_monitor(struct udev *udev, struct evdev_input *master)
{
struct wl_event_loop *loop;
- struct wlsc_compositor *c = master->base.compositor;
+ struct weston_compositor *c = master->base.compositor;
master->udev_monitor = udev_monitor_new_from_netlink(udev, "udev");
if (!master->udev_monitor)
@@ -600,7 +600,7 @@ evdev_config_udev_monitor(struct udev *udev, struct evdev_input *master)
}
void
-evdev_input_create(struct wlsc_compositor *c, struct udev *udev,
+evdev_input_create(struct weston_compositor *c, struct udev *udev,
const char *seat)
{
struct evdev_input *input;
@@ -610,7 +610,7 @@ evdev_input_create(struct wlsc_compositor *c, struct udev *udev,
return;
memset(input, 0, sizeof *input);
- wlsc_input_device_init(&input->base, c);
+ weston_input_device_init(&input->base, c);
wl_list_init(&input->devices_list);
input->seat_id = strdup(seat);
@@ -626,7 +626,7 @@ evdev_input_create(struct wlsc_compositor *c, struct udev *udev,
}
void
-evdev_remove_devices(struct wlsc_input_device *input_base)
+evdev_remove_devices(struct weston_input_device *input_base)
{
struct evdev_input *input = (struct evdev_input *) input_base;
struct evdev_input_device *device, *next;
@@ -642,7 +642,7 @@ evdev_remove_devices(struct wlsc_input_device *input_base)
}
void
-evdev_input_destroy(struct wlsc_input_device *input_base)
+evdev_input_destroy(struct weston_input_device *input_base)
{
struct evdev_input *input = (struct evdev_input *) input_base;
diff --git a/compositor/evdev.h b/src/evdev.h
index 2287893..af5f6d9 100644
--- a/compositor/evdev.h
+++ b/src/evdev.h
@@ -21,15 +21,15 @@
*/
void
-evdev_add_devices(struct udev *udev, struct wlsc_input_device
+evdev_add_devices(struct udev *udev, struct weston_input_device
*input_base);
void
-evdev_remove_devices(struct wlsc_input_device *input_base);
+evdev_remove_devices(struct weston_input_device *input_base);
void
-evdev_input_create(struct wlsc_compositor *c, struct udev *udev,
+evdev_input_create(struct weston_compositor *c, struct udev *udev,
const char *seat);
void
-evdev_input_destroy(struct wlsc_input_device *input_base);
+evdev_input_destroy(struct weston_input_device *input_base);
diff --git a/compositor/hash.c b/src/hash.c
index 1dbee82..1dbee82 100644
--- a/compositor/hash.c
+++ b/src/hash.c
diff --git a/compositor/hash.h b/src/hash.h
index 6e1674e..6e1674e 100644
--- a/compositor/hash.h
+++ b/src/hash.h
diff --git a/compositor/image-loader.c b/src/image-loader.c
index f6dec25..f6dec25 100644
--- a/compositor/image-loader.c
+++ b/src/image-loader.c
diff --git a/compositor/screenshooter.c b/src/screenshooter.c
index 02a8d21..191a77f 100644
--- a/compositor/screenshooter.c
+++ b/src/screenshooter.c
@@ -27,7 +27,7 @@
struct screenshooter {
struct wl_object base;
- struct wlsc_compositor *ec;
+ struct weston_compositor *ec;
};
static void
@@ -36,7 +36,7 @@ screenshooter_shoot(struct wl_client *client,
struct wl_resource *output_resource,
struct wl_resource *buffer_resource)
{
- struct wlsc_output *output = output_resource->data;
+ struct weston_output *output = output_resource->data;
struct wl_buffer *buffer = buffer_resource->data;
if (!wl_buffer_is_shm(buffer))
@@ -65,7 +65,7 @@ bind_shooter(struct wl_client *client,
}
void
-screenshooter_create(struct wlsc_compositor *ec)
+screenshooter_create(struct weston_compositor *ec)
{
struct screenshooter *shooter;
diff --git a/compositor/shell.c b/src/shell.c
index ee15ddf..5274d52 100644
--- a/compositor/shell.c
+++ b/src/shell.c
@@ -38,11 +38,11 @@
struct shell_surface;
struct wl_shell {
- struct wlsc_compositor *compositor;
- struct wlsc_shell shell;
+ struct weston_compositor *compositor;
+ struct weston_shell shell;
struct {
- struct wlsc_process process;
+ struct weston_process process;
struct wl_client *client;
struct wl_resource *desktop_shell;
} child;
@@ -62,7 +62,7 @@ struct wl_shell {
int duration;
struct wl_resource *binding;
struct wl_list surfaces;
- struct wlsc_process process;
+ struct weston_process process;
} screensaver;
};
@@ -82,19 +82,19 @@ enum shell_surface_type {
struct shell_surface {
struct wl_resource resource;
- struct wlsc_surface *surface;
+ struct weston_surface *surface;
struct wl_listener surface_destroy_listener;
enum shell_surface_type type;
int32_t saved_x, saved_y;
- struct wlsc_output *output;
+ struct weston_output *output;
struct wl_list link;
};
-struct wlsc_move_grab {
+struct weston_move_grab {
struct wl_grab grab;
- struct wlsc_surface *surface;
+ struct weston_surface *surface;
int32_t dx, dy;
};
@@ -130,10 +130,10 @@ static void
move_grab_motion(struct wl_grab *grab,
uint32_t time, int32_t x, int32_t y)
{
- struct wlsc_move_grab *move = (struct wlsc_move_grab *) grab;
- struct wlsc_surface *es = move->surface;
+ struct weston_move_grab *move = (struct weston_move_grab *) grab;
+ struct weston_surface *es = move->surface;
- wlsc_surface_configure(es, x + move->dx, y + move->dy,
+ weston_surface_configure(es, x + move->dx, y + move->dy,
es->width, es->height);
}
@@ -156,10 +156,10 @@ static const struct wl_grab_interface move_grab_interface = {
};
static int
-wlsc_surface_move(struct wlsc_surface *es,
- struct wlsc_input_device *wd, uint32_t time)
+weston_surface_move(struct weston_surface *es,
+ struct weston_input_device *wd, uint32_t time)
{
- struct wlsc_move_grab *move;
+ struct weston_move_grab *move;
move = malloc(sizeof *move);
if (!move)
@@ -184,14 +184,14 @@ static void
shell_surface_move(struct wl_client *client, struct wl_resource *resource,
struct wl_resource *input_resource, uint32_t time)
{
- struct wlsc_input_device *wd = input_resource->data;
+ struct weston_input_device *wd = input_resource->data;
struct shell_surface *shsurf = resource->data;
- if (wlsc_surface_move(shsurf->surface, wd, time) < 0)
+ if (weston_surface_move(shsurf->surface, wd, time) < 0)
wl_resource_post_no_memory(resource);
}
-struct wlsc_resize_grab {
+struct weston_resize_grab {
struct wl_grab grab;
uint32_t edges;
int32_t dx, dy, width, height;
@@ -202,7 +202,7 @@ static void
resize_grab_motion(struct wl_grab *grab,
uint32_t time, int32_t x, int32_t y)
{
- struct wlsc_resize_grab *resize = (struct wlsc_resize_grab *) grab;
+ struct weston_resize_grab *resize = (struct weston_resize_grab *) grab;
struct wl_input_device *device = grab->input_device;
int32_t width, height;
@@ -246,12 +246,12 @@ static const struct wl_grab_interface resize_grab_interface = {
};
static int
-wlsc_surface_resize(struct shell_surface *shsurf,
- struct wlsc_input_device *wd,
+weston_surface_resize(struct shell_surface *shsurf,
+ struct weston_input_device *wd,
uint32_t time, uint32_t edges)
{
- struct wlsc_resize_grab *resize;
- struct wlsc_surface *es = shsurf->surface;
+ struct weston_resize_grab *resize;
+ struct weston_surface *es = shsurf->surface;
/* FIXME: Reject if fullscreen */
@@ -286,12 +286,12 @@ shell_surface_resize(struct wl_client *client, struct wl_resource *resource,
struct wl_resource *input_resource, uint32_t time,
uint32_t edges)
{
- struct wlsc_input_device *wd = input_resource->data;
+ struct weston_input_device *wd = input_resource->data;
struct shell_surface *shsurf = resource->data;
/* FIXME: Reject if fullscreen */
- if (wlsc_surface_resize(shsurf, wd, time, edges) < 0)
+ if (weston_surface_resize(shsurf, wd, time, edges) < 0)
wl_resource_post_no_memory(resource);
}
@@ -335,7 +335,7 @@ shell_surface_set_toplevel(struct wl_client *client,
if (reset_shell_surface_type(surface))
return;
- wlsc_surface_damage(surface->surface);
+ weston_surface_damage(surface->surface);
surface->type = SHELL_SURFACE_TOPLEVEL;
}
@@ -346,9 +346,9 @@ shell_surface_set_transient(struct wl_client *client,
int x, int y, uint32_t flags)
{
struct shell_surface *shsurf = resource->data;
- struct wlsc_surface *es = shsurf->surface;
+ struct weston_surface *es = shsurf->surface;
struct shell_surface *pshsurf = parent_resource->data;
- struct wlsc_surface *pes = pshsurf->surface;
+ struct weston_surface *pes = pshsurf->surface;
if (reset_shell_surface_type(shsurf))
return;
@@ -359,15 +359,15 @@ shell_surface_set_transient(struct wl_client *client,
es->x = pes->x + x;
es->y = pes->y + y;
- wlsc_surface_damage(es);
+ weston_surface_damage(es);
shsurf->type = SHELL_SURFACE_TRANSIENT;
}
-static struct wlsc_output *
-get_default_output(struct wlsc_compositor *compositor)
+static struct weston_output *
+get_default_output(struct weston_compositor *compositor)
{
return container_of(compositor->output_list.next,
- struct wlsc_output, link);
+ struct weston_output, link);
}
static void
@@ -376,8 +376,8 @@ shell_surface_set_fullscreen(struct wl_client *client,
{
struct shell_surface *shsurf = resource->data;
- struct wlsc_surface *es = shsurf->surface;
- struct wlsc_output *output;
+ struct weston_surface *es = shsurf->surface;
+ struct weston_output *output;
if (reset_shell_surface_type(shsurf))
return;
@@ -392,7 +392,7 @@ shell_surface_set_fullscreen(struct wl_client *client,
es->x = (output->current->width - es->width) / 2;
es->y = (output->current->height - es->height) / 2;
es->fullscreen_output = output;
- wlsc_surface_damage(es);
+ weston_surface_damage(es);
shsurf->type = SHELL_SURFACE_FULLSCREEN;
}
@@ -430,7 +430,7 @@ shell_handle_surface_destroy(struct wl_listener *listener,
}
static struct shell_surface *
-get_shell_surface(struct wlsc_surface *surface)
+get_shell_surface(struct weston_surface *surface)
{
struct wl_list *lst = &surface->surface.resource.destroy_listener_list;
struct wl_listener *listener;
@@ -452,7 +452,7 @@ shell_get_shell_surface(struct wl_client *client,
uint32_t id,
struct wl_resource *surface_resource)
{
- struct wlsc_surface *surface = surface_resource->data;
+ struct weston_surface *surface = surface_resource->data;
struct shell_surface *shsurf;
if (get_shell_surface(surface)) {
@@ -493,7 +493,7 @@ static const struct wl_shell_interface shell_implementation = {
};
static void
-handle_screensaver_sigchld(struct wlsc_process *proc, int status)
+handle_screensaver_sigchld(struct weston_process *proc, int status)
{
proc->pid = 0;
}
@@ -507,7 +507,7 @@ launch_screensaver(struct wl_shell *shell)
if (!shell->screensaver.path)
return;
- wlsc_client_launch(shell->compositor,
+ weston_client_launch(shell->compositor,
&shell->screensaver.process,
shell->screensaver.path,
handle_screensaver_sigchld);
@@ -534,7 +534,7 @@ show_screensaver(struct wl_shell *shell, struct shell_surface *surface)
wl_list_remove(&surface->surface->link);
wl_list_insert(list, &surface->surface->link);
- wlsc_surface_configure(surface->surface,
+ weston_surface_configure(surface->surface,
surface->surface->x,
surface->surface->y,
surface->surface->width,
@@ -558,7 +558,7 @@ desktop_shell_set_background(struct wl_client *client,
{
struct wl_shell *shell = resource->data;
struct shell_surface *shsurf = surface_resource->data;
- struct wlsc_surface *surface = shsurf->surface;
+ struct weston_surface *surface = shsurf->surface;
struct shell_surface *priv;
if (reset_shell_surface_type(shsurf))
@@ -583,7 +583,7 @@ desktop_shell_set_background(struct wl_client *client,
wl_resource_post_event(resource,
DESKTOP_SHELL_CONFIGURE,
- wlsc_compositor_get_time(), 0, surface_resource,
+ weston_compositor_get_time(), 0, surface_resource,
shsurf->output->current->width,
shsurf->output->current->height);
}
@@ -596,7 +596,7 @@ desktop_shell_set_panel(struct wl_client *client,
{
struct wl_shell *shell = resource->data;
struct shell_surface *shsurf = surface_resource->data;
- struct wlsc_surface *surface = shsurf->surface;
+ struct weston_surface *surface = shsurf->surface;
struct shell_surface *priv;
if (reset_shell_surface_type(shsurf))
@@ -621,7 +621,7 @@ desktop_shell_set_panel(struct wl_client *client,
wl_resource_post_event(resource,
DESKTOP_SHELL_CONFIGURE,
- wlsc_compositor_get_time(), 0, surface_resource,
+ weston_compositor_get_time(), 0, surface_resource,
shsurf->output->current->width,
shsurf->output->current->height);
}
@@ -665,7 +665,7 @@ desktop_shell_set_lock_surface(struct wl_client *client,
static void
resume_desktop(struct wl_shell *shell)
{
- struct wlsc_surface *surface;
+ struct weston_surface *surface;
struct wl_list *list;
struct shell_surface *tmp;
@@ -675,7 +675,7 @@ resume_desktop(struct wl_shell *shell)
terminate_screensaver(shell);
wl_list_for_each(surface, &shell->hidden_surface_list, link)
- wlsc_surface_configure(surface, surface->x, surface->y,
+ weston_surface_configure(surface, surface->x, surface->y,
surface->width, surface->height);
if (wl_list_empty(&shell->backgrounds)) {
@@ -692,9 +692,9 @@ resume_desktop(struct wl_shell *shell)
wl_list_init(&shell->hidden_surface_list);
shell->locked = false;
- wlsc_compositor_repick(shell->compositor);
+ weston_compositor_repick(shell->compositor);
shell->compositor->idle_time = shell->compositor->option_idle_time;
- wlsc_compositor_wake(shell->compositor);
+ weston_compositor_wake(shell->compositor);
}
static void
@@ -717,7 +717,7 @@ static const struct desktop_shell_interface desktop_shell_implementation = {
};
static enum shell_surface_type
-get_shell_surface_type(struct wlsc_surface *surface)
+get_shell_surface_type(struct weston_surface *surface)
{
struct shell_surface *shsurf;
@@ -731,8 +731,8 @@ static void
move_binding(struct wl_input_device *device, uint32_t time,
uint32_t key, uint32_t button, uint32_t state, void *data)
{
- struct wlsc_surface *surface =
- (struct wlsc_surface *) device->pointer_focus;
+ struct weston_surface *surface =
+ (struct weston_surface *) device->pointer_focus;
if (surface == NULL)
return;
@@ -747,15 +747,15 @@ move_binding(struct wl_input_device *device, uint32_t time,
break;
}
- wlsc_surface_move(surface, (struct wlsc_input_device *) device, time);
+ weston_surface_move(surface, (struct weston_input_device *) device, time);
}
static void
resize_binding(struct wl_input_device *device, uint32_t time,
uint32_t key, uint32_t button, uint32_t state, void *data)
{
- struct wlsc_surface *surface =
- (struct wlsc_surface *) device->pointer_focus;
+ struct weston_surface *surface =
+ (struct weston_surface *) device->pointer_focus;
uint32_t edges = 0;
int32_t x, y;
struct shell_surface *shsurf;
@@ -794,7 +794,7 @@ resize_binding(struct wl_input_device *device, uint32_t time,
else
edges |= WL_SHELL_SURFACE_RESIZE_BOTTOM;
- wlsc_surface_resize(shsurf, (struct wlsc_input_device *) device,
+ weston_surface_resize(shsurf, (struct weston_input_device *) device,
time, edges);
}
@@ -802,23 +802,23 @@ static void
terminate_binding(struct wl_input_device *device, uint32_t time,
uint32_t key, uint32_t button, uint32_t state, void *data)
{
- struct wlsc_compositor *compositor = data;
+ struct weston_compositor *compositor = data;
if (state)
wl_display_terminate(compositor->wl_display);
}
static void
-activate(struct wlsc_shell *base, struct wlsc_surface *es,
- struct wlsc_input_device *device, uint32_t time)
+activate(struct weston_shell *base, struct weston_surface *es,
+ struct weston_input_device *device, uint32_t time)
{
struct wl_shell *shell = container_of(base, struct wl_shell, shell);
- struct wlsc_compositor *compositor = shell->compositor;
+ struct weston_compositor *compositor = shell->compositor;
- wlsc_surface_activate(es, device, time);
+ weston_surface_activate(es, device, time);
if (compositor->wxs)
- wlsc_xserver_surface_activate(es);
+ weston_xserver_surface_activate(es);
switch (get_shell_surface_type(es)) {
case SHELL_SURFACE_BACKGROUND:
@@ -855,23 +855,23 @@ click_to_activate_binding(struct wl_input_device *device,
uint32_t time, uint32_t key,
uint32_t button, uint32_t state, void *data)
{
- struct wlsc_input_device *wd = (struct wlsc_input_device *) device;
- struct wlsc_compositor *compositor = data;
- struct wlsc_surface *focus;
+ struct weston_input_device *wd = (struct weston_input_device *) device;
+ struct weston_compositor *compositor = data;
+ struct weston_surface *focus;
- focus = (struct wlsc_surface *) device->pointer_focus;
+ focus = (struct weston_surface *) device->pointer_focus;
if (state && focus && device->grab == NULL)
activate(compositor->shell, focus, wd, time);
}
static void
-lock(struct wlsc_shell *base)
+lock(struct weston_shell *base)
{
struct wl_shell *shell = container_of(base, struct wl_shell, shell);
struct wl_list *surface_list = &shell->compositor->surface_list;
- struct wlsc_surface *cur;
- struct wlsc_surface *tmp;
- struct wlsc_input_device *device;
+ struct weston_surface *cur;
+ struct weston_surface *tmp;
+ struct weston_input_device *device;
struct shell_surface *shsurf;
uint32_t time;
@@ -910,15 +910,15 @@ lock(struct wlsc_shell *base)
if (!wl_list_empty(&shell->screensaver.surfaces)) {
shell->compositor->idle_time = shell->screensaver.duration;
- wlsc_compositor_wake(shell->compositor);
- shell->compositor->state = WLSC_COMPOSITOR_IDLE;
+ weston_compositor_wake(shell->compositor);
+ shell->compositor->state = WESTON_COMPOSITOR_IDLE;
}
/* reset pointer foci */
- wlsc_compositor_repick(shell->compositor);
+ weston_compositor_repick(shell->compositor);
/* reset keyboard foci */
- time = wlsc_compositor_get_time();
+ time = weston_compositor_get_time();
wl_list_for_each(device, &shell->compositor->input_device_list, link) {
wl_input_device_set_keyboard_focus(&device->input_device,
NULL, time);
@@ -930,12 +930,12 @@ lock(struct wlsc_shell *base)
}
static void
-unlock(struct wlsc_shell *base)
+unlock(struct weston_shell *base)
{
struct wl_shell *shell = container_of(base, struct wl_shell, shell);
if (!shell->locked || shell->lock_surface) {
- wlsc_compositor_wake(shell->compositor);
+ weston_compositor_wake(shell->compositor);
return;
}
@@ -954,20 +954,20 @@ unlock(struct wlsc_shell *base)
}
static void
-center_on_output(struct wlsc_surface *surface, struct wlsc_output *output)
+center_on_output(struct weston_surface *surface, struct weston_output *output)
{
- struct wlsc_mode *mode = output->current;
+ struct weston_mode *mode = output->current;
surface->x = output->x + (mode->width - surface->width) / 2;
surface->y = output->y + (mode->height - surface->height) / 2;
}
static void
-map(struct wlsc_shell *base,
- struct wlsc_surface *surface, int32_t width, int32_t height)
+map(struct weston_shell *base,
+ struct weston_surface *surface, int32_t width, int32_t height)
{
struct wl_shell *shell = container_of(base, struct wl_shell, shell);
- struct wlsc_compositor *compositor = shell->compositor;
+ struct weston_compositor *compositor = shell->compositor;
struct wl_list *list;
struct shell_surface *shsurf;
enum shell_surface_type surface_type = SHELL_SURFACE_NONE;
@@ -1020,8 +1020,8 @@ map(struct wlsc_shell *base,
/* lock surface always visible, on top */
wl_list_insert(&compositor->surface_list, &surface->link);
- wlsc_compositor_repick(compositor);
- wlsc_compositor_wake(compositor);
+ weston_compositor_repick(compositor);
+ weston_compositor_wake(compositor);
do_configure = 1;
break;
case SHELL_SURFACE_SCREENSAVER:
@@ -1029,9 +1029,9 @@ map(struct wlsc_shell *base,
if (shell->locked) {
show_screensaver(shell, shsurf);
compositor->idle_time = shell->screensaver.duration;
- wlsc_compositor_wake(compositor);
+ weston_compositor_wake(compositor);
if (!shell->lock_surface)
- compositor->state = WLSC_COMPOSITOR_IDLE;
+ compositor->state = WESTON_COMPOSITOR_IDLE;
}
do_configure = 0;
break;
@@ -1048,7 +1048,7 @@ map(struct wlsc_shell *base,
}
if (do_configure)
- wlsc_surface_configure(surface,
+ weston_surface_configure(surface,
surface->x, surface->y, width, height);
switch (surface_type) {
@@ -1057,20 +1057,20 @@ map(struct wlsc_shell *base,
case SHELL_SURFACE_FULLSCREEN:
if (!shell->locked)
activate(base, surface,
- (struct wlsc_input_device *)
+ (struct weston_input_device *)
compositor->input_device,
- wlsc_compositor_get_time());
+ weston_compositor_get_time());
break;
default:
break;
}
if (surface_type == SHELL_SURFACE_TOPLEVEL)
- wlsc_zoom_run(surface, 0.8, 1.0, NULL, NULL);
+ weston_zoom_run(surface, 0.8, 1.0, NULL, NULL);
}
static void
-configure(struct wlsc_shell *base, struct wlsc_surface *surface,
+configure(struct weston_shell *base, struct weston_surface *surface,
int32_t x, int32_t y, int32_t width, int32_t height)
{
struct wl_shell *shell = container_of(base, struct wl_shell, shell);
@@ -1097,13 +1097,13 @@ configure(struct wlsc_shell *base, struct wlsc_surface *surface,
}
/*
- * wlsc_surface_configure() will assign an output, which means
+ * weston_surface_configure() will assign an output, which means
* the surface is supposed to be in compositor->surface_list.
* Be careful with that, and make sure we stay on the right output.
* XXX: would a fullscreen surface need the same handling?
*/
if (do_configure) {
- wlsc_surface_configure(surface, x, y, width, height);
+ weston_surface_configure(surface, x, y, width, height);
if (surface_type == SHELL_SURFACE_SCREENSAVER)
surface->output = shsurf->output;
@@ -1111,7 +1111,7 @@ configure(struct wlsc_shell *base, struct wlsc_surface *surface,
}
static void
-desktop_shell_sigchld(struct wlsc_process *process, int status)
+desktop_shell_sigchld(struct weston_process *process, int status)
{
struct wl_shell *shell =
container_of(process, struct wl_shell, child.process);
@@ -1125,7 +1125,7 @@ launch_desktop_shell_process(struct wl_shell *shell)
{
const char *shell_exe = LIBEXECDIR "/wayland-desktop-shell";
- shell->child.client = wlsc_client_launch(shell->compositor,
+ shell->child.client = weston_client_launch(shell->compositor,
&shell->child.process,
shell_exe,
desktop_shell_sigchld);
@@ -1187,7 +1187,7 @@ screensaver_set_surface(struct wl_client *client,
{
struct wl_shell *shell = resource->data;
struct shell_surface *surface = shell_surface_resource->data;
- struct wlsc_output *output = output_resource->data;
+ struct weston_output *output = output_resource->data;
if (reset_shell_surface_type(surface))
return;
@@ -1235,10 +1235,10 @@ bind_screensaver(struct wl_client *client,
}
int
-shell_init(struct wlsc_compositor *ec);
+shell_init(struct weston_compositor *ec);
WL_EXPORT int
-shell_init(struct wlsc_compositor *ec)
+shell_init(struct weston_compositor *ec)
{
struct wl_shell *shell;
@@ -1277,14 +1277,14 @@ shell_init(struct wlsc_compositor *ec)
if (launch_desktop_shell_process(shell) != 0)
return -1;
- wlsc_compositor_add_binding(ec, 0, BTN_LEFT, MODIFIER_SUPER,
+ weston_compositor_add_binding(ec, 0, BTN_LEFT, MODIFIER_SUPER,
move_binding, shell);
- wlsc_compositor_add_binding(ec, 0, BTN_MIDDLE, MODIFIER_SUPER,
+ weston_compositor_add_binding(ec, 0, BTN_MIDDLE, MODIFIER_SUPER,
resize_binding, shell);
- wlsc_compositor_add_binding(ec, KEY_BACKSPACE, 0,
+ weston_compositor_add_binding(ec, KEY_BACKSPACE, 0,
MODIFIER_CTRL | MODIFIER_ALT,
terminate_binding, ec);
- wlsc_compositor_add_binding(ec, 0, BTN_LEFT, 0,
+ weston_compositor_add_binding(ec, 0, BTN_LEFT, 0,
click_to_activate_binding, ec);
diff --git a/compositor/switcher.c b/src/switcher.c
index 266b5d3..c4ed79d 100644
--- a/compositor/switcher.c
+++ b/src/switcher.c
@@ -26,50 +26,50 @@
#include "compositor.h"
-struct wlsc_switcher {
- struct wlsc_compositor *compositor;
- struct wlsc_surface *current;
+struct weston_switcher {
+ struct weston_compositor *compositor;
+ struct weston_surface *current;
struct wl_listener listener;
};
static void
-wlsc_switcher_next(struct wlsc_switcher *switcher)
+weston_switcher_next(struct weston_switcher *switcher)
{
struct wl_list *l;
struct wl_surface *current;
- wlsc_surface_damage(switcher->current);
+ weston_surface_damage(switcher->current);
l = switcher->current->link.next;
if (l == &switcher->compositor->surface_list)
l = switcher->compositor->surface_list.next;
- switcher->current = container_of(l, struct wlsc_surface, link);
+ switcher->current = container_of(l, struct weston_surface, link);
wl_list_remove(&switcher->listener.link);
current = &switcher->current->surface;
wl_list_insert(current->resource.destroy_listener_list.prev,
&switcher->listener.link);
switcher->compositor->overlay = switcher->current;
- wlsc_surface_damage(switcher->current);
+ weston_surface_damage(switcher->current);
}
static void
switcher_handle_surface_destroy(struct wl_listener *listener,
struct wl_resource *resource, uint32_t time)
{
- struct wlsc_switcher *switcher =
- container_of(listener, struct wlsc_switcher, listener);
+ struct weston_switcher *switcher =
+ container_of(listener, struct weston_switcher, listener);
- wlsc_switcher_next(switcher);
+ weston_switcher_next(switcher);
}
-static struct wlsc_switcher *
-wlsc_switcher_create(struct wlsc_compositor *compositor)
+static struct weston_switcher *
+weston_switcher_create(struct weston_compositor *compositor)
{
- struct wlsc_switcher *switcher;
+ struct weston_switcher *switcher;
switcher = malloc(sizeof *switcher);
switcher->compositor = compositor;
switcher->current = container_of(compositor->surface_list.next,
- struct wlsc_surface, link);
+ struct weston_surface, link);
switcher->listener.func = switcher_handle_surface_destroy;
wl_list_init(&switcher->listener.link);
@@ -77,7 +77,7 @@ wlsc_switcher_create(struct wlsc_compositor *compositor)
}
static void
-wlsc_switcher_destroy(struct wlsc_switcher *switcher)
+weston_switcher_destroy(struct weston_switcher *switcher)
{
wl_list_remove(&switcher->listener.link);
free(switcher);
@@ -88,16 +88,16 @@ switcher_next_binding(struct wl_input_device *device, uint32_t time,
uint32_t key, uint32_t button,
uint32_t state, void *data)
{
- struct wlsc_compositor *compositor = data;
+ struct weston_compositor *compositor = data;
if (!state)
return;
if (wl_list_empty(&compositor->surface_list))
return;
if (compositor->switcher == NULL)
- compositor->switcher = wlsc_switcher_create(compositor);
+ compositor->switcher = weston_switcher_create(compositor);
- wlsc_switcher_next(compositor->switcher);
+ weston_switcher_next(compositor->switcher);
}
static void
@@ -105,27 +105,27 @@ switcher_terminate_binding(struct wl_input_device *device,
uint32_t time, uint32_t key, uint32_t button,
uint32_t state, void *data)
{
- struct wlsc_compositor *compositor = data;
- struct wlsc_input_device *wd = (struct wlsc_input_device *) device;
+ struct weston_compositor *compositor = data;
+ struct weston_input_device *wd = (struct weston_input_device *) device;
if (compositor->switcher && !state) {
- wlsc_surface_activate(compositor->switcher->current, wd, time);
- wlsc_switcher_destroy(compositor->switcher);
+ weston_surface_activate(compositor->switcher->current, wd, time);
+ weston_switcher_destroy(compositor->switcher);
compositor->switcher = NULL;
compositor->overlay = NULL;
}
}
void
-wlsc_switcher_init(struct wlsc_compositor *compositor)
+weston_switcher_init(struct weston_compositor *compositor)
{
- wlsc_compositor_add_binding(compositor,
+ weston_compositor_add_binding(compositor,
KEY_TAB, 0, MODIFIER_SUPER,
switcher_next_binding, compositor);
- wlsc_compositor_add_binding(compositor,
+ weston_compositor_add_binding(compositor,
KEY_LEFTMETA, 0, MODIFIER_SUPER,
switcher_terminate_binding, compositor);
- wlsc_compositor_add_binding(compositor,
+ weston_compositor_add_binding(compositor,
KEY_RIGHTMETA, 0, MODIFIER_SUPER,
switcher_terminate_binding, compositor);
}
diff --git a/compositor/tablet-shell.c b/src/tablet-shell.c
index 54985b2..46c57a1 100644
--- a/compositor/tablet-shell.c
+++ b/src/tablet-shell.c
@@ -46,21 +46,21 @@ enum {
struct tablet_shell {
struct wl_resource resource;
- struct wlsc_shell shell;
+ struct weston_shell shell;
- struct wlsc_compositor *compositor;
- struct wlsc_process process;
- struct wlsc_input_device *device;
+ struct weston_compositor *compositor;
+ struct weston_process process;
+ struct weston_input_device *device;
struct wl_client *client;
- struct wlsc_surface *surface;
+ struct weston_surface *surface;
- struct wlsc_surface *lockscreen_surface;
+ struct weston_surface *lockscreen_surface;
struct wl_listener lockscreen_listener;
- struct wlsc_surface *home_surface;
+ struct weston_surface *home_surface;
- struct wlsc_surface *switcher_surface;
+ struct weston_surface *switcher_surface;
struct wl_listener switcher_listener;
struct tablet_client *current_client;
@@ -74,12 +74,12 @@ struct tablet_client {
struct wl_resource resource;
struct tablet_shell *shell;
struct wl_client *client;
- struct wlsc_surface *surface;
+ struct weston_surface *surface;
char *name;
};
static void
-tablet_shell_sigchld(struct wlsc_process *process, int status)
+tablet_shell_sigchld(struct weston_process *process, int status)
{
struct tablet_shell *shell =
container_of(process, struct tablet_shell, process);
@@ -104,7 +104,7 @@ tablet_shell_set_state(struct tablet_shell *shell, int state)
}
static void
-tablet_shell_map(struct wlsc_shell *base, struct wlsc_surface *surface,
+tablet_shell_map(struct weston_shell *base, struct weston_surface *surface,
int32_t width, int32_t height)
{
struct tablet_shell *shell =
@@ -129,20 +129,20 @@ tablet_shell_map(struct wlsc_shell *base, struct wlsc_surface *surface,
shell->current_client->client == surface->surface.resource.client) {
tablet_shell_set_state(shell, STATE_TASK);
shell->current_client->surface = surface;
- wlsc_zoom_run(surface, 0.3, 1.0, NULL, NULL);
+ weston_zoom_run(surface, 0.3, 1.0, NULL, NULL);
}
wl_list_insert(&shell->compositor->surface_list, &surface->link);
- wlsc_surface_configure(surface, surface->x, surface->y, width, height);
+ weston_surface_configure(surface, surface->x, surface->y, width, height);
}
static void
-tablet_shell_configure(struct wlsc_shell *base,
- struct wlsc_surface *surface,
+tablet_shell_configure(struct weston_shell *base,
+ struct weston_surface *surface,
int32_t x, int32_t y,
int32_t width, int32_t height)
{
- wlsc_surface_configure(surface, x, y, width, height);
+ weston_surface_configure(surface, x, y, width, height);
}
static void
@@ -163,7 +163,7 @@ tablet_shell_set_lockscreen(struct wl_client *client,
struct wl_resource *surface_resource)
{
struct tablet_shell *shell = resource->data;
- struct wlsc_surface *es = surface_resource->data;
+ struct weston_surface *es = surface_resource->data;
es->x = 0;
es->y = 0;
@@ -192,7 +192,7 @@ tablet_shell_set_switcher(struct wl_client *client,
struct wl_resource *surface_resource)
{
struct tablet_shell *shell = resource->data;
- struct wlsc_surface *es = surface_resource->data;
+ struct weston_surface *es = surface_resource->data;
/* FIXME: Switcher should be centered and the compositor
* should do the tinting of the background. With the cache
@@ -220,25 +220,25 @@ tablet_shell_set_homescreen(struct wl_client *client,
}
static void
-minimize_zoom_done(struct wlsc_zoom *zoom, void *data)
+minimize_zoom_done(struct weston_zoom *zoom, void *data)
{
struct tablet_shell *shell = data;
- struct wlsc_compositor *compositor = shell->compositor;
- struct wlsc_input_device *device =
- (struct wlsc_input_device *) compositor->input_device;
+ struct weston_compositor *compositor = shell->compositor;
+ struct weston_input_device *device =
+ (struct weston_input_device *) compositor->input_device;
- wlsc_surface_activate(shell->home_surface,
- device, wlsc_compositor_get_time());
+ weston_surface_activate(shell->home_surface,
+ device, weston_compositor_get_time());
}
static void
tablet_shell_switch_to(struct tablet_shell *shell,
- struct wlsc_surface *surface)
+ struct weston_surface *surface)
{
- struct wlsc_compositor *compositor = shell->compositor;
- struct wlsc_input_device *device =
- (struct wlsc_input_device *) compositor->input_device;
- struct wlsc_surface *current;
+ struct weston_compositor *compositor = shell->compositor;
+ struct weston_input_device *device =
+ (struct weston_input_device *) compositor->input_device;
+ struct weston_surface *current;
if (shell->state == STATE_SWITCHER) {
wl_list_remove(&shell->switcher_listener.link);
@@ -250,15 +250,15 @@ tablet_shell_switch_to(struct tablet_shell *shell,
if (shell->current_client && shell->current_client->surface) {
current = shell->current_client->surface;
- wlsc_zoom_run(current, 1.0, 0.3,
+ weston_zoom_run(current, 1.0, 0.3,
minimize_zoom_done, shell);
}
} else {
fprintf(stderr, "switch to %p\n", surface);
- wlsc_surface_activate(surface, device,
- wlsc_compositor_get_time());
+ weston_surface_activate(surface, device,
+ weston_compositor_get_time());
tablet_shell_set_state(shell, STATE_TASK);
- wlsc_zoom_run(surface, 0.3, 1.0, NULL, NULL);
+ weston_zoom_run(surface, 0.3, 1.0, NULL, NULL);
}
}
@@ -268,7 +268,7 @@ tablet_shell_show_grid(struct wl_client *client,
struct wl_resource *surface_resource)
{
struct tablet_shell *shell = resource->data;
- struct wlsc_surface *es = surface_resource->data;
+ struct weston_surface *es = surface_resource->data;
tablet_shell_switch_to(shell, es);
}
@@ -279,7 +279,7 @@ tablet_shell_show_panels(struct wl_client *client,
struct wl_resource *surface_resource)
{
struct tablet_shell *shell = resource->data;
- struct wlsc_surface *es = surface_resource->data;
+ struct weston_surface *es = surface_resource->data;
tablet_shell_switch_to(shell, es);
}
@@ -298,7 +298,7 @@ static void
tablet_client_destroy(struct wl_client *client,
struct wl_resource *resource)
{
- wl_resource_destroy(resource, wlsc_compositor_get_time());
+ wl_resource_destroy(resource, weston_compositor_get_time());
}
static void
@@ -325,7 +325,7 @@ tablet_shell_create_client(struct wl_client *client,
uint32_t id, const char *name, int fd)
{
struct tablet_shell *shell = resource->data;
- struct wlsc_compositor *compositor = shell->compositor;
+ struct weston_compositor *compositor = shell->compositor;
struct tablet_client *tablet_client;
tablet_client = malloc(sizeof *tablet_client);
@@ -367,7 +367,7 @@ launch_ux_daemon(struct tablet_shell *shell)
{
const char *shell_exe = LIBEXECDIR "/wayland-tablet-shell";
- shell->client = wlsc_client_launch(shell->compositor,
+ shell->client = weston_client_launch(shell->compositor,
&shell->process,
shell_exe, tablet_shell_sigchld);
}
@@ -389,7 +389,7 @@ toggle_switcher(struct tablet_shell *shell)
}
static void
-tablet_shell_lock(struct wlsc_shell *base)
+tablet_shell_lock(struct weston_shell *base)
{
struct tablet_shell *shell =
container_of(base, struct tablet_shell, shell);
@@ -407,26 +407,26 @@ tablet_shell_lock(struct wlsc_shell *base)
}
static void
-tablet_shell_unlock(struct wlsc_shell *base)
+tablet_shell_unlock(struct weston_shell *base)
{
struct tablet_shell *shell =
container_of(base, struct tablet_shell, shell);
- wlsc_compositor_wake(shell->compositor);
+ weston_compositor_wake(shell->compositor);
}
static void
go_home(struct tablet_shell *shell)
{
- struct wlsc_input_device *device =
- (struct wlsc_input_device *) shell->compositor->input_device;
+ struct weston_input_device *device =
+ (struct weston_input_device *) shell->compositor->input_device;
if (shell->state == STATE_SWITCHER)
wl_resource_post_event(&shell->resource,
TABLET_SHELL_HIDE_SWITCHER);
- wlsc_surface_activate(shell->home_surface, device,
- wlsc_compositor_get_time());
+ weston_surface_activate(shell->home_surface, device,
+ weston_compositor_get_time());
tablet_shell_set_state(shell, STATE_HOME);
}
@@ -464,7 +464,7 @@ home_key_binding(struct wl_input_device *device, uint32_t time,
if (shell->state == STATE_LOCKED)
return;
- shell->device = (struct wlsc_input_device *) device;
+ shell->device = (struct weston_input_device *) device;
if (state) {
wl_event_source_timer_update(shell->long_press_source, 500);
@@ -512,10 +512,10 @@ bind_shell(struct wl_client *client, void *data, uint32_t version, uint32_t id)
}
void
-shell_init(struct wlsc_compositor *compositor);
+shell_init(struct weston_compositor *compositor);
WL_EXPORT void
-shell_init(struct wlsc_compositor *compositor)
+shell_init(struct weston_compositor *compositor)
{
struct tablet_shell *shell;
struct wl_event_loop *loop;
@@ -535,15 +535,15 @@ shell_init(struct wlsc_compositor *compositor)
shell->long_press_source =
wl_event_loop_add_timer(loop, long_press_handler, shell);
- wlsc_compositor_add_binding(compositor, KEY_LEFTMETA, 0, 0,
+ weston_compositor_add_binding(compositor, KEY_LEFTMETA, 0, 0,
home_key_binding, shell);
- wlsc_compositor_add_binding(compositor, KEY_RIGHTMETA, 0, 0,
+ weston_compositor_add_binding(compositor, KEY_RIGHTMETA, 0, 0,
home_key_binding, shell);
- wlsc_compositor_add_binding(compositor, KEY_LEFTMETA, 0,
+ weston_compositor_add_binding(compositor, KEY_LEFTMETA, 0,
MODIFIER_SUPER, home_key_binding, shell);
- wlsc_compositor_add_binding(compositor, KEY_RIGHTMETA, 0,
+ weston_compositor_add_binding(compositor, KEY_RIGHTMETA, 0,
MODIFIER_SUPER, home_key_binding, shell);
- wlsc_compositor_add_binding(compositor, KEY_COMPOSE, 0, 0,
+ weston_compositor_add_binding(compositor, KEY_COMPOSE, 0, 0,
menu_key_binding, shell);
compositor->shell = &shell->shell;
diff --git a/compositor/tty.c b/src/tty.c
index ce2dd56..9e55550 100644
--- a/compositor/tty.c
+++ b/src/tty.c
@@ -34,7 +34,7 @@
#include "compositor.h"
struct tty {
- struct wlsc_compositor *compositor;
+ struct weston_compositor *compositor;
int fd;
struct termios terminal_attributes;
@@ -89,7 +89,7 @@ on_tty_input(int fd, uint32_t mask, void *data)
}
struct tty *
-tty_create(struct wlsc_compositor *compositor, tty_vt_func_t vt_func,
+tty_create(struct weston_compositor *compositor, tty_vt_func_t vt_func,
int tty_nr)
{
struct termios raw_attributes;
diff --git a/compositor/util.c b/src/util.c
index 370edbc..8914721 100644
--- a/compositor/util.c
+++ b/src/util.c
@@ -28,9 +28,9 @@
#include "compositor.h"
WL_EXPORT void
-wlsc_matrix_init(struct wlsc_matrix *matrix)
+weston_matrix_init(struct weston_matrix *matrix)
{
- static const struct wlsc_matrix identity = {
+ static const struct weston_matrix identity = {
{ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 }
};
@@ -38,9 +38,9 @@ wlsc_matrix_init(struct wlsc_matrix *matrix)
}
static void
-wlsc_matrix_multiply(struct wlsc_matrix *m, const struct wlsc_matrix *n)
+weston_matrix_multiply(struct weston_matrix *m, const struct weston_matrix *n)
{
- struct wlsc_matrix tmp;
+ struct weston_matrix tmp;
const GLfloat *row, *column;
div_t d;
int i, j;
@@ -57,30 +57,30 @@ wlsc_matrix_multiply(struct wlsc_matrix *m, const struct wlsc_matrix *n)
}
WL_EXPORT void
-wlsc_matrix_translate(struct wlsc_matrix *matrix, GLfloat x, GLfloat y, GLfloat z)
+weston_matrix_translate(struct weston_matrix *matrix, GLfloat x, GLfloat y, GLfloat z)
{
- struct wlsc_matrix translate = {
+ struct weston_matrix translate = {
{ 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, x, y, z, 1 }
};
- wlsc_matrix_multiply(matrix, &translate);
+ weston_matrix_multiply(matrix, &translate);
}
WL_EXPORT void
-wlsc_matrix_scale(struct wlsc_matrix *matrix, GLfloat x, GLfloat y, GLfloat z)
+weston_matrix_scale(struct weston_matrix *matrix, GLfloat x, GLfloat y, GLfloat z)
{
- struct wlsc_matrix scale = {
+ struct weston_matrix scale = {
{ x, 0, 0, 0, 0, y, 0, 0, 0, 0, z, 0, 0, 0, 0, 1 }
};
- wlsc_matrix_multiply(matrix, &scale);
+ weston_matrix_multiply(matrix, &scale);
}
WL_EXPORT void
-wlsc_matrix_transform(struct wlsc_matrix *matrix, struct wlsc_vector *v)
+weston_matrix_transform(struct weston_matrix *matrix, struct weston_vector *v)
{
int i, j;
- struct wlsc_vector t;
+ struct weston_vector t;
for (i = 0; i < 4; i++) {
t.f[i] = 0;
@@ -92,7 +92,7 @@ wlsc_matrix_transform(struct wlsc_matrix *matrix, struct wlsc_vector *v)
}
WL_EXPORT void
-wlsc_spring_init(struct wlsc_spring *spring,
+weston_spring_init(struct weston_spring *spring,
double k, double current, double target)
{
spring->k = k;
@@ -103,7 +103,7 @@ wlsc_spring_init(struct wlsc_spring *spring,
}
WL_EXPORT void
-wlsc_spring_update(struct wlsc_spring *spring, uint32_t msec)
+weston_spring_update(struct weston_spring *spring, uint32_t msec)
{
double force, v, current, step;
@@ -140,25 +140,25 @@ wlsc_spring_update(struct wlsc_spring *spring, uint32_t msec)
}
WL_EXPORT int
-wlsc_spring_done(struct wlsc_spring *spring)
+weston_spring_done(struct weston_spring *spring)
{
return fabs(spring->previous - spring->target) < 0.0002 &&
fabs(spring->current - spring->target) < 0.0002;
}
-struct wlsc_zoom {
- struct wlsc_surface *surface;
- struct wlsc_animation animation;
- struct wlsc_spring spring;
- struct wlsc_transform transform;
+struct weston_zoom {
+ struct weston_surface *surface;
+ struct weston_animation animation;
+ struct weston_spring spring;
+ struct weston_transform transform;
struct wl_listener listener;
GLfloat start, stop;
- void (*done)(struct wlsc_zoom *zoom, void *data);
+ void (*done)(struct weston_zoom *zoom, void *data);
void *data;
};
static void
-wlsc_zoom_destroy(struct wlsc_zoom *zoom)
+weston_zoom_destroy(struct weston_zoom *zoom)
{
wl_list_remove(&zoom->animation.link);
wl_list_remove(&zoom->listener.link);
@@ -172,34 +172,34 @@ static void
handle_zoom_surface_destroy(struct wl_listener *listener,
struct wl_resource *resource, uint32_t time)
{
- struct wlsc_zoom *zoom =
- container_of(listener, struct wlsc_zoom, listener);
+ struct weston_zoom *zoom =
+ container_of(listener, struct weston_zoom, listener);
- wlsc_zoom_destroy(zoom);
+ weston_zoom_destroy(zoom);
}
static void
-wlsc_zoom_frame(struct wlsc_animation *animation,
- struct wlsc_output *output, uint32_t msecs)
+weston_zoom_frame(struct weston_animation *animation,
+ struct weston_output *output, uint32_t msecs)
{
- struct wlsc_zoom *zoom =
- container_of(animation, struct wlsc_zoom, animation);
- struct wlsc_surface *es = zoom->surface;
+ struct weston_zoom *zoom =
+ container_of(animation, struct weston_zoom, animation);
+ struct weston_surface *es = zoom->surface;
GLfloat scale;
- wlsc_spring_update(&zoom->spring, msecs);
+ weston_spring_update(&zoom->spring, msecs);
- if (wlsc_spring_done(&zoom->spring))
- wlsc_zoom_destroy(zoom);
+ if (weston_spring_done(&zoom->spring))
+ weston_zoom_destroy(zoom);
scale = zoom->start +
(zoom->stop - zoom->start) * zoom->spring.current;
- wlsc_matrix_init(&zoom->transform.matrix);
- wlsc_matrix_translate(&zoom->transform.matrix,
+ weston_matrix_init(&zoom->transform.matrix);
+ weston_matrix_translate(&zoom->transform.matrix,
-(es->x + es->width / 2.0),
-(es->y + es->height / 2.0), 0);
- wlsc_matrix_scale(&zoom->transform.matrix, scale, scale, scale);
- wlsc_matrix_translate(&zoom->transform.matrix,
+ weston_matrix_scale(&zoom->transform.matrix, scale, scale, scale);
+ weston_matrix_translate(&zoom->transform.matrix,
es->x + es->width / 2.0,
es->y + es->height / 2.0, 0);
@@ -207,17 +207,17 @@ wlsc_zoom_frame(struct wlsc_animation *animation,
if (es->alpha > 255)
es->alpha = 255;
scale = 1.0 / zoom->spring.current;
- wlsc_matrix_init(&zoom->transform.inverse);
- wlsc_matrix_scale(&zoom->transform.inverse, scale, scale, scale);
+ weston_matrix_init(&zoom->transform.inverse);
+ weston_matrix_scale(&zoom->transform.inverse, scale, scale, scale);
- wlsc_compositor_damage_all(es->compositor);
+ weston_compositor_damage_all(es->compositor);
}
-WL_EXPORT struct wlsc_zoom *
-wlsc_zoom_run(struct wlsc_surface *surface, GLfloat start, GLfloat stop,
- wlsc_zoom_done_func_t done, void *data)
+WL_EXPORT struct weston_zoom *
+weston_zoom_run(struct weston_surface *surface, GLfloat start, GLfloat stop,
+ weston_zoom_done_func_t done, void *data)
{
- struct wlsc_zoom *zoom;
+ struct weston_zoom *zoom;
zoom = malloc(sizeof *zoom);
if (!zoom)
@@ -229,11 +229,11 @@ wlsc_zoom_run(struct wlsc_surface *surface, GLfloat start, GLfloat stop,
zoom->start = start;
zoom->stop = stop;
surface->transform = &zoom->transform;
- wlsc_spring_init(&zoom->spring, 200.0, 0.0, 1.0);
+ weston_spring_init(&zoom->spring, 200.0, 0.0, 1.0);
zoom->spring.friction = 700;
- zoom->spring.timestamp = wlsc_compositor_get_time();
- zoom->animation.frame = wlsc_zoom_frame;
- wlsc_zoom_frame(&zoom->animation, NULL, zoom->spring.timestamp);
+ zoom->spring.timestamp = weston_compositor_get_time();
+ zoom->animation.frame = weston_zoom_frame;
+ weston_zoom_frame(&zoom->animation, NULL, zoom->spring.timestamp);
zoom->listener.func = handle_zoom_surface_destroy;
wl_list_insert(surface->surface.resource.destroy_listener_list.prev,
@@ -245,21 +245,21 @@ wlsc_zoom_run(struct wlsc_surface *surface, GLfloat start, GLfloat stop,
return zoom;
}
-struct wlsc_binding {
+struct weston_binding {
uint32_t key;
uint32_t button;
uint32_t modifier;
- wlsc_binding_handler_t handler;
+ weston_binding_handler_t handler;
void *data;
struct wl_list link;
};
-WL_EXPORT struct wlsc_binding *
-wlsc_compositor_add_binding(struct wlsc_compositor *compositor,
+WL_EXPORT struct weston_binding *
+weston_compositor_add_binding(struct weston_compositor *compositor,
uint32_t key, uint32_t button, uint32_t modifier,
- wlsc_binding_handler_t handler, void *data)
+ weston_binding_handler_t handler, void *data)
{
- struct wlsc_binding *binding;
+ struct weston_binding *binding;
binding = malloc(sizeof *binding);
if (binding == NULL)
@@ -276,19 +276,19 @@ wlsc_compositor_add_binding(struct wlsc_compositor *compositor,
}
WL_EXPORT void
-wlsc_binding_destroy(struct wlsc_binding *binding)
+weston_binding_destroy(struct weston_binding *binding)
{
wl_list_remove(&binding->link);
free(binding);
}
WL_EXPORT void
-wlsc_compositor_run_binding(struct wlsc_compositor *compositor,
- struct wlsc_input_device *device,
+weston_compositor_run_binding(struct weston_compositor *compositor,
+ struct weston_input_device *device,
uint32_t time,
uint32_t key, uint32_t button, int32_t state)
{
- struct wlsc_binding *b;
+ struct weston_binding *b;
wl_list_for_each(b, &compositor->binding_list, link) {
if (b->key == key && b->button == button &&
diff --git a/compositor/xserver-launcher.c b/src/xserver-launcher.c
index 6cc86ed..4f33ef7 100644
--- a/compositor/xserver-launcher.c
+++ b/src/xserver-launcher.c
@@ -45,7 +45,7 @@ struct xserver {
struct wl_resource resource;
};
-struct wlsc_xserver {
+struct weston_xserver {
struct wl_display *wl_display;
struct wl_event_loop *loop;
struct wl_event_source *sigchld_source;
@@ -54,20 +54,20 @@ struct wlsc_xserver {
int unix_fd;
struct wl_event_source *unix_source;
int display;
- struct wlsc_process process;
+ struct weston_process process;
struct wl_resource *resource;
struct wl_client *client;
- struct wlsc_compositor *compositor;
- struct wlsc_wm *wm;
+ struct weston_compositor *compositor;
+ struct weston_wm *wm;
};
-struct wlsc_wm {
+struct weston_wm {
xcb_connection_t *conn;
const xcb_query_extension_reply_t *xfixes;
struct wl_event_source *source;
xcb_screen_t *screen;
struct hash_table *window_hash;
- struct wlsc_xserver *server;
+ struct weston_xserver *server;
xcb_window_t selection_window;
int incr;
@@ -108,19 +108,19 @@ struct wlsc_wm {
} atom;
};
-struct wlsc_wm_window {
+struct weston_wm_window {
xcb_window_t id;
- struct wlsc_surface *surface;
+ struct weston_surface *surface;
struct wl_listener surface_destroy_listener;
char *class;
char *name;
- struct wlsc_wm_window *transient_for;
+ struct weston_wm_window *transient_for;
uint32_t protocols;
xcb_atom_t type;
};
-static struct wlsc_wm_window *
-get_wm_window(struct wlsc_surface *surface);
+static struct weston_wm_window *
+get_wm_window(struct weston_surface *surface);
static const char *
get_atom_name(xcb_connection_t *c, xcb_atom_t atom)
@@ -144,7 +144,7 @@ get_atom_name(xcb_connection_t *c, xcb_atom_t atom)
}
static void
-dump_property(struct wlsc_wm *wm, xcb_atom_t property,
+dump_property(struct weston_wm *wm, xcb_atom_t property,
xcb_get_property_reply_t *reply)
{
int32_t *incr_value;
@@ -196,7 +196,7 @@ dump_property(struct wlsc_wm *wm, xcb_atom_t property,
}
static void
-dump_window_properties(struct wlsc_wm *wm, xcb_window_t window)
+dump_window_properties(struct weston_wm *wm, xcb_window_t window)
{
xcb_list_properties_cookie_t list_cookie;
xcb_list_properties_reply_t *list_reply;
@@ -237,7 +237,7 @@ static void
data_offer_accept(struct wl_client *client, struct wl_resource *resource,
uint32_t time, const char *mime_type)
{
- struct wlsc_data_source *source = resource->data;
+ struct weston_data_source *source = resource->data;
wl_resource_post_event(&source->resource,
WL_DATA_SOURCE_TARGET, mime_type);
@@ -247,8 +247,8 @@ static void
data_offer_receive(struct wl_client *client, struct wl_resource *resource,
const char *mime_type, int32_t fd)
{
- struct wlsc_data_source *source = resource->data;
- struct wlsc_wm *wm = source->data;
+ struct weston_data_source *source = resource->data;
+ struct weston_wm *wm = source->data;
if (strcmp(mime_type, "text/plain;charset=utf-8") == 0) {
/* Get data for the utf8_string target */
@@ -271,15 +271,15 @@ data_offer_receive(struct wl_client *client, struct wl_resource *resource,
static void
data_offer_destroy(struct wl_client *client, struct wl_resource *resource)
{
- wl_resource_destroy(resource, wlsc_compositor_get_time());
+ wl_resource_destroy(resource, weston_compositor_get_time());
}
static void
destroy_data_offer(struct wl_resource *resource)
{
- struct wlsc_data_source *source = resource->data;
+ struct weston_data_source *source = resource->data;
- wlsc_data_source_unref(source);
+ weston_data_source_unref(source);
free(resource);
}
@@ -290,7 +290,7 @@ static const struct wl_data_offer_interface data_offer_interface = {
};
static struct wl_resource *
-data_source_create_offer(struct wlsc_data_source *source,
+data_source_create_offer(struct weston_data_source *source,
struct wl_resource *target)
{
struct wl_resource *resource;
@@ -304,15 +304,15 @@ data_source_create_offer(struct wlsc_data_source *source,
}
static void
-data_source_cancel(struct wlsc_data_source *source)
+data_source_cancel(struct weston_data_source *source)
{
}
static void
-wlsc_wm_get_selection_targets(struct wlsc_wm *wm)
+weston_wm_get_selection_targets(struct weston_wm *wm)
{
- struct wlsc_data_source *source;
- struct wlsc_input_device *device;
+ struct weston_data_source *source;
+ struct weston_input_device *device;
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *reply;
xcb_atom_t *value;
@@ -356,19 +356,19 @@ wlsc_wm_get_selection_targets(struct wlsc_wm *wm)
}
}
- device = (struct wlsc_input_device *)
+ device = (struct weston_input_device *)
wm->server->compositor->input_device;
- wlsc_input_device_set_selection(device, source,
- wlsc_compositor_get_time());
+ weston_input_device_set_selection(device, source,
+ weston_compositor_get_time());
- wlsc_data_source_unref(source);
+ weston_data_source_unref(source);
free(reply);
}
static int
-wlsc_wm_write_property(int fd, uint32_t mask, void *data)
+weston_wm_write_property(int fd, uint32_t mask, void *data)
{
- struct wlsc_wm *wm = data;
+ struct weston_wm *wm = data;
unsigned char *property;
int len, remainder;
@@ -408,7 +408,7 @@ wlsc_wm_write_property(int fd, uint32_t mask, void *data)
}
static void
-wlsc_wm_get_selection_data(struct wlsc_wm *wm)
+weston_wm_get_selection_data(struct weston_wm *wm)
{
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *reply;
@@ -435,14 +435,14 @@ wlsc_wm_get_selection_data(struct wlsc_wm *wm)
wl_event_loop_add_fd(wm->server->loop,
wm->data_source_fd,
WL_EVENT_WRITABLE,
- wlsc_wm_write_property,
+ weston_wm_write_property,
wm);
wm->property_reply = reply;
}
}
static void
-wlsc_wm_get_incr_chunk(struct wlsc_wm *wm)
+weston_wm_get_incr_chunk(struct weston_wm *wm)
{
xcb_get_property_cookie_t cookie;
xcb_get_property_reply_t *reply;
@@ -465,7 +465,7 @@ wlsc_wm_get_incr_chunk(struct wlsc_wm *wm)
wl_event_loop_add_fd(wm->server->loop,
wm->data_source_fd,
WL_EVENT_WRITABLE,
- wlsc_wm_write_property,
+ weston_wm_write_property,
wm);
wm->property_reply = reply;
} else {
@@ -476,11 +476,11 @@ wlsc_wm_get_incr_chunk(struct wlsc_wm *wm)
}
void
-wlsc_xserver_set_selection(struct wlsc_input_device *device)
+weston_xserver_set_selection(struct weston_input_device *device)
{
- struct wlsc_xserver *wxs = device->compositor->wxs;
- struct wlsc_wm *wm = wxs->wm;
- struct wlsc_data_source *source;
+ struct weston_xserver *wxs = device->compositor->wxs;
+ struct weston_wm *wm = wxs->wm;
+ struct weston_data_source *source;
const char **p, **end;
int has_text_plain = 0;
@@ -514,7 +514,7 @@ wlsc_xserver_set_selection(struct wlsc_input_device *device)
}
static void
-wlsc_wm_handle_configure_request(struct wlsc_wm *wm, xcb_generic_event_t *event)
+weston_wm_handle_configure_request(struct weston_wm *wm, xcb_generic_event_t *event)
{
xcb_configure_request_event_t *configure_request =
(xcb_configure_request_event_t *) event;
@@ -547,7 +547,7 @@ wlsc_wm_handle_configure_request(struct wlsc_wm *wm, xcb_generic_event_t *event)
}
static void
-wlsc_wm_handle_configure_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
+weston_wm_handle_configure_notify(struct weston_wm *wm, xcb_generic_event_t *event)
{
xcb_configure_notify_event_t *configure_notify =
(xcb_configure_notify_event_t *) event;
@@ -559,8 +559,8 @@ wlsc_wm_handle_configure_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
}
static void
-wlsc_wm_activate(struct wlsc_wm *wm,
- struct wlsc_wm_window *window, xcb_timestamp_t time)
+weston_wm_activate(struct weston_wm *wm,
+ struct weston_wm_window *window, xcb_timestamp_t time)
{
xcb_client_message_event_t client_message;
@@ -580,13 +580,13 @@ wlsc_wm_activate(struct wlsc_wm *wm,
}
WL_EXPORT void
-wlsc_xserver_surface_activate(struct wlsc_surface *surface)
+weston_xserver_surface_activate(struct weston_surface *surface)
{
- struct wlsc_wm_window *window = get_wm_window(surface);
- struct wlsc_xserver *wxs = surface->compositor->wxs;
+ struct weston_wm_window *window = get_wm_window(surface);
+ struct weston_xserver *wxs = surface->compositor->wxs;
if (window)
- wlsc_wm_activate(wxs->wm, window, XCB_TIME_CURRENT_TIME);
+ weston_wm_activate(wxs->wm, window, XCB_TIME_CURRENT_TIME);
else if (wxs && wxs->wm)
xcb_set_input_focus (wxs->wm->conn,
XCB_INPUT_FOCUS_POINTER_ROOT,
@@ -595,7 +595,7 @@ wlsc_xserver_surface_activate(struct wlsc_surface *surface)
}
static void
-wlsc_wm_handle_map_request(struct wlsc_wm *wm, xcb_generic_event_t *event)
+weston_wm_handle_map_request(struct weston_wm *wm, xcb_generic_event_t *event)
{
xcb_map_request_event_t *map_request =
(xcb_map_request_event_t *) event;
@@ -609,9 +609,9 @@ wlsc_wm_handle_map_request(struct wlsc_wm *wm, xcb_generic_event_t *event)
#define TYPE_WM_PROTOCOLS XCB_ATOM_CUT_BUFFER0
static void
-wlsc_wm_handle_map_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
+weston_wm_handle_map_notify(struct weston_wm *wm, xcb_generic_event_t *event)
{
-#define F(field) offsetof(struct wlsc_wm_window, field)
+#define F(field) offsetof(struct weston_wm_window, field)
const struct {
xcb_atom_t atom;
@@ -629,7 +629,7 @@ wlsc_wm_handle_map_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
xcb_map_notify_event_t *map_notify = (xcb_map_notify_event_t *) event;
xcb_get_property_cookie_t cookie[ARRAY_LENGTH(props)];
xcb_get_property_reply_t *reply;
- struct wlsc_wm_window *window;
+ struct weston_wm_window *window;
void *p;
uint32_t *xid;
xcb_atom_t *atom;
@@ -666,7 +666,7 @@ wlsc_wm_handle_map_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
break;
case XCB_ATOM_WINDOW:
xid = xcb_get_property_value(reply);
- *(struct wlsc_wm_window **) p =
+ *(struct weston_wm_window **) p =
hash_table_lookup(wm->window_hash, *xid);
break;
case XCB_ATOM_ATOM:
@@ -684,13 +684,13 @@ wlsc_wm_handle_map_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
fprintf(stderr, "window %d: name %s, class %s, transient_for %d\n",
window->id, window->name, window->class,
window->transient_for ? window->transient_for->id : 0);
- wlsc_wm_activate(wm, window, XCB_TIME_CURRENT_TIME);
+ weston_wm_activate(wm, window, XCB_TIME_CURRENT_TIME);
}
static const int incr_chunk_size = 64 * 1024;
static void
-wlsc_wm_send_selection_notify(struct wlsc_wm *wm, xcb_atom_t property)
+weston_wm_send_selection_notify(struct weston_wm *wm, xcb_atom_t property)
{
xcb_selection_notify_event_t selection_notify;
@@ -709,7 +709,7 @@ wlsc_wm_send_selection_notify(struct wlsc_wm *wm, xcb_atom_t property)
}
static void
-wlsc_wm_send_targets(struct wlsc_wm *wm)
+weston_wm_send_targets(struct weston_wm *wm)
{
xcb_atom_t targets[] = {
wm->atom.timestamp,
@@ -728,11 +728,11 @@ wlsc_wm_send_targets(struct wlsc_wm *wm)
32, /* format */
ARRAY_LENGTH(targets), targets);
- wlsc_wm_send_selection_notify(wm, wm->selection_request.property);
+ weston_wm_send_selection_notify(wm, wm->selection_request.property);
}
static void
-wlsc_wm_send_timestamp(struct wlsc_wm *wm)
+weston_wm_send_timestamp(struct weston_wm *wm)
{
xcb_change_property(wm->conn,
XCB_PROP_MODE_REPLACE,
@@ -742,11 +742,11 @@ wlsc_wm_send_timestamp(struct wlsc_wm *wm)
32, /* format */
1, &wm->selection_timestamp);
- wlsc_wm_send_selection_notify(wm, wm->selection_request.property);
+ weston_wm_send_selection_notify(wm, wm->selection_request.property);
}
static int
-wlsc_wm_flush_source_data(struct wlsc_wm *wm)
+weston_wm_flush_source_data(struct weston_wm *wm)
{
int length;
@@ -766,9 +766,9 @@ wlsc_wm_flush_source_data(struct wlsc_wm *wm)
}
static int
-wlsc_wm_read_data_source(int fd, uint32_t mask, void *data)
+weston_wm_read_data_source(int fd, uint32_t mask, void *data)
{
- struct wlsc_wm *wm = data;
+ struct weston_wm *wm = data;
int len, current, available;
void *p;
@@ -782,7 +782,7 @@ wlsc_wm_read_data_source(int fd, uint32_t mask, void *data)
len = read(fd, p, available);
if (len == -1) {
fprintf(stderr, "read error from data source: %m\n");
- wlsc_wm_send_selection_notify(wm, XCB_ATOM_NONE);
+ weston_wm_send_selection_notify(wm, XCB_ATOM_NONE);
wl_event_source_remove(wm->property_source);
close(fd);
wl_array_release(&wm->source_data);
@@ -807,7 +807,7 @@ wlsc_wm_read_data_source(int fd, uint32_t mask, void *data)
wm->selection_property_set = 1;
wm->flush_property_on_delete = 1;
wl_event_source_remove(wm->property_source);
- wlsc_wm_send_selection_notify(wm, wm->selection_request.property);
+ weston_wm_send_selection_notify(wm, wm->selection_request.property);
} else if (wm->selection_property_set) {
fprintf(stderr, "got %d bytes, waiting for "
"property delete\n", wm->source_data.size);
@@ -818,13 +818,13 @@ wlsc_wm_read_data_source(int fd, uint32_t mask, void *data)
fprintf(stderr, "got %d bytes, "
"property deleted, seting new property\n",
wm->source_data.size);
- wlsc_wm_flush_source_data(wm);
+ weston_wm_flush_source_data(wm);
}
} else if (len == 0 && !wm->incr) {
fprintf(stderr, "non-incr transfer complete\n");
/* Non-incr transfer all done. */
- wlsc_wm_flush_source_data(wm);
- wlsc_wm_send_selection_notify(wm, wm->selection_request.property);
+ weston_wm_flush_source_data(wm);
+ weston_wm_send_selection_notify(wm, wm->selection_request.property);
xcb_flush(wm->conn);
wl_event_source_remove(wm->property_source);
close(fd);
@@ -841,7 +841,7 @@ wlsc_wm_read_data_source(int fd, uint32_t mask, void *data)
fprintf(stderr, "got %d bytes, "
"property deleted, seting new property\n",
wm->source_data.size);
- wlsc_wm_flush_source_data(wm);
+ weston_wm_flush_source_data(wm);
}
xcb_flush(wm->conn);
wl_event_source_remove(wm->property_source);
@@ -855,15 +855,15 @@ wlsc_wm_read_data_source(int fd, uint32_t mask, void *data)
}
static void
-wlsc_wm_send_data(struct wlsc_wm *wm, xcb_atom_t target, const char *mime_type)
+weston_wm_send_data(struct weston_wm *wm, xcb_atom_t target, const char *mime_type)
{
- struct wlsc_input_device *device = (struct wlsc_input_device *)
+ struct weston_input_device *device = (struct weston_input_device *)
wm->server->compositor->input_device;
int p[2];
if (pipe2(p, O_CLOEXEC | O_NONBLOCK) == -1) {
fprintf(stderr, "pipe2 failed: %m\n");
- wlsc_wm_send_selection_notify(wm, XCB_ATOM_NONE);
+ weston_wm_send_selection_notify(wm, XCB_ATOM_NONE);
return;
}
@@ -873,7 +873,7 @@ wlsc_wm_send_data(struct wlsc_wm *wm, xcb_atom_t target, const char *mime_type)
wm->property_source = wl_event_loop_add_fd(wm->server->loop,
wm->data_source_fd,
WL_EVENT_READABLE,
- wlsc_wm_read_data_source,
+ weston_wm_read_data_source,
wm);
wl_resource_post_event(&device->selection_data_source->resource,
@@ -882,7 +882,7 @@ wlsc_wm_send_data(struct wlsc_wm *wm, xcb_atom_t target, const char *mime_type)
}
static void
-wlsc_wm_send_incr_chunk(struct wlsc_wm *wm)
+weston_wm_send_incr_chunk(struct weston_wm *wm)
{
fprintf(stderr, "property deleted\n");
int length;
@@ -892,14 +892,14 @@ wlsc_wm_send_incr_chunk(struct wlsc_wm *wm)
fprintf(stderr, "setting new property, %d bytes\n",
wm->source_data.size);
wm->flush_property_on_delete = 0;
- length = wlsc_wm_flush_source_data(wm);
+ length = weston_wm_flush_source_data(wm);
if (wm->data_source_fd >= 0) {
wm->property_source =
wl_event_loop_add_fd(wm->server->loop,
wm->data_source_fd,
WL_EVENT_READABLE,
- wlsc_wm_read_data_source,
+ weston_wm_read_data_source,
wm);
} else if (length > 0) {
/* Transfer is all done, but queue a flush for
@@ -915,7 +915,7 @@ wlsc_wm_send_incr_chunk(struct wlsc_wm *wm)
}
static void
-wlsc_wm_handle_selection_request(struct wlsc_wm *wm,
+weston_wm_handle_selection_request(struct weston_wm *wm,
xcb_generic_event_t *event)
{
xcb_selection_request_event_t *selection_request =
@@ -933,21 +933,21 @@ wlsc_wm_handle_selection_request(struct wlsc_wm *wm,
wm->flush_property_on_delete = 0;
if (selection_request->target == wm->atom.targets) {
- wlsc_wm_send_targets(wm);
+ weston_wm_send_targets(wm);
} else if (selection_request->target == wm->atom.timestamp) {
- wlsc_wm_send_timestamp(wm);
+ weston_wm_send_timestamp(wm);
} else if (selection_request->target == wm->atom.utf8_string ||
selection_request->target == wm->atom.text) {
- wlsc_wm_send_data(wm, wm->atom.utf8_string,
+ weston_wm_send_data(wm, wm->atom.utf8_string,
"text/plain;charset=utf-8");
} else {
fprintf(stderr, "can only handle UTF8_STRING targets...\n");
- wlsc_wm_send_selection_notify(wm, XCB_ATOM_NONE);
+ weston_wm_send_selection_notify(wm, XCB_ATOM_NONE);
}
}
static void
-wlsc_wm_handle_property_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
+weston_wm_handle_property_notify(struct weston_wm *wm, xcb_generic_event_t *event)
{
xcb_property_notify_event_t *property_notify =
(xcb_property_notify_event_t *) event;
@@ -956,12 +956,12 @@ wlsc_wm_handle_property_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
if (property_notify->state == XCB_PROPERTY_NEW_VALUE &&
property_notify->atom == wm->atom.wl_selection &&
wm->incr)
- wlsc_wm_get_incr_chunk(wm);
+ weston_wm_get_incr_chunk(wm);
} else if (property_notify->window == wm->selection_request.requestor) {
if (property_notify->state == XCB_PROPERTY_DELETE &&
property_notify->atom == wm->selection_request.property &&
wm->incr)
- wlsc_wm_send_incr_chunk(wm);
+ weston_wm_send_incr_chunk(wm);
} else if (property_notify->atom == XCB_ATOM_WM_CLASS) {
fprintf(stderr, "wm_class changed\n");
} else if (property_notify->atom == XCB_ATOM_WM_TRANSIENT_FOR) {
@@ -986,11 +986,11 @@ wlsc_wm_handle_property_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
}
static void
-wlsc_wm_handle_create_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
+weston_wm_handle_create_notify(struct weston_wm *wm, xcb_generic_event_t *event)
{
xcb_create_notify_event_t *create_notify =
(xcb_create_notify_event_t *) event;
- struct wlsc_wm_window *window;
+ struct weston_wm_window *window;
uint32_t values[1];
fprintf(stderr, "XCB_CREATE_NOTIFY (window %d)\n",
@@ -1012,11 +1012,11 @@ wlsc_wm_handle_create_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
}
static void
-wlsc_wm_handle_destroy_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
+weston_wm_handle_destroy_notify(struct weston_wm *wm, xcb_generic_event_t *event)
{
xcb_destroy_notify_event_t *destroy_notify =
(xcb_destroy_notify_event_t *) event;
- struct wlsc_wm_window *window;
+ struct weston_wm_window *window;
fprintf(stderr, "XCB_DESTROY_NOTIFY, win %d\n",
destroy_notify->window);
@@ -1036,7 +1036,7 @@ wlsc_wm_handle_destroy_notify(struct wlsc_wm *wm, xcb_generic_event_t *event)
}
static void
-wlsc_wm_handle_selection_notify(struct wlsc_wm *wm,
+weston_wm_handle_selection_notify(struct weston_wm *wm,
xcb_generic_event_t *event)
{
xcb_selection_notify_event_t *selection_notify =
@@ -1045,14 +1045,14 @@ wlsc_wm_handle_selection_notify(struct wlsc_wm *wm,
if (selection_notify->property == XCB_ATOM_NONE) {
/* convert selection failed */
} else if (selection_notify->target == wm->atom.targets) {
- wlsc_wm_get_selection_targets(wm);
+ weston_wm_get_selection_targets(wm);
} else {
- wlsc_wm_get_selection_data(wm);
+ weston_wm_get_selection_data(wm);
}
}
static void
-wlsc_wm_handle_xfixes_selection_notify(struct wlsc_wm *wm,
+weston_wm_handle_xfixes_selection_notify(struct weston_wm *wm,
xcb_generic_event_t *event)
{
xcb_xfixes_selection_notify_event_t *xfixes_selection_notify =
@@ -1080,52 +1080,52 @@ wlsc_wm_handle_xfixes_selection_notify(struct wlsc_wm *wm,
}
static int
-wlsc_wm_handle_event(int fd, uint32_t mask, void *data)
+weston_wm_handle_event(int fd, uint32_t mask, void *data)
{
- struct wlsc_wm *wm = data;
+ struct weston_wm *wm = data;
xcb_generic_event_t *event;
int count = 0;
while (event = xcb_poll_for_event(wm->conn), event != NULL) {
switch (event->response_type & ~0x80) {
case XCB_CREATE_NOTIFY:
- wlsc_wm_handle_create_notify(wm, event);
+ weston_wm_handle_create_notify(wm, event);
break;
case XCB_MAP_REQUEST:
- wlsc_wm_handle_map_request(wm, event);
+ weston_wm_handle_map_request(wm, event);
break;
case XCB_MAP_NOTIFY:
- wlsc_wm_handle_map_notify(wm, event);
+ weston_wm_handle_map_notify(wm, event);
break;
case XCB_UNMAP_NOTIFY:
fprintf(stderr, "XCB_UNMAP_NOTIFY\n");
break;
case XCB_CONFIGURE_REQUEST:
- wlsc_wm_handle_configure_request(wm, event);
+ weston_wm_handle_configure_request(wm, event);
break;
case XCB_CONFIGURE_NOTIFY:
- wlsc_wm_handle_configure_notify(wm, event);
+ weston_wm_handle_configure_notify(wm, event);
break;
case XCB_DESTROY_NOTIFY:
- wlsc_wm_handle_destroy_notify(wm, event);
+ weston_wm_handle_destroy_notify(wm, event);
break;
case XCB_MAPPING_NOTIFY:
fprintf(stderr, "XCB_MAPPING_NOTIFY\n");
break;
case XCB_PROPERTY_NOTIFY:
- wlsc_wm_handle_property_notify(wm, event);
+ weston_wm_handle_property_notify(wm, event);
break;
case XCB_SELECTION_NOTIFY:
- wlsc_wm_handle_selection_notify(wm, event);
+ weston_wm_handle_selection_notify(wm, event);
break;
case XCB_SELECTION_REQUEST:
- wlsc_wm_handle_selection_request(wm, event);
+ weston_wm_handle_selection_request(wm, event);
break;
}
switch (event->response_type - wm->xfixes->first_event) {
case XCB_XFIXES_SELECTION_NOTIFY:
- wlsc_wm_handle_xfixes_selection_notify(wm, event);
+ weston_wm_handle_xfixes_selection_notify(wm, event);
break;
}
@@ -1140,10 +1140,10 @@ wlsc_wm_handle_event(int fd, uint32_t mask, void *data)
}
static void
-wxs_wm_get_resources(struct wlsc_wm *wm)
+wxs_wm_get_resources(struct weston_wm *wm)
{
-#define F(field) offsetof(struct wlsc_wm, field)
+#define F(field) offsetof(struct weston_wm, field)
static const struct { const char *name; int offset; } atoms[] = {
{ "WM_PROTOCOLS", F(atom.wm_protocols) },
@@ -1206,10 +1206,10 @@ wxs_wm_get_resources(struct wlsc_wm *wm)
free(xfixes_reply);
}
-static struct wlsc_wm *
-wlsc_wm_create(struct wlsc_xserver *wxs)
+static struct weston_wm *
+weston_wm_create(struct weston_xserver *wxs)
{
- struct wlsc_wm *wm;
+ struct weston_wm *wm;
struct wl_event_loop *loop;
xcb_screen_iterator_t s;
uint32_t values[1], mask;
@@ -1254,7 +1254,7 @@ wlsc_wm_create(struct wlsc_xserver *wxs)
wm->source =
wl_event_loop_add_fd(loop, sv[0],
WL_EVENT_READABLE,
- wlsc_wm_handle_event, wm);
+ weston_wm_handle_event, wm);
wl_event_source_check(wm->source);
wxs_wm_get_resources(wm);
@@ -1297,7 +1297,7 @@ wlsc_wm_create(struct wlsc_xserver *wxs)
}
static void
-wlsc_wm_destroy(struct wlsc_wm *wm)
+weston_wm_destroy(struct weston_wm *wm)
{
/* FIXME: Free windows in hash. */
hash_table_destroy(wm->window_hash);
@@ -1307,9 +1307,9 @@ wlsc_wm_destroy(struct wlsc_wm *wm)
}
static int
-wlsc_xserver_handle_event(int listen_fd, uint32_t mask, void *data)
+weston_xserver_handle_event(int listen_fd, uint32_t mask, void *data)
{
- struct wlsc_xserver *mxs = data;
+ struct weston_xserver *mxs = data;
char display[8], s[8], logfile[32];
int sv[2], flags;
@@ -1353,7 +1353,7 @@ wlsc_xserver_handle_event(int listen_fd, uint32_t mask, void *data)
close(sv[1]);
mxs->client = wl_client_create(mxs->wl_display, sv[0]);
- wlsc_watch_process(&mxs->process);
+ weston_watch_process(&mxs->process);
wl_event_source_remove(mxs->abstract_source);
wl_event_source_remove(mxs->unix_source);
@@ -1368,7 +1368,7 @@ wlsc_xserver_handle_event(int listen_fd, uint32_t mask, void *data)
}
static void
-wlsc_xserver_shutdown(struct wlsc_xserver *wxs)
+weston_xserver_shutdown(struct weston_xserver *wxs)
{
char path[256];
@@ -1383,15 +1383,15 @@ wlsc_xserver_shutdown(struct wlsc_xserver *wxs)
close(wxs->abstract_fd);
close(wxs->unix_fd);
if (wxs->wm)
- wlsc_wm_destroy(wxs->wm);
+ weston_wm_destroy(wxs->wm);
wxs->loop = NULL;
}
static void
-wlsc_xserver_cleanup(struct wlsc_process *process, int status)
+weston_xserver_cleanup(struct weston_process *process, int status)
{
- struct wlsc_xserver *mxs =
- container_of(process, struct wlsc_xserver, process);
+ struct weston_xserver *mxs =
+ container_of(process, struct weston_xserver, process);
mxs->process.pid = 0;
mxs->client = NULL;
@@ -1400,23 +1400,23 @@ wlsc_xserver_cleanup(struct wlsc_process *process, int status)
mxs->abstract_source =
wl_event_loop_add_fd(mxs->loop, mxs->abstract_fd,
WL_EVENT_READABLE,
- wlsc_xserver_handle_event, mxs);
+ weston_xserver_handle_event, mxs);
mxs->unix_source =
wl_event_loop_add_fd(mxs->loop, mxs->unix_fd,
WL_EVENT_READABLE,
- wlsc_xserver_handle_event, mxs);
+ weston_xserver_handle_event, mxs);
if (mxs->wm) {
fprintf(stderr, "xserver exited, code %d\n", status);
- wlsc_wm_destroy(mxs->wm);
+ weston_wm_destroy(mxs->wm);
mxs->wm = NULL;
} else {
/* If the X server crashes before it binds to the
* xserver interface, shut down and don't try
* again. */
fprintf(stderr, "xserver crashing too fast: %d\n", status);
- wlsc_xserver_shutdown(mxs);
+ weston_xserver_shutdown(mxs);
}
}
@@ -1424,15 +1424,15 @@ static void
surface_destroy(struct wl_listener *listener,
struct wl_resource *resource, uint32_t time)
{
- struct wlsc_wm_window *window =
+ struct weston_wm_window *window =
container_of(listener,
- struct wlsc_wm_window, surface_destroy_listener);
+ struct weston_wm_window, surface_destroy_listener);
fprintf(stderr, "surface for xid %d destroyed\n", window->id);
}
-static struct wlsc_wm_window *
-get_wm_window(struct wlsc_surface *surface)
+static struct weston_wm_window *
+get_wm_window(struct weston_surface *surface)
{
struct wl_resource *resource = &surface->surface.resource;
struct wl_listener *listener;
@@ -1440,7 +1440,7 @@ get_wm_window(struct wlsc_surface *surface)
wl_list_for_each(listener, &resource->destroy_listener_list, link) {
if (listener->func == surface_destroy)
return container_of(listener,
- struct wlsc_wm_window,
+ struct weston_wm_window,
surface_destroy_listener);
}
@@ -1451,10 +1451,10 @@ static void
xserver_set_window_id(struct wl_client *client, struct wl_resource *resource,
struct wl_resource *surface_resource, uint32_t id)
{
- struct wlsc_xserver *wxs = resource->data;
- struct wlsc_wm *wm = wxs->wm;
+ struct weston_xserver *wxs = resource->data;
+ struct weston_wm *wm = wxs->wm;
struct wl_surface *surface = surface_resource->data;
- struct wlsc_wm_window *window;
+ struct weston_wm_window *window;
if (client != wxs->client)
return;
@@ -1467,7 +1467,7 @@ xserver_set_window_id(struct wl_client *client, struct wl_resource *resource,
fprintf(stderr, "set_window_id %d for surface %p\n", id, surface);
- window->surface = (struct wlsc_surface *) surface;
+ window->surface = (struct weston_surface *) surface;
window->surface_destroy_listener.func = surface_destroy;
wl_list_insert(surface->resource.destroy_listener_list.prev,
&window->surface_destroy_listener.link);
@@ -1481,7 +1481,7 @@ static void
bind_xserver(struct wl_client *client,
void *data, uint32_t version, uint32_t id)
{
- struct wlsc_xserver *wxs = data;
+ struct weston_xserver *wxs = data;
/* If it's a different client than the xserver we launched,
* don't start the wm. */
@@ -1492,7 +1492,7 @@ bind_xserver(struct wl_client *client,
wl_client_add_object(client, &xserver_interface,
&xserver_implementation, id, wxs);
- wxs->wm = wlsc_wm_create(wxs);
+ wxs->wm = weston_wm_create(wxs);
if (wxs->wm == NULL) {
fprintf(stderr, "failed to create wm\n");
}
@@ -1624,16 +1624,16 @@ create_lockfile(int display, char *lockfile, size_t lsize)
}
int
-wlsc_xserver_init(struct wlsc_compositor *compositor)
+weston_xserver_init(struct weston_compositor *compositor)
{
struct wl_display *display = compositor->wl_display;
- struct wlsc_xserver *mxs;
+ struct weston_xserver *mxs;
char lockfile[256];
mxs = malloc(sizeof *mxs);
memset(mxs, 0, sizeof *mxs);
- mxs->process.cleanup = wlsc_xserver_cleanup;
+ mxs->process.cleanup = weston_xserver_cleanup;
mxs->wl_display = display;
mxs->compositor = compositor;
@@ -1673,11 +1673,11 @@ wlsc_xserver_init(struct wlsc_compositor *compositor)
mxs->abstract_source =
wl_event_loop_add_fd(mxs->loop, mxs->abstract_fd,
WL_EVENT_READABLE,
- wlsc_xserver_handle_event, mxs);
+ weston_xserver_handle_event, mxs);
mxs->unix_source =
wl_event_loop_add_fd(mxs->loop, mxs->unix_fd,
WL_EVENT_READABLE,
- wlsc_xserver_handle_event, mxs);
+ weston_xserver_handle_event, mxs);
wl_display_add_global(display, &xserver_interface, mxs, bind_xserver);
@@ -1687,15 +1687,15 @@ wlsc_xserver_init(struct wlsc_compositor *compositor)
}
void
-wlsc_xserver_destroy(struct wlsc_compositor *compositor)
+weston_xserver_destroy(struct weston_compositor *compositor)
{
- struct wlsc_xserver *wxs = compositor->wxs;
+ struct weston_xserver *wxs = compositor->wxs;
if (!wxs)
return;
if (wxs->loop)
- wlsc_xserver_shutdown(wxs);
+ weston_xserver_shutdown(wxs);
free(wxs);
}