Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Typedefs | Functions | Variables
nsWindow.cpp File Reference
#include "nsWindow.h"
#include "plevent.h"
#include "nsIAppShell.h"
#include "nsIFontMetrics.h"
#include "nsIFontEnumerator.h"
#include "nsIFontPackageService.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "nsFont.h"
#include "nsGUIEvent.h"
#include "nsIRenderingContext.h"
#include "nsIDeviceContext.h"
#include "nsIScreenManager.h"
#include "nsRect.h"
#include "nsTransform2D.h"
#include "nsIEventQueue.h"
#include "nsIObserverService.h"
#include "imgIContainer.h"
#include "gfxIImageFrame.h"
#include "nsNativeCharsetUtils.h"
#include <windows.h>
#include <process.h>
#include <imm.h>
#include <unknwn.h>
#include <zmouse.h>
#include "nsGfxCIID.h"
#include "resource.h"
#include <commctrl.h>
#include "prtime.h"
#include "nsIRenderingContextWin.h"
#include "nsIImage.h"
#include "aimm.h"
#include <pbt.h>
#include "nsNativeDragTarget.h"
#include "nsIRollupListener.h"
#include "nsIMenuRollup.h"
#include "nsIRegion.h"
#include "nsplugindefs.h"
#include "nsIServiceManager.h"
#include "nsIClipboard.h"
#include "nsWidgetsCID.h"
#include "nsITimer.h"
#include "nsITheme.h"
#include "nsILocalFile.h"
#include "nsCRT.h"
#include "nsAppDirectoryServiceDefs.h"
#include "nsXPIDLString.h"
#include "nsIFile.h"
#include "prprf.h"
#include "prmem.h"

Go to the source code of this file.

Classes

class  OleRegisterMgr
struct  tagRECONVERTSTRING
struct  tagIMECHARPOSITION
class  nsAttentionTimerMonitor
struct  nsAttentionTimerMonitor::TimerInfo

Defines

#define PBT_APMRESUMEAUTOMATIC   0x0012
#define kWindowPositionSlop   20
#define SPI_GETWHEELSCROLLLINES   104
#define MAPVK_VSC_TO_VK   1
#define MAPVK_VK_TO_CHAR   2
#define WM_MOUSEHWHEEL   0x020E
#define SPI_GETWHEELSCROLLCHARS   0x006C
#define NS_FLASH_TIMER_ID   0x011231984
#define IDC_HAND   MAKEINTRESOURCE(32649)
#define IS_VK_DOWN(a)   (GetKeyState(a) < 0)
#define IME_X_OFFSET   0
#define IME_Y_OFFSET   0
#define IS_IME_CODEPAGE(cp)   ((932==(cp))||(936==(cp))||(949==(cp))||(950==(cp)))
#define NS_IMM_GETCOMPOSITIONSTRINGA(hIMC, dwIndex, pBuf, dwBufLen, compStrLen)
#define NS_IMM_GETCOMPOSITIONSTRINGW(hIMC, dwIndex, pBuf, dwBufLen, compStrLen)
#define NS_IMM_GETCONTEXT(hWnd, hIMC)
#define NS_IMM_RELEASECONTEXT(hWnd, hIMC)
#define NS_IMM_NOTIFYIME(hIMC, dwAction, dwIndex, dwValue, bRtn)
#define NS_IMM_SETCANDIDATEWINDOW(hIMC, candForm)
#define NS_IMM_SETCOMPOSITIONWINDOW(hIMC, compForm)
#define NS_IMM_GETCOMPOSITIONWINDOW(hIMC, compForm)
#define NS_IMM_GETPROPERTY(hKL, dwIndex, dwProp)
#define NS_IMM_GETDEFAULTIMEWND(hWnd, phDefWnd)
#define NS_IMM_GETOPENSTATUS(hIMC, bRtn)
#define NS_IMM_SETOPENSTATUS(hIMC, bOpen)
#define NS_IMM_GETCOMPOSITIONSTRING(hIMC, dwIndex, cBuf, dwBufLen, lRtn)
#define WM_IME_REQUEST   0x0288
#define IMR_RECONVERTSTRING   0x0004
#define IMR_QUERYCHARPOSITION   0x0006
#define RWM_RECONVERT   TEXT("MSIMEReconvert")
#define RWM_MOUSE   TEXT("MSIMEMouseOperation")
#define IMEMOUSE_NONE   0x00
#define IMEMOUSE_LDOWN   0x01
#define IMEMOUSE_RDOWN   0x02
#define IMEMOUSE_MDOWN   0x04
#define IMEMOUSE_WUP   0x10
#define IMEMOUSE_WDOWN   0x20
#define MSGNAME_ATOK_RECONVERT   TEXT("Atok Message for ReconvertString")
#define WM_APPCOMMAND   0x0319
#define APPCOMMAND_BROWSER_BACKWARD   1
#define APPCOMMAND_BROWSER_FORWARD   2
#define APPCOMMAND_BROWSER_REFRESH   3
#define APPCOMMAND_BROWSER_STOP   4
#define FAPPCOMMAND_MASK   0xF000
#define GET_APPCOMMAND_LPARAM(lParam)   ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))
#define WM_XP_THEMECHANGED   0x031A
#define CS_XP_DROPSHADOW   0x00020000
#define ZH_CN_INTELLEGENT_ABC_IME   ((HKL)0xe0040804L)
#define ZH_CN_MS_PINYIN_IME_3_0   ((HKL)0xe00e0804L)
#define ZH_CN_NEIMA_IME   ((HKL)0xe0050804L)
#define PINYIN_IME_ON_XP(kl)
#define PT_IN_RECT(pt, rc)   ((pt).x>(rc).left && (pt).x <(rc).right && (pt).y>(rc).top && (pt).y<(rc).bottom)
#define DISPLAY_NMM_PRT(_arg)

