Reference: Application Program Interface



This is the list of the application program interface (API) entries useful for writing a plugin.
Table of contents
* Miscellanea
* Wrapper
* Properties
* Tiles
* SparseTiles
* FullTiles
* TilesStack
* Map
* Brush
* GraphicalUserInterface
* Features
* SelectedTiles
* Various commands
* LayerUtils
* ViewedLayers
* Popups
* [ FIXME DatafileManager ]
* [ FIXME Strings ]
* Deprecated
For all functions :
* 0 = NULL
* arrays begin with 0
* (0, 0) is top left corner

 


Miscellanea


 


int EME_VERSION_MAJOR
int EME_VERSION_MINOR
int EME_VERSION_DEVEL
const char * EME_VERSION_TEXT
Define eme version. [ FIXME: add more description ]

 


Wrapper



Wrapper objects allow you to create and access a map.
Table of contents
* Types
* Constructors and destructor
* Miscellanea
* Iterators
* Userdata
* Getting a map property
* Setting a map property
* Map property misc
* Getting a layer
* Setting a layer
* Layer misc
* Getting a tile
* Setting a tile
* Tile misc
* Composite

 


Types


LAYER_TYPE FULL_LAYER


LAYER_TYPE SPARSE_LAYER


class CompositeHandle
See also: Composite


typedef int Wrapper::iterator
See also: Wrapper::Begin, Wrapper::Next, Wrapper::End.


typedef int Wrapper::const_iterator
See also: Wrapper::Begin, Wrapper::Next, Wrapper::End.

 


Constructors and destructor

 


Wrapper::Wrapper(int width, int height, int num_layers, int num_map_props)
Wrapper::Wrapper(int width, int height)
   int width, int height - map width and height, in tiles
   int num_layers - number of layers in the map
   int num_map_props - number of properties in the map
Wrapper::Wrapper(Map *map)
   Map *map - map to access
Wrapper::Wrapper(const Map *map)
   const Map *map - map to access
The first two functions create a Wrapper object and the wrapped map. They are typically used in the plugin functions "plugin_load" and "plugin_new". If width and height aren't specified, they are automatically computed.
The third function creates a Wrapper object to modify an existing map. It is typically used in plugin menu callbacks.
The fourth function creates a Wrapper object to access an existing map. It is typically used in the plugin function "plugin_save" and menu callbacks. Note that Wrapper non-const methods won't work in the case of a const map. This won't be caught at compilation time, but at execution time. Note also that to be able to catch this at compile time, you should declare the wrapper with a const map as a const Wrapper.

 


Wrapper::~Wrapper()
Destroys a Wrapper.

 


Miscellanea

 


void Wrapper::SetMapShape(MAP_SHAPE shape)
   MAP_SHAPE shape - map shape, can be MAP_SHAPE_RECT or MAP_SHAPE_DIAMOND
Sets the map shape.
Must not be called if the wrapper was constructed with a const map.

 


void Wrapper::SetTileShape(TILE_SHAPE shape, int w, int h)
   TILE_SHAPE shape - tile shape, can be TILE_SHAPE_RECT or TILE_SHAPE_DIAMOND
   int w, int h - tile size, in pixels
Sets the tile shape and size.
Must not be called if the wrapper was constructed with a const map.

 


void Wrapper::SetTileOffset(int dx, int dy)
void Wrapper::SetTileOffset(int dx, int dy, ODD odd)
   int dx, int dy - tile delta, in pixels
   ODD odd - tile oddness, can be ODD_NONE, ODD_RIGHT or ODD_LEFT
Sets the tile oddness and delta. By default the oddness is ODD_NONE.
Must not be called if the wrapper was constructed with a const map.

 


int Wrapper::GetMapWidth() const
Returns the map width in tiles.

 


int Wrapper::GetMapHeight() const
Returns the map height in tiles.

 


bool Wrapper::IsIn(int i, int j) const
   int i, int j - tile indices
Returns true iff the position (i, j) is between (0, 0) inclusive and (width, height) exclusive.

 


void Wrapper::SetMap()
Tells eme that the map construction is done. Should be called at the end of plugin_new and plugin_load. Accessing the wrapper after calling this function is undefined.
Must not be called if the wrapper was constructed with a const map. Must not be called if there was an error during the map construction.

 


const Map * Wrapper::GetMap() const
Map * Wrapper::GetMap()
Returns the wrapped map.

 


const ViewedLayers & Wrapper::GetViewedLayers() const
Returns the list of visible layers.

 


const SelectedTiles * Wrapper::GetSelectedTiles() const
Returns the current map selection.

 


void Wrapper::Execute(Command *cmd)
   Command *cmd - command to execute, the wrapper takes ownership of it
Executes the command cmd on the current map and put it in the undoable list.
Must not be called if the wrapper was constructed with a const map.
See also: Wrapper::ClearUndoStack.

 


void Wrapper::ClearUndoStack()
Clears the undo stack.
See also: Wrapper::Execute.

 


Iterators


Iterators allow you to access the tiles in a layer.

 


int Wrapper::BeginI(int l) const
   int l - layer index (first layer drawn is 0)
Returns the smallest horizontal index in the layer at index l (leftmost tile).
See also: Wrapper::BeginJ, Wrapper::EndI.

 


int Wrapper::BeginJ(int l) const
   int l - layer index (first layer drawn is 0)
Returns the smallest vertical index in the layer at index l (topmost tile).
See also: Wrapper::BeginI, Wrapper::EndJ.

 


int Wrapper::EndI(int l) const
   int l - layer index (first layer drawn is 0)
Returns one plus the highest horizontal index in the layer at index l (rightmost tile).
See also: Wrapper::EndI, Wrapper::BeginJ.

 


int Wrapper::EndJ(int l) const
   int l - layer index (first layer drawn is 0)
Returns one plus the highest vertical index in the layer at index l (bottommost tile).
See also: Wrapper::EndJ, Wrapper::BeginI.

 


int Wrapper::Count(int l) const
   int l - layer index (first layer drawn is 0)
Returns the number of tiles in the layer at index l.

 


const_iterator Wrapper::Begin(int l) const
iterator Wrapper::Begin(int l)
   int l - layer index (first layer drawn is 0)
Returns an iterator referencing the "first" tiles in the lth layer.
See also: Wrapper::End, Wrapper::Next.

 


const_iterator Wrapper::End(int l) const
iterator Wrapper::End(int l)
   int l - layer index (first layer drawn is 0)
Returns an iterator one past the "last" tiles in the lth layer.
See also: Wrapper::Begin, Wrapper::Next.

 


const_iterator Wrapper::Next(int l, const_iterator id) const
iterator Wrapper::Next(int l, iterator id)
   int l - layer index (first layer drawn is 0)
   iterator id - iterator to advance
Advance an iterator.
See also: Wrapper::Begin, Wrapper::End.

 


Userdata


A userdata is a data that can't be interpreted by eme, but that should be associated to a map. Its type is void*.

 


void Wrapper::SetUserdata(void *userdata)
void Wrapper::SetUserdata(void *userdata, void (*destroyer)(void *userdata))
   void *userdata - the new userdata, does not take ownership of it
   void (*destroyer)(void *userdata) - the function to destroy the userdata, 0 if unspecified
Sets the map userdata. The previous userdata destroyer is called if both the userdata and the destroyer are non-zero. The destroyer is also called when the map is destroyed.
Must not be called if the wrapper was constructed with a const map.
See also: Wrapper::GetUserdata, GraphicalUserInterface::SetDrawUserdata.

 


void * Wrapper::GetUserdata() const
Returns the map userdata.
See also: Wrapper::SetUserdata, GraphicalUserInterface::SetDrawUserdata.

 


Getting a map property

 


template<typename Type> Type::Base Wrapper::GetProperty(int n) const
   int n - property index (the first one is 0)
Returns the nth map property value.

 


const BaseProperty * Wrapper::RawGetProperty(int n) const
   int n - property index (the first one is 0)
Returns the nth map property. This is a low level function, use GetProperty as much as possible.
See also: Wrapper::SetProperty.

 


Setting a map property

 


template<typename Type> void Wrapper::SetProperty(int n, const char *name, Type::Base value)
template<typename Type> void Wrapper::SetProperty(int n, const char *name, Type::Base value, Type::Param param)
   int n - property index (the first one is 0)
   const char *name - property name, in the current encoding
   Type::Base value - property value
   Type::Param param - additional parameter for the type
Sets the nth map property to value.
Must not be called if the wrapper was constructed with a const map.

 


void Wrapper::RawSetProperty(int n, BaseCreator *creator)
   int n - property index (the first one is 0)
   BaseCreator *creator - creator of the property to set, the Wrapper takes ownership of it
Sets the nth map property to creator. This is a low level function, use SetProperty as much as possible.
Must not be called if the wrapper was constructed with a const map.
See also: Wrapper::SetProperty.

 


Map property misc

 


void Wrapper::SetNumProperties(int property_count)
   int property_count - number of properties
Sets the number of properties in a map.
Must not be called if the wrapper was constructed with a const map.

 


int Wrapper::GetNumProperties() const
Returns the number of properties in a map.

 


Getting a layer

 


const Tiles * Wrapper::GetLayer(int l) const
Tiles * Wrapper::GetLayer(int l)
   int l - layer index (first layer drawn is 0)
Returns the lth layer in the map.

 


const char * Wrapper::GetLayerName(int l) const
   int l - layer index (first layer drawn is 0)
Returns the lth layer name, in current encoding.

 


const BaseProperty * GetLayerReference(int l) const
   int l - layer index (first layer drawn is 0)
Returns the reference property of the layer at index l.

 


template<typename Type> const Type::Creator * Wrapper::GetLayerCreator(int l) const
   int l - layer index (first layer drawn is 0)
Returns the creator of lth layer in the map.

 


const BaseCreator * Wrapper::RawGetCreator(int l) const
   int l - layer index (first layer drawn is 0)
Returns the creator of lth layer in the map. This is a low level function, use GetLayerCreator as much as possible.
See also: Wrapper::GetLayerCreator.

 


Setting a layer

 


