Skip to content

Commit d70325b

Browse files
committed
add XDGActivation
1 parent 8bd57bc commit d70325b

2 files changed

Lines changed: 53 additions & 0 deletions

File tree

‎src/javaforce/linux/wl/WLClient.java‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ public WLObject createObject(WLGlobal global, int new_id) {
172172
//xdg
173173
case "zxdg_output_manager_v1": return new XDGOutputManager(this, new_id);
174174
case "xdg_wm_base": return new XDGWMBase(this, new_id);
175+
case "xdg_activation_v1": return new XDGActivation(this, new_id);
175176
//wlroots
176177
case "zwlr_foreign_toplevel_manager_v1": return new WLRForeignToplevelManager(this, new_id);
177178
case "zwlr_foreign_toplevel_handle_v1": return new WLRForeignToplevelHandle(this, new_id);
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
package javaforce.linux.wl;
2+
3+
import java.lang.reflect.*;
4+
5+
import javaforce.*;
6+
7+
/** xdg_activation_v1 object.
8+
*
9+
* @author pquiring
10+
*/
11+
12+
public class XDGActivation extends WLObject {
13+
@SuppressWarnings("unchecked")
14+
public XDGActivation(WLClient client, int id) {
15+
super(client, id);
16+
Class cls = getClass();
17+
try {
18+
requests = new Method[] {
19+
cls.getMethod("destroy", new Class[] {}),
20+
cls.getMethod("get_activation_token", new Class[] {int.class}),
21+
cls.getMethod("activate", new Class[] {String.class, int.class}),
22+
};
23+
events = new Method[] {
24+
};
25+
} catch (Exception e) {
26+
client.log(e);
27+
}
28+
}
29+
30+
public String get_wl_name() {
31+
return "xdg_activation_v1";
32+
}
33+
34+
//requests
35+
36+
public void destroy() {
37+
if (debug) client.log("XDGActivation.destroy");
38+
invokeRequest(id, 0);
39+
}
40+
41+
public void get_activation_token(int new_id) {
42+
if (debug) client.log("XDGActivation.get_activation_token:new_id=" + new_id);
43+
invokeRequest(id, 1, new_id);
44+
}
45+
46+
public void activate(String token, int wl_surface) {
47+
if (debug) client.log("XDGActivation.activate");
48+
invokeRequest(id, 2, token, wl_surface);
49+
}
50+
51+
//events
52+
}

0 commit comments

Comments
 (0)