当前位置: 首页>>代码示例>>Java>>正文


Java Pointer.from方法代码示例

本文整理汇总了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);
}
 
开发者ID:udevbe,项目名称:wayland-java-bindings,代码行数:20,代码来源:Global.java

示例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);
}
 
开发者ID:udevbe,项目名称:wayland-java-bindings,代码行数:25,代码来源:Resource.java

示例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);
    }
}
 
开发者ID:udevbe,项目名称:wayland-java-bindings,代码行数:26,代码来源:Proxy.java

示例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));
}
 
开发者ID:udevbe,项目名称:wayland-java-bindings,代码行数:13,代码来源:EventLoop.java

示例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));
}
 
开发者ID:udevbe,项目名称:wayland-java-bindings,代码行数:9,代码来源:EventLoop.java

示例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));
}
 
开发者ID:udevbe,项目名称:wayland-java-bindings,代码行数:11,代码来源:EventLoop.java

示例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));
}
 
开发者ID:udevbe,项目名称:wayland-java-bindings,代码行数:10,代码来源:EventLoop.java


注:本文中的org.freedesktop.jaccall.Pointer.from方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。