Package org.eclipse.swt.internal

Examples of org.eclipse.swt.internal.Callback


   */
  public void installHook()
  {
    if (callback == null)
    {
      windowMsgCallback = new Callback(this, "WindowMsgProc", 4);
      newAddress = windowMsgCallback.getAddress();
      oldAddress = Extension.SetWindowLong(shell.handle, Win32.GWL_WNDPROC, newAddress);
      callback = new WNDCallback(shell, oldAddress, newAddress)
      {
        public void dispose()
View Full Code Here


    trackItemIndex = -1;
  }

  private void installMouseHook()
  {
    mouseCallback = new Callback(this, "MouseProc", 3);
    newAddress = mouseCallback.getAddress();
    if (newAddress == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
    int threadId = Extension.GetCurrentThreadId();
    oldAddress = Extension.SetWindowsHookEx(Win32.WH_MOUSE, newAddress, 0, threadId);
    popupMenu.getControl().addDisposeListener(new DisposeListener()
View Full Code Here

  private int oldAddress;

  private void installMouseHook()
  {
    mouseCallback = new Callback(this, "MouseProc", 3);
    newAddress = mouseCallback.getAddress();
    if (newAddress == 0) SWT.error(SWT.ERROR_NO_MORE_CALLBACKS);
    int threadId = Extension.GetCurrentThreadId();
    oldAddress = Extension.SetWindowsHookEx(Win32.WH_MOUSE, newAddress, 0, threadId);
    popupMenu.getControl().addDisposeListener(new DisposeListener()
View Full Code Here

  }

  public static int[] enumChildrens(int handle)
  {
    childList.clear();
    Callback callback = new Callback(Windows.class, "enumChildrenProc", 2);
    int address = callback.getAddress();
    if (address != 0)
    {
      try
      {
        Function function = new Function(USER32_LIB, FUNTION_ENUMCHILDWINDOWS);
        function.invoke_I(handle, address, 0);
        function.close();
      } catch (Exception e)
      {
        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
      }
      callback.dispose();
    }
    int[] handles = new int[windowsList.size()];
    for (int i = 0; i < windowsList.size(); i++)
      handles[i] = ((LONG) windowsList.get(i)).value;
    return handles;
View Full Code Here

  }

  public static int[] enumWindows()
  {
    windowsList.clear();
    Callback callback = new Callback(Windows.class, "enumWindowsProc", 2);
    int address = callback.getAddress();
    if (address != 0)
    {
      try
      {
        Function function = new Function(USER32_LIB, FUNTION_ENUMWINDOWS);
        function.invoke_I(address, 0);
        function.close();
      } catch (Exception e)
      {
        SWT.error(SWT.ERROR_INVALID_ARGUMENT);
      }
      callback.dispose();
    }
    int[] handles = new int[windowsList.size()];
    for (int i = 0; i < windowsList.size(); i++)
      handles[i] = ((LONG) windowsList.get(i)).value;
    return handles;
View Full Code Here

  public void installHook()
  {
    if (callback == null)
    {
      windowMsgCallback = new Callback(this, "WindowMsgProc", 4);
      newAddress = windowMsgCallback.getAddress();
      oldAddress = Extension.SetWindowLong(shell.handle, Win32.GWL_WNDPROC, newAddress);
      callback = new WNDCallback(shell, oldAddress, newAddress)
      {
        public void dispose()
View Full Code Here

  return proxy;

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);
}
View Full Code Here

  return proxy;

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);
}
View Full Code Here

  }
  OS.gtk_set_locale();
  if (!OS.gtk_init_check (new int /*long*/ [] {0}, null)) {
    SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]");
  }
  Callback printerCallback = new Callback(Printer.class, "GtkPrinterFunc_List", 2); //$NON-NLS-1$
  int /*long*/ GtkPrinterFunc_List = printerCallback.getAddress();
  if (GtkPrinterFunc_List == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS);
  OS.gtk_enumerate_printers(GtkPrinterFunc_List, 0, 0, true);
  printerCallback.dispose ();
  return printerList;
}
View Full Code Here

  }
  OS.gtk_set_locale();
  if (!OS.gtk_init_check (new int /*long*/ [] {0}, null)) {
    SWT.error (SWT.ERROR_NO_HANDLES, null, " [gtk_init_check() failed]");
  }
  Callback printerCallback = new Callback(Printer.class, "GtkPrinterFunc_Default", 2); //$NON-NLS-1$
  int /*long*/ GtkPrinterFunc_Default = printerCallback.getAddress();
  if (GtkPrinterFunc_Default == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS);
  OS.gtk_enumerate_printers(GtkPrinterFunc_Default, 0, 0, true);
  printerCallback.dispose ();
  return printerList[0];
}
View Full Code Here

TOP

Related Classes of org.eclipse.swt.internal.Callback

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.