gdilib.c

来自「深圳市微逻辑电子有限公司 巨果&#8226 Kingmos&reg 系统核心」· C语言 代码 · 共 2,460 行 · 第 1/5 页

C
2,460
字号

		bRetv = pGetWindowOrg( hdc, lpPoint );
		API_Leave(  );
	}
	return bRetv;

#endif
}

typedef BOOL ( WINAPI * PGDI_INVERTRECT )( HDC, LPCRECT );
BOOL WINAPI Gdi_InvertRect( HDC hdc, LPCRECT lpcrect )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_INVERTRECT, 2 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, lpcrect );
#else

	PGDI_INVERTRECT pInvertRect;// = (PGDI_INVERTRECT)lpGDIAPI[GDI_INVERTRECT];

    
	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_INVERTRECT, &pInvertRect, &cs ) )
	{
		lpcrect = MapProcessPtr( lpcrect, (LPPROCESS)cs.lpvData );

		bRetv = pInvertRect( hdc, lpcrect );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef BOOL ( WINAPI * PGDI_INVERTRGN )( HDC, HRGN );
BOOL WINAPI Gdi_InvertRgn( HDC hdc, HRGN hrgn )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_INVERTRGN, 2 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, hrgn );
#else

	PGDI_INVERTRGN pInvertRgn;// = (PGDI_INVERTRGN)lpGDIAPI[GDI_INVERTRGN];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_INVERTRGN, &pInvertRgn, &cs ) )
	{
		bRetv = pInvertRgn( hdc, hrgn );
		API_Leave(  );
	}
	return bRetv;

#endif
}

typedef BOOL ( WINAPI * PGDI_LINETO )( HDC hdc, int nXEnd, int nYEnd );
BOOL WINAPI Gdi_LineTo( HDC hdc, int nXEnd, int nYEnd )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_LINETO, 3 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, nXEnd, nYEnd );
#else

	PGDI_LINETO pLineTo;// = (PGDI_LINETO)lpGDIAPI[GDI_LINETO];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_LINETO, &pLineTo, &cs ) )
	{
		bRetv = pLineTo( hdc, nXEnd, nYEnd );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef BOOL ( WINAPI * PGDI_LINE )( HDC hdc, int x0, int y0, int x1, int y1 );
BOOL WINAPI Gdi_Line( HDC hdc, int x0, int y0, int x1, int y1 )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_LINE, 5 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, x0, y0, x1, y1 );
#else

	PGDI_LINE pLine;// = (PGDI_LINE)lpGDIAPI[GDI_LINE];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_LINE, &pLine, &cs ) )
	{
		bRetv = pLine( hdc, x0, y0, x1, y1 );
		API_Leave(  );
	}
	return bRetv;

#endif
}

typedef BOOL ( WINAPI * PGDI_LPTODP )( HDC hdc, LPPOINT lpPoints, int nCount );
BOOL WINAPI Gdi_LPtoDP( HDC hdc, LPPOINT lpPoints, int nCount )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_LPTODP, 3 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, lpPoints, nCount );
#else

	PGDI_LPTODP pLPtoDP;// = (PGDI_LPTODP)lpGDIAPI[GDI_LPTODP];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_LPTODP, &pLPtoDP, &cs ) )
	{
		lpPoints = MapProcessPtr( lpPoints, (LPPROCESS)cs.lpvData );

		bRetv = pLPtoDP( hdc, lpPoints, nCount );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef BOOL ( WINAPI * PGDI_MOVETO )( HDC hdc, int x, int y, LPPOINT lppt );
BOOL WINAPI Gdi_MoveTo( HDC hdc, int x, int y, LPPOINT lppt )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_MOVETO, 4 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, x, y, lppt );
#else

	PGDI_MOVETO pMoveTo;// = (PGDI_MOVETO)lpGDIAPI[GDI_MOVETO];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_MOVETO, &pMoveTo, &cs ) )
	{
		lppt = MapProcessPtr( lppt, (LPPROCESS)cs.lpvData );

		bRetv = pMoveTo( hdc, x, y, lppt );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef int ( WINAPI * PGDI_OFFSETCLIPRGN )( HDC hdc, int xOff, int yOff );
int WINAPI Gdi_OffsetClipRgn( HDC hdc, int xOff, int yOff )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_OFFSETCLIPRGN, 3 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, xOff, yOff );
#else

	PGDI_OFFSETCLIPRGN pOffsetClipRgn;// = (PGDI_OFFSETCLIPRGN)lpGDIAPI[GDI_OFFSETCLIPRGN];

	int  iRetv = ERROR;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_OFFSETCLIPRGN, &pOffsetClipRgn, &cs ) )
	{
		iRetv = pOffsetClipRgn( hdc, xOff, yOff );
		API_Leave(  );
	}
	return iRetv;
