gecko/widget/gtk2/nsNativeKeyBindings.h
Ehsan Akhgari 0fd9123eac Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00

73 lines
2.2 KiB
C++

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#ifndef nsNativeKeyBindings_h_
#define nsNativeKeyBindings_h_
// X.h defines KeyPress
#ifdef KeyPress
#undef KeyPress
#endif
#include "nsINativeKeyBindings.h"
#include "mozilla/Attributes.h"
#include <gtk/gtk.h>
enum NativeKeyBindingsType {
eKeyBindings_Input,
eKeyBindings_TextArea
};
#define NS_NATIVEKEYBINDINGSINPUT_CID \
{0x5c337258, 0xa580, 0x472e, {0x86, 0x15, 0xf2, 0x77, 0xdd, 0xc5, 0xbb, 0x06}}
#define NS_NATIVEKEYBINDINGSINPUT_CONTRACTID \
NS_NATIVEKEYBINDINGS_CONTRACTID_PREFIX "input"
#define NS_NATIVEKEYBINDINGSTEXTAREA_CID \
{0x2a898043, 0x180f, 0x4c8b, {0x8e, 0x54, 0x41, 0x0c, 0x7a, 0x54, 0x0f, 0x27}}
#define NS_NATIVEKEYBINDINGSTEXTAREA_CONTRACTID \
NS_NATIVEKEYBINDINGS_CONTRACTID_PREFIX "textarea"
#define NS_NATIVEKEYBINDINGSEDITOR_CID \
{0xf916ebfb, 0x78ef, 0x464b, {0x94, 0xd0, 0xa6, 0xf2, 0xca, 0x32, 0x00, 0xae}}
#define NS_NATIVEKEYBINDINGSEDITOR_CONTRACTID \
NS_NATIVEKEYBINDINGS_CONTRACTID_PREFIX "editor"
class nsNativeKeyBindings MOZ_FINAL : public nsINativeKeyBindings
{
public:
NS_HIDDEN_(void) Init(NativeKeyBindingsType aType);
NS_DECL_ISUPPORTS
// nsINativeKeyBindings
virtual NS_HIDDEN_(bool) KeyDown(const nsNativeKeyEvent& aEvent,
DoCommandCallback aCallback,
void *aCallbackData);
virtual NS_HIDDEN_(bool) KeyPress(const nsNativeKeyEvent& aEvent,
DoCommandCallback aCallback,
void *aCallbackData);
virtual NS_HIDDEN_(bool) KeyUp(const nsNativeKeyEvent& aEvent,
DoCommandCallback aCallback,
void *aCallbackData);
private:
~nsNativeKeyBindings() NS_HIDDEN;
bool KeyPressInternal(const nsNativeKeyEvent& aEvent,
DoCommandCallback aCallback,
void *aCallbackData,
uint32_t aKeyCode);
GtkWidget *mNativeTarget;
};
#endif