Welcome to mirror list, hosted at ThFree Co, Russian Federation.

LCDGfx.h « LCDUI « ui « src - github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 880e825d6681e21ae4fedb684ac75da48ec83e83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//************************************************************************
//
// LCDGfx.h
//
// The CLCDGfx class abstracts GDI/bitmap details. It is used in the
// OnDraw event.
// 
// Logitech LCD SDK
//
// Copyright 2005 Logitech Inc.
//************************************************************************

#ifndef _LCDGFX_H_INCLUDED_ 
#define _LCDGFX_H_INCLUDED_ 

#include <windows.h>
#include <tchar.h>
#include <lglcd/lglcd.h>

#if _MSC_VER >= 1400  
#define LCDUI_tcsncpy(x, y, z)       _tcsncpy_s(x, _countof(x), y, z)
#define LCDUI_tcscpy(x, y)           _tcscpy_s(x, _countof(x), y)
#else
#define LCDUI_tcsncpy(x, y, z)       _tcsncpy(x, y, z)
#define LCDUI_tcscpy(x, y)           _tcscpy(x, y)
#endif

#ifndef LCDUITRACE
    // .NET compiler uses __noop intrinsic
    #if _MSC_VER > 1300
        #define LCDUITRACE __noop
    #else
        #define LCDUITRACE (void)0
    #endif
#endif

#ifndef LCDUIASSERT
    // .NET compiler uses __noop intrinsic
    #if _MSC_VER > 1300
        #define LCDUIASSERT __noop
    #else
        #define LCDUIASSERT (void)0
    #endif
#endif



class CLCDGfx
{
public:
    CLCDGfx(void);
    virtual ~CLCDGfx(void);

    HRESULT Initialize(int nWidth, int nHeight);
    void Shutdown(void);

    void BeginDraw(void);
    void ClearScreen(void);
    void SetPixel(int nX, int nY, BYTE bValue);
    void DrawLine(int nX1, int nY1, int nX2, int nY2);
    void DrawFilledRect(int nX, int nY, int nWidth, int nHeight);
    void DrawText(int nX, int nY, LPCTSTR sText);
    void EndDraw(void);

    HDC GetHDC(void);
    lgLcdBitmap160x43x1 *GetLCDScreen(void);
    BITMAPINFO *GetBitmapInfo(void);
    HBITMAP GetHBITMAP(void);
    
protected:
    int m_nWidth;
    int m_nHeight;
    lgLcdBitmap160x43x1 *m_pLCDScreen;
    BITMAPINFO *m_pBitmapInfo;
    HDC m_hDC;
    HBITMAP m_hBitmap;
    HBITMAP m_hPrevBitmap;
    PBYTE m_pBitmapBits;
};


#endif // !_LCDGFX_H_INCLUDED_ 

//** end of LCDGfx.h *****************************************************