-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Break up view creation and placement, add positioning functions
Split view initialization into two steps; we can't initialize the scene tree until we know where the node is going to be initially placed, but the backend code doesn't know how to do that. Also add additional functions that allow a view's size and location to be set.
- Loading branch information
Showing
4 changed files
with
59 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,31 @@ | ||
#include <stdint.h> | ||
#include <wayland-server-core.h> | ||
#include "hrt/hrt_server.h" | ||
|
||
struct hrt_view { | ||
struct wlr_xdg_surface *xdg_surface; | ||
struct wlr_xdg_toplevel *xdg_toplevel; | ||
/* | ||
Contains the tree with the xdg surface tree | ||
plus decorations and that sort of thing. | ||
*/ | ||
struct wlr_scene_tree *scene_tree; | ||
struct wl_listener map; | ||
struct wl_listener unmap; | ||
struct wl_listener destroy; | ||
}; | ||
|
||
/** | ||
* Fully initialize the view and place it in the given scene tree. | ||
**/ | ||
void hrt_view_init(struct hrt_view *view, struct wlr_scene_tree *tree); | ||
|
||
/** | ||
* Request that this view be the given size. Returns the associated configure serial. | ||
**/ | ||
uint32_t hrt_view_set_size(struct hrt_view *view, int width, int height); | ||
|
||
/** | ||
* Sets the view to the given coordinates relative to its parent. | ||
**/ | ||
void hrt_view_set_relative(struct hrt_view *view, int x, int y); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
hrt_source_files += files( | ||
'server.c', | ||
'output.c', | ||
'cursor.c', | ||
'input.c', | ||
'seat.c', | ||
'keyboard.c', | ||
'cursor.c', | ||
'output.c', | ||
'seat.c', | ||
'server.c', | ||
'view.c', | ||
'xdg_shell.c', | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters