Back to index

lightning-sunbird  0.9+nobinonly
Classes | Functions | Variables
nsCommonWidget.cpp File Reference
#include "nsCommonWidget.h"
#include "nsGUIEvent.h"
#include "nsQtEventDispatcher.h"
#include "nsIRenderingContext.h"
#include "nsIServiceManager.h"
#include "nsGfxCIID.h"
#include "nsIPrefBranch.h"
#include "nsIPrefService.h"
#include "mozqwidget.h"
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qwidget.h>
#include <qcursor.h>
#include <execinfo.h>
#include <stdlib.h>

Go to the source code of this file.

Classes

struct  nsKeyConverter

Functions

static void backTrace ()
static PRInt32 NS_GetKey (PRInt32 aKey)
static PRBool isContextMenuKey (const nsKeyEvent &aKeyEvent)
static void keyEventToContextMenuEvent (const nsKeyEvent *aKeyEvent, nsMouseEvent *aCMEvent)

Variables

static const int WHEEL_DELTA = 120
static const int kWindowPositionSlop = 20
static struct nsKeyConverter []

Class Documentation

struct nsKeyConverter

Definition at line 2227 of file nsWindow.cpp.

Collaboration diagram for nsKeyConverter:
Class Members
char bekeycode
unsigned int keysym
int keysym
unsigned long keysym
PRUint32 vkCode
int vkCode

Function Documentation

static void backTrace ( ) [static]

Definition at line 71 of file nsCommonWidget.cpp.

{
    int levels = -1;
    QString s;
    void* trace[256];
    int n = backtrace(trace, 256);
    if (!n)
       return;
    char** strings = backtrace_symbols (trace, n);

    if ( levels != -1 )
        n = QMIN( n, levels );
    s = "[\n";

    for (int i = 0; i < n; ++i)
        s += QString::number(i) +
             QString::fromLatin1(": ") +
             QString::fromLatin1(strings[i]) + QString::fromLatin1("\n");
    s += "]\n";
    if (strings)
        free (strings);
    qDebug("stacktrace:\n%s", s.latin1());
}
static PRBool isContextMenuKey ( const nsKeyEvent aKeyEvent) [static]

Definition at line 231 of file nsCommonWidget.cpp.

{
    return ((aKeyEvent.keyCode == NS_VK_F10 && aKeyEvent.isShift &&
             !aKeyEvent.isControl && !aKeyEvent.isMeta && !aKeyEvent.isAlt) ||
            (aKeyEvent.keyCode == NS_VK_CONTEXT_MENU && !aKeyEvent.isShift &&
             !aKeyEvent.isControl && !aKeyEvent.isMeta && !aKeyEvent.isAlt));
}

Here is the caller graph for this function:

static void keyEventToContextMenuEvent ( const nsKeyEvent aKeyEvent,
nsMouseEvent aCMEvent 
) [static]

Definition at line 240 of file nsCommonWidget.cpp.

{
    memcpy(aCMEvent, aKeyEvent, sizeof(nsInputEvent));
    aCMEvent->message = NS_CONTEXTMENU_KEY;
    aCMEvent->isShift = aCMEvent->isControl = PR_FALSE;
    aCMEvent->isAlt = aCMEvent->isMeta = PR_FALSE;
    aCMEvent->clickCount = 0;
    aCMEvent->acceptActivation = PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRInt32 NS_GetKey ( PRInt32  aKey) [static]

Definition at line 218 of file nsCommonWidget.cpp.

{
    PRInt32 length = sizeof(nsKeycodes) / sizeof(nsKeyConverter);

    for (PRInt32 i = 0; i < length; i++) {
        if (nsKeycodes[i].keysym == aKey) {
            return nsKeycodes[i].vkCode;
        }
    }
    return 0;
}

Here is the caller graph for this function:


Variable Documentation

const int kWindowPositionSlop = 20 [static]

Definition at line 63 of file nsCommonWidget.cpp.

struct nsKeyConverter[] [static]

Definition at line 95 of file nsCommonWidget.cpp.

const int WHEEL_DELTA = 120 [static]

Definition at line 62 of file nsCommonWidget.cpp.