#ifndef WMSLIDESHOWCLASS_HPP_INCLUDED
#define WMSLIDESHOWCLASS_HPP_INCLUDED

/*
    wmimagedock

  Copyright (c) 2018 Michael Heras

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program; if not, write to the Free Software
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307,
  USA.
*/


#define APPNAME "wmimagedock"
#define VERSION "1.10.1"
#define AUTHOR "Michael Heras"
#define COPYRIGHT " (c) 2018"
#define CLASSNAME "wmimagedock"
#define INSTANCENAME "wmimagedock"

const char *const wClassName = CLASSNAME;
const char *const wInstanceName = INSTANCENAME;
#include <iostream>
#include <X11/Xlib.h>
#include <X11/extensions/shape.h>
#include <Imlib2.h>

class WMWindowDock
{
    Display *mDisplay;
    Visual *visual;
    Window mRoot;
    Window mAppWin;
    Window mIconWin;
    GC gc;
    Imlib_Image image;
    Imlib_Image buffer;
    Pixmap pix;
    std::string filename;
    std::string LoadFile;
    std::string mInstanceName;
    std::string command1;
    std::string command2;
    XClassHint  classHint;
    XSizeHints  sizeHints;
    XWMHints    wmHints;
    Atom        deleteWindow;

    unsigned long   gcm;
    unsigned int	borderwidth;
    unsigned char mode;
    int dummy;
    int screen;
    int depth;
	int DockSize;
    size_t stime;
    int isize;
    int whatNumber;
    char *Geometry;
    bool isRandom = false;
    bool isOrdered = false;
    bool isByNumber = false;

    char *displayName;

    enum selectionM {A,B,C};

public:
    WMWindowDock() {
        dummy = 0;
        screen = 0;
        depth = 0;
		DockSize = 64;
        stime = 350;
        isize = 56;
        borderwidth = 1;

        isRandom = false;
        isOrdered = false;
        isByNumber = false;
        whatNumber = 1;
        displayName = NULL;
        Geometry  = NULL;//"";
    };
    virtual ~WMWindowDock() {};
    void parseCmLine(int argc, char **argv);
    void filesGetter(char **argv);
    void openXup(int argc, char **argv);
    void DisplayImage();
    void transverseImage();
    void reverseImage();
    void setBuffer(Imlib_Image im);
    int load_err_image(std::string path);
    void usage(char **argv);
    void setMode(int s);

    //inline
    inline int getMode() { return mode; }
    inline void setCommandOne(char *argv) {command1 = argv; }
    inline std::string getCommandOne (){ return command1; }
    inline void setCommandTwo(char *argv) { command2 = argv; }
    inline std::string getCommandTwo() { return command2; }
    inline void setLoadedFileName(std::string lf) { LoadFile = lf; }
    inline std::string getLoadedFileName() { return LoadFile; }
    inline std::string getFileName() { return filename; }
    inline int getScreen(){ return screen; }
    inline Display *getDisplay() { return mDisplay; }
    inline Window getIconWin() { return mIconWin; }
    inline Window getAppWin() { return mAppWin; }
    inline Pixmap getPixMap() { return pix; }
    inline GC getGC() { return gc; }
    inline bool getRandom() { return isRandom; }
    inline bool getOrder() { return isOrdered; }
    inline bool getByNumber() { return isByNumber; }
    inline int getWhatNumber() { return whatNumber; }
    inline int getStime() { return stime; }
    inline int getIsize() { return isize; }
    inline Imlib_Image getImage() { return image; }
    inline void setOrder()
    {
        if (!isOrdered)
            isOrdered = true;
        else
            isOrdered = false;
    }
    inline void setRandom()
    {
        if (!isRandom)
            isRandom = true;
        else
            isRandom = false;
    }
    inline void setByNumber()
    {
        if (!isByNumber)
            isByNumber = true;
        else
            isByNumber = false;
    }
    inline WMWindowDock &getObject() { return *this; }
    inline Imlib_Image getBuffer() { return buffer; }
};

#endif // WMSLIDESHOW_HPP_INCLUDED
