Renamed GObject -> GObjectType then renamed Gobject -> GObject (changed

case...) This was to solve issues with case on windows (it doesn't
 support it)
This commit is contained in:
nathan 2018-04-08 18:13:22 +02:00
parent bdea27342c
commit 37144a03c9
5 changed files with 16 additions and 16 deletions

View File

@ -23,7 +23,7 @@ import com.sun.jna.Pointer;
import dorkbox.systemTray.peer.EntryPeer;
import dorkbox.systemTray.util.ImageResizeUtil;
import dorkbox.util.jna.linux.Gobject;
import dorkbox.util.jna.linux.GObject;
import dorkbox.util.jna.linux.GtkEventDispatch;
abstract
@ -110,7 +110,7 @@ class GtkBaseMenuItem implements EntryPeer {
// To work around this issue, we destroy then recreate the menu every time something is changed.
// always on EDT
void onDeleteMenu(final Pointer parentNative) {
Gobject.g_object_force_floating(_native); // makes it a floating reference
GObject.g_object_force_floating(_native); // makes it a floating reference
Gtk2.gtk_container_remove(parentNative, _native);
}
@ -122,7 +122,7 @@ class GtkBaseMenuItem implements EntryPeer {
// will also get: gsignal.c:2516: signal 'child-added' is invalid for instance '0x7f1df8244080' of type 'GtkMenu'
Gtk2.gtk_menu_shell_append(parentNative, _native);
Gobject.g_object_ref_sink(_native); // undoes "floating"
GObject.g_object_ref_sink(_native); // undoes "floating"
Gtk2.gtk_widget_show_all(_native); // necessary to guarantee widget is visible
}

View File

@ -27,7 +27,7 @@ import dorkbox.systemTray.SystemTray;
import dorkbox.systemTray.peer.MenuItemPeer;
import dorkbox.systemTray.util.EventDispatch;
import dorkbox.util.jna.linux.GCallback;
import dorkbox.util.jna.linux.Gobject;
import dorkbox.util.jna.linux.GObject;
import dorkbox.util.jna.linux.GtkEventDispatch;
class GtkMenuItem extends GtkBaseMenuItem implements MenuItemPeer, GCallback {
@ -50,7 +50,7 @@ class GtkMenuItem extends GtkBaseMenuItem implements MenuItemPeer, GCallback {
super(Gtk2.gtk_image_menu_item_new_with_mnemonic(""));
this.parent = parent;
Gobject.g_signal_connect_object(_native, "activate", this, null, 0);
GObject.g_signal_connect_object(_native, "activate", this, null, 0);
}

View File

@ -32,7 +32,7 @@ import dorkbox.systemTray.util.HeavyCheckMark;
import dorkbox.systemTray.util.ImageResizeUtil;
import dorkbox.util.OSUtil;
import dorkbox.util.jna.linux.GCallback;
import dorkbox.util.jna.linux.Gobject;
import dorkbox.util.jna.linux.GObject;
import dorkbox.util.jna.linux.GtkEventDispatch;
import dorkbox.util.jna.linux.GtkTheme;
@ -96,7 +96,7 @@ class GtkMenuItemCheckbox extends GtkBaseMenuItem implements CheckboxPeer, GCall
super(useFakeCheckMark ? Gtk2.gtk_image_menu_item_new_with_mnemonic("") : Gtk2.gtk_check_menu_item_new_with_mnemonic(""));
this.parent = parent;
handlerId = Gobject.g_signal_connect_object(_native, "activate", this, null, 0);
handlerId = GObject.g_signal_connect_object(_native, "activate", this, null, 0);
if (useFakeCheckMark) {
if (checkedFile == null) {
@ -124,9 +124,9 @@ class GtkMenuItemCheckbox extends GtkBaseMenuItem implements CheckboxPeer, GCall
setCheckedIconForFakeCheckMarks();
} else {
Gobject.g_signal_handler_block(_native, handlerId);
GObject.g_signal_handler_block(_native, handlerId);
Gtk2.gtk_check_menu_item_set_active(_native, false);
Gobject.g_signal_handler_unblock(_native, handlerId);
GObject.g_signal_handler_unblock(_native, handlerId);
}
}
@ -252,9 +252,9 @@ class GtkMenuItemCheckbox extends GtkBaseMenuItem implements CheckboxPeer, GCall
// we assume this is consistent across ALL versions and variants of GTK
// https://github.com/GNOME/gtk/blob/master/gtk/gtkcheckmenuitem.c#L317
// this disables the signal handler, then enables it
Gobject.g_signal_handler_block(_native, handlerId);
GObject.g_signal_handler_block(_native, handlerId);
Gtk2.gtk_check_menu_item_set_active(_native, isChecked);
Gobject.g_signal_handler_unblock(_native, handlerId);
GObject.g_signal_handler_unblock(_native, handlerId);
}
}
});

View File

@ -26,7 +26,7 @@ import dorkbox.systemTray.Tray;
import dorkbox.systemTray.gnomeShell.Extension;
import dorkbox.systemTray.util.ImageResizeUtil;
import dorkbox.util.jna.linux.AppIndicator;
import dorkbox.util.jna.linux.Gobject;
import dorkbox.util.jna.linux.GObject;
import dorkbox.util.jna.linux.GtkEventDispatch;
import dorkbox.util.jna.linux.structs.AppIndicatorInstanceStruct;
@ -210,7 +210,7 @@ class _AppIndicatorNativeTray extends Tray {
// STATUS_PASSIVE hides the indicator
savedAppIndicator.app_indicator_set_status(AppIndicator.STATUS_PASSIVE);
Pointer p = savedAppIndicator.getPointer();
Gobject.g_object_unref(p);
GObject.g_object_unref(p);
GtkEventDispatch.shutdownGui();
}

View File

@ -28,7 +28,7 @@ import dorkbox.systemTray.Tray;
import dorkbox.systemTray.gnomeShell.Extension;
import dorkbox.util.JavaFX;
import dorkbox.util.jna.linux.GEventCallback;
import dorkbox.util.jna.linux.Gobject;
import dorkbox.util.jna.linux.GObject;
import dorkbox.util.jna.linux.GtkEventDispatch;
import dorkbox.util.jna.linux.structs.GdkEventButton;
@ -155,7 +155,7 @@ class _GtkStatusIconNativeTray extends Tray {
void run() {
// this hides the indicator
Gtk2.gtk_status_icon_set_visible(trayIcon, false);
Gobject.g_object_unref(trayIcon);
GObject.g_object_unref(trayIcon);
// mark for GC
trayIcon = null;
@ -189,7 +189,7 @@ class _GtkStatusIconNativeTray extends Tray {
}
}
};
Gobject.g_signal_connect_object(trayIcon, "button_press_event", gtkCallback, null, 0);
GObject.g_signal_connect_object(trayIcon, "button_press_event", gtkCallback, null, 0);
}
});