// Copyright (c) 2019 Giorgos Vougioukas
//
// The license can be found in the LICENSE file.

#ifndef _MNEMOSYNE_NCURSES_EDITOR_H_
#define _MNEMOSYNE_NCURSES_EDITOR_H_

#ifndef CURSES_INSTANCE
#define CURSES_INSTANCE ((win32CursesCtx *)m_cursesCtx)
#endif

#include <string.h>
#include <stdlib.h>

#include "mnemosyne/definitions.h"
#include "WDL/win32_curses/curses.h"
#include "WDL/win32_curses/curses_editor.h"
// Time to panic
//#undef move
//#undef erase
//#undef sync

#define WM_TOGGLE_FOCUS (WM_USER + 200)

class RSM_PreviewEditor : public WDL_CursesEditor
{
public:
  RSM_PreviewEditor(void *curses_ctx);
  ~RSM_PreviewEditor();

  void ClearText();

  void SetParent(HWND parent);
  int onChar(int c);

private:
  HWND m_parent;
};

class RSM_PreferencesEditor : public WDL_CursesEditor
{
public:
  RSM_PreferencesEditor(void *curses_ctx);
  ~RSM_PreferencesEditor();

  void ClearText();

  void SetParent(HWND parent);
  int onChar(int c);

  void draw_bottom_line();

private:
  HWND m_parent;
};

#endif // _MNEMOSYNE_NCURSES_EDITOR_H_
