diff options
Diffstat (limited to 'include/wlr')
-rw-r--r-- | include/wlr/types/wlr_xdg_shell_v6.h | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/include/wlr/types/wlr_xdg_shell_v6.h b/include/wlr/types/wlr_xdg_shell_v6.h index 0867b2f6..e2a58669 100644 --- a/include/wlr/types/wlr_xdg_shell_v6.h +++ b/include/wlr/types/wlr_xdg_shell_v6.h @@ -32,6 +32,77 @@ struct wlr_xdg_client_v6 { struct wl_event_source *ping_timer; }; +enum wlr_positioner_v6_anchor { + /** + * the center of the anchor rectangle + */ + WLR_POSITIONER_V6_ANCHOR_NONE = 0, + /** + * the top edge of the anchor rectangle + */ + WLR_POSITIONER_V6_ANCHOR_TOP = 1, + /** + * the bottom edge of the anchor rectangle + */ + WLR_POSITIONER_V6_ANCHOR_BOTTOM = 2, + /** + * the left edge of the anchor rectangle + */ + WLR_POSITIONER_V6_ANCHOR_LEFT = 4, + /** + * the right edge of the anchor rectangle + */ + WLR_POSITIONER_V6_ANCHOR_RIGHT = 8, +}; + +enum wlr_positioner_v6_gravity { + /** + * center over the anchor edge + */ + WLR_POSITIONER_V6_GRAVITY_NONE = 0, + /** + * position above the anchor edge + */ + WLR_POSITIONER_V6_GRAVITY_TOP = 1, + /** + * position below the anchor edge + */ + WLR_POSITIONER_V6_GRAVITY_BOTTOM = 2, + /** + * position to the left of the anchor edge + */ + WLR_POSITIONER_V6_GRAVITY_LEFT = 4, + /** + * position to the right of the anchor edge + */ + WLR_POSITIONER_V6_GRAVITY_RIGHT = 8, +}; + +enum wlr_positioner_v6_constraint_adjustment { + WLR_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE = 0, + WLR_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X = 1, + WLR_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y = 2, + WLR_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X = 4, + WLR_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y = 8, + WLR_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X = 16, + WLR_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y = 32, +}; + +struct wlr_xdg_positioner_v6_attributes { + struct wlr_box anchor_rect; + enum wlr_positioner_v6_anchor anchor; + enum wlr_positioner_v6_gravity gravity; + enum wlr_positioner_v6_constraint_adjustment constraint_adjustment; + + struct { + int32_t width, height; + } size; + + struct { + int32_t x, y; + } offset; +}; + struct wlr_xdg_popup_v6 { struct wlr_xdg_surface_v6 *base; struct wl_list link; @@ -45,6 +116,8 @@ struct wlr_xdg_popup_v6 { // geometry of the parent surface struct wlr_box geometry; + struct wlr_xdg_positioner_v6_attributes positioner; + struct wl_list grab_link; // wlr_xdg_popup_grab_v6::popups }; @@ -229,4 +302,19 @@ struct wlr_xdg_surface_v6 *wlr_xdg_surface_v6_popup_at( struct wlr_xdg_surface_v6 *surface, double sx, double sy, double *popup_sx, double *popup_sy); +struct wlr_box wlr_xdg_positioner_v6_get_geometry( + struct wlr_xdg_positioner_v6_attributes *positioner); + +/** + * Get the anchor point for this popup in the root parent's coordinate system. + */ +void wlr_xdg_popup_v6_get_anchor_point(struct wlr_xdg_popup_v6 *popup, + int *root_sx, int *root_sy); + +void wlr_positioner_v6_invert_x( + struct wlr_xdg_positioner_v6_attributes *positioner); + +void wlr_positioner_v6_invert_y( + struct wlr_xdg_positioner_v6_attributes *positioner); + #endif |