本文整理汇总了Java中org.freedesktop.jaccall.Pointer.from方法的典型用法代码示例。如果您正苦于以下问题:Java Pointer.from方法的具体用法?Java Pointer.from怎么用?Java Pointer.from使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.freedesktop.jaccall.Pointer
的用法示例。
在下文中一共展示了Pointer.from方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Global
import org.freedesktop.jaccall.Pointer; //导入方法依赖的package包/类
protected Global(final Display display,
final Class<R> resourceClass,
final int version) {
if (version <= 0) {
throw new IllegalArgumentException("Version must be bigger than 0");
}
this.jObjectPointer = Pointer.from(this);
this.pointer = WaylandServerCore.INSTANCE()
.wl_global_create(display.pointer,
InterfaceMeta.get(resourceClass)
.getNative().address,
version,
this.jObjectPointer.address,
FUNC_T_POINTER.address);
ObjectCache.store(this.pointer,
this);
}
示例2: Resource
import org.freedesktop.jaccall.Pointer; //导入方法依赖的package包/类
protected Resource(final Client client,
final int version,
final int id,
final I implementation) {
this.implementation = implementation;
final long resourcePointer = WaylandServerCore.INSTANCE()
.wl_resource_create(client.pointer,
InterfaceMeta.get(getClass())
.getNative().address,
version,
id);
this.pointer = resourcePointer;
ObjectCache.store(this.pointer,
this);
this.jObjectPointer = Pointer.from(this);
WaylandServerCore.INSTANCE()
.wl_resource_set_dispatcher(resourcePointer,
Dispatcher.INSTANCE.address,
this.jObjectPointer.address,
0L,
RESOURCE_DESTROY_FUNC.address);
}
示例3: Proxy
import org.freedesktop.jaccall.Pointer; //导入方法依赖的package包/类
/**
* @param pointer
* @param implementation The listener to be added to proxy
* @param version
*/
protected Proxy(final Long pointer,
final I implementation,
final int version) {
this.pointer = pointer;
this.implementation = implementation;
this.version = version;
ObjectCache.store(this.pointer,
this);
this.jObjectPointer = Pointer.from(this);
//Special casing implementation. For some proxies the underlying native library provides its own implementation.
//We pass in a null implementation in those cases. (Eg Display proxy).
if (implementation != null) {
WaylandClientCore.INSTANCE()
.wl_proxy_add_dispatcher(this.pointer,
Dispatcher.INSTANCE.address,
jObjectPointer.address,
0L);
}
}
示例4: addFileDescriptor
import org.freedesktop.jaccall.Pointer; //导入方法依赖的package包/类
public EventSource addFileDescriptor(final int fd,
final int mask,
final FileDescriptorEventHandler handler) {
final Pointer<Object> jObjectPointer = Pointer.from(handler);
return EventSource.create(jObjectPointer,
WaylandServerCore.INSTANCE()
.wl_event_loop_add_fd(this.pointer,
fd,
mask,
WL_EVENT_LOOP_FD_FUNC.address,
jObjectPointer.address));
}
示例5: addTimer
import org.freedesktop.jaccall.Pointer; //导入方法依赖的package包/类
public EventSource addTimer(final TimerEventHandler handler) {
final Pointer<Object> jObjectPointer = Pointer.from(handler);
return EventSource.create(jObjectPointer,
WaylandServerCore.INSTANCE()
.wl_event_loop_add_timer(this.pointer,
WL_EVENT_LOOP_TIMER_FUNC.address,
jObjectPointer.address));
}
示例6: addSignal
import org.freedesktop.jaccall.Pointer; //导入方法依赖的package包/类
public EventSource addSignal(final int signalNumber,
final SignalEventHandler handler) {
final Pointer<Object> jObjectPointer = Pointer.from(handler);
return EventSource.create(jObjectPointer,
WaylandServerCore.INSTANCE()
.wl_event_loop_add_signal(this.pointer,
signalNumber,
WL_EVENT_LOOP_SIGNAL_FUNC.address,
jObjectPointer.address));
}
示例7: addIdle
import org.freedesktop.jaccall.Pointer; //导入方法依赖的package包/类
public EventSource addIdle(final IdleHandler handler) {
final Pointer<Object> jObjectPointer = Pointer.from(handler);
return EventSource.create(jObjectPointer,
WaylandServerCore.INSTANCE()
.wl_event_loop_add_idle(this.pointer,
WL_EVENT_LOOP_IDLE_FUNC.address,
jObjectPointer.address));
}