Skip to content

Commit

Permalink
Fixing several issues that make the projects unusable.
Browse files Browse the repository at this point in the history
* Fixing XAuthority when parsing number
* switched back to junixsocket as jdk does not support sockets only SocketChannel
* Fixing usage of io.freefair.lombok in protocol projects. The module-path was not being set on the delombok task
* fixing delombok by removing lombok from projects using junixsocket. Delombok does not support mutli-release jar files.
* Switched back to junixsocket
  • Loading branch information
moaxcp committed Jul 31, 2024
1 parent 16872ee commit 14817b2
Show file tree
Hide file tree
Showing 65 changed files with 828 additions and 381 deletions.
13 changes: 0 additions & 13 deletions .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 2 additions & 6 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/modules/examples/x11.examples.main.iml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules/x11-client/x11.x11-client.main.iml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules/x11-client/x11.x11-client.test.iml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules/x11-keysym/x11.x11-keysym.main.iml

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/modules/x11-toolkit/x11.x11-toolkit.main.iml

This file was deleted.

8 changes: 0 additions & 8 deletions .idea/modules/xephyr-runner/x11.xephyr-runner.main.iml

This file was deleted.

12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ The x11-client library can be added to your project using maven or gradle.
<dependency>
<groupId>com.github.moaxcp.x11</groupId>
<artifactId>x11-client</artifactId>
<version>0.18.1</version>
<version>0.18.2</version>
<type>module</type>
</dependency>
```

## Gradle

```
implementation 'com.github.moaxcp.x11:x11-client:0.18.1'
implementation 'com.github.moaxcp.x11:x11-client:0.18.2'
```

# Usage
Expand Down Expand Up @@ -435,6 +435,14 @@ https://www.x.org/releases/X11R7.6/doc/libXtst/recordlib.html

# versions

## 0.18.2

* Fixing XAuthority when parsing number
* switched back to junixsocket as jdk does not support sockets only SocketChannel
* Fixing usage of io.freefair.lombok in protocol projects. The module-path was not being set on the delombok task
* fixing delombok by removing lombok from projects using junixsocket. Delombok does not support mutli-release jar files.
* Switched back to junixsocket

## 0.18.1

* fixing delombok task so javadoc works again and the project can be published to maven central
Expand Down
7 changes: 1 addition & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

allprojects {
version = '0.18.1'
version = '0.18.2'
group = 'com.github.moaxcp.x11'
repositories {
mavenCentral()
Expand All @@ -18,7 +18,6 @@ allprojects {

subprojects {
apply plugin: 'java-library'
apply plugin: 'io.freefair.lombok'

java {
sourceCompatibility = JavaVersion.VERSION_21
Expand All @@ -27,10 +26,6 @@ subprojects {
withJavadocJar()
}

delombok {
modulePath = classpath
}

dependencies {

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

import com.github.moaxcp.x11.keysym.KeySym;
import com.github.moaxcp.x11.x11client.X11Client;
import lombok.extern.java.Log;

import java.io.IOException;
import java.util.List;
import java.util.logging.Logger;

@Log
public class KeySymMain {

private static final Logger log = Logger.getLogger(KeySymMain.class.getName());

public static void main(String... args) throws IOException {
try(X11Client client = X11Client.connect()) {
try (X11Client client = X11Client.connect()) {
List<Byte> keyCodes = client.keySymToKeyCodes(KeySym.XK_Escape);
for(byte keyCode : keyCodes) {
for (byte keyCode : keyCodes) {
KeySym keySym = client.keyCodeToKeySym(keyCode, (short) 0);
log.info(keySym.toString());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

import com.github.moaxcp.x11.protocol.record.QueryVersionReply;
import com.github.moaxcp.x11.x11client.X11Client;
import lombok.extern.java.Log;

import java.io.IOException;
import java.util.logging.Logger;

@Log
public class QueryVersion {

private static final Logger log = Logger.getLogger(QueryVersion.class.getName());

public static void main(String... args) throws IOException {
try (X11Client client = X11Client.connect()) {
com.github.moaxcp.x11.protocol.record.QueryVersion queryVersion = com.github.moaxcp.x11.protocol.record.QueryVersion.builder().majorVersion((short) 1).minorVersion((short) 13).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@
import com.github.moaxcp.x11.protocol.xproto.KeyPressEvent;
import com.github.moaxcp.x11.protocol.xproto.MotionNotifyEvent;
import com.github.moaxcp.x11.x11client.X11Client;
import lombok.extern.java.Log;

import java.io.IOException;
import java.util.Collections;
import java.util.logging.Logger;

import static com.github.moaxcp.x11.protocol.Utilities.toX11Input;

@Log
public class Record {
private static final Logger log = Logger.getLogger(Record.class.getName());

/**
* Tests with only standard device events and directly parses the data
*
* @throws IOException
*/
public static void main(String... args) throws IOException {
Expand Down Expand Up @@ -60,7 +62,7 @@ public static void main(String... args) throws IOException {

log.info(String.format("enableContextReply: %s", enableContextReply));

while(true) {
while (true) {
EnableContextReply reply = data.getNextReply(enableContext.getReplyFunction());
log.info(String.format("Next reply: %s", reply));
XEvent replyData = data.readEvent(toX11Input(reply.getData()));
Expand All @@ -69,7 +71,7 @@ public static void main(String... args) throws IOException {
if (replyData instanceof KeyPressEvent) {
KeyPressEvent e = (KeyPressEvent) replyData;
KeySym keysym = data.keyCodeToKeySym(e);
if(keysym == KeySym.XK_Escape) {
if (keysym == KeySym.XK_Escape) {
break;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@
import com.github.moaxcp.x11.x11client.X11Client;
import com.github.moaxcp.x11.x11client.api.record.RecordData;
import com.github.moaxcp.x11.x11client.api.record.RecordReply;
import lombok.extern.java.Log;

import java.io.IOException;
import java.util.Collections;
import java.util.Optional;
import java.util.logging.Logger;

@Log
public class RecordApi {

private static final Logger log = Logger.getLogger(RecordApi.class.getName());

/**
* Tests all xproto events including generic events. Also tests errors.
*
* @throws IOException
*/
public static void main(String... args) throws IOException {
Expand Down Expand Up @@ -65,7 +67,7 @@ public static void main(String... args) throws IOException {
.context(rc)
.build();
data.send(enableContext);
while(true) {
while (true) {
RecordReply recordReply = data.record().readNextRecord();
log.info(String.format("%s", recordReply));
Optional<KeySym> first = recordReply.getData().stream()
Expand Down
Loading

0 comments on commit 14817b2

Please sign in to comment.