#endif
}

typedef BOOL ( WINAPI * PGDI_OFFSETVIEWPORTORG )( HDC hdc, int xOff, int yOff, LPPOINT lppt );
BOOL WINAPI Gdi_OffsetViewportOrg( HDC hdc, int xOff, int yOff, LPPOINT lppt )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_OFFSETVIEWPORTORG, 4 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, xOff, yOff, lppt );
#else

	PGDI_OFFSETVIEWPORTORG pOffsetViewportOrg;// = (PGDI_OFFSETVIEWPORTORG)lpGDIAPI[GDI_OFFSETVIEWPORTORG];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_OFFSETVIEWPORTORG, &pOffsetViewportOrg, &cs ) )
	{
		lppt = MapProcessPtr( lppt, (LPPROCESS)cs.lpvData );

		bRetv = pOffsetViewportOrg( hdc, xOff, yOff, lppt );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef BOOL ( WINAPI * PGDI_OFFSETWINDOWORG )( HDC hdc, int xOff, int yOff, LPPOINT lppt );
BOOL WINAPI Gdi_OffsetWindowOrg( HDC hdc, int xOff, int yOff, LPPOINT lppt )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_OFFSETWINDOWORG, 4 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, xOff, yOff, lppt );
#else

	PGDI_OFFSETWINDOWORG pOffsetWindowOrg;// = (PGDI_OFFSETWINDOWORG)lpGDIAPI[GDI_OFFSETWINDOWORG];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_OFFSETWINDOWORG, &pOffsetWindowOrg, &cs ) )
	{
		lppt = MapProcessPtr( lppt, (LPPROCESS)cs.lpvData );

		bRetv = pOffsetWindowOrg( hdc, xOff, yOff, lppt );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef BOOL ( WINAPI * PGDI_POLYLINE )( HDC hdc, const POINT * lpcPoints, int nCount );
BOOL WINAPI Gdi_Polyline( HDC hdc, const POINT * lpcPoints, int nCount )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_POLYLINE, 3 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, lpcPoints, nCount );
#else

	PGDI_POLYLINE pPolyline;// = (PGDI_POLYLINE)lpGDIAPI[GDI_POLYLINE];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_POLYLINE, &pPolyline, &cs ) )
	{
		lpcPoints = MapProcessPtr( lpcPoints, (LPPROCESS)cs.lpvData );

		bRetv =  pPolyline( hdc, lpcPoints, nCount );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef BOOL ( WINAPI * PGDI_PTVISIBLE )( HDC, int x, int y );
BOOL WINAPI Gdi_PtVisible( HDC hdc, int x, int y )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_PTVISIBLE, 3 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, x, y );
#else

	PGDI_PTVISIBLE pPtVisible;// = (PGDI_PTVISIBLE)lpGDIAPI[GDI_PTVISIBLE];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_PTVISIBLE, &pPtVisible, &cs ) )
	{
		bRetv =  pPtVisible( hdc, x, y );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef BOOL ( WINAPI * PGDI_RECTANGLE )( HDC hdc, int left, int top, int right, int bottom );
BOOL WINAPI Gdi_Rectangle( HDC hdc, int left, int top, int right, int bottom )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_RECTANGLE, 4 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, left, top, right, bottom );
#else

	PGDI_RECTANGLE pRectangle;// = (PGDI_RECTANGLE)lpGDIAPI[GDI_RECTANGLE];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_RECTANGLE, &pRectangle, &cs ) )
	{
		bRetv = pRectangle( hdc, left, top, right, bottom );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef BOOL ( WINAPI * PGDI_ROUNDRECT ) ( HDC hdc, int left, int top, int right, int bottom, int nWidth, int nHeight );
BOOL WINAPI Gdi_RoundRect( HDC hdc, int left, int top, int right, int bottom, int nWidth, int nHeight )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_ROUNDRECT, 7 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, left, top, right, bottom, nWidth, nHeight );
#else

	PGDI_ROUNDRECT pfn;// = (PGDI_EXCLUDECLIPRECT)lpGDIAPI[GDI_EXCLUDECLIPRECT];

	CALLSTACK cs;
	BOOL  iRetv = FALSE;

	if( API_Enter( API_GDI, GDI_ROUNDRECT, &pfn, &cs ) )
	{
		iRetv = pfn( hdc, left, top, right, bottom, nWidth, nHeight );
		API_Leave(  );
	}
	return iRetv;
#endif
}


typedef BOOL  ( WINAPI * PGDI_RECTVISIBLE )( HDC hdc, LPCRECT lpcrc );
BOOL WINAPI Gdi_RectVisible( HDC hdc, LPCRECT lpcrc )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_RECTVISIBLE, 2 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, lpcrc );
#else

	PGDI_RECTVISIBLE pRectVisible;// = (PGDI_RECTVISIBLE)lpGDIAPI[GDI_RECTVISIBLE];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_RECTVISIBLE, &pRectVisible, &cs ) )
	{
		lpcrc = MapProcessPtr( lpcrc, (LPPROCESS)cs.lpvData );

		bRetv =  pRectVisible( hdc, lpcrc );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef HGDIOBJ ( WINAPI * PGDI_SELECTOBJECT )(HDC hdc, HGDIOBJ handle);
HGDIOBJ WINAPI Gdi_SelectObject(HDC hdc, HGDIOBJ handle)
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_SELECTOBJECT, 2 );
    cs.arg0 = (DWORD)hdc;
    return (HGDIOBJ)CALL_SERVER( &cs, handle );
#else

	PGDI_SELECTOBJECT pSelectObject;// = (PGDI_SELECTOBJECT)lpGDIAPI[GDI_SELECTOBJECT];

	HGDIOBJ hRetv = NULL;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_SELECTOBJECT, &pSelectObject, &cs ) )
	{
		hRetv =  pSelectObject( hdc, handle );
		API_Leave(  );
	}
	return hRetv;
#endif
}

typedef BOOL ( WINAPI * PGDI_DELETEOBJECT )(HGDIOBJ handle);
BOOL WINAPI Gdi_DeleteObject(HGDIOBJ handle)
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_DELETEOBJECT, 1 );
    cs.arg0 = (DWORD)handle ;
    return (DWORD)CALL_SERVER( &cs );
#else

	PGDI_DELETEOBJECT pDeleteObject;/// = (PGDI_DELETEOBJECT)lpGDIAPI[GDI_DELETEOBJECT];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_DELETEOBJECT, &pDeleteObject, &cs ) )
	{
		bRetv = pDeleteObject( handle );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef BOOL ( WINAPI * PGDI_DELETEDC )(HDC hdc);
BOOL WINAPI Gdi_DeleteDC(HDC hdc)
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_DELETEDC, 1 );
    cs.arg0 = (DWORD)hdc ;
    return (DWORD)CALL_SERVER( &cs );
#else

	PGDI_DELETEDC pDeleteDC;// = (PGDI_DELETEDC)lpGDIAPI[GDI_DELETEDC];

	BOOL  bRetv = FALSE;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_DELETEDC, &pDeleteDC, &cs ) )
	{
		bRetv = pDeleteDC( hdc );
		API_Leave(  );
	}
	return bRetv;
#endif
}

typedef int ( WINAPI * PGDI_SELECTCLIPRGN )( HDC hdc, HRGN hrgn );
int WINAPI Gdi_SelectClipRgn( HDC hdc, HRGN hrgn )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_SELECTCLIPRGN, 2 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, hrgn );
#else

	PGDI_SELECTCLIPRGN pSelectClipRgn;// = (PGDI_SELECTCLIPRGN)lpGDIAPI[GDI_SELECTCLIPRGN];

	int  iRetv = ERROR;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_SELECTCLIPRGN, &pSelectClipRgn, &cs ) )
	{
		iRetv =  pSelectClipRgn( hdc, hrgn );
		API_Leave(  );
	}
	return iRetv;
#endif
}

typedef int ( WINAPI * PGDI_EXTSELECTCLIPRGN )( HDC hdc, HRGN hrgn, int iMode );
int WINAPI Gdi_ExtSelectClipRgn( HDC hdc, HRGN hrgn, int iMode )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_EXTSELECTCLIPRGN, 3 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, hrgn, iMode );
#else

	PGDI_EXTSELECTCLIPRGN pExtSelectClipRgn;// = (PGDI_EXTSELECTCLIPRGN)lpGDIAPI[GDI_EXTSELECTCLIPRGN];

	int  iRetv = ERROR;
	CALLSTACK cs;

	if( API_Enter( API_GDI, GDI_EXTSELECTCLIPRGN, &pExtSelectClipRgn, &cs ) )
	{
		iRetv = pExtSelectClipRgn( hdc, hrgn, iMode );
		API_Leave(  );
	}
	return iRetv;
#endif
}

typedef int ( WINAPI * PGDI_SETBKCOLOR )( HDC hdc, COLORREF color );
COLORREF WINAPI Gdi_SetBkColor( HDC hdc, COLORREF color )
{
#ifdef CALL_TRAP
    CALLTRAP cs;
    cs.apiInfo = CALL_API( API_GDI, GDI_SETBKCOLOR, 2 );
    cs.arg0 = (DWORD)hdc;
    return (DWORD)CALL_SERVER( &cs, color );
#else

⌨️ 快捷键说明

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