Shinya Kitaoka 810553
#pragma once
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TPALETTE_H
Toshihiro Shimizu 890ddd
#define TPALETTE_H
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// TnzCore includes
Toshihiro Shimizu 890ddd
#include "tpersist.h"
Toshihiro Shimizu 890ddd
#include "timage.h"
Toshihiro Shimizu 890ddd
#include "tfilepath.h"
Toshihiro Shimizu 890ddd
#include "tpixel.h"
Toshihiro Shimizu 890ddd
#include "tcolorstyles.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
// Qt includes
Toshihiro Shimizu 890ddd
#include <qmutex></qmutex>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TVRENDER_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
#pragma warning(push)
Toshihiro Shimizu 890ddd
#pragma warning(disable : 4251)
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=========================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//    Forward declarations
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class TPixelRGBM32;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
typedef TSmartPointerT<tpalette> TPaletteP;</tpalette>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//=========================================================
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//*****************************************************************************************
Toshihiro Shimizu 890ddd
//    TPalette  declaration
Toshihiro Shimizu 890ddd
//*****************************************************************************************
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
/*!
Toshihiro Shimizu 890ddd
  \brief    The class representing a Toonz palette object.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
  \par Rationale
Toshihiro Shimizu 890ddd
    A palette is a collection of color styles that adds a level of indirection
Toshihiro Shimizu 890ddd
    on color selections when drawing certain graphical objects.
Toshihiro Shimizu 890ddd
\n
Toshihiro Shimizu 890ddd
    Palette-based objects store style identifiers into an associated palette object,
Toshihiro Shimizu 890ddd
    rather than the colors directly. When a color needs to be accessed, the palette
Toshihiro Shimizu 890ddd
    objects is queried for a style id, and the associated \a style is returned.
Toshihiro Shimizu 890ddd
\n
Toshihiro Shimizu 890ddd
    A TColorStyle instance generalizes the notion of \a color, providing the ability to
Toshihiro Shimizu 890ddd
    reduce a style instance to a color, \a and specialized drawing functions for
Toshihiro Shimizu 890ddd
    vector graphics objects.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
  \par Reserved colors
Toshihiro Shimizu 890ddd
    A palette object has two fixed \a reserved styles - which cannot be removed - at
Toshihiro Shimizu 890ddd
    indexes \p 0 and \p1. Index \p 0 is reserved for the \b transparent color. Index \p 1
Toshihiro Shimizu 890ddd
    is reserved for the \b ink color, initialized by default to black.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
  \par Syntax
Toshihiro Shimizu 890ddd
    A palette is supposedly created on the heap, to the point that, in current
Toshihiro Shimizu 890ddd
    implementation, copy and assignment are \a forbidden. This behavior is somewhat
Toshihiro Shimizu 890ddd
    inconsitent since a palette \b is currently \a clonable and \a assignable with the
Toshihiro Shimizu 890ddd
    appropriate functions. Normalization to common C++ syntax should be enforced ASAP.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
\sa The TColorStyle class.
Toshihiro Shimizu 890ddd
*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI TPalette : public TPersist, public TSmartObject
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
	DECLARE_CLASS_CODE
Toshihiro Shimizu 890ddd
	PERSIST_DECLARATION(TPalette);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
		\brief A palette page is a restricted view of a palette instance.
Toshihiro Shimizu 890ddd
	*/
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	class DVAPI Page
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		friend class TPalette;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	private:
Shinya Kitaoka 3bfa54
		std::wstring m_name;			//!< Name of the page to be displayed.
Toshihiro Shimizu 890ddd
		int m_index;			//!< Index of the page in the palette's pages collection.
Toshihiro Shimizu 890ddd
		TPalette *m_palette;	//!< (\p not \p owned)  Palette the page refers to.
Shinya Kitaoka 3bfa54
		std::vector<int> m_styleIds; //!< Palette style ids contained in the page.</int>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	public:
Shinya Kitaoka 3bfa54
		Page(std::wstring name);
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
		std::wstring getName() const { return m_name; }	//!< Returns the name of the page.
Shinya Kitaoka 3bfa54
		void setName(std::wstring name) { m_name = name; } //!< Sets the name of the page.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		TPalette *getPalette() const { return m_palette; } //!< Returns a pointer to the palette that contains this page.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		int getIndex() const { return m_index; } //!< Returns the page index in the palette.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		int getStyleCount() const { return (int)m_styleIds.size(); } //!< Returns the number of the styles contained in the page.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		int getStyleId(int indexInPage) const;		  //!< Returns the \a index-th style id in the page, or \p -1 if not found.
Toshihiro Shimizu 890ddd
		TColorStyle *getStyle(int indexInPage) const; //!< Returns the \a index-th style in the page, or \p 0 if not found.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		//! \return The insertion index in the page, or \p -1 on failure
Toshihiro Shimizu 890ddd
		int addStyle(int styleId); //!< Adds the specified style Id to the page (at the \a back
Toshihiro Shimizu 890ddd
								   //!  of the page).
Toshihiro Shimizu 890ddd
		/*!
Toshihiro Shimizu 890ddd
      \warning  The supplied style must have been allocated with \a new.
Toshihiro Shimizu 890ddd
      \warning  Style ownership is surrendered to the palette.
Toshihiro Shimizu 890ddd
      \return   The insertion index in the page, or \p -1 on failure.
Toshihiro Shimizu 890ddd
                In case of failure, the supplied style is \a deleted.
Toshihiro Shimizu 890ddd
    */
Toshihiro Shimizu 890ddd
		int addStyle(TColorStyle *style); //!< Adds the specified style to the palette, and assigns it
Toshihiro Shimizu 890ddd
										  //!  to this page.
Toshihiro Shimizu 890ddd
		//! \return The insertion index in the page, or \p -1 on failure
Toshihiro Shimizu 890ddd
		int addStyle(TPixel32 color); //!< Add a solid color style to the palette, and assigns it
Toshihiro Shimizu 890ddd
									  //!  to this page.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		void insertStyle(int indexInPage, int styleId); //!< Inserts the supplied style id at the specified position
Toshihiro Shimizu 890ddd
														//!  in the page.
Toshihiro Shimizu 890ddd
		//! \sa The specifics of addStyle(TColorStyle*) apply here.
Toshihiro Shimizu 890ddd
		void insertStyle(int indexInPage, TColorStyle *style); //!< Inserts the supplied style in the palette, and assigns its
Toshihiro Shimizu 890ddd
															   //!  id at the specified position in the page.
Toshihiro Shimizu 890ddd
		void insertStyle(int indexInPage, TPixel32 color);	 //!< Inserts a solid color style in the palette, and assigns its
Toshihiro Shimizu 890ddd
															   //!  id at the specified position in the page.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
		void removeStyle(int indexInPage);	//!< Removes the style at the specified position from this page.
Toshihiro Shimizu 890ddd
		int search(int styleId) const;		  //!< Returns the page position of the specified style id,
Toshihiro Shimizu 890ddd
											  //!  or \p -1 if it cannot be found on the page.
Toshihiro Shimizu 890ddd
		int search(TColorStyle *style) const; //!< Returns the page position of the specified style,
Toshihiro Shimizu 890ddd
											  //!  or \p -1 if it cannot be found on the page.
Toshihiro Shimizu 890ddd
	};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Toshihiro Shimizu 890ddd
	typedef std::map<int, tcolorstylep=""> StyleAnimation;		   //!< Style keyframes list.</int,>
Toshihiro Shimizu 890ddd
	typedef std::map<int, styleanimation=""> StyleAnimationTable; //!< Style keyframes list per style id.</int,>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	friend class Page;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Toshihiro Shimizu 890ddd
	std::wstring m_globalName;  //!< Palette \a global name.
Toshihiro Shimizu 890ddd
	std::wstring m_paletteName; //!< Palette name.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int m_version;										   //!< Palette version number.
