Package org.eclipse.swt.internal.win32

Examples of org.eclipse.swt.internal.win32.TCHAR


      alpha = data.alpha;
      alphaData = data.alphaData;
      transparentPixel = data.transparentPixel;
      break;
    }
    BITMAP bm = new BITMAP();
    Extension.GetObject(hBitmap, BITMAP.sizeof, bm);
    int imgWidth = bm.bmWidth;
    int imgHeight = bm.bmHeight;
    int /* long */hDC = Extension.GetDC(0);
    int /* long */srcHdc = Extension.CreateCompatibleDC(hDC);
    int /* long */oldSrcBitmap = Extension.SelectObject(srcHdc, hBitmap);
    int /* long */memHdc = Extension.CreateCompatibleDC(hDC);
    BITMAPINFOHEADER bmiHeader = new BITMAPINFOHEADER();
    bmiHeader.biSize = BITMAPINFOHEADER.sizeof;
    bmiHeader.biWidth = imgWidth;
    bmiHeader.biHeight = -imgHeight;
    bmiHeader.biPlanes = 1;
    bmiHeader.biBitCount = (short) 32;
    bmiHeader.biCompression = Extension.BI_RGB;
    byte[] bmi = new byte[BITMAPINFOHEADER.sizeof];
    Extension.MoveMemory(bmi, bmiHeader, BITMAPINFOHEADER.sizeof);
    int /* long */[] pBits = new int /* long */[1];
    int /* long */memDib = Extension.CreateDIBSection(0, bmi, Extension.DIB_RGB_COLORS,
        pBits, 0, 0);
    if (memDib == 0)
      SWT.error(SWT.ERROR_NO_HANDLES);
    int /* long */oldMemBitmap = Extension.SelectObject(memHdc, memDib);
    BITMAP dibBM = new BITMAP();
    Extension.GetObject(memDib, BITMAP.sizeof, dibBM);
    int sizeInBytes = dibBM.bmWidthBytes * dibBM.bmHeight;
    Extension.BitBlt(memHdc, 0, 0, imgWidth, imgHeight, srcHdc, 0, 0, Extension.SRCCOPY);
    byte red = 0, green = 0, blue = 0;
    if (transparentPixel != -1) {
View Full Code Here


    int imgHeight = bm.bmHeight;
    int /* long */hDC = Extension.GetDC(0);
    int /* long */srcHdc = Extension.CreateCompatibleDC(hDC);
    int /* long */oldSrcBitmap = Extension.SelectObject(srcHdc, hBitmap);
    int /* long */memHdc = Extension.CreateCompatibleDC(hDC);
    BITMAPINFOHEADER bmiHeader = new BITMAPINFOHEADER();
    bmiHeader.biSize = BITMAPINFOHEADER.sizeof;
    bmiHeader.biWidth = imgWidth;
    bmiHeader.biHeight = -imgHeight;
    bmiHeader.biPlanes = 1;
    bmiHeader.biBitCount = (short) 32;
View Full Code Here

   *
   * @param libraryName
   *            the name of library to be loaded.
   */
  public void loadVersionInfo(String libraryName) {
    DLLVERSIONINFO dvi = new DLLVERSIONINFO();
    dvi.cbSize = DLLVERSIONINFO.sizeof;
    TCHAR lpLibFileName = new TCHAR(0, libraryName, true); //$NON-NLS-1$
    int hModule = OS.LoadLibrary(lpLibFileName);
    if (hModule != 0) {
      String name = "DllGetVersion\0"; //$NON-NLS-1$
View Full Code Here

    int transparentPixel = -1, alpha = -1;
    int /* long */hMask = 0, hBitmap = 0;
    byte[] alphaData = null;
    switch (image.type) {
    case SWT.ICON:
      ICONINFO info = new ICONINFO();
      Extension.GetIconInfo(image.handle, info);
      hBitmap = info.hbmColor;
      hMask = info.hbmMask;
      break;
    case SWT.BITMAP:
View Full Code Here

    }
  }

  boolean getEnabled(int itemId) {
    checkState();
    MENUITEMINFO info = new MENUITEMINFO();
    info.cbSize = MENUITEMINFO.sizeof;
    info.fMask = Win32.MIIM_STATE;
    boolean success = Extension.GetMenuItemInfo(hMenu, itemId, false, info);
    if (!success)
      SWT.error(SWT.ERROR_CANNOT_GET_ENABLED);
View Full Code Here

    return (SystemMenuItem) itemMap.get(new Integer(itemId));
  }

  boolean getSelection(int itemId) {
    checkState();
    MENUITEMINFO info = new MENUITEMINFO();
    info.cbSize = MENUITEMINFO.sizeof;
    info.fMask = Win32.MIIM_STATE;
    boolean success = Extension.GetMenuItemInfo(hMenu, itemId, false, info);
    if (!success)
      SWT.error(SWT.ERROR_CANNOT_GET_SELECTION);
View Full Code Here

    return shell;
  }

  String getText(int itemId) {
    checkState();
    MENUITEMINFO info = new MENUITEMINFO();
    info.cbSize = MENUITEMINFO.sizeof;
    if (Win32.getWin32Version() >= Win32.VERSION(4, 10)) {
      info.fMask = Win32.MIIM_STRING;
    } else {
      info.fMask = Win32.MIIM_TYPE;
View Full Code Here

    hMenu = Extension.GetSystemMenu(shell.handle, false);
  }

  void setEnabled(int itemId, boolean enabled) {
    checkState();
    MENUITEMINFO info = new MENUITEMINFO();
    info.cbSize = MENUITEMINFO.sizeof;
    info.fMask = Win32.MIIM_STATE;
    boolean success = Extension.GetMenuItemInfo(hMenu, itemId, false, info);
    if (!success) {
      return;
View Full Code Here

        bitmap);
  }

  void setSelection(int itemId, boolean selected) {
    checkState();
    MENUITEMINFO info = new MENUITEMINFO();
    info.cbSize = MENUITEMINFO.sizeof;
    info.fMask = Win32.MIIM_STATE;
    boolean success = Extension.GetMenuItemInfo(hMenu, itemId, false, info);
    if (!success)
      SWT.error(SWT.ERROR_CANNOT_SET_SELECTION);
View Full Code Here

    checkState();
    int /* long */hHeap = Extension.GetProcessHeap();
    int /* long */pszText = 0;
    boolean success = false;

    MENUITEMINFO info = new MENUITEMINFO();
    info.cbSize = MENUITEMINFO.sizeof;
    /* Use the character encoding for the default locale */
    TCHAR buffer = new TCHAR(0, text, true);
    int byteCount = buffer.length() * TCHAR.sizeof;
    pszText = Extension.HeapAlloc(hHeap, Extension.HEAP_ZERO_MEMORY,
View Full Code Here

TOP

Related Classes of org.eclipse.swt.internal.win32.TCHAR

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.