Typedefs

typedef struct tagRECONVERTSTRING RECONVERTSTRING
typedef struct tagRECONVERTSTRINGLPRECONVERTSTRING
typedef struct tagIMECHARPOSITION IMECHARPOSITION
typedef struct tagIMECHARPOSITIONPIMECHARPOSITION

Functions

static PRBool IsCursorTranslucencySupported ()
static PRBool IsWin2k ()
static NS_DEFINE_CID (kCClipboardCID, NS_CLIPBOARD_CID)
static NS_DEFINE_IID (kRenderingContextCID, NS_RENDERING_CONTEXT_CID)
static PRBool LangIDToCP (WORD aLangID, UINT &oCP)
static char * GetNSWindowPropName ()
static BOOL CALLBACK DummyDialogProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
static BOOL CALLBACK gEnumWindowsProc (HWND hwnd, LPARAM lParam)
static nsresult HeapDump (const char *filename, const char *heading)
static PRUint32 PlatformToNSAttr (PRUint8 aAttr)
static VOID CALLBACK nsGetAttentionTimerFunc (HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)

Variables

static const char kMozHeapDumpMessageString [] = "MOZ_HeapDump"
static const char * sScreenManagerContractID = "@mozilla.org/gfx/screenmanager;1"
static nsIRollupListenergRollupListener = nsnull
static nsIWidgetgRollupWidget = nsnull
static PRBool gRollupConsumeRollupEvent = PR_FALSE
static HHOOK gMsgFilterHook = NULL
static HHOOK gCallProcHook = NULL
static HHOOK gCallMouseHook = NULL
static PRPackedBool gProcessHook = PR_FALSE
static UINT gRollupMsgId = 0
static HWND gRollupMsgWnd = NULL
static UINT gHookTimerId = 0
static POINT gLastMousePoint
static POINT gLastMouseMovePoint
static LONG gLastMouseDownTime = 0L
static LONG gLastClickCount = 0L
static BYTE gLastMouseButton = 0
static PRUint32 gLastInputEventTime = 0
static int gTrimOnMinimize = 2
static nsAttentionTimerMonitorgAttentionTimerMonitor = 0
static char sPropName [40] = ""
PRBool gWindowsVisible
static PRBool gJustGotDeactivate = PR_FALSE
static PRBool gJustGotActivate = PR_FALSE
PRBool gPinYinIMECaretCreated = PR_FALSE

