⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 osdinternal.h

📁 MiniWinOuterSM MiniWinOuterSM
💻 H
字号:
#ifndef __OSD_INTERNAL_H__
#define __OSD_INTERNAL_H__
#include"osdwingdi.h"
#include"prgfx.h"
//#include"osddc.h"  
#include"osdfont.h"  
#include"osdmessage.h"
#include"blockheap.h"
#include"prmem.h"
#include"prdbg.h"
#define WM_SYSTIMER 0x0118
typedef struct{
	USHORT		magic;
	USHORT		isStock;
	DWORD		dwRefCount;//引用的计数
}GDIOBJ;
typedef struct{
	GDIOBJ		hdr;
	LOGPEN		logPen;

}PENOBJ;
typedef struct{
	GDIOBJ		hdr;
	LOGBRUSH	logbrush;
}BRUSHOBJ;
typedef struct{
	GDIOBJ		hdr;
	LOGFONT	logfont;
}FONTOBJ;

typedef struct tagBITMAPOBJ
{
    GDIOBJ		hdr;
    BITMAP		bitmap;
    SIZE		size;   /* For SetBitmapDimension() */
    //const DC_FUNCTIONS *funcs; //DC function table 
    /* For device-independent bitmaps: */
    DIBSECTION  *dib;
    /*SEGPTR*/DWORD		segptr_bits;  /* segptr to DIB bits */
	RGBQUAD *color_table;
	UINT nb_colors;
} BITMAPOBJ;
typedef struct tagCURSORICONINFO
{
    POINTS ptHotSpot;
    WORD    nWidth;
    WORD    nHeight;
    WORD    nWidthBytes;
    BYTE    bPlanes;
    BYTE    bBitsPerPixel;
} CURSORICONINFO;
typedef struct tagPALETTEOBJ
{
    GDIOBJ		hdr;
    int*		mapping;
    LOGPALETTE	logpalette; /* _MUST_ be the last field */
} PALETTEOBJ;

typedef struct tagClipRect{
	RECT rc;
	struct tagClipRect*next;
	struct tagClipRect*prev;
}CLIPRECT;
typedef struct tagClipRgn{
	BYTE	type;
	BYTE	reserved[3];
    RECT     rcBound;//剪裁区所在区域
   //head of the clipping rectangle list.
    CLIPRECT*head;
	//tail of the clipping rectangle list.
    CLIPRECT*tail;
	BLOCKHEAP*Heap;
}CLIPRGN;
typedef struct tagRGNOBJ{
	GDIOBJ		hdr;
	CLIPRGN		rgn;
}RGNOBJ;

typedef struct tagGCRINFO
{//窗口全局剪裁区域,所有区域都采用屏幕坐标,而不是窗口坐标,
 //crgn中包含窗口被其他窗口覆盖后余下的所有可见区域.
    PRMutex	lock;
    HRGN	hrgn;
    int     Version;
}GCRINFO;
typedef struct tagDC{
	GDIOBJ		hdr;
	DWORD		dcFlags;
	PGFX		gfx;	
	RECT		DevRC;//屏幕输出区域。这应该随相应的window改变
	RECT		rcOut;//
	RECT		rcUpdate;//
	int			UpdateLock;
	HWND		hWnd;
	BYTE*		dstPixel;
	HRGN		hClipRgn;//可能为0局部坐标系统
	HRGN		hMetaRgn;//==0局部坐标系统
	HRGN		hMetaClipRgn;//=CombineRgn(hMetaRgn,hClipRgn,RGN_AND)局部坐标系统
	HRGN		hVisRgn;//可见区域,全局坐标系统,不能为空
	//保存DC被暴露的那部分区域 ,如果剪裁区域非空,者是可见区域和剪裁区域的交集

	//HRGN		hergn;//effective region 有效区域,全局坐标系,绘图的时剪裁用,该区域在lcrgn之内
	POINT		PenPos;
	POINT		BrushOrg;
	COLORREF	bkColor;
	INT			bkMode;
	COLORREF	txtColor;
	WORD		stretchBltMode;
	UINT		pixPen;//绘图功能所用象素颜色(非RGB值)
	GDIFONT*	gdiFont;//private 

	HPEN		hPen;
	HBRUSH		hBrush;
	HFONT		hFont;
	HBITMAP		hBitmap;
	HPALETTE	hPalette;
	int Version;//
}DC;

  /* WND flags values */
