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

#ifndef _THA_NCURSES_EDITOR_H_
#define _THA_NCURSES_EDITOR_H_

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

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

#include "thalia/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 THA_PreviewEditor : public WDL_CursesEditor
{
public:
  THA_PreviewEditor(void *curses_ctx);
  ~THA_PreviewEditor();

  void ClearText();

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

private:
  HWND m_parent;
};

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

  void ClearText();

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

  void draw_bottom_line();

private:
  HWND m_parent;
};

#endif // _THA_NCURSES_EDITOR_H_
