Class Proxy<I>
- Type Parameters:
I
- Implementation type that will act as the listener for received events.
- All Implemented Interfaces:
WaylandObject
- Direct Known Subclasses:
Display
,WlBufferProxy
,WlCallbackProxy
,WlCompositorProxy
,WlDataDeviceManagerProxy
,WlDataDeviceProxy
,WlDataOfferProxy
,WlDataSourceProxy
,WlKeyboardProxy
,WlOutputProxy
,WlPointerProxy
,WlRegionProxy
,WlRegistryProxy
,WlSeatProxy
,WlShellProxy
,WlShellSurfaceProxy
,WlShmPoolProxy
,WlShmProxy
,WlSubcompositorProxy
,WlSubsurfaceProxy
,WlSurfaceProxy
,WlTouchProxy
,WpPresentationFeedbackProxy
,WpPresentationProxy
,WpViewporterProxy
,WpViewportProxy
,XdgPopupProxy
,XdgPositionerProxy
,XdgSurfaceProxy
,XdgToplevelProxy
,XdgWmBaseProxy
,ZwpLinuxBufferParamsV1Proxy
,ZwpLinuxDmabufFeedbackV1Proxy
,ZwpLinuxDmabufV1Proxy
,ZwpTabletManagerV2Proxy
,ZwpTabletPadGroupV2Proxy
,ZwpTabletPadRingV2Proxy
,ZwpTabletPadStripV2Proxy
,ZwpTabletPadV2Proxy
,ZwpTabletSeatV2Proxy
,ZwpTabletToolV2Proxy
,ZwpTabletV2Proxy
A Proxy
acts as a client side proxy to an object existing in the
compositor. The proxy is responsible for converting requests made by the
clients with marshal(int)
into Wayland's wire format. Events
coming from the compositor are also handled by the proxy, which will in
turn call the implementation.
With the exception of function setQueue(EventQueue)
, functions
accessing a Proxy
are not normally used by client code. Clients
should normally use the higher level interface generated by the scanner to
interact with compositor objects.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Proxy
(MemorySegment pointer) protected
Proxy
(MemorySegment pointer, I implementation, int version) -
Method Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Destroy a proxy objectboolean
int
getId()
Get the id of a proxy objectGet a proxy's listenerint
int
hashCode()
protected void
marshal
(int opcode) protected void
Prepare a request to be sent to the compositorprotected <J,
T extends Proxy<J>>
TmarshalConstructor
(int opcode, J implementation, int version, Class<T> newProxyCls, Arguments args) Prepare a request to be sent to the compositorvoid
setQueue
(EventQueue queue) Assign a proxy to an event queue
-
Field Details
-
pointer
-
-
Constructor Details
-
Proxy
-
Proxy
- Parameters:
pointer
-implementation
- The listener to be added to proxyversion
-
-
-
Method Details
-
marshal
Prepare a request to be sent to the compositorThis function is similar to
marshalConstructor(int, Object, int, Class, Arguments)
, except it doesn't create proxies for new-id arguments.This should not normally be used by non-generated code.
- Parameters:
opcode
- Opcode of the request to be sentargs
- Extra arguments for the given request
-
marshal
protected void marshal(int opcode) - Parameters:
opcode
- Opcode of the request to be sent see {link #marshal(int, Arguments)}
-
marshalConstructor
protected <J,T extends Proxy<J>> T marshalConstructor(int opcode, J implementation, int version, Class<T> newProxyCls, Arguments args) Prepare a request to be sent to the compositorTranslates the request given by opcode and the extra arguments into the wire format and write it to the connection buffer.
For new-id arguments, this function will allocate a new
Proxy
and send the ID to the server. The newProxy
will be returned on success or NULL on errror with errno set accordingly.This is intended to be used by language bindings and not in non-generated code.
- Type Parameters:
J
- implementation TypeT
- proxy Type- Parameters:
opcode
- Opcode of the request to be sentimplementation
- The listener to use for the new proxyversion
- The runtime version of the new proxynewProxyCls
- The type to use for the new proxyargs
- Extra arguments for the given request- Returns:
- a new proxy
-
getImplementation
Get a proxy's listenerGets the proxy's listener; which is the implementation set when this proxy was constructed.
This function is useful in client with multiple listeners on the same interface to allow the identification of which code to execute.
- Specified by:
getImplementation
in interfaceWaylandObject
- Returns:
- The proxy's listener or NULL if no listener is set
-
getId
public int getId()Get the id of a proxy object- Specified by:
getId
in interfaceWaylandObject
- Returns:
- The id the object associated with the proxy
-
getVersion
public int getVersion()- Specified by:
getVersion
in interfaceWaylandObject
-
setQueue
Assign a proxy to an event queueAssign proxy to event queue. Events coming from
proxy
will be queued inqueue
instead of the display's main queue.- Parameters:
queue
- The event queue that will handle this proxy- See Also:
-
hashCode
-
equals
-
destroy
public void destroy()Destroy a proxy object -
getPointer
- Specified by:
getPointer
in interfaceWaylandObject
-