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

#ifndef TANGO_WINDOWS_W32WIN_H
#define TANGO_WINDOWS_W32WIN_H

#include <tango/common/tango_const.h>

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

namespace Tango
{

class Util;
class CoutBuf;

class W32Win
{
  public:
    W32Win(Util *, int);
    ~W32Win();

    HWND get_win()
    {
        return win;
    }

    CoutBuf *get_output_buffer()
    {
        return pcb;
    }

  private:
    HWND win;

    CoutBuf *pcb;
    void RegisterTangoClass(HINSTANCE);
    void InitInstance(HINSTANCE, int);
};

//
// Some define for the main window drawing
//

#define X_FACTOR 2
#define Y_FACTOR 1.3
#define TOO_LARGE_TXT "Your text is too large for this window !!"
#define MAIN_TXT "Tango\nDevice\nServer"

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

LRESULT CALLBACK TangoWndProc(HWND, UINT, WPARAM, LPARAM);
LRESULT CALLBACK AboutProc(HWND, UINT, WPARAM, LPARAM);
void SetDebugLevel(LogLevel, HMENU, bool);
void all_dev(Util *, LogLevel);
int get_all_dev_log_level(Util *, LogLevel &);
void NoDebugLevel(HMENU, bool);
void add_cout_appender(Util *);
void all_dev_add_cout(Util *);

} // namespace Tango

#endif /* _COUTBUF_H */
