112 lines
3.5 KiB
C
112 lines
3.5 KiB
C
![]() |
#ifndef _TALKWINDOW_H_
|
|||
|
#define _TALKWINDOW_H_
|
|||
|
#include <windows.h>
|
|||
|
#include "../systeminc/chat.h"
|
|||
|
|
|||
|
#define WM_UPDATE_SKIN 0x8000
|
|||
|
#define MAX_TALK_WINDOW_LINE 6
|
|||
|
#define TALK_WINDOW_SXO 12 // <20>Ի<EFBFBD><D4BB>Ӵ<EFBFBD><D3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>ʼx<CABC><78><EFBFBD><EFBFBD>
|
|||
|
#define TALK_WINDOW_SYO 10 // <20>Ի<EFBFBD><D4BB>Ӵ<EFBFBD><D3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>ʼy<CABC><79><EFBFBD><EFBFBD>
|
|||
|
#define TALK_WINDOW_SXI 30 // <20>Ի<EFBFBD><D4BB>Ӵ<EFBFBD><D3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>ʼx<CABC><78><EFBFBD><EFBFBD>
|
|||
|
#define TALK_WINDOW_SYI 128 // <20>Ի<EFBFBD><D4BB>Ӵ<EFBFBD><D3B4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD>ʼy<CABC><79><EFBFBD><EFBFBD>
|
|||
|
#define SKIN_WIDTH 645
|
|||
|
#define SKIN_HEIGHT 155
|
|||
|
#define SKIN_KIND 5
|
|||
|
#define TALK_WINDOW_MAX_CHAT_LINE 40 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>buffer
|
|||
|
#ifdef _STONDEBUG_
|
|||
|
#define FACE_SYMBOL_NUM 20 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#define STORE_SYMBOL_NUM 200 // <20><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
#define LINE_HEIGHT 20 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>о<EFBFBD>
|
|||
|
#define SYMBOL_WIDTH 19 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
|||
|
#define SYMBOL_HEIGHT 19 // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC>
|
|||
|
#endif
|
|||
|
|
|||
|
extern BOOL g_bTalkWindow;
|
|||
|
extern int g_iCursorCount;
|
|||
|
|
|||
|
#ifdef _STONDEBUG_
|
|||
|
typedef struct _tsFaceSymbol{ // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
HDC hDraw;
|
|||
|
HDC hDrawMask;
|
|||
|
HBITMAP hbmpMaskBMP;
|
|||
|
HANDLE hLoadBMP;
|
|||
|
HANDLE hOldLoadBMP;
|
|||
|
HANDLE hOldMaskBMP;
|
|||
|
BOOL bUse;
|
|||
|
char szSymbol[8]; // <20><><EFBFBD><EFBFBD>( :) :( :D ...etc)
|
|||
|
char szFaceName[32]; // <20><><EFBFBD><EFBFBD>
|
|||
|
}FaceSymbol;
|
|||
|
|
|||
|
typedef struct _tsStoreSymbol{ // <20><>¼<EFBFBD><C2BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
BOOL bUse;
|
|||
|
HDC hDraw;
|
|||
|
HDC hDrawMask;
|
|||
|
int x;
|
|||
|
int y;
|
|||
|
}StoreSymbol;
|
|||
|
#endif
|
|||
|
|
|||
|
typedef struct _tsChatBufferLink{
|
|||
|
CHAT_BUFFER ChatBuffer;
|
|||
|
_tsChatBufferLink *prev;
|
|||
|
_tsChatBufferLink *next;
|
|||
|
BOOL bUse;
|
|||
|
}ChatBufferLink;
|
|||
|
|
|||
|
LRESULT CALLBACK TalkWindowProc(HWND hWnd,UINT Message,WPARAM wParam,LPARAM lParam);
|
|||
|
|
|||
|
class CTalkWindow
|
|||
|
{
|
|||
|
private:
|
|||
|
HWND m_hWnd; // <20><><EFBFBD>Ӵ<EFBFBD><D3B4><EFBFBD> HWND
|
|||
|
HWND m_hTalkWindow; // <20>Լ<EFBFBD><D4BC><EFBFBD> HWND
|
|||
|
HINSTANCE m_hInstance; // <20><><EFBFBD>Ӵ<EFBFBD><D3B4><EFBFBD> HINSTANCE
|
|||
|
HANDLE m_hSkin[SKIN_KIND]; // SKIN_KIND->0:base 1:up arrow 2:up arrow hit 3:down arrow 4:down arrow hit
|
|||
|
HANDLE m_hOldSkin[SKIN_KIND];
|
|||
|
HDC m_hdcSkin[SKIN_KIND]; // SKIN_KIND->0:base 1:up arrow 2:up arrow hit 3:down arrow 4:down arrow hit
|
|||
|
HDC m_hdcBackBuffer; // backbuffer dc for draw
|
|||
|
HBITMAP m_hbmpBackBuffer; // backbuffer of memory for draw
|
|||
|
HANDLE m_hbmpOldBackBuffer;
|
|||
|
BOOL m_bUpArrowHit; // <20>Ͼ<EFBFBD><CFBE><EFBFBD>ť<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
BOOL m_bDownArrowHit; // <20>¾<EFBFBD><C2BE><EFBFBD>ť<EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
BOOL m_bScroll; // <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ھ<EFBFBD><DABE><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
BOOL m_bInit; // <20><>ʼ<EFBFBD><CABC><EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD>ʧ<EFBFBD><CAA7>
|
|||
|
ChatBufferLink *m_pCBLHead; // ָ<><D6B8><EFBFBD>Ի<EFBFBD>link<6E><6B>һ<EFBFBD><D2BB>link<6E><6B>ָ<EFBFBD><D6B8>
|
|||
|
ChatBufferLink *m_pCBLTail; // ָ<><D6B8><EFBFBD>Ի<EFBFBD>link<6E><6B><EFBFBD><EFBFBD>һ<EFBFBD><D2BB>link<6E><6B>ָ<EFBFBD><D6B8>
|
|||
|
ChatBufferLink *m_pCBLString; // ָ<><D6B8><EFBFBD>Ի<EFBFBD>link<6B><D7BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ִ<EFBFBD><D6B4><EFBFBD>link<6E><6B>ָ<EFBFBD><D6B8>
|
|||
|
ChatBufferLink *m_pCBLView; // ָ<><D6B8>Ҫ<EFBFBD><D2AA>ʾ<EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD>ϵ<EFBFBD>һ<EFBFBD>е<EFBFBD><D0B5>ִ<EFBFBD><D6B4><EFBFBD>linkָ<6B><D6B8>
|
|||
|
ChatBufferLink *m_pCBLViewBottom; // ָ<><D6B8>Ҫ<EFBFBD><D2AA>ʾ<EFBFBD>ڻ<EFBFBD><DABB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD>е<EFBFBD><D0B5>ִ<EFBFBD><D6B4><EFBFBD>linkָ<6B><D6B8>
|
|||
|
#ifdef _STONDEBUG_
|
|||
|
FaceSymbol m_fsFaceSymbol[FACE_SYMBOL_NUM]; // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|||
|
StoreSymbol m_ssStoreSymbol[STORE_SYMBOL_NUM]; // <20><>¼<EFBFBD><C2BC><EFBFBD>DZ<EFBFBD><C7B1><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
|
|||
|
int m_iSymbolCount;
|
|||
|
#endif
|
|||
|
int m_iline;
|
|||
|
public:
|
|||
|
CTalkWindow(void);
|
|||
|
~CTalkWindow(void);
|
|||
|
|
|||
|
void Create();
|
|||
|
void Update(void);
|
|||
|
void LoadSkin(char *szSkinPath);
|
|||
|
void DrawSkin(BOOL bShowCursor);
|
|||
|
void AddString(char *szString,int color);
|
|||
|
HWND GetTalkWindowWND(void) { return m_hTalkWindow;};
|
|||
|
void UpArrowHit(BOOL bHit);
|
|||
|
void DownArrowHit(BOOL bHit);
|
|||
|
void ClearChatBuffer(void);
|
|||
|
void Init(HWND hWnd,HINSTANCE hInstance);
|
|||
|
void Visible(BOOL flag);
|
|||
|
void Release(void);
|
|||
|
#ifdef _STONDEBUG_
|
|||
|
void ReadFaceSymbolFile(void);
|
|||
|
void InitFaceSymbol(COLORREF MaskColor);
|
|||
|
void ReleaseFaceSymbol(void);
|
|||
|
void SetToFaceSymbolString(char *szDestString,ChatBufferLink *pCBL,int x,int y);
|
|||
|
void ShowFaceSymbol(void);
|
|||
|
#endif
|
|||
|
};
|
|||
|
|
|||
|
extern CTalkWindow TalkWindow;
|
|||
|
|
|||
|
#endif
|