#define WIN_RESTORE_MAX           0x0001 /* Maximize when restoring */
#define WIN_NEED_SIZE             0x0002 /* Internal WM_SIZE is needed */
#define WIN_NCACTIVATED           0x0004 /* last WM_NCACTIVATE was positive */
#define WIN_ISMDICLIENT           0x0008 /* Window is an MDIClient */
#define WIN_ISDIALOG              0x0010 /* Window is a dialog */
#define WIN_ISWIN32               0x0020 /* Understands Win32 messages */
#define WIN_ISUNICODE             0x0040 /* Window is Unicode */
#define WIN_NEEDS_SHOW_OWNEDPOPUP 0x0080 /* WM_SHOWWINDOW:SC_SHOW must be sent in the next ShowOwnedPopup call */

typedef struct _tagMWCLASS{
    UINT            style;         /* Class style */
    BOOL            local;         /* Local class? */
    WNDPROC         lpfnWndProc;   /* Window procedure */
    INT             cbClsExtra;    /* Class extra bytes */
    INT             cbWndExtra;    /* Window extra bytes */
	LPSTR			lpszClassName;//
    LPSTR           menuName;      /* Default menu name (Unicode followed by ASCII) */
    HINSTANCE       hInstance;     /* Module that created the task */
    HICON           hIcon;         /* Default icon */
    HICON           hIconSm;       /* Default small icon */
    HCURSOR         hCursor;       /* Default cursor */
    HBRUSH          hbrBackground; /* Default background */
    ATOM            atomName;      /* Name of the class */
	struct _tagMWCLASS*next;
}MWCLASS;

typedef struct Window WINDOW;

struct Window{
	UINT		wID;//Dialog Item ID
	UINT		clsStyle;
	UINT		dwStyle;//Window Item Styles
	UINT		dwExStyle;//Window Extention Styles
	UINT		flags;//UCHAR		WinType;//
	DWORD		paint_flags;
	UCHAR		bRedraw;
	HFONT		Font;
	HMENU		hMenu;
	HMENU		hSysMenu;
	PMSGQUEUE	msgQ;
	DWORD		helpContext;
	UINT		Data;//stored the data user defined
	HWND		Parent;
	HWND		Owner;
	HRGN		hwinRgn;//窗口区域,可为空相对主窗口客户区坐标
	RECT		winRect;//窗口区域,该值为主窗口客户区坐标
	RECT		cliRect;//客户区域,该值为主窗口客户区坐标
	HRGN		update_region;//invalidate region
	GCRINFO		GCRInfo;//global clip info
	GCRINFO*	pGCRInfo;//
	//HANDLE		Thread;//Handle of thread that Window belong to
	char*		Caption;
	MWCLASS*	ClassInfo;
	SCROLLBARINFO*pVScroll;//滚动条的区域坐标必须是为窗口(NC非客户区域)相对坐标
	SCROLLBARINFO*pHScroll;//滚动条的区域坐标必须是为窗口(NC非客户区域)相对坐标
    WINDOW*		ActiveChild;
    WINDOW*		Children;//子窗口
	WINDOW*		prev;//上一个窗口,窗口专用,
	WINDOW*		next;//下一个窗口,窗口专用,下一个为topmost
	WNDPROC		WndProc;
	DWORD		userData;
    int			cbExtra;    // class cbWndExtra at window creation 
	DWORD		wExtra[1]; 
};//WINDOW;
/*
|----next--->| |----next--->| |
|DESKTOP     | |            | |TOPMOST
|<---prev----| |<---prev----| |
*/
MWCLASS*GetWindowClassInfo(LPCTSTR clsname);
void*AllocGdiObject(INT size,USHORT magic);
void FreeGdiObject(HGDIOBJ hgdiobj);

BOOL IsMemDC(HDC hdc);
// clip all windows under this window.
void ClipWindowsUnderThis(HWND hWnd,RECT*rcWin);
//将hWnd用它上面所有的窗口重新剪裁
void ClipByAllAbove(HWND hWnd);
void InvalidateWnd(HWND hwnd,RECT*rc);//rc为屏幕坐标
int  RemoveWindow(HWND hwin);//把hwin从其Parent的链表中删除,但不销毁窗口
BOOL WIN_IsWindowDrawable(HWND hwnd, BOOL icon );
ULONG WIN_SetStyle(HWND hwnd,ULONG set_bits,ULONG clear_bits );
int BeginDCUpdate(HDC hdc);
int EndDCUpdate(HDC hdc,LPRECT rc);
HBRUSH DEFWND_ControlColor( HDC hDC, UINT ctlType );
HWND *WIN_ListChildren( HWND hwnd );
#endif    

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -