Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

MngAnimationStorer Class Reference

This class lets you store a game as MNG-animation. More...

#include <mng_animation_storer.h>

List of all members.

Public Types

enum  Result { OK, FINISHED, ERROR }

Public Methods

virtual ~MngAnimationStorer ()
 MngAnimationStorer (Map const &map, Movements const &moves, Theme const &theme, int piece_size, int use_background, int start_delay, int delay, bool cycle, int end_delay, bool low_quality, KURL const &url)
virtual Result proccess ()

Private Methods

QRect getBoundingRect (QPoint const &position) const
void createPngObject (int index, QImage const &image)
void paintObject (int index, QPoint const &position)
void paintPiece (QPoint const &position)

Static Private Methods

mng_ptr allocMNG (mng_size_t length)
void freeMNG (mng_ptr pointer, mng_size_t length)
mng_bool openMNG (mng_handle handle)
mng_bool closeMNG (mng_handle handle)
mng_bool writeMNG (mng_handle handle, mng_ptr buffer, mng_uint32 size, mng_uint32 *written)

Private Attributes

Map m_map
Movements m_moves
Theme const & m_theme
PixmapProvider m_pixmap_provider
int m_piece_size
QPoint m_offset
int m_keeper_direction
mng_handle m_handle
int m_background_width
int m_background_height
bool m_use_background
bool m_use_background_image
bool m_low_quality
int m_delay
KURL m_url
KTempFile * m_temp_file


Detailed Description

This class lets you store a game as MNG-animation.

Author:
Ralf Schmelter (ralfs@pc2a.chemie.uni-dortmund.de).
Version:
0.1


Member Enumeration Documentation

enum MngAnimationStorer::Result
 

Defines the result of proccess().

Enumeration values:
OK   Everythings fine, but you have to call proccess() at least one time more.
FINISHED   We are ready.
ERROR   An error occured.


Constructor & Destructor Documentation

virtual MngAnimationStorer::~MngAnimationStorer [virtual]
 

Releases the resources.

MngAnimationStorer::MngAnimationStorer Map const & map,
Movements const & moves,
Theme const & theme,
int piece_size,
int use_background,
int start_delay,
int delay,
bool cycle,
int end_delay,
bool low_quality,
KURL const & url
 

Creates the object.

Parameters:
map   The map to use.
move   The <e>atomic</e> moves to display.
theme   The theme to use.
piece_size   The size (width and height) of a single piece.
use_background   If true, we use the background image of the theme if there is one.
start_delay   The start delay (in miliseconds) for the first frame.
delay   The delay (in miliseconds) between two frames.
cycle   If true, we go to the first frame if at end.
end_delay   The time (in miliseconds) between the last frame and the first frame in cyling.
low_quality   If true, we only use low quality images.
url   The url to save the animation.


Member Function Documentation

mng_ptr MngAnimationStorer::allocMNG mng_size_t length [static, private]
 

The callback function for memory allocation.

Parameters:
length   The lenght of the allocated buffer.
Returns:
A pointer to the allocated buffer.

mng_bool MngAnimationStorer::closeMNG mng_handle handle [static, private]
 

The callback function for closing a stream (this is a dummy function).

Parameters:
handle   The handle to use.

void MngAnimationStorer::createPngObject int index,
QImage const & image
[private]
 

Creates a object in png format for the given image.

Parameters:
index   The index of the object to create.
image   The image to convert to png.

void MngAnimationStorer::freeMNG mng_ptr pointer,
mng_size_t length
[static, private]
 

The callback function for freeing memory.

Parameters:
pointer   The pointer to the buffer to free.
length   The length of the buffer.

QRect MngAnimationStorer::getBoundingRect QPoint const & position const [private]
 

Returns the bound rectangle of the piece at the given position.

Parameters:
position   The position of the piece.

mng_bool MngAnimationStorer::openMNG mng_handle handle [static, private]
 

The callback functions for opening a stream (this is a dummy function).

Parameters:
handle   The handle to use.

void MngAnimationStorer::paintObject int index,
QPoint const & position
[private]
 

Puts an object at the given position.

Parameters:
index   The index of the object.
position   The position of the object.

void MngAnimationStorer::paintPiece QPoint const & position [private]
 

Paints an item of a map.

Parameters:
direction   The direction of the keeper.
position   The position of the piece.

virtual Result MngAnimationStorer::proccess [virtual]
 

Call this as long as OK is returned.

mng_bool MngAnimationStorer::writeMNG mng_handle handle,
mng_ptr buffer,
mng_uint32 size,
mng_uint32 * written
[static, private]
 

The callback function for writing to a stream.

Parameters:
handle   The handle to use.
buffer   The buffer to write.
size   The size of the buffer to write.
written   Here we write the number of bytes written.


Member Data Documentation

int MngAnimationStorer::m_background_height [private]
 

The height of the background image.

int MngAnimationStorer::m_background_width [private]
 

The width of the background image.

int MngAnimationStorer::m_delay [private]
 

The delay to use.

mng_handle MngAnimationStorer::m_handle [private]
 

The libmng handle.

int MngAnimationStorer::m_keeper_direction [private]
 

The direction of the keeper.

bool MngAnimationStorer::m_low_quality [private]
 

If true, we use low quality images.

Map MngAnimationStorer::m_map [private]
 

The current map.

Movements MngAnimationStorer::m_moves [private]
 

The moves.

QPoint MngAnimationStorer::m_offset [private]
 

The offset.

int MngAnimationStorer::m_piece_size [private]
 

The piece size.

PixmapProvider MngAnimationStorer::m_pixmap_provider [private]
 

The pixmap provider.

KTempFile* MngAnimationStorer::m_temp_file [private]
 

The temp file to use.

Theme const& MngAnimationStorer::m_theme [private]
 

The theme used.

KURL MngAnimationStorer::m_url [private]
 

The url to save.

bool MngAnimationStorer::m_use_background [private]
 

If true, we use the theme background.

bool MngAnimationStorer::m_use_background_image [private]
 

If true, we use a background image.


The documentation for this class was generated from the following file:
Generated at Sun Jan 6 18:49:12 2002 for EasySok by doxygen1.2.9.1 written by Dimitri van Heesch, © 1997-2001