Class Documentation

struct tagRECONVERTSTRING

Definition at line 649 of file nsWindow.cpp.

Class Members
DWORD dwCompStrLen
DWORD dwCompStrOffset
DWORD dwSize
DWORD dwStrLen
DWORD dwStrOffset
DWORD dwTargetStrLen
DWORD dwTargetStrOffset
DWORD dwVersion
struct tagIMECHARPOSITION

Definition at line 663 of file nsWindow.cpp.

Class Members
UINT cLineHeight
DWORD dwCharPos
DWORD dwSize
POINT pt
RECT rcDocument
struct nsAttentionTimerMonitor::TimerInfo

Definition at line 827 of file nsWindow.cpp.

Collaboration diagram for nsAttentionTimerMonitor::TimerInfo:
Class Members
PRInt32 flashCount
HWND flashWindow
PRBool hasFlashed
PRInt32 maxFlashCount
TimerInfo * next
UINT timerID
HWND timerWindow

Define Documentation

Definition at line 696 of file nsWindow.cpp.

Definition at line 697 of file nsWindow.cpp.

Definition at line 698 of file nsWindow.cpp.

Definition at line 699 of file nsWindow.cpp.

#define CS_XP_DROPSHADOW   0x00020000

Definition at line 5648 of file nsWindow.cpp.

#define DISPLAY_NMM_PRT (   _arg)

Definition at line 8030 of file nsWindow.cpp.

#define FAPPCOMMAND_MASK   0xF000

Definition at line 724 of file nsWindow.cpp.

#define GET_APPCOMMAND_LPARAM (   lParam)    ((short)(HIWORD(lParam) & ~FAPPCOMMAND_MASK))

Definition at line 726 of file nsWindow.cpp.

#define IDC_HAND   MAKEINTRESOURCE(32649)

Definition at line 347 of file nsWindow.cpp.

Definition at line 485 of file nsWindow.cpp.

Definition at line 486 of file nsWindow.cpp.

#define IMEMOUSE_LDOWN   0x01

Definition at line 677 of file nsWindow.cpp.

#define IMEMOUSE_MDOWN   0x04

Definition at line 679 of file nsWindow.cpp.

#define IMEMOUSE_NONE   0x00

Definition at line 676 of file nsWindow.cpp.

#define IMEMOUSE_RDOWN   0x02

Definition at line 678 of file nsWindow.cpp.

#define IMEMOUSE_WDOWN   0x20

Definition at line 681 of file nsWindow.cpp.

#define IMEMOUSE_WUP   0x10

Definition at line 680 of file nsWindow.cpp.

Definition at line 662 of file nsWindow.cpp.

Definition at line 648 of file nsWindow.cpp.

#define IS_IME_CODEPAGE (   cp)    ((932==(cp))||(936==(cp))||(949==(cp))||(950==(cp)))

Definition at line 490 of file nsWindow.cpp.

#define IS_VK_DOWN (   a)    (GetKeyState(a) < 0)

Definition at line 478 of file nsWindow.cpp.

Definition at line 164 of file nsWindow.cpp.

Definition at line 172 of file nsWindow.cpp.

Definition at line 171 of file nsWindow.cpp.

#define MSGNAME_ATOK_RECONVERT   TEXT("Atok Message for ReconvertString")

Definition at line 684 of file nsWindow.cpp.

#define NS_FLASH_TIMER_ID   0x011231984

Definition at line 334 of file nsWindow.cpp.

#define NS_IMM_GETCOMPOSITIONSTRING (   hIMC,
  dwIndex,
  cBuf,
  dwBufLen,
  lRtn 
)
Value:
{ \
  if (nsToolkit::mUseImeApiW) { \
    NS_IMM_GETCOMPOSITIONSTRINGW(hIMC, dwIndex, cBuf, dwBufLen, lRtn); \
  } else { \
    NS_IMM_GETCOMPOSITIONSTRINGA(hIMC, dwIndex, cBuf, dwBufLen, lRtn); \
  } \
}

Definition at line 629 of file nsWindow.cpp.

#define NS_IMM_GETCOMPOSITIONSTRINGA (   hIMC,
  dwIndex,
  pBuf,
  dwBufLen,
  compStrLen 
)
Value:
{ \
  compStrLen = 0; \
  if (nsToolkit::gAIMMApp) \
    nsToolkit::gAIMMApp->GetCompositionStringA(hIMC, dwIndex, dwBufLen, &(compStrLen), pBuf); \
   else { \
      nsIMM &theIMM = nsIMM::LoadModule(); \
      compStrLen = theIMM.GetCompositionStringA(hIMC, dwIndex, pBuf, dwBufLen); \
   } \
}

Definition at line 496 of file nsWindow.cpp.

#define NS_IMM_GETCOMPOSITIONSTRINGW (   hIMC,
  dwIndex,
  pBuf,
  dwBufLen,
  compStrLen 
)
Value:
{ \
  compStrLen = 0; \
  if (nsToolkit::gAIMMApp) \
    nsToolkit::gAIMMApp->GetCompositionStringW(hIMC, dwIndex, dwBufLen, &(compStrLen), pBuf); \
    else { \
      nsIMM &theIMM = nsIMM::LoadModule(); \
      compStrLen = theIMM.GetCompositionStringW(hIMC, dwIndex, pBuf, dwBufLen); \
    } \
}

Definition at line 507 of file nsWindow.cpp.

#define NS_IMM_GETCOMPOSITIONWINDOW (   hIMC,
  compForm 
)
Value:
{ \
  if (nsToolkit::gAIMMApp) \
    nsToolkit::gAIMMApp->GetCompositionWindow(hIMC, compForm); \
  else { \
    nsIMM &theIMM = nsIMM::LoadModule(); \
    theIMM.GetCompositionWindow(hIMC, compForm); \
  } \
}

Definition at line 571 of file nsWindow.cpp.

#define NS_IMM_GETCONTEXT (   hWnd,
  hIMC 
)
Value:
{ \
  hIMC = NULL; \
  if (nsToolkit::gAIMMApp) \
    nsToolkit::gAIMMApp->GetContext(hWnd, &(hIMC)); \
  else { \
    nsIMM& theIMM = nsIMM::LoadModule(); \
    hIMC = (HIMC)theIMM.GetContext(hWnd);  \
  } \
}

Definition at line 518 of file nsWindow.cpp.

#define NS_IMM_GETDEFAULTIMEWND (   hWnd,
  phDefWnd 
)
Value:
{ \
  if (nsToolkit::gAIMMApp) \
    return nsToolkit::gAIMMApp->GetDefaultIMEWnd(hWnd, phDefWnd); \
  else { \
    nsIMM& theIMM = nsIMM::LoadModule(); \
    *(phDefWnd) = (HWND)theIMM.GetDefaultIMEWnd(hWnd);  \
  } \
}

Definition at line 591 of file nsWindow.cpp.

#define NS_IMM_GETOPENSTATUS (   hIMC,
  bRtn 
)
Value:
{ \
  if (nsToolkit::gAIMMApp) \
    bRtn = nsToolkit::gAIMMApp->GetOpenStatus(hIMC); \
  else { \
    nsIMM& theIMM = nsIMM::LoadModule(); \
    bRtn = theIMM.GetOpenStatus(hIMC);  \
  } \
}

Definition at line 601 of file nsWindow.cpp.

#define NS_IMM_GETPROPERTY (   hKL,
  dwIndex,
  dwProp 
)
Value:
{ \
  if (nsToolkit::gAIMMApp) \
    nsToolkit::gAIMMApp->GetProperty(hKL, dwIndex, &(dwProp)); \
  else { \
    nsIMM& theIMM = nsIMM::LoadModule(); \
    dwProp = (DWORD)theIMM.GetProperty(hKL, dwIndex);  \
  } \
}

Definition at line 581 of file nsWindow.cpp.

#define NS_IMM_NOTIFYIME (   hIMC,
  dwAction,
  dwIndex,
  dwValue,
  bRtn 
)
Value:
{ \
  bRtn = TRUE; \
  if (nsToolkit::gAIMMApp) { \
    bRtn = (nsToolkit::gAIMMApp->NotifyIME(hIMC, dwAction, dwIndex, dwValue) == S_OK); \
  }\
  else { \
    nsIMM &theIMM = nsIMM::LoadModule(); \
    (theIMM.NotifyIME(hIMC, dwAction, dwIndex, dwValue)); \
  } \
}

Definition at line 539 of file nsWindow.cpp.

#define NS_IMM_RELEASECONTEXT (   hWnd,
  hIMC 
)
Value:
{ \
  if (nsToolkit::gAIMMApp) \
    nsToolkit::gAIMMApp->ReleaseContext(hWnd, hIMC); \
  else { \
    nsIMM &theIMM = nsIMM::LoadModule(); \
    theIMM.ReleaseContext(hWnd, hIMC); \
  } \
}

Definition at line 529 of file nsWindow.cpp.

#define NS_IMM_SETCANDIDATEWINDOW (   hIMC,
  candForm 
)
Value:
{ \
  if (nsToolkit::gAIMMApp) \
    nsToolkit::gAIMMApp->SetCandidateWindow(hIMC, candForm); \
  else { \
    nsIMM &theIMM = nsIMM::LoadModule(); \
    theIMM.SetCandidateWindow(hIMC, candForm); \
  } \
}

Definition at line 551 of file nsWindow.cpp.

#define NS_IMM_SETCOMPOSITIONWINDOW (   hIMC,
  compForm 
)
Value:
{ \
  if (nsToolkit::gAIMMApp) \
    nsToolkit::gAIMMApp->SetCompositionWindow(hIMC, compForm); \
  else { \
    nsIMM &theIMM = nsIMM::LoadModule(); \
    theIMM.SetCompositionWindow(hIMC, compForm); \
  } \
}

Definition at line 561 of file nsWindow.cpp.

#define NS_IMM_SETOPENSTATUS (   hIMC,
  bOpen 
)
Value:
{ \
  if (nsToolkit::gAIMMApp) \
    nsToolkit::gAIMMApp->SetOpenStatus(hIMC, bOpen); \
  else { \
    nsIMM& theIMM = nsIMM::LoadModule(); \
    theIMM.SetOpenStatus(hIMC, bOpen);  \
  } \
}

Definition at line 611 of file nsWindow.cpp.

Definition at line 131 of file nsWindow.cpp.

Value:

Definition at line 6698 of file nsWindow.cpp.

#define PT_IN_RECT (   pt,
  rc 
)    ((pt).x>(rc).left && (pt).x <(rc).right && (pt).y>(rc).top && (pt).y<(rc).bottom)

Definition at line 7763 of file nsWindow.cpp.

#define RWM_MOUSE   TEXT("MSIMEMouseOperation")

Definition at line 674 of file nsWindow.cpp.

#define RWM_RECONVERT   TEXT("MSIMEReconvert")

Definition at line 673 of file nsWindow.cpp.

Definition at line 180 of file nsWindow.cpp.

Definition at line 167 of file nsWindow.cpp.

#define WM_APPCOMMAND   0x0319

Definition at line 692 of file nsWindow.cpp.

#define WM_IME_REQUEST   0x0288

Definition at line 644 of file nsWindow.cpp.

#define WM_MOUSEHWHEEL   0x020E

Definition at line 176 of file nsWindow.cpp.

#define WM_XP_THEMECHANGED   0x031A

Definition at line 4309 of file nsWindow.cpp.

