/* ------------------------------------------------------------------
 * GEM - Graphics Environment for Multimedia
 *
 * SPDX-FileCopyrightText: © 2011, IOhannes m zmölnig and the GEM contributors
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * ------------------------------------------------------------------
 */

#ifndef _INCLUDE__GEM_OUTPUT_GEMW__WINDOW_H_
#define _INCLUDE__GEM_OUTPUT_GEMW__WINDOW_H_

#include "Base/GemWindow.h"

/*-----------------------------------------------------------------
  -------------------------------------------------------------------
  CLASS
  gemw32window

  The window manager (W32)

  DESCRIPTION

  Access to GemMan.

  "bang"  - swap the buffers
  "render" - render a frame now

  "create" - create a graphics window
  "destroy" - destroy the graphics window


  "buffer" - single or double buffered
  "fsaa" - full screen anti-aliasing

  "title" - set a title for the graphics window
  "border" - whether we want a border as decoration or not

  "dimen" - the window dimensions
  "fullscreen" - fullscreen mode
  "offset" - the window offset
  "secondscreen" - render to the secondscreen (auto-offset)

  "cursor" - whether we want a cursor or not
  "menubar" - hide notorious menubars
  "topmost" - set the window to stay on top

  -----------------------------------------------------------------*/

#ifdef GEMW32WINDOW_INTERNAL
# define GEMW32WINDOW_EXTERN GEM_EXPORT
#else
# define GEMW32WINDOW_EXTERN GEM_IMPORT
#endif


class GEMW32WINDOW_EXTERN gemw32window : public GemWindow
{
  CPPEXTERN_HEADER(gemw32window, GemWindow);

public:

  //////////
  // Constructor
  gemw32window(void);

private:

  //////////
  // Destructor
  virtual ~gemw32window(void);


  // create window
  virtual bool create(void);

  // destroy window
  virtual void destroy(void);

  // check whether we have a window and if so, make it current
  virtual bool makeCurrent(void);
  virtual void swapBuffers(void);

  /* dispatch window events */
  virtual void dispatch(void);

  LONG WINAPI event(UINT uMsg, WPARAM wParam, LPARAM lParam);
  void  move(void);

  virtual void createMess(const std::string&);
  virtual void        dimensionsMess(unsigned int, unsigned int);
  virtual void        offsetMess(int, int);
  virtual void        cursorMess(bool);
  virtual void        topmostMess(bool);
  virtual void        titleMess(const std::string&);
  virtual void        fullscreenMess(int);

private:
  bool m_topmost;
  class Window;
  Window*m_win;
};

#endif    // for header file
