-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Finish tinywl. #5
Draft
jsoo1
wants to merge
109
commits into
swaywm:master
Choose a base branch
from
jsoo1:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
109 commits
Select commit
Hold shift + click to select a range
6d6e75f
Adding role to xdg_shell_surface
LambdaCalrissian 87af175
Adding surface events
LambdaCalrissian e11ecb5
Work in progress filling out TinyWL
LambdaCalrissian 1d16d8f
wlroots: Refer to implicit t in xdg_shell.surface sig.
jsoo1 f726517
Remove CTypes from tinywl.
jsoo1 1925924
Add keyboard_state field to Seat.
jsoo1 0d8e5d4
Rename Xdg_shell.Surface -> Xdg_shell.Xdg_surface.
jsoo1 c9a39be
Add surface field to Xdg_surface.
jsoo1 01d3222
Seat: Return option for focused_surface.
jsoo1 0770122
xdg_surface: Add from_surface.
jsoo1 aa7c61b
xdg_surface: Move into separate directory.
jsoo1 3ac5ce5
wlr_xdg_toplevel: Add wlr_xdg_toplevel_set_activated.
jsoo1 b2bdb00
[WIP] tinywl: Set previous surface to deactivated on xdg_surface.mapped.
jsoo1 a5f7978
Fixed type of modifiers field
LambdaCalrissian ddb0f28
Expose the Keyboard_modifiers module.
LambdaCalrissian b72fc83
Add the Keycodes type and module.
LambdaCalrissian ed6953d
Format Wlroots modules on new lines for better commits.
LambdaCalrissian eff3a34
Add Keycodes, Num_keycodes, and Modifier fields to Keyboard.
LambdaCalrissian f228aa0
Add keyboard_notify_enter.
jsoo1 97752b3
tinywl: Finish focus_view.
LambdaCalrissian 5e1e2dc
Add keyboard, modifiers struct and keyboard, modifiers fields.
jsoo1 321482c
[WIP] tinywl: Notify keyboard enter in focus_view.
jsoo1 51e4770
Add mapped property to view.
LambdaCalrissian 7063ea6
Make view a ref.
LambdaCalrissian 0477c1a
Add unmap callback.
LambdaCalrissian 2a17b40
xdg_toplevel: Creates types, interfaces, and events
LambdaCalrissian 1a4089a
view:mutability Change from a ref to mutable on mapped.
LambdaCalrissian 9f49b2e
tinywl: Stub out begin interactive.
LambdaCalrissian b8194af
tinywl:new_xdg_surface Comment about making mapped true.
LambdaCalrissian b4503e1
tinywl: Begin implementation of server_new_keyboard.
jsoo1 883195b
tinywl: Set repeat info in server_new_keyboard.
jsoo1 7a5efa2
keyboard: Add modifiers event, create Events module.
jsoo1 5c8627a
tinywl: Stub keyboard handlers.
jsoo1 046fa8f
seat: Add set_keyboard and seat_keyboard_notify_modifiers.
jsoo1 f507fba
tinwyl: Add keyboard_handle_modifiers.
jsoo1 0c8865c
keyboard: Add get_modifiers.
jsoo1 d63becb
types: Add wlr_keyboard_modifier.
jsoo1 b6e41ad
keyboard_modifiers: Add has_alt.
jsoo1 492a38e
[WIP] tinywl: Stub handle_keybinding
jsoo1 f812bdc
tinywl:server_new_sdg_surface Remove unneeded reference comment.
LambdaCalrissian 16dde28
cursor: Add x & y fields
LambdaCalrissian 9fd4ed0
[WIP] tinywl: process_cursor_motion
LambdaCalrissian 9d30693
tinywl: Only do new_xdg_surface handling if TopLevel.
jsoo1 4d7409b
seat: Add keyboard_notify_key.
jsoo1 84e4812
Fill in handle_keybinding
jsoo1 6a50824
keyboard_modifiers: Fix has_alt coercions.
jsoo1 9bb93e0
cursor_move: Added ffi and functions.
LambdaCalrissian dda4e27
edges: Add module
LambdaCalrissian cbeb048
ffi: Add wlr_xdg_surface_get_geometry.
jsoo1 7420b87
ffi: Add wlr_xdg_toplevel_set_size.
jsoo1 26e8854
tinywl: Change Tinywl.box to Box.t.
jsoo1 3d338fc
tinywl: process_cursor_resize Added edge processing.
LambdaCalrissian 0309baf
ffi: Add wlr_xdg_surface_surface_at
LambdaCalrissian 05ad4a1
ffi: Add wlr_xcursor_manager_set_cursor_image
LambdaCalrissian 0b2a5f1
ffi:seat Add wlr_seat_notify_pointer_enter
LambdaCalrissian 23b8b9a
ffi:seat Add wlr_seat_pointer_clear_focus
LambdaCalrissian e0d9302
types:pointer_state Add focused_surface
LambdaCalrissian c8b571e
ffi:seat Add wlr_seat_pointer_notify_motion
LambdaCalrissian 0349b37
tinywl: Finish server_cursor_motion
LambdaCalrissian 757d53d
ffi: Add wlr_cursor_warp_absolute.
jsoo1 0611f49
types: Add device field to Event_pointer_motion_absolute.
jsoo1 d2d3a16
types: Add x and y fields to wlr_event_pointer_motion_absolute.
jsoo1 1ea917b
lib/event_pointer_motion_absolute: Move module out of Pointer.
jsoo1 224e614
event_pointer_motion_absolute: Add time_msec field.
jsoo1 8d07b27
tinywl: Finish server_cursor_motion_absolute.
jsoo1 88cf008
wlroots: Move Event_pointer_button to separate module.
jsoo1 17ebc7a
event_pointer_button: Add time_msec field.
jsoo1 69d547c
event_pointer_button: Add button field.
jsoo1 60301e1
types: Add Button_state.
jsoo1 80ccc9b
event_pointer_button: Add state field.
jsoo1 57e3ffa
ffi: Add wlr_seat_pointer_notify_button.
jsoo1 01cc9ba
tinywl: Finish server_cursor_button.
jsoo1 4b0c834
types: Add wlr_axis_source enum.
jsoo1 2d7deac
types: Add wlr_axis_orientation enum.
jsoo1 fefa49b
event_pointer_axis: Move Event_pointer_axis module to separate file.
jsoo1 d706005
types: Add field orientation of wlr_event_pointer_axis.
jsoo1 1dc5bb1
types: Add delta field of wlr_event_pointer_axis.
jsoo1 fc34992
types: Add delta_discrete field of wlr_event_pointer_axis.
jsoo1 743196f
types: Add source field of wlr_event_pointer_axis.
jsoo1 71d4e5a
ffi: Add wlr_seat_pointer_notify_axis.
jsoo1 d09affe
types: Add field time_msec of wlr_event_pointer_axis.
jsoo1 3010ad2
tinywl: Finish server_cursor_axis.
jsoo1 ad2500e
ffi: Add wlr_seat_pointer_notify_frame.
jsoo1 248451c
tinywl: Finish server_cursor_frame.
jsoo1 704faac
tiny: Make view.mapped = true when xdg_surface mapped event happens.
jsoo1 b95bc3c
tinywl: Create more descriptive failwiths.
jsoo1 8e3a5f0
ffi: Add wlr_output_effective_resolution.
jsoo1 a565a8f
types: Add wlr_surface_iterator_func_t.
jsoo1 0b8b28b
ffi: Add wlr_xdg_surface_for_each_surface.
jsoo1 880999f
ffi: Add wlr_surface_get_texture.
jsoo1 4b8dbf5
ffi: Add wlr_output_layout_output_coords.
jsoo1 c36922b
types: Add wlr_output.scale.
jsoo1 38a0a81
types: Define enum for wl_output_transform.
jsoo1 7504fe9
ffi: Add wlr_output_transform_invert.
jsoo1 03bd566
ffi: Add wlr_renderer_render_texture_with_matrix.
jsoo1 d8971b8
ffi: Add wlr_output_render_software_cursors.
jsoo1 41ea0e4
tinywl: Finish output_frame.
jsoo1 c0a8c27
utils: Add bitwise_enum32.
jsoo1 57bcbf9
types: Swaps Edges.t from enum to bitwise_enum32
jsoo1 55bcc65
types: Add xdg_toplevel_move_event and xdg_toplevel_resize_event.
jsoo1 935fb94
tinywl: Finish begin_interactive.
jsoo1 19f7318
tinywl: Swap out discard for ignore.
jsoo1 a27d884
tinywl: Use Module.(expr) to cleanup module noise.
jsoo1 586c96b
tinywl: Use single branched i.t.e. where applicable.
jsoo1 37f84cd
ffi: Add pixman_region32_t.
jsoo1 fd22f9c
ffi: Remove wl_output_transform.
jsoo1 a8dee0b
lib: Move Keyboard_modifiers to submodule of Keyboard.
jsoo1 a0568b0
common: Add Bitwise functor for bitwise enums.
jsoo1 a5a92a0
[WIP] bitwise_enums: Use Bitwise.Enum modules instead of functions
jsoo1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
open Ctypes | ||
|
||
module type Size = sig | ||
type t | ||
val zero : t | ||
val logor : t -> t -> t | ||
val logand : t -> t -> t | ||
end | ||
|
||
module type Elems = sig | ||
type t | ||
module Size : Size | ||
val size : Size.t typ | ||
val desc : (t * Size.t) list | ||
end | ||
|
||
module type Enum = sig | ||
type elem | ||
type t | ||
val t : t | ||
end | ||
|
||
module Make (E : Elems) : Enum = struct | ||
type elem = E.t | ||
type t = E.t list typ | ||
let t : t = | ||
let read i = | ||
List.filter_map (fun (x, cst) -> | ||
if (E.Size.logand i cst) <> E.Size.zero then | ||
Some x | ||
else None | ||
) E.desc | ||
in | ||
let write items = | ||
List.fold_left (fun i item -> | ||
E.Size.logor (List.assoc item E.desc) i | ||
) E.Size.zero items | ||
in | ||
view ~read ~write E.size | ||
end |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
open Ctypes | ||
module Types = Wlroots_ffi_f.Ffi.Types | ||
|
||
type t = None | Top | Bottom | Left | Right | ||
module Size = Unsigned.UInt32 | ||
let size = uint32_t | ||
open Types.Edges | ||
let desc = [ | ||
None, _WLR_EDGE_NONE; | ||
Top, _WLR_EDGE_TOP; | ||
Bottom, _WLR_EDGE_BOTTOM; | ||
Right, _WLR_EDGE_RIGHT; | ||
Left, _WLR_EDGE_LEFT; | ||
] |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
open Ctypes | ||
open Wlroots_common.Utils | ||
|
||
module Bindings = Wlroots_ffi_f.Ffi.Make (Generated_ffi) | ||
module Types = Wlroots_ffi_f.Ffi.Types | ||
|
||
type t = Types.Event_pointer_axis.t ptr | ||
let t = ptr Types.Event_pointer_axis.t | ||
include Ptr | ||
|
||
let time_msec = getfield Types.Event_pointer_axis.time_msec | ||
let orientation = getfield Types.Event_pointer_axis.orientation | ||
let delta = getfield Types.Event_pointer_axis.delta | ||
let delta_discrete = getfield Types.Event_pointer_axis.delta_discrete | ||
let source = getfield Types.Event_pointer_axis.source |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
open Ctypes | ||
open Wlroots_common.Utils | ||
|
||
module Bindings = Wlroots_ffi_f.Ffi.Make (Generated_ffi) | ||
module Types = Wlroots_ffi_f.Ffi.Types | ||
|
||
type t = Types.Event_pointer_button.t ptr | ||
let t = ptr Types.Event_pointer_button.t | ||
include Ptr | ||
|
||
let time_msec = getfield Types.Event_pointer_button.time_msec | ||
let button = getfield Types.Event_pointer_button.button | ||
let state = getfield Types.Event_pointer_button.state |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why move these to external modules? The naming convention I was trying to follow (and that also appears with Keyboard.Event_key for example) is that if there's a wlr_foo.h, then
wlr_event_foo_bar
gets mapped toFoo.Event_bar
.Did that naming scheme not work here? Otherwise I'd prefer to stick to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we did this because we were struggling to learn the module system. We can definitely use a different convention.
I was kind of hoping to move events to submodules as a convention, like
Pointer.Event.motion
for instance.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in any case each event type needs to have its own module (so it can include its compare/hash function for example), so it would have to be
Pointer.Event.Motion.t
.I think having an
Event
submodule would be useful if we had functions that worked on all events, so that we could put them there (Pointer.Event.foo
). However I IIRC don't think we have such functions currently, so for now I would just stick with thePointer.Event_foo
naming scheme.