[PATCH V4 2/7] weston: Add the weston randr support in compositor.h
Quanxian Wang
quanxian.wang at intel.com
Thu Apr 24 00:50:06 PDT 2014
1) Add weston_randr definition and randr_backend intreface.
2) Export functions used in compositor.c so that module wrandr
could use them. For example, weston_output_transform_scale_init.
3) Support new_mode backend interface in output structure.
Signed-off-by: Quanxian Wang <quanxian.wang at intel.com>
---
src/compositor.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
diff --git a/src/compositor.h b/src/compositor.h
index ace75da..008b0f2 100644
--- a/src/compositor.h
+++ b/src/compositor.h
@@ -172,6 +172,23 @@ enum weston_mode_switch_op {
WESTON_MODE_SWITCH_RESTORE_NATIVE
};
+enum weston_output_rel_motion {
+ MOVE_LEFTOF,
+ MOVE_RIGHTOF,
+ MOVE_ABOVE,
+ MOVE_BELOW
+};
+
+struct wrandr {
+ struct weston_compositor *compositor;
+ struct wl_global *global;
+ struct wl_resource *resource;
+ struct wl_listener destroy_listener;
+ struct {
+ struct wl_list request_list;
+ } pending;
+};
+
struct weston_output {
uint32_t id;
char *name;
@@ -179,6 +196,9 @@ struct weston_output {
void *renderer_state;
struct wl_list link;
+ struct wl_list hlink; /* horizontal link */
+ struct wl_list vlink; /* vertical link */
+ struct wl_list clink; /* clone link */
struct wl_list resource_list;
struct wl_global *global;
struct weston_compositor *compositor;
@@ -218,6 +238,33 @@ struct weston_output {
void (*destroy)(struct weston_output *output);
void (*assign_planes)(struct weston_output *output);
int (*switch_mode)(struct weston_output *output, struct weston_mode *mode);
+ struct weston_mode * (*new_timing)(struct weston_output *output,
+ uint32_t clock,
+ int hdisplay,
+ int hsync_start,
+ int hsync_end,
+ int htotal,
+ int vdisplay,
+ int vsync_start,
+ int vsync_end,
+ int vtotal,
+ int vscan,
+ uint32_t flags);
+
+ int (*compare_timing)(struct weston_mode *mode,
+ uint32_t clock,
+ int hdisplay,
+ int hsync_start,
+ int hsync_end,
+ int htotal,
+ int vdisplay,
+ int vsync_start,
+ int vsync_end,
+ int vtotal,
+ int vscan,
+ uint32_t flags);
+
+ struct weston_mode * (*new_mode)(int width, int height, int refresh);
/* backlight values are on 0-255 range, where higher is brighter */
int32_t backlight_current;
@@ -567,6 +614,7 @@ struct weston_compositor {
struct wl_display *wl_display;
struct weston_shell_interface shell_interface;
struct weston_config *config;
+ struct weston_output *primary;
/* surface signals */
struct wl_signal activate_signal;
@@ -635,6 +683,7 @@ struct weston_compositor {
/* Raw keyboard processing (no libxkbcommon initialization or handling) */
int use_xkbcommon;
+ struct wrandr *randr;
};
struct weston_buffer {
@@ -1359,6 +1408,10 @@ weston_surface_set_color(struct weston_surface *surface,
void
weston_surface_destroy(struct weston_surface *surface);
+void
+weston_output_transform_scale_init(struct weston_output *output,
+ uint32_t transform, uint32_t scale);
+
int
weston_output_switch_mode(struct weston_output *output, struct weston_mode *mode,
int32_t scale, enum weston_mode_switch_op op);
--
1.8.1.2
More information about the wayland-devel
mailing list