Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Commit

Permalink
Add settings app
Browse files Browse the repository at this point in the history
  • Loading branch information
valpackett committed Jan 13, 2019
1 parent 5563d6f commit 0ed3c53
Show file tree
Hide file tree
Showing 13 changed files with 947 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,2 +1,4 @@
build/
subprojects/packagecache
subprojects/*-*
*.core
9 changes: 8 additions & 1 deletion meson.build
Expand Up @@ -13,24 +13,31 @@ gtk = dependency('gtk+-wayland-3.0', version: '>=3.22.0')
gtkmm = dependency('gtkmm-3.0', version: '>=3.22.0')
cairomm = dependency('cairomm-1.0')
wayland_client = dependency('wayland-client')
flatbuffers = dependency('Flatbuffers', method: 'cmake', modules: ['flatbuffers::flatbuffers_shared'])
fmtlib = subproject('fmt').get_variable('fmt_dep')

gnome = import('gnome')
i18n = import('i18n')

conf_data = configuration_data()
conf_data.set_quoted('N9_LIBEXEC_DIR', get_option('prefix') / get_option('libexecdir'))
conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
configure_file(output: 'n9config.h', configuration: conf_data)
conf_dir = include_directories('.')

subdir('protocols')
subdir('schemas')
subdir('dbus')

subdir('supervisor')
subdir('gtk-lsh')
subdir('wallpaper')
subdir('panel')
subdir('launcher')
subdir('notification-daemon')
subdir('settings')

all_srcs = [ lsh_srcs, supervisor_srcs_all, wallpaper_srcs, panel_srcs, launcher_srcs, nd_srcs ]
all_srcs = [ lsh_srcs, supervisor_srcs_all, wallpaper_srcs, panel_srcs, launcher_srcs, nd_srcs, settings_app_srcs ]
all_hdrs = [ lsh_hdrs, supervisor_hdrs, wallpaper_hdrs, panel_hdrs, launcher_hdrs ]

prog_clang_format = find_program('clang-format80', 'clang-format70', 'clang-format60', 'clang-format', required: false)
Expand Down
3 changes: 3 additions & 0 deletions protocols/meson.build
Expand Up @@ -14,6 +14,9 @@ wl_client_header = generator(prog_scanner,
capabilities_code = wl_code.process('wldip-capabilities.xml')
capabilities_client_header = wl_client_header.process('wldip-capabilities.xml')

compositor_management_code = wl_code.process('wldip-compositor-manager.xml')
compositor_management_client_header = wl_client_header.process('wldip-compositor-manager.xml')

layer_shell_code = wl_code.process('wlr-layer-shell-unstable-v1.xml')
layer_shell_client_header = wl_client_header.process('wlr-layer-shell-unstable-v1.xml')

Expand Down
57 changes: 57 additions & 0 deletions protocols/wldip-compositor-manager.xml
@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<protocol name="wldip_compositor_manager">

<interface name="wldip_compositor_manager" version="1">
<description summary="privileged protocol for managing Weston compositor internals">
This protocol allows external privileged applications to get dumps of the important bits
of the compositor state (as file descriptors to flatbuffer serializations), both
on demand and as notifications for events,
and to tell the compositor to change some bits of the state.
</description>

<enum name="topic" bitfield="true">
<entry name="surfaces" value="1" summary="notify on surface events"/>
<entry name="outputs" value="2" summary="notify on output and head events"/>
<entry name="inputdevs" value="4" summary="notify on input device and seat events"/>
</enum>

<request name="subscribe">
<description summary="subscribe to updates">
Requests the compositor to send update events when there's any event that
corresponds to one of the topics selected via the topics bitfield.

There is no way to unsubscribe currently, as the intended users of the protocol
are simple daemons that synchronize the state a settings store like dconf,
panels that always need to know current surfaces, etc.
</description>
<arg name="topics" type="uint" enum="topic"/>
</request>

<request name="get">
<description summary="request one update">
Requests one update event from the compositor.
</description>
</request>

<event name="update">
<arg name="state" type="fd" summary="descriptor to a wlst format file"/>
</event>

<request name="desktop_surface_activate">
<arg name="surface_uid" type="uint" summary="uid of surface"/>
</request>

<request name="output_set_scale">
<arg name="output_id" type="uint" summary="id of the output"/>
<arg name="scale" type="fixed" summary="desired scale"/>
</request>

<request name="device_set_natural_scrolling">
<arg name="seat_idx" type="uint" summary="index of the seat"/>
<arg name="device_idx" type="uint" summary="index of the input device"/>
<arg name="enable" type="uint" summary="desired state of natural scrolling (bool)"/>
</request>

</interface>

</protocol>
176 changes: 176 additions & 0 deletions schemas/Management.fbs
@@ -0,0 +1,176 @@
namespace wldip.compositor_management;

file_extension "wlst";
file_identifier "WLST";

table DesktopSurface {
title: string;
app_id: string;
pid: uint64;
activated: bool;
maximized: bool;
fullscreen: bool;
resizing: bool;
max_width: int32;
max_height: int32;
min_width: int32;
min_height: int32;
}

enum Role : ubyte {
Other,
XdgToplevel,
Lsh,
}

table Surface {
uid: uint64;
role: Role;
other_role: string;
label: string;
width: int32;
height: int32;
desktop: DesktopSurface; // present when role == XdgToplevel
primary_output_id: int32;
}

// We expose more details than wl_output: internal connection, head vs output..

table Head {
name: string;
output_id: int32;
mm_width: int32;
mm_height: int32;
make: string;
model: string;
serial_number: string;
subpixel: uint32; // TODO Enum?
connection_internal: bool;
connected: bool;
non_desktop: bool;
}

table Output {
id: uint32;
name: string;
x: int32;
y: int32;
width: int32;
height: int32;
current_scale: float = 1;
original_scale: float = 1;
}

enum DeviceCapability : ubyte {
Keyboard = 0,
Pointer = 1,
Touch = 2,
TabletTool = 3,
TabletPad = 4,
Gesture = 5,
Switch = 6,
}

enum TapButtonMap : uint32 {
LeftRightMiddle = 0,
LeftMiddleRight = 1,
}

enum SendEventsMode : uint32 {
Enabled = 0,
Disabled = 1,
DisabledOnExternalMouse = 2,
}

enum AccelerationProfile : uint32 {
None = 0,
Flat = 1,
Adaptive = 2,
}

enum ClickMethod : uint32 {
None = 0,
ButtonAreas = 1,
ClickFinger = 2,
}

enum ScrollMethod : uint32 {
None = 0,
TwoFingers = 1,
Edge = 2,
OnButtonDown = 4,
}

table InputDevice {
product_id: uint32;
vendor_id: uint32;
mm_width: double;
mm_height: double;
touch_count: int32;
tap_finger_count: int32;
tap_click_default: bool;
tap_click: bool;
tap_click_button_map: TapButtonMap;
tap_click_button_map_default: TapButtonMap;
tap_drag_default: bool;
tap_drag: bool;
drag_lock_default: bool;
drag_lock: bool;
send_events_mode_default: SendEventsMode;
send_events_mode: SendEventsMode;
acceleration_speed_default: double;
acceleration_speed: double;
acceleration_profile_default: AccelerationProfile;
acceleration_profile: AccelerationProfile;
natural_scrolling_available: bool;
natural_scrolling_default: bool;
natural_scrolling: bool;
left_handed_mode_available: bool;
left_handed_mode_default: bool;
left_handed_mode: bool;
available_click_methods: [ClickMethod];
click_method_default: ClickMethod;
click_method: ClickMethod;
middle_emulation_available: bool;
middle_emulation_default: bool;
middle_emulation: bool;
available_scroll_methods: [ScrollMethod];
scroll_method_default: ScrollMethod;
scroll_method: ScrollMethod;
scroll_button_default: uint32;
scroll_button: uint32;
disable_while_typing_available: bool;
disable_while_typing_default: bool;
disable_while_typing: bool;
rotation_available: bool;
rotation_degrees_cw_default: uint32;
rotation_degrees_cw: uint32;
capabilites: [DeviceCapability];
name: string;
system_name: string;
}

// table Keymap {
// rules: string;
// model: string;
// layout: string;
// variant: string;
// options: string;
// }

table Seat {
name: string;
// keymap: Keymap;
input_devices: [InputDevice];
}

table CompositorState {
kb_repeat_rate: int32;
kb_repeat_delay: int32;
heads: [Head];
outputs: [Output];
seats: [Seat];
surfaces: [Surface];
}

root_type CompositorState;
6 changes: 6 additions & 0 deletions schemas/meson.build
@@ -0,0 +1,6 @@
prog_flatc = find_program('flatc')
flatc = generator(prog_flatc,
output: '@BASENAME@_generated.h',
arguments: ['--cpp', '-o', '@BUILD_DIR@', '@EXTRA_ARGS@', '@INPUT@'])

compositor_management_fb = flatc.process('Management.fbs')

0 comments on commit 0ed3c53

Please sign in to comment.