ClipboardProxy(Display display) { this.display = display; getFunc = new Callback( this, "getFunc", 4); //$NON-NLS-1$ if (getFunc.getAddress() == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS); clearFunc = new Callback( this, "clearFunc", 2); //$NON-NLS-1$ if (clearFunc.getAddress() == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS); }
case 4: signature = SIGNATURE_4; break; //$NON-NLS-1$ default: signature = getSignature(argCount); address = bind (this, object, method, signature, argCount, isStatic, isArrayBased, errorResult);
@Override public void run() { if (hHook != 0) OS.UnhookWindowsHookEx(hHook); if (callback != null) callback.dispose(); } });
void convertRgn(NSAffineTransform transform) { long /*int*/ newRgn = OS.NewRgn(); Callback callback = new Callback(this, "convertRgn", 4); long /*int*/ proc = callback.getAddress(); if (proc == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS); this.transform = transform; OS.QDRegionToRects(handle, OS.kQDParseRegionFromTopLeft, proc, newRgn); this.transform = null; callback.dispose(); OS.CopyRgn(newRgn, handle); OS.DisposeRgn(newRgn); }
static long /*int*/ initActionIfaceCB (long /*int*/ iface) { AtkActionIface inter = new AtkActionIface (); ATK.memmove (inter, iface); inter.do_action = AtkActionCB_do_action.getAddress (); inter.get_n_actions = AtkActionCB_get_n_actions.getAddress (); inter.get_description = AtkActionCB_get_description.getAddress (); inter.get_keybinding = AtkActionCB_get_keybinding.getAddress (); inter.get_name = AtkActionCB_get_name.getAddress (); ATK.memmove (iface, inter); return 0; }
/** * This might be called directly from native code in environments * which can generate spurious events. Check before removing it. * * @deprecated * * @param ignore true if callbacks should not be invoked */ static final void ignoreCallbacks (boolean ignore) { setEnabled (!ignore); }
/** * Releases the native level resources associated with the callback, * and removes all references between the callback and * other objects. This helps to prevent (bad) application code * from accidentally holding onto extraneous garbage. */ public void dispose () { if (object == null) return; unbind (this); object = method = signature = null; address = 0; }
static int /*long*/ gtkPrinterFromPrinterData(PrinterData data) { gtk_init(); Callback printerCallback = new Callback(Printer.class, "GtkPrinterFunc_FindNamedPrinter", 2); //$NON-NLS-1$ int /*long*/ GtkPrinterFunc_FindNamedPrinter = printerCallback.getAddress(); if (GtkPrinterFunc_FindNamedPrinter == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); findPrinter = 0; findData = data; OS.gtk_enumerate_printers(GtkPrinterFunc_FindNamedPrinter, 0, 0, true); /* * This call to gdk_threads_leave() is a temporary work around * to avoid deadlocks when gdk_threads_init() is called by native * code outside of SWT (i.e AWT, etc). It ensures that the current * thread leaves the GTK lock acquired by the function above. */ OS.gdk_threads_leave(); printerCallback.dispose (); return findPrinter; }
static int /*long*/ initActionIfaceCB (int /*long*/ iface) { AtkActionIface inter = new AtkActionIface (); ATK.memmove (inter, iface); inter.do_action = AtkActionCB_do_action.getAddress (); inter.get_n_actions = AtkActionCB_get_n_actions.getAddress (); inter.get_description = AtkActionCB_get_description.getAddress (); inter.get_keybinding = AtkActionCB_get_keybinding.getAddress (); inter.get_name = AtkActionCB_get_name.getAddress (); ATK.memmove (iface, inter); return 0; }
/** * This might be called directly from native code in environments * which can generate spurious events. Check before removing it. * * @deprecated * * @param ignore true if callbacks should not be invoked */ @Deprecated static final void ignoreCallbacks (boolean ignore) { setEnabled (!ignore); }
/** * Releases the native level resources associated with the callback, * and removes all references between the callback and * other objects. This helps to prevent (bad) application code * from accidentally holding onto extraneous garbage. */ public void dispose () { if (object == null) return; unbind (this); object = method = signature = null; address = 0; }
NSBezierPath getPath() { Callback callback = new Callback(this, "regionToRects", 4); if (callback.getAddress() == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS); NSBezierPath path = NSBezierPath.bezierPath(); path.retain(); OS.QDRegionToRects(handle, OS.kQDParseRegionFromTopLeft, callback.getAddress(), path.id); callback.dispose(); if (path.isEmpty()) path.appendBezierPathWithRect(new NSRect()); return path; }
static private Callback newCallback (Object object, String method, int argCount) { Callback callback = new Callback (object, method, argCount); if (callback.getAddress () == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); return callback; }
static int /*long*/ initActionIfaceCB (int /*long*/ iface) { AtkActionIface inter = new AtkActionIface (); ATK.memmove (inter, iface); inter.do_action = AtkActionCB_do_action.getAddress (); inter.get_n_actions = AtkActionCB_get_n_actions.getAddress (); inter.get_description = AtkActionCB_get_description.getAddress (); inter.get_keybinding = AtkActionCB_get_keybinding.getAddress (); inter.get_name = AtkActionCB_get_name.getAddress (); ATK.memmove (iface, inter); return 0; }
case 4: signature = SIGNATURE_4; break; //$NON-NLS-1$ default: signature = getSignature(argCount); address = bind (this, object, method, signature, argCount, isStatic, isArrayBased, errorResult);
void dispose () { if (display == null) return; if (activeClipboard != null) { OS.gtk_clipboard_store(Clipboard.GTKCLIPBOARD); } if (activePrimaryClipboard != null) { OS.gtk_clipboard_store(Clipboard.GTKPRIMARYCLIPBOARD); } display = null; if (getFunc != null ) getFunc.dispose(); getFunc = null; if (clearFunc != null) clearFunc.dispose(); clearFunc = null; clipboardData = null; clipboardDataTypes = null; primaryClipboardData = null; primaryClipboardDataTypes = null; if (clipboardOwner != 0) OS.gtk_widget_destroy (clipboardOwner); clipboardOwner = 0; }
/** * This might be called directly from native code in environments * which can generate spurious events. Check before removing it. * * @deprecated * * @param ignore true if callbacks should not be invoked */ @Deprecated static final void ignoreCallbacks (boolean ignore) { setEnabled (!ignore); }
/** * Releases the native level resources associated with the callback, * and removes all references between the callback and * other objects. This helps to prevent (bad) application code * from accidentally holding onto extraneous garbage. */ public void dispose () { if (object == null) return; unbind (this); object = method = signature = null; address = 0; }
NSBezierPath getPath(long /*int*/ region) { Callback callback = new Callback(this, "regionToRects", 4); if (callback.getAddress() == 0) error(SWT.ERROR_NO_MORE_CALLBACKS); NSBezierPath path = NSBezierPath.bezierPath(); path.retain(); OS.QDRegionToRects(region, OS.kQDParseRegionFromTopLeft, callback.getAddress(), path.id); callback.dispose(); if (path.isEmpty()) path.appendBezierPathWithRect(new NSRect()); return path; }
ClipboardProxy(Display display) { this.display = display; getFunc = new Callback( this, "getFunc", 4); //$NON-NLS-1$ if (getFunc.getAddress() == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS); clearFunc = new Callback( this, "clearFunc", 2); //$NON-NLS-1$ if (clearFunc.getAddress() == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS); }