|
| 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