template<typename Type> void Wrapper::SetLayer(int l, const char *name, LAYER_TYPE ltype, int i, int j, int w, int h, Type::Base default_value)
template<typename Type> void Wrapper::SetLayer(int l, const char *name, LAYER_TYPE ltype, int i, int j, int w, int h, Type::Base default_value, Type::Param param)
template<typename Type> void Wrapper::SetLayer(int l, const char *name, LAYER_TYPE ltype, Type::Base default_value)
template<typename Type> void Wrapper::SetLayer(int l, const char *name, LAYER_TYPE ltype, Type::Base default_value, Type::Param param)
   int l - layer index (first layer drawn is 0)
   const char *name - layer name, in current encoding
   LAYER_TYPE ltype - layer type, can be FULL_LAYER or SPARSE_LAYER
   int i, int j - layer position, in tiles (topleft is (0, 0))
   int w, int h - layer size, in tiles
   Type::Base default_value - default value for the layer tiles
   Type::Param param - additional parameter for the type
Creates the lth layer, of the given Type. If i, j, w, h aren't specified, the layer begins at (0, 0) and its size is the map size.
Must not be called if the wrapper was constructed with a const map.

 


void Wrapper::RawSetLayer(int l, LAYER_TYPE ltype, BaseCreator *creator, int i, int j, int w, int h)
void Wrapper::RawSetLayer(int l, LAYER_TYPE ltype, BaseCreator *creator)
   int l - layer index (first layer drawn is 0)
   LAYER_TYPE ltype - layer type, can be FULL_LAYER or SPARSE_LAYER
   BaseCreator *creator - tiles creator of the layer to set, the Wrapper takes ownership of it
   int i, int j - layer position, in tiles (topleft is (0, 0))
   int w, int h - layer size, in tiles
Creates the lth layer, of the given creator. If i, j, w, h aren't specified, the layer begins at (0, 0) and its size is the map size. This is a low level function, use SetLayer as much as possible.
Must not be called if the wrapper was constructed with a const map.
See also: Wrapper::SetLayer.

 


Layer misc

 


void Wrapper::SetNumLayers(int layer_count)
   int layer_count - number of layers
Sets the number of layer in a map.
Must not be called if the wrapper was constructed with a const map.

 


int Wrapper::GetNumLayers() const
Returns the number of layer in a map.

 


int Wrapper::GetActiveLayerIndex() const
Returns the index of the active layer.

 


int Wrapper::FindLayerIndex(const char *name) const
   const char *name - layer name, in current encoding
Returns the index of the first layer with name, or GetNumLayers() if not found.

 


template<typename Type> bool Wrapper::LayerIs(int l) const
Returns true if the layer at index l has the given type.

 


void Wrapper::FillLayer(int l)
   int l - layer index (first layer drawn is 0)
Fills the layer at index l if it is a full layer. If it is a sparse layer, do nothing.
Must not be called if the wrapper was constructed with a const map.

 


const TilesStack * Wrapper::GetLayers() const
TilesStack * Wrapper::GetLayers()
Returns the stack of layers of the map.

 


Getting a tile

 


template<typename Type> const Type::Base Wrapper::GetTileValue(int l, int i, int j) const
template<typename Type> Type::Base Wrapper::GetTileValue(int l, int i, int j)
template<typename Type> const Type::Base Wrapper::GetTileValue(int l, const_iterator id) const
template<typename Type> Type::Base Wrapper::GetTileValue(int l, iterator id)
   int l - layer index (first layer drawn is 0)
   int i, int j - tile position, in tiles (topleft is (0, 0))
   const_iterator id - reference to the tile
   iterator id - reference to the tile
Returns the tile value at (i, j) or referenced by id, of the lth layer.

 


template<typename Type> const Type::Property * Wrapper::GetTileProperty(int l, const_iterator id) const
template<typename Type> Type::Property * Wrapper::GetTileProperty(int l, iterator id)
template<typename Type> const Type::Property * Wrapper::GetTileProperty(int l, int i, int j) const
template<typename Type> Type::Property * Wrapper::GetTileProperty(int l, int i, int j)
   int l - layer index (first layer drawn is 0)
   int i, int j - tile position, in tiles (topleft is (0, 0))
   const_iterator id - reference to the tile
   iterator id - reference to the tile
Returns the tile property at (i, j) or referenced by id, of the lth layer. This is a somewhat low level function, use GetTileValue as much as possible.
See also: Wrapper::GetTileValue.

 


const BaseProperty * Wrapper::RawGetTileProperty(int l, const_iterator id) const
BaseProperty * Wrapper::RawGetTileProperty(int l, iterator id)
const BaseProperty * Wrapper::RawGetTileProperty(int l, int i, int j) const
BaseProperty * Wrapper::RawGetTileProperty(int l, int i, int j)
   int l - layer index (first layer drawn is 0)
   int i, int j - tile position, in tiles (topleft is (0, 0))
   const_iterator id - reference to the tile
   iterator id - reference to the tile
Returns the tile property at (i, j) or referenced by id, of the lth layer. This is a low level function, use GetTileValue or GetTileProperty as much as possible.
See also: Wrapper::GetTileValue, Wrapper::GetTileProperty.

 


Setting a tile

 


template<typename Type> void Wrapper::SetTileValue(int l, int i, int j, Type::Base value)
   int l - layer index (first layer drawn is 0)
   int i, int j - tile position, in tiles (topleft is (0, 0))
   Type::Base value - tile value
Sets the tile at (i, j) of the lth layer to value.
Must not be called if the wrapper was constructed with a const map.

 


void Wrapper::RawSetTileProperty(int l, int i, int j, BaseProperty *prop)
   int l - layer index (first layer drawn is 0)
   int i, int j - tile position, in tiles (topleft is (0, 0))
   BaseProperty *prop - new tile property
Sets the tile at (i, j) of the lth layer to creator. This is a low level function, use SetTileValue as much as possible.
Must not be called if the wrapper was constructed with a const map.
See also: Wrapper::SetTileValue.

 


Tile misc

 


inline bool Wrapper::TileExists(int l, int i, int j) const
   int l - layer index (first layer drawn is 0)
   int i, int j - tile position, in tiles (topleft is (0, 0))
Returns true iff there is a tile at (i, j) on the lth layer.

 


int Wrapper::GetTileI(int l, const_iterator id) const
   int l - layer index (first layer drawn is 0)
   const_iterator id - reference to the tile
Returns the horizontal index of the tile (leftmost is 0). Note: you can pass an iterator instead of a const_iterator).

 


int Wrapper::GetTileJ(int l, const_iterator id) const
   int l - layer index (first layer drawn is 0)
   const_iterator id - reference to the tile
Returns the vertical index of the tile (topmost is 0). Note: you can pass an iterator instead of a const_iterator).

 


Composite


The Composite property is a little different from other property types. It thus needs special functions in the Wrapper to handle it.
See also: Properties - Composite

 


CompositeHandle Wrapper::CreateComposite(const char *name, int num_properties)
   const char *name - composite (i.e. map property or layer) name
   int num_properties - number of properties in the composite
Creates and returns a handle to a Composite, to be used with the various wrapper functions handling Composite.
Must not be called if the wrapper was constructed with a const map.

 


const Composite::Property * Wrapper::GetCompositeProperty(int n) const
Composite::Property * Wrapper::GetCompositeProperty(int n)
   int n - property index (the first one is 0)
Returns the nth map property, cast to Composite::Property. This is equivalent to a call to Wrapper::GetProperty<Composite>.
See also: Wrapper::GetProperty

 


void Wrapper::SetCompositeProperty(int n, CompositeHandle handle)
   int n - property index (the first one is 0)
   CompositeHandle handle - handle to the Composite
Sets the nth map property to the property referenced by handle. This is the Composite version of the function Wrapper::SetProperty.
Must not be called if the wrapper was constructed with a const map.
See also: Wrapper::SetProperty

 


template<typename Type> void Wrapper::Add(CompositeHandle handle, int index, const char *name, Type::Base default_value)
template<typename Type> void Wrapper::Add(CompositeHandle handle, int index, const char *name, Type::Base default_value, Type::Param param)
   CompositeHandle handle - handle to the Composite
   int index - property index in the composite
   const char *name - property name in the composite
   Type::Base value - property value
   Type::Param param - additional parameter for the type
Sets the indexth property in the composite to value.
Must not be called if the wrapper was constructed with a const map.

 


inline void Wrapper::RawAdd(CompositeHandle handle, int index, BaseCreator *creator)
   CompositeHandle handle - handle to the Composite
   int index - property index in the composite
   BaseCreator *creator - creator of the property to set, the Composite object takes ownership of it
Sets the indexth property in the composite to creator. This is a low level function, use Wrapper::Add as much as possible.
Must not be called if the wrapper was constructed with a const map.
See also: Wrapper::Add

 


void Wrapper::SetCompositeLayer(int l, LAYER_TYPE ltype, CompositeHandle handle, int i, int j, int w, int h)
void Wrapper::SetCompositeLayer(int l, LAYER_TYPE ltype, CompositeHandle handle)
   int l - layer index (first layer drawn is 0)
   LAYER_TYPE ltype - layer type, can be FULL_LAYER or SPARSE_LAYER
   CompositeHandle handle - handle to the Composite
   int i, int j - tile position, in tiles (topleft is (0, 0))
   int w, int h - layer size, in tiles
Creates the lth layer, as a Composite layer. If i, j, w, h aren't specified, the layer begins at (0, 0) and its size is the map size. This is the Composite version of the function Wrapper::SetLayer.
Must not be called if the wrapper was constructed with a const map.
See also: Wrapper::SetLayer.

 


const Composite::Property * Wrapper::GetCompositeTile(int l, int i, int j) const
Composite::Property * Wrapper::GetCompositeTile(int l, int i, int j)
   int l - layer index (first layer drawn is 0)
   int i, int j - tile position, in tiles (topleft is (0, 0))
Returns the tile property at (i, j) of the lth layer. This is the composite version of the function Wrapper::GetTileValue. The properties inside the composite can be accessed with Wrapper::Get.
See also: Wrapper::GetTileValue, Wrapper::Get.

 


template<typename Type> Type::Base Wrapper::Get(const Composite::Property *composite, int index) const
   Composite Composite::Property *composite - composite tile
   int index - index of the property to get
