
org.freedesktop.wayland.server.Resource Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of stubs Show documentation
Show all versions of stubs Show documentation
Wayland protocol Java-language Binding Stubs
//Copyright 2015 Erik De Rijcke
//
//Licensed under the Apache License,Version2.0(the"License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or agreed to in writing,software
//distributed under the License is distributed on an"AS IS"BASIS,
//WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,either express or implied.
//See the License for the specific language governing permissions and
//limitations under the License.
package org.freedesktop.wayland.server;
import org.freedesktop.jaccall.Pointer;
import org.freedesktop.jaccall.Ptr;
import org.freedesktop.wayland.server.jaccall.Pointerwl_resource_destroy_func_t;
import org.freedesktop.wayland.server.jaccall.WaylandServerCore;
import org.freedesktop.wayland.server.jaccall.wl_resource_destroy_func_t;
import org.freedesktop.wayland.util.Arguments;
import org.freedesktop.wayland.util.Dispatcher;
import org.freedesktop.wayland.util.InterfaceMeta;
import org.freedesktop.wayland.util.ObjectCache;
import org.freedesktop.wayland.util.WaylandObject;
import java.util.HashSet;
import java.util.Set;
/**
* Server side implementation of a wayland object for a specific client.
*
* @param Type of implementation that will be used to handle client requests.
*/
public abstract class Resource implements WaylandObject {
private static final Pointer RESOURCE_DESTROY_FUNC = Pointerwl_resource_destroy_func_t.nref(new wl_resource_destroy_func_t() {
@Override
public void $(final @Ptr long resourcePointer) {
final Resource> resource = ObjectCache.from(resourcePointer);
resource.notifyDestroyListeners();
resource.destroyListeners.clear();
ObjectCache.remove(resourcePointer);
resource.jObjectPointer.close();
}
});
public final Long pointer;
private final I implementation;
private final Set destroyListeners = new HashSet<>();
private final Pointer
© 2015 - 2025 Weber Informatics LLC | Privacy Policy