Skip to content
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

feature: make next id public to support external implementations #3

Merged
merged 1 commit into from
Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions lib/src/wayland_client.dart
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ class WaylandClient {
}
}

int _getNextId() {
int getNextId() {
var id = _nextId;
_nextId++;
return id;
Expand Down Expand Up @@ -616,7 +616,7 @@ class WaylandDisplay extends WaylandObject {
WaylandDisplay(WaylandClient client) : super(client, 1);

WaylandCallback sync(Function(int) onDone) {
var callback = client._getNextId();
var callback = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(callback);
client.sendRequest(id, 0, payload.data);
Expand All @@ -625,7 +625,7 @@ class WaylandDisplay extends WaylandObject {

WaylandRegistry getRegistry(
{Function(int, String, int)? onGlobal, Function(int)? onGlobalRemove}) {
var registry = client._getNextId();
var registry = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(registry);
client.sendRequest(id, 1, payload.data);
Expand Down Expand Up @@ -667,7 +667,7 @@ class WaylandRegistry extends WaylandObject {
: super(client, id);

int bind(int name, String interface, int version) {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(name);
payload.writeString(interface);
Expand Down Expand Up @@ -729,15 +729,15 @@ class WaylandCompositor extends WaylandObject {

WaylandSurface createSurface(
{Function(WaylandOutput)? onEnter, Function(WaylandOutput)? onLeave}) {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
client.sendRequest(this.id, 0, payload.data);
return WaylandSurface(client, id, onEnter: onEnter, onLeave: onLeave);
}

WaylandRegion createRegion() {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
client.sendRequest(this.id, 1, payload.data);
Expand All @@ -758,7 +758,7 @@ class WaylandShmPool extends WaylandObject {
required int stride,
required WaylandShmFormat format,
Function()? onRelease}) {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
payload.writeInt(offset);
Expand Down Expand Up @@ -793,7 +793,7 @@ class WaylandShm extends WaylandObject {
var shmFile = await File('/dev/shm').open();
var fd = ResourceHandle.fromFile(shmFile);

var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
payload.writeFd(fd);
Expand Down Expand Up @@ -990,7 +990,7 @@ class WaylandDataDeviceManager extends WaylandObject {
Function()? onDndDropPerformed,
Function()? onDndDropFinished,
Function(int)? onAction}) {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
client.sendRequest(this.id, 0, payload.data);
Expand All @@ -1004,7 +1004,7 @@ class WaylandDataDeviceManager extends WaylandObject {
}

WaylandDataDevice getDataDevice(WaylandSeat seat) {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
payload.writeObject(seat);
Expand Down Expand Up @@ -1045,7 +1045,7 @@ class WaylandSurface extends WaylandObject {
}

WaylandCallback frame(Function(int) onDone) {
var callback = client._getNextId();
var callback = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(callback);
client.sendRequest(id, 3, payload.data);
Expand Down Expand Up @@ -1132,7 +1132,7 @@ class WaylandSeat extends WaylandObject {
Function(int serial, WaylandSurface surface)? onLeave,
Function(int time, double x, double y)? onMotion,
Function(int serial, int time, int button, int state)? onButton}) {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
client.sendRequest(this.id, 0, payload.data);
Expand All @@ -1147,7 +1147,7 @@ class WaylandSeat extends WaylandObject {
{Function(int serial, WaylandSurface surface, Uint8List keys)? onEnter,
Function(int serial, WaylandSurface surface)? onLeave,
Function(int serial, int time, int key, int state)? onKey}) {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
client.sendRequest(this.id, 1, payload.data);
Expand All @@ -1156,7 +1156,7 @@ class WaylandSeat extends WaylandObject {
}

WaylandTouch getTouch() {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
client.sendRequest(this.id, 2, payload.data);
Expand Down Expand Up @@ -1455,7 +1455,7 @@ class XdgWmBase extends WaylandObject {
}

XdgPositioner createPositioner() {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
client.sendRequest(this.id, 1, payload.data);
Expand All @@ -1464,7 +1464,7 @@ class XdgWmBase extends WaylandObject {

XdgSurface getXdgSurface(WaylandSurface surface,
{Function(int serial)? onConfigure}) {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
payload.writeObject(surface);
Expand Down Expand Up @@ -1629,7 +1629,7 @@ class XdgSurface extends WaylandObject {
{Function(int, int, List<int>)? onConfigure,
Function()? onClose,
Function(int, int)? onConfigureBounds}) {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
client.sendRequest(this.id, 1, payload.data);
Expand All @@ -1643,7 +1643,7 @@ class XdgSurface extends WaylandObject {
{Function(int, int, int, int)? onConfigure,
Function()? onPopupDone,
Function(int)? onRepositioned}) {
var id = client._getNextId();
var id = client.getNextId();
var payload = WaylandWriteBuffer();
payload.writeUint(id);
payload.writeUint(parent);
Expand Down
Loading