Returns the value of the indexth property in the composite. The composite property was typically retrieved with Wrapper::GetCompositeTile.
See also: Wrapper::GetCompositeTile.

 


Composite::Property * Wrapper::SetCompositeTile(int l, int i, int j)
   int l - layer index (first layer drawn is 0)
   int i, int j - tile position, in tiles (topleft is (0, 0))
Creates a composite tile at (i, j) on the lth layer, returning a property to be filled with the function Wrapper::AddToTile.
Must not be called if the wrapper was constructed with a const map.
See also: Wrapper::AddToTile.

 


template<typename Type> void Wrapper::AddToTile(Composite::Property *composite, int index, Type::Base value)
   Composite::Property *composite - composite tile
   int index - index of the property to set
   Type::Base value - value of the indexth property
Sets the indexth property in the composite to value. The composite property was typically created with Wrapper::SetCompositeTile.
Must not be called if the wrapper was constructed with a const map.
See also: Wrapper::SetCompositeTile.

 


Properties



Table of content
* Properties and creators type
* Boolean
* Number
* Percent
* String
* List
* Color
* DatafileObject
* Composite

 


Properties and creators type


struct Type
class Type::Creator : public BaseCreator
class Type::Property : public BaseProperty
Type::Base
Type::Param
These types are defined for all the couples creator+property. Composite creator and property are the sole exception. Type is the general type, grouping creator and property. Type::Base is the type of the property data. Type::Param is the type for an additionnal data, if required.

 


Type::Creator::Creator(StaticString *name, Type::Property default)
Type::Creator::Creator(StaticString *name, Type::Param additional, Type::Property default)
   StaticString *name - creator name
   Type::Property default - default value for the properties
   Type::Param additional - additionnal data
The creator constructor is *either* one. The first is used in the case where no additionnal data is required. The second is used in the case where an additionnal is required.

 


Type::Creator::~Creator();
Creator destructor.

 


Type::Creator * Type::Creator::Clone() const
Returns a newly created creator, identical to the current one.

 


StaticString * Type::Creator::GetName() const
Returns the creator name.

 


const Type::Property * Type::Creator::GetReference() const
Returns the reference property, containing the default value.

 


Type::Property * Type::Creator::Create() const
Returns a newly created property, with the default value.

 


int Type::Creator::IsSameType(const BaseProperty *p) const
   const BaseProperty *p - property to compare
Returns true (i.e. non-zero) iff p has the same type than the reference property.

 


Type::Property::Property()
Creates a property.

 


Type::Property::~Property()
Destroys a property.

 


Type::Property Type::Property::Clone() const
Returns a newly created property, identical to the current one.

 


Type::Base Type::Property::Get() const
Returns the property value.

 


void Type::Property::Set(Type::Base value) const
Sets the property value.

 


void Type::Property::CopyFrom(const BaseProperty *other)
   const BaseProperty *p - property to copy from
Copies the value in other in the current property. The current property and other must be the same type, as defined by Type::Creator::IsSameType.

 


int Type::Property::IsEqualTo(const BaseProperty *other) const
   const BaseProperty *p - property to compare
Returns true (non-zero) iff other has the same value than the current property. The current property and other must be the same type, as defined by Type::Creator::IsSameType.

 


Boolean


The Boolean property has two possible values (true and false). It can represent a flag.

 


   Type - Boolean
   Type::Base - int
   Type::Param - void
The Boolean type represents either true or false.
Boolean::Type is true if it is non-zero, false if is is zero.
Boolean::Param is unused
See also: Boolean::Property::Set, Boolean::Property::Reset.

 


void Boolean::Property::Set()
Set a Boolean property to true.
See also: Boolean::Property::Reset.

 


void Boolean::Property::Reset()
Set a Boolean property to false.
See also: Boolean::Property::Set.

 


Number


The Number property represents an integer number.

 


   Type - Number
   Type::Base - int
   Type::Param - void
The Number type represents an integer number.
Number::Base is the property value.
Number::Param is unused

 


Percent


The percent property represents an integer number between 0 and a maximum value.

 


   Type - Percent
   Type::Base - int
   Type::Param - int
The Percent type represents an interger number between 0 (inclusive) and a maximum.
Percent::Base is the property value.
Percent::Param is the maximum value (inclusive).

 


String


The String property represents a character string, encoded in the current encoding. The maximum string length must be specified.

 


   Type - String
   Type::Base - const char *
   Type::Param - int
The String type represents a character string.
String::Base is the property value, a zero terminated char array.
String::Param is the maximum number of characters in the string, not including the terminating 0.

 


List


The List property represents a list of character strings. It can be used to represent an enumerated type.

 


   Type - List
   Type::Base - int
   Type::Param - char const*const*
The List type represents a choice in a list of character strings.
List::Base is the index in the list (beginning with 0).
List::Param is the list of character strings, it must be NULL terminated.

 


Color


The Color property represents a color with three composant (red, green and blue - no alpha).

 


   Type - Color
   Type::Base - int
   Type::Param - void
The Color type represents a color, in RGB format.
Type::Base is the property type, and can be accessed with Color::pack, Color::red, Color::green and Color::blue.
Type::Param is unused

 


int Color::Property::GetRed()
Returns the redcomponent of a property, with values between 0 and 255 (both inclusive).
See also: Color::Property::GetGreen, Color::Property::GetBlue, Color::Property::Set, Color::Property.

 


int Color::Property::GetGreen()
Returns the green component of a property, with values between 0 and 255 (both inclusive).
See also: Color::Property::GetRed, Color::Property::GetBlue, Color::Property::Set, Color::Property.

 


int Color::Property::GetBlue()
Returns the blue component of a property, with values between 0 and 255 (both inclusive).
See also: Color::Property::GetRed, Color::Property::GetGreen, Color::Property::Set, Color::Property.

 


void Color::Property::Set(int r, int g, int b)
   int r, int g, int b - red, green and blue components, between 0 and 255 (both inclusive)
Sets the value of a property.
See also: Color::Property::GetRed, Color::Property::GetGreen, Color::Property::GetBlue, Color::Property.

 


static int Color::pack(int r, int g, int b)
   int r, int g, int b - red, green and blue components, between 0 and 255 (both inclusive)
Returns a packed color, suitable for using with the Color type.
See also: Color::Property::red, Color::Property::green, Color::Property::blue.

 


static int Color::red(int value)
   int value - packed value, as used by the Color type
Returns the red component of a packed color, between 0 and 255 (both inclusive).
See also: Color::Property::green, Color::Property::blue, Color::Property::pack.

 


static int Color::green(int value)
   int value - packed value, as used by the Color type
Returns the green component of a packed color, between 0 and 255 (both inclusive).
See also: Color::Property::red, Color::Property::blue, Color::Property::pack.

 


static int Color::blue(int value)
   int value - packed value, as used by the Color type
Returns the blue component of a packed color, between 0 and 255 (both inclusive).
See also: Color::Property::red, Color::Property::green, Color::Property::pack.

 


static const int Color::white
Pre-defined packed color, suitable for using with the Color type.

 


static const int Color::grey
Pre-defined packed color, suitable for using with the Color type.

 


static const int Color::black
Pre-defined packed color, suitable for using with the Color type.

 


static const int Color::majik
Pre-defined packed color, suitable for using with the Color type.

 


DatafileObject


The DatafileObject property represents an object in an Allegro datafile. The datafile name must be specified.

 


   Type - DatafileObject
   Type::Base - int
   Type::Param - StaticString*
The DatafileObject type represents an object from an Allegro DATAFILE.
DatafileObject::Base is the index in the DATAFILE (beginning with 0).
DatafileObject::Param is the DATAFILE path.

 


typedef void (*DatafileObject::DrawingCallback)(const DatafileObject::Property *tile, BITMAP *dest, int x, int y, int w, int h, float scale, int l, int i, int j)
void DatafileObject::Creator::SetDrawingCallback(DatafileObject::DrawingCallback *cb)
   DatafileObject::DrawingCallback *cb - function to draw a tile
Sets the function to draw a DatafileObject property.
The function cb should draw the property tile on the bitmap dest, at x, y (in pixels). The parameters w and h are the tile width and height (in pixels, scaled to the current scale). The parameters l, i and j are the layer index and tile indices.

 


Composite


The Composite property is a container for other properties. It can be used to group some related properties. It cannot be used by the wrapper the same way than the other property types.
See also: Wrapper - Composite

 


   Type - Composite
   Type::Base - undefined
   Type::Param - undefined
The Composite type represents a group of properties.
Neither Composite::Base nor Composite::Param are defined.

 


typedef void (*Composite::DrawingCallback)(const Composite::Property *tile, BITMAP *dest, int x, int y, int w, int h, float scale, int l, int i, int j)
void Composite::Creator::SetDrawingCallback(Composite::DrawingCallback *cb)
   Composite::DrawingCallback *cb - function to draw a tile
Sets the function to draw a Composite property.
The function cb should draw the property tile on the bitmap dest, at x, y (in pixels). The parameters w and h are the tile width and height (in pixels, scaled to the current scale). The parameters l, i and j are the layer index and tile indices.

 


Tiles



The Tiles interface represents a group of tiles (here called elements). It is used to represent layers, clipboard, etc. The Tiles interface is abstract, with two implementations SparseTiles and FullTiles.
See also: SparseTiles, FullTiles.
Table of contents
* Constructors and destructor
* Size
* Creator
* Access and modification

 


Constructors and destructor

 


Tiles * Tiles::clone() const
Returns an newly created Tiles object, identical to the current one.

 


Size

 


int Tiles::count() const
Returns the number of elements in the Tiles object.

 


int Tiles::begini() const
[ FIXME Tiles::begini description ]
See also: Tiles::beginj, Tiles::endi, Tiles::width.

 


int Tiles::beginj() const
[ FIXME ]
See also: Tiles::begini, Tiles::endj, Tiles::height.

 


int Tiles::endi() const
[ FIXME ]
See also: Tiles::endj, Tiles::begini, Tiles::width.

 


int Tiles::endj() const
[ FIXME ]
See also: Tiles::endi, Tiles::beginj, Tiles::height.

 


int Tiles::width() const
Returns the width in tiles, equivalent to endi()-begini()
See also: Tiles::height.

 