Toshihiro Shimizu 890ddd
	std::vector<page *=""> m_pages;						   //!< Pages list.</page>
Toshihiro Shimizu 890ddd
	std::vector<std::pair<page *,="" tcolorstylep="">> m_styles; //!< Styles container.</std::pair<page>
Toshihiro Shimizu 890ddd
	std::map<int, int=""> m_shortcuts;</int,>
Toshihiro Shimizu 890ddd
	StyleAnimationTable m_styleAnimationTable; //!< Table of style animations (per style).
Toshihiro Shimizu 890ddd
	int m_currentFrame;						   //!< Palette's current frame in style animations.
Toshihiro Shimizu 890ddd
	bool m_isCleanupPalette;				   //!< Whether the palette is used for cleanup purposes.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TImageP m_refImg;
Toshihiro Shimizu 890ddd
	TFilePath m_refImgPath;
Toshihiro Shimizu 890ddd
	std::vector<tframeid> m_refLevelFids;</tframeid>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool m_dirtyFlag; //!< Whether the palette changed and needs to be refreshed.
Toshihiro Shimizu 890ddd
	QMutex m_mutex;   //!< Synchronization mutex for multithreading purposes.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool m_isLocked;		 //!< Whether the palette is locked.
Toshihiro Shimizu 890ddd
	bool m_askOverwriteFlag; //!< This variable is quite unique. This flag is to acheive following beghavior:
Toshihiro Shimizu 890ddd
							 //! When saving the level with the palette being edited, ask whether the palette
Toshihiro Shimizu 890ddd
							 //! should be overwitten ONLY ONCE AT THE FIRST TIME.
Toshihiro Shimizu 890ddd
							 //! The confirmation dialog will not be opened unless the palette is edited again,
Toshihiro Shimizu 890ddd
							 //! even if the palette's dirtyflag is true.
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TPalette();
Toshihiro Shimizu 890ddd
	~TPalette();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TPalette *clone() const; //!< Allocates a \a new copy of this palette instance.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	static void setRootDir(const TFilePath &fp); //!< It must be specified to save textures in \e fp/textures.
Toshihiro Shimizu 890ddd
	static TFilePath getRootDir();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	std::wstring getGlobalName() const { return m_globalName; } //!< Returns the name of the palette object.
Shinya Kitaoka 3bfa54
	void setGlobalName(std::wstring name) { m_globalName = name; }   //!< Assigns the name of the palette.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setDirtyFlag(bool dirtyFlag) //!< Declares the palette \a changed with respect to the last saved state.
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		m_dirtyFlag = dirtyFlag;
Toshihiro Shimizu 890ddd
		//synchronize with the dirty flag
Toshihiro Shimizu 890ddd
		m_askOverwriteFlag = dirtyFlag;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
	bool getDirtyFlag() { return m_dirtyFlag; } //!< Returns whether the palette changed with respect to the last saved state.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TColorStyle *getStyle(int styleId) const;				   //!< Returns a pointer to the color style with the specified id,
Toshihiro Shimizu 890ddd
															   //!  or \p 0 if said id is not stored in the palette.
Toshihiro Shimizu 890ddd
	int getStyleCount() const { return (int)m_styles.size(); } //!< Returns the number of the color styles in the palette.
Toshihiro Shimizu 890ddd
	int getStyleInPagesCount() const;						   //!< Returns the number of styles contained in palette pages.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getFirstUnpagedStyle() const; //!< Returns the styleId of the first style not in a page (\p -1 if none).
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
		\remark   Style ownserhip is \a surrendered to the palette
Toshihiro Shimizu 890ddd
		\return   The styleId associated to the inserted style, or \a -1 on failure.
Toshihiro Shimizu 890ddd
	*/
Toshihiro Shimizu 890ddd
	int addStyle(TColorStyle *style);		 //!< Adds the specified style to the palette (but in no page).
