/*
 * SPDX-FileCopyrightText: 2004 Copyright contributors to the cppTango project
 *
 * SPDX-License-Identifier: LGPL-3.0-or-later
 */

#ifndef TANGO_WINDOWS_COUTBUF_H
#define TANGO_WINDOWS_COUTBUF_H

// clang-format off
#include <winsock2.h> // prevents windows.h from including winsock.h
#include <windows.h>
// clang-format on

namespace Tango
{

//
//   Some defines
//

#define IDC_LIST -777
#define MAXLISTLINES 200

class CoutBuf
{
  public:
    CoutBuf(HINSTANCE, int, HWND, LPCSTR);
    virtual ~CoutBuf();

    HWND get_debug_window()
    {
        return DbgWin;
    }

    void clear_debug_window()
    {
        DbgWin = nullptr;
    }

    void CreateWin(LPCSTR);

    int dbg_out(LPCSTR);

  protected:
    HWND DbgWin;
    HWND parent_window;
};

//
//  Some functions for windows window management!!!
//

LRESULT CALLBACK DebugWndProc(HWND, UINT, WPARAM, LPARAM);
void DrawDebugItem(HWND, LPDRAWITEMSTRUCT);
void MeasureDebugItem(HWND, LPMEASUREITEMSTRUCT);

} // namespace Tango

#endif /* TANGO_WINDOWS_COUTBUF_H */
