//
// Palette class for PTC 2.0 C++ API (HERMES INTERFACE PACKAGE)
// Copyright (c) 1998 Glenn Fiedler (ptc@gaffer.org)
// This source code is licensed under the GNU LGPL
//

#ifndef __PTC_PALETTE_H
#define __PTC_PALETTE_H

// include files
#include "Copy.h"
#include "Types.h"
#include "Hermes.h"




class Palette
{
    public:

        // setup
        Palette();
        Palette(const Palette &palette);
        ~Palette();

        // memory access
        int32* lock();
        void unlock();

        // load palette data
        void load(const int32 data[]);

        // save palette data
        void save(int32 data[]) const;
        
        // get palette data
        const int32* data() const;

        // operators
        Palette& operator =(const Palette &palette);
        bool operator ==(const Palette &palette) const;
        bool operator !=(const Palette &palette) const;

    private:

        // locked flag
        bool m_locked;

        // hermes handle
        HermesHandle m_handle;

        // copy friend function
        friend void Copy::palette(const Palette &source,const Palette &destination);
};




#endif