Toshihiro Shimizu 890ddd
	int addStyle(const TPixelRGBM32 &color); //!< Adds a solid color style to the palette (but in no page).
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    \remark     Style ownserhip is \a surrendered to the palette.
Toshihiro Shimizu 890ddd
    \remark     Any existing style's animation will be discarded.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	void setStyle(int styleId, TColorStyle *style);		   //!< Replaces the style with the specified style id.
Toshihiro Shimizu 890ddd
	void setStyle(int styleId, const TPixelRGBM32 &color); //!< Replaces the style with the specified style id.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getPageCount() const; //!< Returns the pages count.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	Page *getPage(int pageIndex);			  //!< Returns the \a index-th palette page, or \p 0 if no such page was found.
Toshihiro Shimizu 890ddd
	const Page *getPage(int pageIndex) const; //!< Const version of getPage(int).
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    \return  A pointer to the newly created page.
Toshihiro Shimizu 890ddd
  */
Shinya Kitaoka 3bfa54
	Page *addPage(std::wstring name); //!< Creates a new page with the specified name.
Toshihiro Shimizu 890ddd
	void erasePage(int index);   //!< Deletes the \a index-th page.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void movePage(Page *page, int dstPageIndex); //!< Moves the specified page to a different page index.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	Page *getStylePage(int styleId) const; //!< Returns the page containing the specified \a styleId.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    \note   The distance between colors is calculated with the usual sphrical norm between RGBA color components.
Toshihiro Shimizu 890ddd
    \return The style id of the nearest style, or \p -1 if none was found.
Toshihiro Shimizu 890ddd
	*/
Toshihiro Shimizu 890ddd
	int getClosestStyle(const TPixelRGBM32 &color) const; //!< Returns the index of the style whose main color
Toshihiro Shimizu 890ddd
														  //!  is nearest to the requested one.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void loadData(TIStream &is); //!< I/O palette save function.
Toshihiro Shimizu 890ddd
	void saveData(TOStream &os); //!< I/O palette load function.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getVersion() const { return m_version; } //!< Returns the palette's version number
Toshihiro Shimizu 890ddd
	void setVersion(int v) { m_version = v; }	//!< Sets the palette's version number
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setRefLevelFids(const std::vector<tframeid> fids); //!< Associates the list of frames \e fids to this palette.</tframeid>
Toshihiro Shimizu 890ddd
	std::vector<tframeid> getRefLevelFids();				//!< Returns the list of frames associated to this palette.</tframeid>
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	//! \deprecated  Should be substituted by operator=(const TPalette&).
Toshihiro Shimizu 890ddd
	void assign(const TPalette *src, bool isFromStudioPalette = false); //!< Copies src's page, color styles an animation table to the
Toshihiro Shimizu 890ddd
																		//!  correspondig features of the palette.
Toshihiro Shimizu 890ddd
																		//!  if the palette is copied from studio palette, this function will modify the original names.
Toshihiro Shimizu 890ddd
	void merge(const TPalette *src, bool isFromStudioPalette = false);  //!< Adds src's styles and pages to the palette.
Toshihiro Shimizu 890ddd
																		//!  if the palette is merged from studio palette, this function will modify the original names.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setAskOverwriteFlag(bool askOverwriteFlag)