int Tiles::height() const
Returns the height in tiles, equivalent to endj()-beginj()
See also: Tiles::width.

 


bool Tiles::is_in(int i, int j) const
   int i, int j - indices, in tiles (topleft is (0, 0))
Returns true iff begini() <= i < endi() and beginj() <= j < endj().

 


Creator

 


const BaseCreator * Tiles::creator() const
BaseCreator * Tiles::creator()
Returns the elements creator.

 


Access and modification

 


const BaseProperty * Tiles::get(int i, int j) const
BaseProperty * Tiles::get(int i, int j)
   int i, int j - indices of the element, in tiles (topleft is (0, 0))
Returns the element at (i, j) if it exists. If the element doesn't exist, returns 0.
See also: Tiles::set.

 


void Tiles::set(int i, int j, BaseProperty *p)
   int i, int j - indices, in tiles (topleft is (0, 0))
   BaseProperty *p - element to set, the Tiles object takes ownership of it
Assigns p to the element at (i, j), deleting the previous one if required.
See also: Tiles::get.

 


void Tiles::copy(int i, int j, const BaseProperty *p)
   int i, int j - indices, in tiles (topleft is (0, 0))
   const BaseProperty *p - element to set, the Tiles object does not take ownership of it
Copies p onto the element at (i, j), creating one if required.

 


void Tiles::clear(int i, int j)
   int i, int j - indices, in tiles (topleft is (0, 0))
Removes the element at (i, j), deleting it.

 


void Tiles::move(int di, int dj)
   int di, int dj - motion, in tiles
Moves the Tiles object (di, dj) tiles.

 


void Tiles::resize(int i, int j, int w, int h)
   int i, int j - indices of the new top left corner
   int w, int h - new size
Resizes the Tiles object, inserting or deleting elements if required.

 


void Tiles::insert_col(int i)
void Tiles::insert_col(int i, int count)
   int i - insertion position, in tiles (leftmost is 0)
   int count - number of columns to insert
Inserts count columns between the columns i-1 and i.
* If i < begini(), moves to the right,
* if begini() <= i < endi(), inserts columns,
* if i == endi(), appends columns,
* if i > endi(), does nothing.
By default the count is 1.
See also: Tiles::remove_col, Tiles::insert_row.

 


void Tiles::insert_row(int j)
void Tiles::insert_row(int j, int count)
   int j - insertion position, in tiles (topmost is 0)
   int count - number of rows to insert
Inserts count rows between the rows j-1 and j.
* If j < beginj(), moves to the bottom,
* if beginj() <= j < endj(), inserts rows,
* if j == endj(), appends rows,
* if j > endj(), does nothing.
By default the count is 1.
See also: Tiles::remove_row, Tiles::insert_col.

 


void Tiles::remove_col(int i)
void Tiles::remove_col(int i, int count)
   int i - deletion position, in tiles (leftmost is 0)
   int count - number of columns to delete
Deletes columns i to i+count-1, inclusive. For each column c to delete
* if c < begini(), moves to the left,
* if begini() <= c < endi(), remove the column,
* if c >= endi(), do nothing.
By default the count is 1.
See also: Tiles::insert_col, Tiles::remove_row.

 


void Tiles::remove_row(int j)
void Tiles::remove_row(int j, int count)
   int j - deletion position, in tiles (topmost is 0)
   int count - number of rows to delete
Deletes rows j to j+count-1, inclusive. For each row r to delete
* if r < beginj(), moves to the top,
* if beginj() <= r < endj(), remove the row,
* if r >= endj(), do nothing.
By default the count is 1.
See also: Tiles::insert_row, Tiles::remove_col.

 


SparseTiles



A SparseTiles object is a Tiles object that can contains holes : i.e. the elements at some indices can be absent.
See also: Tiles.
Table of contents
* Constructors and destructor
* Iterators

 


Constructors and destructor

 


SparseTiles::SparseTiles(BaseCreator *c, int i, int j, int w, int h)
SparseTiles::SparseTiles(BaseCreator *c)
   BaseCreator *c - the elements creator, the SparseTiles object takes ownership of it
   int i, int j - the indices of the top left element
   int w, int h - the size in tiles
Creates a new SparseTiles object.
See also: Tiles.

 


SparseTiles::~SparseTiles()
Destroys a SparseTiles object.

 


SparseTiles * SparseTiles::clone() const
Returns an newly created SparseTiles object, identical to the current one.

 


SparseTiles & SparseTiles::operator=(const SparseTiles &other)
Copy the other SparseTiles object to the current one.

 


Iterators

 


SparseTiles::iterator
Iterators to access the SparseTiles elements out of order.
See also: SparseTiles::const_iterator, SparseTiles::begin

 


SparseTiles::const_iterator
Iterators to access the const SparseTiles elements out of order.
See also: SparseTiles::iterator, SparseTiles::begin.

 


const_iterator SparseTiles::begin() const
iterator SparseTiles::begin()
Returns an iterator at the beginning of the SparseTiles object.
See also: SparseTiles::iterator, SparseTiles::const_iterator, SparseTiles::end.

 


const_iterator SparseTiles::end() const
iterator SparseTiles::end()
Returns an iterator one past the end of the SparseTiles object.
See also: SparseTiles::iterator, SparseTiles::const_iterator, SparseTiles::begin.

 


const BaseProperty * SparseTiles::get_tile(const_iterator it) const
BaseProperty * SparseTiles::get_tile(iterator it)
   iterator it - the iterator to dereference
   const_iterator it - the iterator to dereference
Returns the tile referenced by the iterator.
See also: SparseTiles::iterator, SparseTiles::const_iterator, SparseTiles::begin.

 


int SparseTiles::get_i(const_iterator it) const
   const_iterator it - the iterator to dereference
Returns the position referenced by the iterator.
See also: SparseTiles::get_j, SparseTiles::iterator, SparseTiles::const_iterator, SparseTiles::begin.

 


int SparseTiles::get_i(const_iterator it) const
   const_iterator it - the iterator to dereference
Returns the position referenced by the iterator.
See also: SparseTiles::get_i, SparseTiles::iterator, SparseTiles::const_iterator, SparseTiles::begin.

 


FullTiles



A FullTiles object is a Tiles object for which all elements must be present.
See also: Tiles.
Table of contents
* Constructors and destructor

 


Constructors and destructor

 


FullTiles::FullTiles(BaseCreator *c, int i, int j, int w, int h)
FullTiles::FullTiles(BaseCreator *c)
   BaseCreator *c - the elements creator, the FullTiles object takes ownership of it
   int i, int j - the indices of the top left element
   int w, int h - the size in tiles
Creates a new FullTiles object.
See also: Tiles.

 


FullTiles::~FullTiles()
Destroys a FullTiles object.

 


FullTiles * FullTiles::clone() const
Returns an newly created FullTiles object, identical to the current one.

 


FullTiles & FullTiles::operator=(const FullTiles &other)
Copy the other FullTiles object to the current one.

 


TilesStack



A TilesStack object is a stack of Tiles objects (here called layers). It is used both in the Map and Brush objects.
See also: Tiles, Map, Brush.
Table of contents
* Constructors and destructor
* Size
* Access and modification

 


Constructors and destructor

 


TilesStack::TilesStack()
Creates a TilesStack object.

 


TilesStack::~TilesStack()
Destroys a TilesStack object.

 


TilesStack * TilesStack::clone() const
Returns a newly created TilesStack object, identical to the current one.

 


Size

 


int TilesStack::begin() const
Returns the index of the first layer in the TilesStack.
See also: TilesStack::end, TilesStack::depth.

 


int TilesStack::end() const
Returns one plus the index of the last layer in the TilesStack.
See also: TilesStack::begin, TilesStack::depth.

 


int TilesStack::depth() const
Returns the number of layers in the TilesStack.
See also: TilesStack::begin, TilesStack::width, TilesStack::height.

 


int TilesStack::begini() const
Returns the smallest horizontal index (leftmost) for all layers.
See also: TilesStack::endi, TilesStack::beginj, TilesStack::begin.

 


int TilesStack::beginj() const
Returns the smallest vertical index (topmost) for all layers.
See also: TilesStack::endj, TilesStack::begini, TilesStack::begin.

 


int TilesStack::endi() const
Returns one plus the hightest horizontal index (rightmos) for all layers.
See also: TilesStack::begini, TilesStack::endj, TilesStack::begin.

 


int TilesStack::endj() const
Returns one plus the hightest vertical index (bottommost) for all layers.
See also: TilesStack::beginj, TilesStack::endi, TilesStack::begin.

 


int TilesStack::width() const
Returns the width, equivalent to endi()-begini()
See also: TilesStack::height, TilesStack::depth, TilesStack::begini.

 


int TilesStack::height() const
Returns the height, equivalent to endj()-beginj()
See also: TilesStack::width, TilesStack::depth, TilesStack::beginj,

 


bool TilesStack::is_in(int l) const
   int l - layer index (first layer drawn is 0)
bool TilesStack::is_in(int i, int j) const
   int i, int j - indices, in tiles (topleft is (0, 0))
The first returns true iff begin() <= l < end().
The second returns true iff begini() <= i < endi() and beginj() <= j < endj().
See also: TilesStack::begin, TilesStack::end, TilesStack::depth, TilesStack::begini, TilesStack::endi, TilesStack::width, TilesStack::beginj, TilesStack::endj, TilesStack::height.

 


Access and modification

 


const Tiles * TilesStack::get(int l) const
Tiles * TilesStack::get(int l)
template<typename T> const T * TilesStack::get(int l) const
   int l - layer index (first layer drawn is 0)
Returns the layer at index l in the TilesStack object.
See also: Tiles, TilesStack::depth.

 


void TilesStack::set(int l, Tiles *t)
   int l - layer index (first layer drawn is 0)
   Tiles *t - new layer, the TilesStack object takes ownership of it
Sets the layer at index l to t. It does not destroy the previous layer at index l.
See also: Tiles, TilesStack::depth.

 


void TilesStack::clear(int l)
   int l - layer index (first layer drawn is 0)
Sets the layer at index l to 0. It does not destroy the previous layer at index l.
See also: TilesStack::get, TilesStack::depth, TilesStack::insert, TilesStack::remove.

 


void TilesStack::remove(int l)
   int l - layer index (first layer drawn is 0)
