author Mike Hommey <mh+mozilla@glandium.org>
Fri, 23 Jun 2017 15:05:06 +0900
changeset 366422 374900b2142af725d4136758ac00dce2fbb824be
parent 359279 68c474271ba5786863f2e89bfcf8e6069383c38a
child 370465 2d219d3f6dc453342267c55fdbdc355fc6d97568
permissions -rw-r--r--
Bug 1375798 - Reorganize the library_name_info function. r=mshal The function as it currently is matches how things were done in old-configure.in. However, that's just confusing and hard to follow. In fact, the unit test failing numerous times while writing this patch pretty much highlights the problem. So instead of a confusing set of overrides to the prefixes and suffixes, spell out the whole set for each set of platforms. This also happens to make the function shorter. Win/win. At the same time, we normalize the function output as a nested namespace, where we get, for each of dll, lib, import_lib, etc. a prefix/suffix pair. Further down the road, we can imagine changing those to class instances with a method allowing to format file names based on those prefix/suffixes.

/* -*- 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 mozilla_EventForwards_h__
#define mozilla_EventForwards_h__

#include <stdint.h>

#include "nsTArray.h"

class nsCString;

 * XXX Following enums should be in BasicEvents.h.  However, currently, it's
 *     impossible to use foward delearation for enum.

 * Return status for event processors.
enum nsEventStatus
  // The event is ignored, do default processing
  // The event is consumed, don't do default processing
  // The event is consumed, but do default processing
  // Value is not for use, only for serialization

namespace mozilla {

 * Event messages

typedef uint16_t EventMessageType;

enum EventMessage : EventMessageType

#define NS_EVENT_MESSAGE(aMessage) aMessage,
#define NS_EVENT_MESSAGE_FIRST_LAST(aMessage, aFirst, aLast) \
  aMessage##First = aFirst, aMessage##Last = aLast,

#include "mozilla/EventMessageList.h"


  // For preventing bustage due to "," after the last item.

const char* ToChar(EventMessage aEventMessage);

 * Event class IDs

typedef uint8_t EventClassIDType;

enum EventClassID : EventClassIDType
  // The event class name will be:
  //   eBasicEventClass for WidgetEvent
  //   eFooEventClass for WidgetFooEvent or InternalFooEvent
#define NS_ROOT_EVENT_CLASS(aPrefix, aName)   eBasic##aName##Class
#define NS_EVENT_CLASS(aPrefix, aName)      , e##aName##Class

#include "mozilla/EventClassList.h"


const char* ToChar(EventClassID aEventClassID);

typedef uint16_t Modifiers;

#define NS_DEFINE_KEYNAME(aCPPName, aDOMKeyName) \

typedef uint16_t KeyNameIndexType;
enum KeyNameIndex : KeyNameIndexType
#include "mozilla/KeyNameList.h"
  // If a DOM keyboard event is synthesized by script, this is used.  Then,
  // specified key name should be stored and use it as .key value.


const nsCString ToString(KeyNameIndex aKeyNameIndex);


typedef uint8_t CodeNameIndexType;
enum CodeNameIndex : CodeNameIndexType
#include "mozilla/PhysicalKeyCodeNameList.h"
  // If a DOM keyboard event is synthesized by script, this is used.  Then,
  // specified code name should be stored and use it as .code value.


const nsCString ToString(CodeNameIndex aCodeNameIndex);

#define NS_DEFINE_COMMAND(aName, aCommandStr) , Command##aName

typedef int8_t CommandInt;
enum Command : CommandInt

#include "mozilla/CommandList.h"

} // namespace mozilla

 * All header files should include this header instead of *Events.h.

namespace mozilla {

#define NS_EVENT_CLASS(aPrefix, aName) class aPrefix##aName;
#define NS_ROOT_EVENT_CLASS(aPrefix, aName) NS_EVENT_CLASS(aPrefix, aName)

#include "mozilla/EventClassList.h"


// BasicEvents.h
struct BaseEventFlags;
struct EventFlags;

class WidgetEventTime;

class NativeEventData;

// TextEvents.h
struct AlternativeCharCode;
struct ShortcutKeyCandidate;

typedef nsTArray<ShortcutKeyCandidate> ShortcutKeyCandidateArray;
typedef AutoTArray<ShortcutKeyCandidate, 10> AutoShortcutKeyCandidateArray;

// TextRange.h
typedef uint8_t RawTextRangeType;
enum class TextRangeType : RawTextRangeType;

struct TextRangeStyle;
struct TextRange;

class EditCommands;
class TextRangeArray;

// FontRange.h
struct FontRange;

} // namespace mozilla

#endif // mozilla_EventForwards_h__