2010-07-15 14:07:49 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
* vim: set ts=2 sw=2 et tw=78:
|
2012-05-21 04:12:37 -07:00
|
|
|
* 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/.
|
2010-07-15 14:07:49 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* It's useful to be able to dynamically check the type of certain items.
|
|
|
|
* Every subclass of nsDisplayItem must have a new type added here for the purposes
|
|
|
|
* of easy comparison and matching of items in different display lists.
|
|
|
|
*
|
|
|
|
* This is #included inside nsDisplayItem.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
2012-10-11 16:38:25 -07:00
|
|
|
enum Type {
|
|
|
|
TYPE_ZERO = 0, /** Spacer so that the first item starts at 1 */
|
2010-07-15 14:07:49 -07:00
|
|
|
|
2012-10-11 16:38:25 -07:00
|
|
|
#define DECLARE_DISPLAY_ITEM_TYPE(name) TYPE_##name,
|
|
|
|
#include "nsDisplayItemTypesList.h"
|
|
|
|
#undef DECLARE_DISPLAY_ITEM_TYPE
|
2010-07-15 14:07:49 -07:00
|
|
|
|
|
|
|
TYPE_MAX
|
|
|
|
};
|
2010-07-15 14:08:10 -07:00
|
|
|
|
|
|
|
enum {
|
|
|
|
// Number of bits needed to represent all types
|
|
|
|
TYPE_BITS = 8
|
|
|
|
};
|
2012-10-11 16:38:25 -07:00
|
|
|
|
|
|
|
static const char* DisplayItemTypeName(Type aType)
|
|
|
|
{
|
|
|
|
switch (aType) {
|
|
|
|
#define DECLARE_DISPLAY_ITEM_TYPE(name) case TYPE_##name: return #name;
|
|
|
|
#include "nsDisplayItemTypesList.h"
|
|
|
|
#undef DECLARE_DISPLAY_ITEM_TYPE
|
|
|
|
|
|
|
|
default: return "TYPE_UNKNOWN";
|
|
|
|
}
|
|
|
|
}
|