Toshihiro Shimizu 890ddd
	{ //!< Sets the ask-overwrite flag.
Toshihiro Shimizu 890ddd
		m_askOverwriteFlag = askOverwriteFlag;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
	bool getAskOverwriteFlag() { return m_askOverwriteFlag; } //!< Returns the ask-overwrite flag.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setIsCleanupPalette(bool on);							 //!< Sets the palette's identity as a cleanup palette.
Toshihiro Shimizu 890ddd
	bool isCleanupPalette() const { return m_isCleanupPalette; } //!< Returns whether this is a cleanup palette.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	const TImageP &getRefImg() const { return m_refImg; } //!< Returns an image that represents the frame image associated to this palette.
Toshihiro Shimizu 890ddd
	void setRefImg(const TImageP &img);					  //!< Associates an image to this palette, that is an image in the frame
Toshihiro Shimizu 890ddd
														  //!  builded or modified using this palette.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	const TFilePath getRefImgPath() const { return m_refImgPath; } //!< Returns the file path of the reference image.
Toshihiro Shimizu 890ddd
	void setRefImgPath(const TFilePath &fp);					   //!< Sets the path filename of the reference image.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isAnimated() const; //!< Returns whether this palette is animated (styles change through time).
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getFrame() const;	 //!< Returns the index of the current frame.
Toshihiro Shimizu 890ddd
	void setFrame(int frame); //!< Sets the index of the current frame.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isKeyframe(int styleId, int frame) const; //!< Returns whether the specified frame is a \a keyframe in styleId's animation
Toshihiro Shimizu 890ddd
	int getKeyframeCount(int styleId) const;	   //!< Returns the keyframes count in styleId's animation.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	int getKeyframe(int styleId, int index) const; //!< Returns the \a index-th frame in styleId's animation,
Toshihiro Shimizu 890ddd
												   //!  or \p -1 if it couldn't be found.
Toshihiro Shimizu 890ddd
	void setKeyframe(int styleId, int frame);	  //!< Sets a keyframe at the specified frame of styleId's animation.
Toshihiro Shimizu 890ddd
	void clearKeyframe(int styleId, int frame);	//!< Deletes the keyframe at the specified frame of styleId's animation.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
    \note   Key is an integer between 0 and 9 included.
Toshihiro Shimizu 890ddd
  */
Toshihiro Shimizu 890ddd
	int getShortcutValue(int key) const; //!< Returns the style id \a shortcut associated to key,
Toshihiro Shimizu 890ddd
										 //!  or \p -1 if it couldn't be found.
Toshihiro Shimizu 890ddd
	/*!
Toshihiro Shimizu 890ddd
		
Toshihiro Shimizu 890ddd
	*/
Toshihiro Shimizu 890ddd
	int getStyleShortcut(int styleId) const;	 //!< Returns the shortcut associated to styleId, or
Toshihiro Shimizu 890ddd
												 //!  or \p -1 if it couldn't be found.
Toshihiro Shimizu 890ddd
	void setShortcutValue(int key, int styleId); //!< Associates the specified key to a styleId.
Toshihiro Shimizu 890ddd
Shinya Kitaoka 3bfa54
	void setPaletteName(std::wstring name) { m_paletteName = name; } //!< Sets the name of the palette.
Shinya Kitaoka 3bfa54
	std::wstring getPaletteName() const { return m_paletteName; }	//!< Returns the name of the palette.
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	QMutex *mutex() { return &m_mutex; } //!< Returns the palette's mutex
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	bool isLocked() const { return m_isLocked; } //!< Returns whether the palette is locked.
Toshihiro Shimizu 890ddd
	void setIsLocked(bool lock)					 //!< Sets lock/unlock to the palette.
Toshihiro Shimizu 890ddd
	{
Toshihiro Shimizu 890ddd
		m_isLocked = lock;
Toshihiro Shimizu 890ddd
	}
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	// Deprecated functions
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	//! \deprecated  Used only once throughout Toonz, should be verified.
Toshihiro Shimizu 890ddd
	bool getFxRects(
Toshihiro Shimizu 890ddd
		const TRect &rect,
Toshihiro Shimizu 890ddd
		TRect &rectIn,
Toshihiro Shimizu 890ddd
		TRect &rectOut);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Toshihiro Shimizu 890ddd
	// Not copyable
Toshihiro Shimizu 890ddd
	TPalette(const TPalette &);			   //!< Not implemented
Toshihiro Shimizu 890ddd
	TPalette &operator=(const TPalette &); //!< Not implemented
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
template class DVAPI TSmartPointerT<tpalette>;</tpalette>
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
#pragma warning(pop)
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif // TPALETTE_H