Remove the layer at index l, moving down the following ones. It does not destroy the previous layer at index l.
See also: TilesStack::get, TilesStack::depth, TilesStack::insert, TilesStack::clear.

 


void TilesStack::insert(int l, Tiles *t)
   int l - layer index (first layer drawn is 0)
   Tiles *t - layer to insert, the TilesStack object takes ownership of it
Insert the layer t at index l, moving up the previous layer at index l and the following ones.
See also: Tiles, TilesStack::get, TilesStack::depth, TilesStack::remove.

 


void TilesStack::update()
Updates the size of the TilesStack object. This should be called after any modifications involving changing the layers size.
Note: you need to do this yourself, because the TilesStack isn't aware of when the layers size change and computing the size each time it's needed is too slow.

 


Map



A Map object represents the map. It contains a TilesStack object for the layers, a Composite::Property for the map properties, a Commands object for managing the commands executed on the map, a SelectedTiles object containing the current selection and a userdata for any other data the user wants to associate to the map. Map obects should always be accessed thru Wrapper objects.
See also: Wrapper, TilesStack, SelectedTiles.

 


Brush



A Brush object is a sort of clipboard with more than one layer. It contains a TilesStack object.
See also: TilesStack.
Table of contents
* Constructors and destructor
* Access and modification

 


Constructors and destructor

 


Brush::Brush()
Brush::Brush(int num_layers)
   int num_layers - the number of layer in the brush
Brush::Brush(const TilesStack *map, const ViewedLayers *layers, const SelectedTiles *sel)
   const TilesStack *map - the map to copy
   const ViewedLayers *layers - indices of the layers to copy
   const SelectedTiles *sel - the zone to copy
The first creates an empty Brush object.
The second creates an empty Brush object, and pre-reserve num_layers layers.
The third creates a Brush object by copying the map.
See also: TilesStack, ViewedLayers, Brush::clone.

 


Brush::~Brush()
Destroys a Brush object.
See also: Brush::Brush.

 


Brush * Brush::Clone() const
Returns a newly created Brush object, identical to the current one.
See also: Brush::Brush.

 


Access and modification

 


int Brush::MinX() const
Returns the horizontal index of the leftmost element (minimum index).

 


int Brush::MinY() const
Returns the vertical index of the topmost element (minimum index).

 


int Brush::MaxX() const
Returns the horizontal index of the rightmost element (maximum index).

 


int Brush::MaxY() const
Returns the vertical index of the bottommost element (maximum index).

 


int Brush::GetNumLayers() const
Returns the bnumber of layers.

 


const SparseTiles * Brush::GetLayer(int l) const
   int l - layer index (first layer drawn is 0)
Returns the layer at index l if it exists. If the layer does not exist, returns 0.
See also: SparseTiles.

 


void Brush::SetLayer(int l, SparseTiles *tiles)
   int l - layer index (first layer drawn is 0)
   SparseTiles *tiles - layer to insert
Sets the layer at index l to tiles. There must be no layer at index l before calling this function.
See also: SparseTiles.

 


void Brush::ClearLayer(int l)
   int l - layer index (first layer drawn is 0)
Removes the layer at index l. Does not destroy the layer.

 


void Brush::MoveLayers(int di, int dj)
   int di, int dj - motion, in tiles
Moves the Brush object (di, dj) tiles.

 


GraphicalUserInterface



The GraphicalUserInterface object holds all the data specific to the GUI.
Table of contents
* The global GUI
* User configuration
* Access and modification

 


The global GUI

 


GraphicalUserInterface GUI
The only GraphicalUserInterface object.

 


User configuration

 


void GraphicalUserInterface::AllowFeature(bool yesno, Features::Group::Groups group, unsigned int features)
void GraphicalUserInterface::AllowFeature(bool yesno, Features::Group::Groups group)
   bool yesno - true: allow the feature(s), false: disallow the feature(s)
   Features::Group::Groups group - Group of features
   unsigned int features - flag for the features to allow or disallow
   bool yesno - true: allow the feature(s), false: disallow the feature(s)
   Features::Group::Groups group - Group of features to allow or disallow
The first allows or disallows one or several feature(s) from a group.
The second allows or disallows an entire group of features.
See also: Features.

 


void GraphicalUserInterface::SetLoadBrush(Brush *(*load_brush)(const char *fname))
   Brush *(*load_brush)(const char*) - brush loading function
Sets the callback for loading a brush.
The callback function is called when the user uses the menu Brush->Load. It receives the file name to load. It must create (via new) a Brush object, load the file in it and return it. If there was an error, the load_brush function can return 0.
See also: Brush, GraphicalUserInterface::SetSaveBrush, GraphicalUserInterface::AllowFeature.

 


void GraphicalUserInterface::SetSaveBrush(bool (*save_brush)(const char *fname, const Brush *brush))
   void (*save_brush)(const char*, const Brush*) - brush saving function
Sets the callback for saving the current brush.
The callback function is called when the user uses the menu Brush->Save. It receives the brush to save and the filename where to save. It must save the current brush in the file. The save_brush function should return true if the save was ok.
See also: Brush, GraphicalUserInterface::SetLoadBrush, GraphicalUserInterface::AllowFeature.

 