#define ZH_CN_INTELLEGENT_ABC_IME   ((HKL)0xe0040804L)

Definition at line 6695 of file nsWindow.cpp.

#define ZH_CN_MS_PINYIN_IME_3_0   ((HKL)0xe00e0804L)

Definition at line 6696 of file nsWindow.cpp.

#define ZH_CN_NEIMA_IME   ((HKL)0xe0050804L)

Definition at line 6697 of file nsWindow.cpp.


Typedef Documentation


Function Documentation

static BOOL CALLBACK DummyDialogProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
) [static]

Definition at line 1535 of file nsWindow.cpp.

                                                                                            {
  return FALSE;
}
static BOOL CALLBACK gEnumWindowsProc ( HWND  hwnd,
LPARAM  lParam 
) [static]

Definition at line 1917 of file nsWindow.cpp.

{
  DWORD pid;
  ::GetWindowThreadProcessId(hwnd, &pid);
  if (pid == _getpid() && ::IsWindowVisible(hwnd))
  {
    gWindowsVisible = PR_TRUE;
    return FALSE;
  }
  return TRUE;
}

Here is the caller graph for this function:

static char* GetNSWindowPropName ( ) [static]

Definition at line 1446 of file nsWindow.cpp.

                                   {
  if (!*sPropName)
  {
    _snprintf(sPropName, 39, "MozillansIWidgetPtr%p", _getpid());
    sPropName[39] = '\0';
  }
  return sPropName;
}
static nsresult HeapDump ( const char *  filename,
const char *  heading 
) [static]

Definition at line 4312 of file nsWindow.cpp.

