Skip to content

Commit

Permalink
Remove SignalHandler class, not needed anymore: since #125 the arena …
Browse files Browse the repository at this point in the history
…is closed automatically
  • Loading branch information
jwharm committed Sep 22, 2024
1 parent c8734ce commit f4b21a9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ public final class ClassNames {
public static final ClassName BUILDER_INTERFACE = get(PKG_GOBJECT, "BuilderInterface");
public static final ClassName INSTANCE_CACHE = get(PKG_GOBJECT, "InstanceCache");
public static final ClassName JAVA_CLOSURE = get(PKG_GOBJECT, "JavaClosure");
public static final ClassName SIGNAL_CONNECTION = get(PKG_GOBJECT, "SignalConnection");

public static final ClassName OVERRIDES = get(PKG_GOBJECT_TYPES, "Overrides");
public static final ClassName PROPERTIES = get(PKG_GOBJECT_TYPES, "Properties");
Expand All @@ -66,7 +65,6 @@ public final class ClassNames {
public static final ClassName TYPES = get(PKG_GOBJECT_TYPES, "Types");

// Some frequently used class names
public final static ClassName DESTROY_NOTIFY = get("org.gnome.glib", "DestroyNotify");
public final static ClassName GERROR = get("org.gnome.glib", "GError");
public final static ClassName GLIB = get("org.gnome.glib", "GLib");
public final static ClassName GTYPE = get("org.gnome.glib", "Type");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,12 +282,12 @@ private MethodSpec gobjectConnect() {
@param detailedSignal a string of the form "signal-name::detail"
@param callback the callback to connect
@return a SignalConnection object to track, block and disconnect the
@return a signal handler id to track, block and disconnect the
signal connection
""")
.addModifiers(Modifier.PUBLIC)
.addTypeVariable(TypeVariableName.get("T"))
.returns(ClassNames.SIGNAL_CONNECTION)
.returns(int.class)
.addParameter(String.class, "detailedSignal")
.addParameter(TypeVariableName.get("T"), "callback")
.addStatement("return connect(detailedSignal, callback, false)")
Expand All @@ -303,21 +303,19 @@ private MethodSpec gobjectConnectAfter() {
@param callback the callback to connect
@param after whether the handler should be called before or
after the default handler of the signal
@return a SignalConnection object to track, block and disconnect the
@return a signal handler id to track, block and disconnect the
signal connection
""")
.addModifiers(Modifier.PUBLIC)
.addTypeVariable(TypeVariableName.get("T"))
.returns(ClassNames.SIGNAL_CONNECTION)
.returns(int.class)
.addParameter(String.class, "detailedSignal")
.addParameter(TypeVariableName.get("T"), "callback")
.addParameter(boolean.class, "after")
.addStatement("$1T closure = new $1T(callback)",
ClassNames.JAVA_CLOSURE)
.addStatement("int handlerId = $T.signalConnectClosure(this, detailedSignal, closure, after)",
.addStatement("return $T.signalConnectClosure(this, detailedSignal, closure, after)",
ClassNames.GOBJECTS)
.addStatement("return new $T(handle(), handlerId, closure)",
ClassNames.SIGNAL_CONNECTION)
.build();
}

Expand Down

This file was deleted.

0 comments on commit f4b21a9

Please sign in to comment.