void GraphicalUserInterface::SetCreateLayer(void (*create_layer)(Map *map, int l));
   void (*create_layer(Map *map, int l) - layer creating function
Sets the callback for creating a layer.
The callback function is called when the user clicks on the Add layer button (under the layer list). It should create a layer and insert it in the map. The l parameter is the current active layer. The layer insertion should be done via a CommandInsertLayer.
See also: Tiles, GraphicalUserInterface::AllowFeature, CommandInsertLayer::CommandInsertLayer.

 


void GraphicalUserInterface::SetUserMenuTitle(const char *title)
   const char *title - menu title, in current encoding
Sets the user menu title.
See also: GraphicalUserInterface::AllowFeature.

 


void GraphicalUserInterface::SetUserMenu(int menu_index, const char *menu_name, void (*menu_callback)(Map *map))
void GraphicalUserInterface::SetUserMenu(int menu_index, const char *menu_name, void (*menu_callback)(Map *map), int hotkey)
   int menu_index - index in the menu, beginning with 0, there must not be holes in the numbering
   const char *menu_name - menu entry name, in the current encoding
   void (*menu_callback)(Map *map) - menu callback, map is the current map
   int hotkey - menu entry hotkey, must be an ASCII character
Sets a user menu entry. By default there is no hotkey.
The menu callback is called when the user selects this menu entry and when the user presses the hotkey.
The menu name can be 0, in this case the menu entry is not clickable and is replaced by a separator. If a & character is inserted in the text, the next character is underlined and is a shortcut key. To actually have a & appear, use &&.
The menu hotkey should not be an already used character. Characters used by eme itself are: ``b'', ``c'', ``d'', ``f'', ``p'', ``r'', ``w'', ``+'', ``-'', ``='', ``.'', ``,'', ``>'' and ``<''.
See also: Map, GraphicalUserInterface::AllowFeature.

 


void GraphicalUserInterface::SetDrawUserdata(void (*draw)(void *data, BITMAP *bmp, int i, int j, float scale))
   void (*draw)(void *data, BITMAP *bmp, int i, int j, float scale) - userdata drawing function
Sets the callback for drawing the map userdata.
The drawing callback is called whenever the map is re-drawn. The first parameter is the map userdata. It must be drawn on the BITMAP parameter. The (i, j) indices are the indices of the tile to be drawn at (0, 0) on the bitmap. The scale parameter tells how much the map is scaled.
See also: Map - Userdata.

 


Access and modification

 


Map * GraphicalUserInterface::GetMap() const
Returns the current Map object.
See also: Map.

 


Brush * GraphicalUserInterface::GetBrush() const
Returns the current Brush object.
See also: Brush.

 


bool GraphicalUserInterface::IsInteractive() const
Returns true if the gui is interactive, else false. The gui is initialized but not interactive when the program is called with --save.

 


int GraphicalUserInterface::GetWidth() const
Returns the width of the screen in pixels.
See also: GraphicalUserInterface::GetHeight.

 


int GraphicalUserInterface::GetHeight() const
Returns the height of the screen in pixels.
See also: GraphicalUserInterface::GetWidth.

 


int GraphicalUserInterface::IsGridDrawn() const
Returns true if the grid is drawn.

 


void GraphicalUserInterface::SetMouseBusy()
Sets the mouse pointer to a clock image. Whenever a plugin function is called, the mouse pointer is the default arrow.
See also: GraphicalUserInterface::UnsetMouseBusy.

 


void GraphicalUserInterface::UnsetMouseBusy()
Resets the mouse pointer to the default image (an arrow). Whenever a plugin function is called, the mouse pointer is the default arrow.
See also: GraphicalUserInterface::SetMouseBusy.

 


void GraphicalUserInterface::SetAppName(const char *name)
   const char *name - the new application name, in current encoding
Sets the application name to be inserted in the window title (if the program runs in windowed mode).

 


Features



There'a function to allow or disallow features in the GUI. Each feature belongs to a feature group.
See also: GraphicalUserInterface - User configuration.
Table of contents
* Feature groups
* Map menu features
* Edit menu features
* Select menu features
* Brush menu features
* User menu features
* Tile box features
* Layers box features
* Tools box features

 


Feature groups

 


typedef enum Features::Group::Groups
Type of the groups.

 


Features::Group::Groups Features::Group::MapMenu
Features accessed thru the Map menu.
This group can be used both AllowFeature functions.
See also: GraphicalUserInterface::AllowFeature, Features::MapMenu.

 


Features::Group::Groups Features::Group::EditMenu
Features accessed thru the Edit menu.
This group can be used both AllowFeature functions.
See also: GraphicalUserInterface::AllowFeature, Features::EditMenu.

 


Features::Group::Groups Features::Group::SelectMenu
Features accessed thru the Select menu.
This group can be used both AllowFeature functions.
See also: GraphicalUserInterface::AllowFeature, Features::SelectMenu.

 


Features::Group::Groups Features::Group::BrushMenu
Features accessed thru the Brush menu.
This group can be used both AllowFeature functions.
See also: GraphicalUserInterface::AllowFeature, Features::BrushMenu.

 


Features::Group::Groups Features::Group::UserMenu
Features accessed thru the User menu.
This group can be used both AllowFeature functions.
See also: GraphicalUserInterface::AllowFeature, Features::UserMenu.

 


Features::Group::Groups Features::Group::TileBox
Features accessed thru the tile box.
This group can be used both AllowFeature functions.
See also: GraphicalUserInterface::AllowFeature, Features::TileBox.

 


Features::Group::Groups Features::Group::LayersBox
Features accessed thru the layers list box.
This group can be used both AllowFeature functions.
See also: GraphicalUserInterface::AllowFeature, Features::LayersBox.

 


Features::Group::Groups Features::Group::ToolsBox
Features accessed thru the tools box.
This group can be used both AllowFeature functions.
See also: GraphicalUserInterface::AllowFeature, Features::ToolsBox.

 


Features::Group::Groups Features::Group::VariableLayerSize
Features which modify a layer size independently from the other layers :
* Menu: Map->Resize active layer,
* Menu: Map->Insert in active layer,
* Menu: Map->Delete in active layer,
* Tool: move.
This group can be used only to allow or disallow all features in the group.
See also: GraphicalUserInterface::AllowFeature.

 


Features::Group::Groups Features::Group::VariableLayerCount
Features which modify the layer count or order :
* Layer list buttons.
This group can be used only to allow or disallow all features in the group.
See also: GraphicalUserInterface::AllowFeature.

 


Features::Group::Groups Features::Group::VariableMapSize
Features chich modify the map size :
* Menu: Map->Resize all layers,
* Menu: Map->Insert in all layers,
* Menu: Map->Delete in all layers.
This group can be used only to allow or disallow all features in the group.
See also: GraphicalUserInterface::AllowFeature.

 


Features::Group::Groups Features::Group::Select
Features which change the selection :
* Menu: Select,
* Tool: Select Point,
* Tool: Select Rectangle,
* Tool: Select Circle,
* Tool: Select By Property,
* Tool: Select By Wand.
This group can be used only to allow or disallow all features in the group.
See also: GraphicalUserInterface::AllowFeature.

 


Features::Group::Groups Features::Group::Brushes
Features associated with brush :
* Menu: Edit->Copy brush,
* Menu: Brush,
* Tool: Paste brush.
This group can be used only to allow or disallow all features in the group.
See also: GraphicalUserInterface::AllowFeature.

 


Features::Group::Groups Features::Group::Everything
All the above groups.
This group can be used only to allow or disallow all features in the group.
See also: GraphicalUserInterface::AllowFeature.

 


Map menu features

 


const unsigned int Features::MapMenu::ResizeAll
const unsigned int Features::MapMenu::InsertInAll
const unsigned int Features::MapMenu::DeleteInAll
const unsigned int Features::MapMenu::ResizeActive
const unsigned int Features::MapMenu::InsertInActive
const unsigned int Features::MapMenu::DeleteInActive
See also: GraphicalUserInterface::AllowFeature Features::Group::MapMenu.

 


Edit menu features

 


const unsigned int Features::EditMenu::Undo
const unsigned int Features::EditMenu::Redo
const unsigned int Features::EditMenu::Copy
const unsigned int Features::EditMenu::CopyBrush
const unsigned int Features::EditMenu::Cut
See also: GraphicalUserInterface::AllowFeature Features::Group::EditMenu.

 


Select menu features

 


const unsigned int Features::SelectMenu::All
const unsigned int Features::SelectMenu::None
const unsigned int Features::SelectMenu::Invert
const unsigned int Features::SelectMenu::Grow
const unsigned int Features::SelectMenu::Shrink
See also: GraphicalUserInterface::AllowFeature Features::Group::SelectMenu.

 


Brush menu features

 


const unsigned int Features::BrushMenu::Load
const unsigned int Features::BrushMenu::Save
const unsigned int Features::BrushMenu::Choose
See also: GraphicalUserInterface::AllowFeature Features::Group::BrushMenu.

 


User menu features

 


Tile box features

 


const unsigned int Features::TileBox::Apply
See also: GraphicalUserInterface::AllowFeature Features::Group::TileBox.

 


Layers box features

 


const unsigned int Features::LayersBox::Add
const unsigned int Features::LayersBox::Del
const unsigned int Features::LayersBox::Swap
See also: GraphicalUserInterface::AllowFeature Features::Group::LayersBox.

 


Tools box features

 


const unsigned int Features::ToolsBox::Pencil
const unsigned int Features::ToolsBox::Fill
const unsigned int Features::ToolsBox::Point
const unsigned int Features::ToolsBox::Rectangle
const unsigned int Features::ToolsBox::Circle
const unsigned int Features::ToolsBox::ByProperty
const unsigned int Features::ToolsBox::Wand
const unsigned int Features::ToolsBox::Zoom
const unsigned int Features::ToolsBox::Paste
const unsigned int Features::ToolsBox::PasteBrush
const unsigned int Features::ToolsBox::Move
const unsigned int Features::ToolsBox::User
See also: GraphicalUserInterface::AllowFeature Features::Group::ToolsBox.

 


SelectedTiles



A SelectedTiles object contains the position of tiles. It is used to hold a selection. A Map object contains a SelectedTiles object.
Table of contents
* Constructors and destructor
* Iterators
* Modifications

 


Constructors and destructor

 


SelectedTiles::SelectedTiles()
Creates a SelectedTiles object.

 


SelectedTiles::~SelectedTiles()
Destroys a SelectedTiles object.

 


SelectedTiles::SelectedTiles * SelectedTiles::Clone() const
Returns a newly created SelectedTiles object, identical to the current one.

 


Iterators

 


SelectedTiles::iterator
Iterators to access the SelectedTiles elements out of order.
See also: SelectedTiles::const_iterator, SelectedTiles::Begin.

 


SelectedTiles::const_iterator
Iterators to access the const SelectedTiles elements out of order.
See also: SelectedTiles::iterator, SelectedTiles::Begin.

 


const_iterator SelectedTiles::Begin()
iterator SelectedTiles::Begin()
Returns an iterator at the beginning of the SelectedTiles object.
See also: SelectedTiles::iterator, SelectedTiles::const_iterator, SelectedTiles::End.

 


const_iterator SelectedTiles::End()
iterator SelectedTiles::End()
Returns an iterator one past the end of the SelectedTiles object.
See also: SelectedTiles::iterator, SelectedTiles::const_iterator, SelectedTiles::Begin.

 


int SelectedTiles::GetX(const_iterator id) const
   const_iterator id - the iterator to dereference
Returns the horizontal position referenced by the iterator.
See also: SelectedTiles::iterator, SelectedTiles::const_iterator, SelectedTiles::GetY.

 


int SelectedTiles::GetY(const_iterator id) const
   const_iterator id - the iterator to dereference
Returns the vertical position referenced by the iterator.
See also: SelectedTiles::iterator, SelectedTiles::const_iterator, SelectedTiles::GetX.

 


bool SelectedTiles::Empty() const
Returns true iff there is no position in the SelectedTiles object.

 


int SelectedTiles::Num() const
Returns the number of positions in the SelectedTiles object.

 


bool SelectedTiles::IsIn(int i, int j) const
   int i, int j - indices, in tiles (topleft is (0, 0))
Returns true iff the position (i, j) is in the positions list.

 


Modifications

 


void SelectedTiles::Replace(int i, int j)
   int i, int j - new position, in tiles (topleft is (0, 0))
void SelectedTiles::Replace(const SelectedTiles *to_replace)
   const SelectedTiles *to_replace - new list of positions
The first replace all the positions in the SelectedTiles object by (i, j).
The second replace all the positions in the SelectedTiles object by the ones in to_replace.
See also: SelectedTiles::Add, SelectedTiles::Remove, SelectedTiles::Clear.

 


void SelectedTiles::Add(int i, int j)
   int i, int j - position to add, in tiles (topleft is (0, 0))
void SelectedTiles::Add(const SelectedTiles *to_add)
   const SelectedTiles *to_add - list of positions to add
The first adds the position (i, j) to the SelectedTiles object, if it isn't there yet.
The second adds the positions in to_add to the SelectedTiles object.
See also: SelectedTiles::Replace, SelectedTiles::Remove, SelectedTiles::Clear.

 


void SelectedTiles::Remove(int i, int j)
   int i, int j - position to remove, in tiles (topleft is (0, 0))
void SelectedTiles::Remove(const SelectedTiles *to_remove)
   const SelectedTiles *to_remove - list of positions to remove
The first removes the position (i, j) from the SelectedTiles object, if it is there.
The second removes the positions in to_remove from the SelectedTiles object.
See also: SelectedTiles::Add, SelectedTiles::Replace, SelectedTiles::Clear.

 


void SelectedTiles::Clear()
Remove all the positions from the SelectedTiles object.
See also: SelectedTiles::Add, SelectedTiles::Remove, SelectedTiles::Replace.

 


Various commands



These are various commands that can be executed by the command manager (of type Commands) contained in the map.
See also: Wrapper::Executes.
Table of contents
* Selection
* Cut and paste
* Apply
* Group
* Add and remove layers
* Resize layers

 


Selection

 


CommandSelectionReplace::CommandSelectionReplace(Map *map, const SelectedTiles *sel)
   Map *map - map where to change the selection
   const SelectedTiles *sel - new selection, the Command object does not takes ownership of it
Creates a command to replace the map current selection by sel.
See also: Map, Wrapper::GetMap, Wrapper::Execute, SelectedTiles.

 


CommandSelectionAdd::CommandSelectionAdd(Map *map, const SelectedTiles *sel)
   Map *map - map where to change the selection
   const SelectedTiles *sel - selection to add, the Command object does not takes ownership of it
Creates a command to add the selection sel to the current map selection.
See also: Map, Wrapper::GetMap, Wrapper::Execute, SelectedTiles.

 


CommandSelectionSuppress::CommandSelectionSuppress(Map *map, const SelectedTiles *sel)
   Map *map - map where to change the selection
   const SelectedTiles *sel - selection to remove, the Command object does not takes ownership of it
Creates a command to remove the selection sel from the current map selection.
See also: Map, Wrapper::GetMap, Wrapper::Execute, SelectedTiles.

 


Cut and paste

 


CommandCut::CommandCut(Map *map, int l, const SelectedTiles *tiles)
   Map *map - map where to cut
   int l - layer index (first layer drawn is 0)
   const SelectedTiles *tiles - which tiles to cut
Creates a command to cut the tiles which position is in tiles from the lht layer of map.
See also: Map, Wrapper::GetMap, Wrapper::Execute, SelectedTiles.

 


CommandPaste::CommandPaste(Map *map, int l, const SparseTiles *to_paste, int i, int j)
   Map *map - map where to paste
   int l - layer index (first layer drawn is 0)
   const SparseTiles *to_paste - tiles to paste
   int i, int j - top left pasting position
Creates a command to paste to_paste at (i, j) on the lth layer of map.
See also: Map, Wrapper::GetMap, Wrapper::Execute, SparseTiles.

 


CommandPasteBrush::CommandPasteBrush(Map *map, const Brush *to_paste, int i, int j)
   Map *map - map where to paste
   const Brush *to_paste - brush to be pasted
   int i, int j - top left pasting position
Creates a command to paste to_paste at (i, j) on the map.
See also: Map, Wrapper::GetMap, Wrapper::Execute, Brush.

 


Apply

 


CommandApply::CommandApply(Map *map, int l, const SelectedTiles *tiles, const BaseProperty *value, int id=MAX_MERGE_ID, int probability=FILL_PROBA_MAX)
   Map *map - Map to edit
   int l - layer index (first layer drawn is 0)
   const SelectedTiles *tiles - positions of the tiles to be modified
   const BaseProperty *value - property to copy
   int id -
   int probability -
CommandApply::CommandApply(Map *map, int l, int i, int j, const BaseProperty *value, int id=MAX_MERGE_ID)
   Map *map - Map to edit
   int l - layer index (first layer drawn is 0)
   int i, int j - position of the tile to be modified, in tiles (topleft is (0, 0))
   const BaseProperty *value - property to copy
   int id -
[ FIXME CommandApply::CommandApply ]
See also: Map, Wrapper::GetMap, Wrapper::Execute, SelectedTiles.

 


Group

 


CommandGroup::CommandGroup()
Creates a CommandGroup.
See also: Wrapper::Execute, CommandGroup::Add.

 


void CommandGroup::Add(Command *cmd)
   Command *cmd - command to insert in the group, the group takes ownership of the command
Adds a command to a CommandGroup. The first added command is the first executed.
See also: CommandGroup::CommandGroup.

 


Add and remove layers

 


CommandInsertLayer::CommandInsertLayer(Map *map, Tiles *layer, int l)
   Map *map - map where to insert a layer
   Tiles *layer - layer to insert, the command takes ownership of it
   int l - layer index (first layer drawn is 0)
Creates a command to insert the layer in the map at position l, moving up the following layers.
See also: Map, Wrapper::GetMap, Wrapper::Execute, Tiles, CommandRemoveLayer::CommandRemoveLayer, CommandSwapLayers::CommandSwapLayers, CommandMergeLayers::CommandMergeLayers, CommandReplaceLayer::CommandReplaceLayer.

 


CommandRemoveLayer::CommandRemoveLayer(Map *map, int l)
   Map *map - map where to remove a layer
   int l - layer index (first layer drawn is 0)
Creates a command to remove the layer at index l from the map, moving down the following layers.
See also: Map, Wrapper::GetMap, Wrapper::Execute, Tiles, CommandInsertLayer::CommandInsertLayer, CommandSwapLayers::CommandSwapLayers, CommandMergeLayers::CommandMergeLayers, CommandReplaceLayer::CommandReplaceLayer.

 


CommandSwapLayers::CommandSwapLayers(Map *map, int l1, int l2)
   Map *map - map where to swap layers
   int l1 - index of one of the layers to swap
   int l2 - index of the other layer to swap
Creates a command to swap the layers at index l1 and l2 in the map.
See also: Map, Wrapper::GetMap, Wrapper::Execute, Tiles, CommandRemoveLayer::CommandRemoveLayer, CommandInsertLayer::CommandInsertLayer, CommandMergeLayers::CommandMergeLayers, CommandReplaceLayer::CommandReplaceLayer.

 


CommandMergeLayers::CommandMergeLayers(Map *map, const ViewedLayers &layers)
   Map *map - map where to merge layers
   const ViewedLayers &layers - indices of the layers to merge
Creates a command to merge the layers defined in layers on the first layer defined in layer. Removes the merged layers. If one of the layers to merge has not the correct type, does not merge nor remove this layer.
The merge is executed as follow: from the layer with the smallest index to the one with the highest, paste the layer on the one with the smallest index.
See also: ViewedLayers. Map, Wrapper::GetMap, Wrapper::Execute, Tiles, CommandRemoveLayer::CommandRemoveLayer, CommandInsertLayer::CommandInsertLayer, CommandSwapLayers::CommandSwapLayers, CommandReplaceLayer::CommandReplaceLayer.

 


CommandReplaceLayer::CommandReplaceLayer(Map *map, Tiles *layer, int l)
   Map *map - map where to replace a layer
   Tiles *layer - new layer, the command takes ownership of it
   int l - layer index (first layer drawn is 0)
Creates a command to replace the layer at index l in map by layer.
See also: Map, Wrapper::GetMap, Wrapper::Execute, Tiles, CommandRemoveLayer::CommandRemoveLayer, CommandInsertLayer::CommandInsertLayer, CommandSwapLayers::CommandSwapLayers, CommandMergeLayers::CommandMergeLayers.

 


Resize layers

 


CommandMoveLayer::CommandMoveLayer(Map *map, int l, int di, int dj)
   Map *map - map to edit
   int l - layer index (first layer drawn is 0)
   int di, int dj - motion, in tiles
Creates a command to move the layer at index l (di, dj) tiles
See also: Map, Wrapper::GetMap, Wrapper::Execute, CommandResize::CommandResize, CommandStack::CommandStack.

 


CommandResize::CommandResize(Map *map, int l, int i, int j, int w, int h)
   Map *map - map to edit
   int l - layer index (first layer drawn is 0)
   int i, int j - new top left corner, in tiles
   int w, int h - new size, in tiles
Creates a command to resize the layer at index l to (i, j, w, h) tiles.
See also: Map, Wrapper::GetMap, Wrapper::Execute, CommandMoveLayer::CommandMoveLayer, CommandStack::CommandStack.

 


CommandStack::CommandStack<CommandType>(Map *map, int i, int j, int count)
CommandStack::CommandStack<CommandType>(Map *map, const ViewedLayers &layers, int i, int j, int count)
CommandStack::CommandStack<CommandType>(Map *map, int l, int i, int j, int count)
   CommandType - can be CommandInsertColumn, CommandInsertRow, CommandDeleteColumn, CommandDeleteRow
   Map *map - map to edit
   const ViewedLayers &layers - indices of the layers to edit
   int l - layer index (first layer drawn is 0)
   int i, int j - insertion or deletion point, in tiles (topleft is (0, 0))
   int count - number of rows or columns to insert or delete
The first creates a command to insert or delete rows or columns in all layers of the map.
The second creates a command to insert or delete rows or columns in the layers defined by layer.
The third creates a command to insert or delete rows or columns in the layer at index l.
See also: Map, Wrapper::GetMap, Wrapper::Execute, ViewedLayers. CommandMoveLayer::CommandMoveLayer, CommandResize::CommandResize.

 


ViewedLayers



A ViewedLayers object contains an array of booleans. It is used for the list of visible layers and in various places (some commands and LayerUtils) to specify on which layers to work.
See also: Various commands, LayerUtils.
Table of contents
* Constructors and destructor
* Access and modification

 


Constructors and destructor

 


ViewedLayers::ViewedLayers(int count)
   int count - number of layers
ViewedLayers::ViewedLayers(int count, const char *layers)
   int count - number of layers
   const char *layers - array of count true or false elements
ViewedLayers::ViewedLayers(int count, int l)
   int l - layer index (first layer drawn is 0)
   int count - number of layers
ViewedLayers::ViewedLayers(const ViewedLayers &other)
   const ViewedLayers &other - object to copy
The first creates a ViewedLayers object with count elements, all true.
The second creates a ViewedLayers object with count elements by copying the values in layers.
The third creates a ViewedLayers object with count elements and the lth element to true, the others to false.
The fourth creates a ViewedLayers object containing the same data as other.

 


ViewedLayers::~ViewedLayers()
Destroys a ViewedLayers object.

 


Access and modification

 


bool ViewedLayers::at(int l) const
   int l - layer index (first layer drawn is 0)
Returns the value of the lth element.
See also: ViewedLayers::set, ViewedLayers::reset,

 


int ViewedLayers::count() const
Returns the number of elements.

 


char * ViewedLayers::get()
Returns the implementation.

 


void ViewedLayers::set(int l)
   int l - layer index (first layer drawn is 0)
Set to true the lth element.
See also: ViewedLayers::at, ViewedLayers::reset, ViewedLayers::insert,

 


void ViewedLayers::reset(int l)
   int l - layer index (first layer drawn is 0)
Set to false the lth element.
See also: ViewedLayers::at, ViewedLayers::set, ViewedLayers::remove,

 


void ViewedLayers::insert(int l)
   int l - layer index (first layer drawn is 0)
Inserts an element at index l. The new element value is undefined.
See also: ViewedLayers::remove, ViewedLayers::set, ViewedLayers::reset.

 


void ViewedLayers::remove(int l)
   int l - layer index (first layer drawn is 0)
Remove the element at index l.
See also: ViewedLayers::insert, ViewedLayers::set, ViewedLayers::reset.

 


LayerUtils



Table of contents
* Selection
* Copy, cut and paste
* Resize layers

 


Selection


The selections functions select only the existing tiles. The only exception is SelectEmpty which selects only non existing tiles.

 


SelectedTiles * LayerUtils::SelectAll(const Tiles *tiles)
   const Tiles *tiles - layer
Returns a newly created SelectedTiles object containing the positions of all the tiles in tiles.
See also: SelectedTiles, Tiles.

 


SelectedTiles * LayerUtils::SelectEmpty(const Tiles *tiles, const SelectedTiles *sel)
   const Tiles *tiles - layer
   const SelectedTiles *sel - positions to search
Returns a newly created SelectedTiles object containing the positions given in sel for which there aren't any tile in tiles.
See also: SelectedTiles, Tiles.

 


SelectedTiles * LayerUtils::SelectRect(const Tiles *tiles, int i1, int j1, int i2, int j2)
   const Tiles *tiles - layer
   int i1, int j1 - top left corner, inclusive, of the selection
   int i2, int j2 - bottom right corner, inclusive, of the selection
Returns a newly created SelectedTiles object containing the positions of the tiles in the rectangle defined by (i1, j1, i2, j2).
See also: SelectedTiles, Tiles.

 


SelectedTiles * LayerUtils::SelectCircle(const Tiles *tiles, int i, int j, int r)
   const Tiles *tiles - layer
   int i, int j - center of the circle, in tiles (topleft is (0, 0))
   int r - circle radius
Returns a newly created SelectedTiles object containing the positions of the tiles in the circle defined by (i, j) and r.
See also: SelectedTiles, Tiles.

 


SelectedTiles * LayerUtils::SelectByProperty(const Tiles *tiles, int i, int j)
   const Tiles *tiles - layer
   int i, int j - position of the reference tile, in tiles (topleft is (0, 0))
Returns a newly created SelectedTiles object containing the positions of the tiles having the same value as the tile at (i, j). If there is no tile at (i, j), returns an empty selection.
See also: SelectedTiles, Tiles.

 


SelectedTiles * LayerUtils::SelectByWand(const Tiles *tiles, int i, int j)
   const Tiles *tiles - layer
   int i, int j - position of the reference tile, in tiles (topleft is (0, 0))
Returns a newly created SelectedTiles object containing the position of the tiles neighboring (i, j) and having the same value. If there is no tile at (i, j), returns an empty selection.
See also: SelectedTiles, Tiles.

 


SelectedTiles * LayerUtils::Intersection(const SelectedTiles *s1, const SelectedTiles *s2)
   const SelectedTiles *s1, const SelectedTiles *s2 - selections to intersect
Returns a newly created SelectedTiles object containing positions that are in both s1 and s2.
See also: SelectedTiles.

 


SelectedTiles * LayerUtils::GrowSelection(const SelectedTiles *sel)
   const SelectedTiles *sel - selection to grow
Returns a newly created SelectedTiles object containing the positions in sel, plus a border.
See also: SelectedTiles.

 


SelectedTiles * LayerUtils::ShrinkSelection(const SelectedTiles *sel, const Tiles *tiles)
   const SelectedTiles *sel - selection to shrink
   const Tiles *tiles - layer
Returns a newly created SelectedTiles object containing the positions in sel, minus a border.
See also: SelectedTiles, Tiles.

 


SelectedTiles * LayerUtils::InvertSelection(const SelectedTiles *sel, const Tiles *tiles)
   const SelectedTiles *sel - selection to invert
   const Tiles *tiles - layer
Returns a newly created SelectedTiles object containing the positions not in sel and where there is a tile.
See also: SelectedTiles, Tiles.

 


Copy, cut and paste

 


SparseTiles * LayerUtils::Copy(const Tiles *tiles, const SelectedTiles *sel)
   const Tiles *tiles - layer to copy
   const SelectedTiles *sel - positions of the tiles to copy
TilesStack * LayerUtils::Copy(const TilesStack *layers, const ViewedLayers *viewed, const SelectedTiles *sel)
   const TilesStack *layers - stack of layers to copy
   const ViewedLayers *viewed - indices of the layers to copy
   const SelectedTiles *sel - positions of the tiles to copy
The first returns a newly created SparseTiles object containing the tiles copied from tiles which appear in sel.
The second returns a newly created TilesStack object containing the layers defined by viewed, and the tiles copied from layers which appear in sel.
See also: ViewedLayers, SelectedTiles, SparseTiles.

 


void LayerUtils::Fill(Tiles *tiles, const SelectedTiles *sel, const BaseProperty *value)
   Tiles *tiles - layer to edit
   const SelectedTiles *sel - positions of the tiles to fill
   const BaseProperty *value - new value for the filled tiles
void LayerUtils::Fill(Tiles *tiles, int i, int j, const BaseProperty *value)
   Tiles *tiles - layer to edit
   int i, int j - position of the tile to fill, in tiles (topleft is (0, 0))
   const BaseProperty *value - new value for thw filled tile
The first copies the property value on the tiles specified by sel in the layer tiles.
The second copies the property value on the tile at (i, j) in the layer tiles.
See also: SelectedTiles, Tiles.

 


void LayerUtils::Cut(Tiles *tiles, const SelectedTiles *sel)
   Tiles *tiles - layer to edit
   const SelectedTiles *sel - positions to cut
Cuts the tiles specified by sel from the layer tiles.
See also: SelectedTiles, Tiles.

 


void LayerUtils::Paste(Tiles *tiles, int i, int j, const SparseTiles *to_paste)
   Tiles *tiles - layer to edit
   int i, int j - top left pasting position
   const SparseTiles *to_paste - tiles to paste
void LayerUtils::Paste(TilesStack *layers, int i, int j, const TilesStack *to_paste)
   TilesStack *layers - layers to edit
   int i, int j - top left pasting position
   const TilesStack *to_paste - tiles to paste
The first pastes to_paste at position (i, j) on the layer tiles.
The first pastes to_paste at position (i, j) on layers. For each layer in layers and to_paste, the layer is pasted if both exist, the one from to_paste is a SparseTiles layer, both have the same type.
See also: SelectedTiles, SparseTiles, Tiles.

 


Resize layers

 


void LayerUtils::Move(TilesStack *layers, const ViewedLayers *viewed, int di, int dj)
   TilesStack *layers - stack of layers to edit
   const ViewedLayers *viewed - indices of the layers to edit
   int di, int dj - motion, in tiles
Moves the layers specified in viewed (di, dj) tiles
See also: TilesStack, ViewedLayers.

 


void LayerUtils::InsertColumns(TilesStack *layers, const ViewedLayers *viewed, int i, int count)
   TilesStack *layers - stack of layers to edit
   const ViewedLayers *viewed - indices of the layers to edit
   int i - index of the insertion column, in tiles (leftmost is 0)
   int count - number of columns to insert
Inserts count columns between columns i-1 and i, in the layers specified by viewed.
See also: TilesStack, ViewedLayers.

 


void LayerUtils::InsertRows(TilesStack *layers, const ViewedLayers *viewed, int j, int count)
   TilesStack *layers - stack of layers to edit
   const ViewedLayers *viewed - indices of the layers to edit
   int j - index of the insertion row, in tiles (topmost is 0)
   int count - number of rows to insert
Inserts count rows between rows j-1 and j, in the layers specified by viewed.
See also: TilesStack, ViewedLayers.

 


void LayerUtils::DeleteColumns(TilesStack *layers, const ViewedLayers *viewed, int i, int count)
   TilesStack *layers - stack of layers to edit
   const ViewedLayers *viewed - indices of the layers to edit
   int i - index of the deletion column, in tiles (leftmost is 0)
   int count - number of columns to delete
Removes columns i to i+count-1, in the layers specified by viewed.
See also: TilesStack, ViewedLayers.

 


void LayerUtils::DeleteRows(TilesStack *layers, const ViewedLayers *viewed, int j, int count)
   TilesStack *layers - stack of layers to edit
   const ViewedLayers *viewed - indices of the layers to edit
   int j - index of the deletion row, in tiles (topmost is 0)
   int count - number of rows to delete
Removes rowd j to j+count-1, in the layers specified by viewed.
See also: TilesStack, ViewedLayers.

 


Popups


 


void popup_quit(const char *msg1, const char *msg2, const char *msg3)
   const char *msg1, const char *msg2, const char *msg3 - messages to print, in current encoding
Displays the three messages in a popup with buttons Quit and Continue. If quit is clicked the program quits (or dump a core if compiled with DEBUG). You should use this function only in special cases (i.e. if the program continue it would crash).

 


int popup_size(const char *width_title, int *width, const char *height_title, int *height)
   const char *width_title - title of the first popup, in current encoding
   int *width - value entered in the first popup
   const char *height_title - title of the second popup, in current encoding
   int *height - value entered in the second popup
Displays two popups to input two numbers. Returns TRUE if both popups are OK'ed, FALSE if any of them are cancelled. If the function returns TRUE, *width and *height are set to the values entered by the user. If the function returns FALSE, *width and *height are undefined.

 


int popup_size_and_pos(const char *title, int *x, int *y, int *w, int *h, const char **list, int *item)
   const char *title - title of the popup, in current encoding
   int *x, int *y, int *w, int *h - position and size entered by the user
   char **list - NULL terminated list of strings, in the current encoding
   int *item - index of list item selected by the user
Displays a popup to enter a size, a position and select a value from a list. This can be used for creating a new layer. Returns TRUE if the popup was OK'ed, FALSE if it was canceled. If any of x, y, w, h is NULL, the corresponding entry is disabled. If either list or item is NULL, the list is disabled.
See also: popup_size, GraphicalUserInterface::SetCreateLayer.

 


Deprecated



This is the list of deprecated classes and functions.
Table of contents
* TileGroup
* Layer, SparseLayer, FullLayer
* SelectedTiles::RawAdd, SelectedTiles::Intersection

TileGroup


The class TileGroup is deprecated, use SparseTiles instead.
If you have compiled eme with compatibility on, you can still use TileGroup, with one difference : the constructor now takes ownership of the BaseCreator parameter.
See also: SparseTiles, Tiles.

Layer, SparseLayer, FullLayer


The classes Layer, SparseLayer and FullLayer are deprecated, use Tiles, SparseTiles and FullTiles.
If you have compiled eme with compatibility on, you can still use Layer, SparseLayer, and FullLayer.
See also: Tiles, SparseTiles, FullTiles.

SelectedTiles::RawAdd, SelectedTiles::Intersection


The functions RawAdd and Intersection of the class SelectedTiles are deprecated, use SelectedTiles::Add and LayerUtils::Intersection instead.
If you have compiled eme with compatibility on, you can still use SelectedTiles::RawAdd and SelectedTiles::Intersection.
See also: SelectedTiles::Add, LayerUtils::Intersection.