{
#ifdef WINCE
  return NS_ERROR_NOT_IMPLEMENTED;
#else
  // Make sure heapwalk() is available
  typedef BOOL WINAPI HeapWalkProc(HANDLE hHeap, LPPROCESS_HEAP_ENTRY lpEntry);
  typedef DWORD WINAPI GetProcessHeapsProc(DWORD NumberOfHeaps, PHANDLE ProcessHeaps);

  static PRBool firstTime = PR_TRUE;
  static HeapWalkProc *heapWalkP = NULL;
  static GetProcessHeapsProc *getProcessHeapsP = NULL;

  if (firstTime) {
    firstTime = PR_FALSE;
    HMODULE kernel = GetModuleHandle("kernel32.dll");
    if (kernel) {
      heapWalkP = (HeapWalkProc*)GetProcAddress(kernel, "HeapWalk");
      getProcessHeapsP = (GetProcessHeapsProc*)GetProcAddress(kernel, "GetProcessHeaps");
    }
  }

  if (!heapWalkP)
    return NS_ERROR_NOT_AVAILABLE;

  PRFileDesc *prfd = PR_Open(filename, PR_CREATE_FILE | PR_APPEND | PR_WRONLY, 0777);
  if (!prfd)
    return NS_ERROR_FAILURE;

  char buf[1024];
  PRUint32 n;
  PRUint32 written = 0;
  HANDLE heapHandle[64];
  DWORD nheap = (*getProcessHeapsP)(64, heapHandle);
  if (nheap == 0 || nheap > 64) {
    return NS_ERROR_FAILURE;
  }

  n = PR_snprintf(buf, sizeof buf, "BEGIN HEAPDUMP : %s\n", heading);
  PR_Write(prfd, buf, n);
  for (DWORD i = 0; i < nheap; i++) {
    // Dump each heap
    PROCESS_HEAP_ENTRY ent = {0};
    n = PR_snprintf(buf, sizeof buf, "BEGIN heap %d : 0x%p\n", i+1, heapHandle[i]);
    PR_Write(prfd, buf, n);
    ent.lpData = NULL;
    while ((*heapWalkP)(heapHandle[i], &ent)) {
      if (ent.wFlags & PROCESS_HEAP_REGION)
        n = PR_snprintf(buf, sizeof buf, "REGION %08p : overhead %d committed %d uncommitted %d firstblock %08p lastblock %08p\n",
                        ent.lpData, ent.cbOverhead,
                        ent.Region.dwCommittedSize, ent.Region.dwUnCommittedSize,
                        ent.Region.lpFirstBlock, ent.Region.lpLastBlock);
      else
        n = PR_snprintf(buf, sizeof buf, "%s %08p : %6d overhead %2d\n",
                        (ent.wFlags & PROCESS_HEAP_UNCOMMITTED_RANGE) ? "----" : ((ent.wFlags & PROCESS_HEAP_ENTRY_BUSY) ? "USED" : "FREE"),
                        ent.lpData, ent.cbData, ent.cbOverhead);
      PR_Write(prfd, buf, n);
    }
    n = PR_snprintf(buf, sizeof buf, "END heap %d : 0x%p\n", i+1, heapHandle[i]);
    PR_Write(prfd, buf, n);
  }
  n = PR_snprintf(buf, sizeof buf, "END HEAPDUMP : %s\n", heading);
  PR_Write(prfd, buf, n);

  PR_Close(prfd);
  return NS_OK;
#endif // WINCE
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 295 of file nsWindow.cpp.

                                              {
  static PRBool didCheck = PR_FALSE;
  static PRBool isSupported = PR_FALSE;
  if (!didCheck) {
    didCheck = PR_TRUE;
    // Cursor translucency is supported on Windows XP and newer
    OSVERSIONINFO osversion;
    memset(&osversion, 0, sizeof(OSVERSIONINFO));
    osversion.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
    if (GetVersionEx(&osversion))
      isSupported = osversion.dwMajorVersion > 5 || // Newer Windows versions
                    osversion.dwMajorVersion == 5 &&
                       osversion.dwMinorVersion >= 1; // WinXP, Server 2003
  }

  return isSupported;
}

Here is the call graph for this function:

static PRBool IsWin2k ( ) [static]

Definition at line 314 of file nsWindow.cpp.

{
  static PRBool didCheck = PR_FALSE;
  static PRBool isWin2k = PR_FALSE;

  if (!didCheck) {
    didCheck = PR_TRUE;
    OSVERSIONINFO versionInfo;
  
    versionInfo.dwOSVersionInfoSize = sizeof(versionInfo);
    if (::GetVersionEx(&versionInfo))
      isWin2k = versionInfo.dwMajorVersion == 5 &&
                versionInfo.dwMinorVersion == 0;
  }

  return isWin2k;
}
static PRBool LangIDToCP ( WORD  aLangID,
UINT oCP 
) [static]

Definition at line 734 of file nsWindow.cpp.

{
  int localeid=MAKELCID(aLangID,SORT_DEFAULT);
  int numchar=GetLocaleInfo(localeid,LOCALE_IDEFAULTANSICODEPAGE,NULL,0);
  char cp_on_stack[32];
  char* cp_name;

  if (numchar > 32)
    cp_name  = new char[numchar];
  else
    cp_name = cp_on_stack;
  if (cp_name) {
    GetLocaleInfo(localeid,LOCALE_IDEFAULTANSICODEPAGE,cp_name,numchar);
    oCP = atoi(cp_name);
    if (cp_name != cp_on_stack)
      delete [] cp_name;
    return PR_TRUE;
  } else {
    oCP = CP_ACP;
    return PR_FALSE;
  }
}

Here is the caller graph for this function:

static NS_DEFINE_CID ( kCClipboardCID  ,
NS_CLIPBOARD_CID   
) [static]
static NS_DEFINE_IID ( kRenderingContextCID  ,
NS_RENDERING_CONTEXT_CID   
) [static]
static VOID CALLBACK nsGetAttentionTimerFunc ( HWND  hwnd,
UINT  uMsg,
UINT  idEvent,
DWORD  dwTime 
) [static]

Definition at line 7918 of file nsWindow.cpp.

{
  // flash the window until we're in the foreground.
  if (::GetForegroundWindow() != hwnd)
  {
    // flash the outermost owner
    HWND flashwnd = gAttentionTimerMonitor->GetFlashWindowFor(hwnd);

    PRInt32 maxFlashCount = gAttentionTimerMonitor->GetMaxFlashCount(hwnd);
    PRInt32 flashCount = gAttentionTimerMonitor->GetFlashCount(hwnd);
    if (maxFlashCount > 0) {
      // We have a max flash count, if we haven't met it yet, flash again.
      if (flashCount < maxFlashCount) {
        ::FlashWindow(flashwnd, TRUE);
        gAttentionTimerMonitor->IncrementFlashCount(hwnd);
      }
      else
        gAttentionTimerMonitor->KillTimer(hwnd);
    }
    else {
      // The caller didn't specify a flash count.
      ::FlashWindow(flashwnd, TRUE);
    }

    gAttentionTimerMonitor->SetFlashed(hwnd);
  }
  else
    gAttentionTimerMonitor->KillTimer(hwnd);
}

Here is the call graph for this function:

static PRUint32 PlatformToNSAttr ( PRUint8  aAttr) [static]

Definition at line 6891 of file nsWindow.cpp.

{
  switch (aAttr)
  {
    case ATTR_INPUT_ERROR:
    // case ATTR_FIXEDCONVERTED:
    case ATTR_INPUT:
      return NS_TEXTRANGE_RAWINPUT;
    case ATTR_CONVERTED:
      return NS_TEXTRANGE_CONVERTEDTEXT;
    case ATTR_TARGET_NOTCONVERTED:
      return NS_TEXTRANGE_SELECTEDRAWTEXT;
    case ATTR_TARGET_CONVERTED:
      return NS_TEXTRANGE_SELECTEDCONVERTEDTEXT;
    default:
      NS_ASSERTION(PR_FALSE, "unknown attribute");
      return NS_TEXTRANGE_CARETPOSITION;
  }
}

Here is the caller graph for this function:


Variable Documentation

Definition at line 868 of file nsWindow.cpp.

HHOOK gCallMouseHook = NULL [static]

Definition at line 441 of file nsWindow.cpp.

HHOOK gCallProcHook = NULL [static]

Definition at line 440 of file nsWindow.cpp.

UINT gHookTimerId = 0 [static]

Definition at line 445 of file nsWindow.cpp.

Definition at line 3953 of file nsWindow.cpp.

Definition at line 3952 of file nsWindow.cpp.

LONG gLastClickCount = 0L [static]

Definition at line 456 of file nsWindow.cpp.

Definition at line 463 of file nsWindow.cpp.

BYTE gLastMouseButton = 0 [static]

Definition at line 457 of file nsWindow.cpp.

LONG gLastMouseDownTime = 0L [static]

Definition at line 455 of file nsWindow.cpp.

POINT gLastMouseMovePoint [static]

Definition at line 454 of file nsWindow.cpp.

POINT gLastMousePoint [static]

Definition at line 453 of file nsWindow.cpp.

HHOOK gMsgFilterHook = NULL [static]

Definition at line 439 of file nsWindow.cpp.

Definition at line 6700 of file nsWindow.cpp.

Definition at line 442 of file nsWindow.cpp.

Definition at line 432 of file nsWindow.cpp.

Definition at line 430 of file nsWindow.cpp.

UINT gRollupMsgId = 0 [static]

Definition at line 443 of file nsWindow.cpp.

HWND gRollupMsgWnd = NULL [static]

Definition at line 444 of file nsWindow.cpp.

Definition at line 431 of file nsWindow.cpp.

int gTrimOnMinimize = 2 [static]

Definition at line 465 of file nsWindow.cpp.

Definition at line 1915 of file nsWindow.cpp.

const char kMozHeapDumpMessageString[] = "MOZ_HeapDump" [static]

Definition at line 162 of file nsWindow.cpp.

char sPropName[40] = "" [static]

Definition at line 1445 of file nsWindow.cpp.

const char* sScreenManagerContractID = "@mozilla.org/gfx/screenmanager;1" [static]

Definition at line 350 of file nsWindow.cpp.