mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-02-07 02:52:42 +08:00
Remove some inline definitions
This commit is contained in:
@@ -12,7 +12,7 @@ add_definitions (-D_GNU_SOURCE)
|
||||
# the version number.
|
||||
set (MINIGUI_MAJOR_VERSION 3)
|
||||
set (MINIGUI_MINOR_VERSION 2)
|
||||
set (MINIGUI_MICRO_VERSION 1)
|
||||
set (MINIGUI_MICRO_VERSION 2)
|
||||
|
||||
set (MINIGUI_NAME "minigui")
|
||||
set (MGLIB_SUFFIX "")
|
||||
|
||||
11
ChangeLog
11
ChangeLog
@@ -1,5 +1,13 @@
|
||||
*******************************************************************************
|
||||
What's new in trunk:
|
||||
What's new (V3.2.2):
|
||||
10/24-2017
|
||||
CLEANUP: Remove some 'inline' definitions:
|
||||
* GetIMEPos/SetIMEPos.
|
||||
* WndRect -> gui_WndRect.
|
||||
* WndClientRect -> gui_WndClientRect.
|
||||
|
||||
*******************************************************************************
|
||||
What's new (V3.2.1):
|
||||
|
||||
12/06. CLEANUP #11: Merge differences from rel-3-0, and remove unnecessary
|
||||
files. svn merge -r 12913:13673 ../branches/rel-3-0 (wanzheng)
|
||||
@@ -18,7 +26,6 @@ rel-3.0(dongjunjie)
|
||||
* src/textedit/mtextedit.c
|
||||
* src/textedit/mtextedit.h
|
||||
|
||||
|
||||
06/30. BUGFIXING: #4801 Fix a bug which introduce a absolute path check error
|
||||
in Windows (dongkai).
|
||||
* src/font/devfont.c
|
||||
|
||||
2
Version
2
Version
@@ -1,4 +1,4 @@
|
||||
Version 3.2.1 (the developing version of the official version 3.2)
|
||||
Version 3.2.2 (the official release)
|
||||
|
||||
This release needs the following resource packages:
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ AC_PREREQ(2.52)
|
||||
|
||||
dnl ========================================================================
|
||||
dnl Put the name and version of the package here
|
||||
AC_INIT([libminigui], [3.2.1])
|
||||
AC_INIT([libminigui], [3.2.2])
|
||||
AC_CONFIG_SRCDIR([src/main/main.c])
|
||||
|
||||
dnl Set various version strings - taken gratefully from the SDL sources
|
||||
|
||||
@@ -7815,22 +7815,6 @@ MG_EXPORT int GUIAPI SetIMEStatus (int StatusCode, int Value);
|
||||
*/
|
||||
MG_EXPORT int GUIAPI GetIMETargetInfo (IME_TARGET_INFO *info);
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI GetIMEPos (POINT* pt)
|
||||
* \brief Retrives the position of the current IME window.
|
||||
*
|
||||
* This function retrives the position of the current IME window.
|
||||
*
|
||||
* \param pt The item to be retrived. The positon is
|
||||
* return by the current IME Window.
|
||||
*
|
||||
* \return The current IME window positon.
|
||||
* ERR_IME_NOIMEWND if error occurred.
|
||||
*
|
||||
* \sa GetIMEPos
|
||||
*/
|
||||
MG_EXPORT inline int GUIAPI GetIMEPos (POINT* pt);
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI SetIMETargetInfo (const IME_TARGET_INFO *info)
|
||||
* \brief Sets the target info of the current IME window.
|
||||
@@ -7849,9 +7833,29 @@ MG_EXPORT inline int GUIAPI GetIMEPos (POINT* pt);
|
||||
MG_EXPORT int GUIAPI SetIMETargetInfo (const IME_TARGET_INFO *info);
|
||||
|
||||
/**
|
||||
* \fn inline int GUIAPI SetIMEPos (POINT* pt)
|
||||
* \fn int GUIAPI GetIMEPos (POINT* pt)
|
||||
* \brief Retrives the position of the current IME window.
|
||||
*
|
||||
* NOTE that this function is deprecated.
|
||||
*
|
||||
* This function retrives the position of the current IME window.
|
||||
*
|
||||
* \param pt The item to be retrived. The positon is
|
||||
* return by the current IME Window.
|
||||
*
|
||||
* \return The current IME window positon.
|
||||
* ERR_IME_NOIMEWND if error occurred.
|
||||
*
|
||||
* \sa GetIMEPos
|
||||
*/
|
||||
MG_EXPORT int GUIAPI GetIMEPos (POINT* pt);
|
||||
|
||||
/**
|
||||
* \fn int GUIAPI SetIMEPos (POINT* pt)
|
||||
* \brief Sets the position of the current IME window.
|
||||
*
|
||||
* NOTE that this function is deprecated.
|
||||
*
|
||||
* This function sets the position of the current IME window.
|
||||
*
|
||||
* \param pt The set position value.
|
||||
@@ -7863,7 +7867,7 @@ MG_EXPORT int GUIAPI SetIMETargetInfo (const IME_TARGET_INFO *info);
|
||||
*
|
||||
* \sa SetIMEPos
|
||||
*/
|
||||
MG_EXPORT inline int GUIAPI SetIMEPos(const POINT* pt);
|
||||
MG_EXPORT int GUIAPI SetIMEPos (const POINT* pt);
|
||||
|
||||
/** @} end of ime_fns */
|
||||
|
||||
|
||||
733
src/gui/window.c
733
src/gui/window.c
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
**
|
||||
** dc.h: this head file declares all internal types and data of GDI module.
|
||||
**
|
||||
** Copyright (C) 2003 ~ 2007 Feynman Software.
|
||||
** Copyright (C) 2003 ~ 2017 FMSoft.
|
||||
** Copyright (C) 1999 ~ 2002 Wei Yongming.
|
||||
**
|
||||
** Create Date: 1999/xx/xx
|
||||
@@ -217,16 +217,13 @@ struct tagDC
|
||||
extern DC __mg_screen_dc;
|
||||
extern DC __mg_screen_sys_dc;
|
||||
|
||||
inline void WndRect(HWND hWnd, PRECT prc);
|
||||
inline void WndClientRect(HWND hWnd, PRECT prc);
|
||||
|
||||
/* This function convert HDC to PDC. */
|
||||
static inline PDC dc_HDC2PDC (HDC hdc)
|
||||
{
|
||||
if (hdc == HDC_SCREEN_SYS)
|
||||
return &__mg_screen_sys_dc;
|
||||
return &__mg_screen_sys_dc;
|
||||
else if (hdc == HDC_SCREEN)
|
||||
return &__mg_screen_dc;
|
||||
return &__mg_screen_dc;
|
||||
return (PDC) hdc;
|
||||
}
|
||||
|
||||
|
||||
@@ -608,6 +608,9 @@ void mg_TerminateLFManager (void);
|
||||
char* gui_GetIconFile(const char* rdr_name, char* file, char* _szValue);
|
||||
BOOL gui_LoadIconRes(HDC hdc, const char* rdr_name, char* file);
|
||||
|
||||
void gui_WndRect(HWND hWnd, PRECT prc);
|
||||
void gui_WndClientRect(HWND hWnd, PRECT prc);
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
141
src/newgdi/gdi.c
141
src/newgdi/gdi.c
@@ -87,63 +87,6 @@ static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient);
|
||||
static void dc_InitMemDCFrom (PDC pdc, const PDC pdc_ref);
|
||||
static void dc_InitScreenDC (PDC pdc, GAL_Surface* surface);
|
||||
|
||||
/************************** inline functions *********************************/
|
||||
inline void WndRect(HWND hWnd, PRECT prc)
|
||||
{
|
||||
PCONTROL pParent;
|
||||
PCONTROL pCtrl;
|
||||
|
||||
pParent = pCtrl = (PCONTROL) hWnd;
|
||||
|
||||
if (hWnd == HWND_DESKTOP) {
|
||||
*prc = g_rcScr;
|
||||
return;
|
||||
}
|
||||
|
||||
prc->left = pCtrl->left;
|
||||
prc->top = pCtrl->top;
|
||||
prc->right = pCtrl->right;
|
||||
prc->bottom = pCtrl->bottom;
|
||||
|
||||
/*dongjunjie 2009/7/9 main window and control as main window
|
||||
* don't need offset
|
||||
* */
|
||||
if(pCtrl->WinType == TYPE_MAINWIN )
|
||||
// || (pCtrl->dwExStyle & WS_EX_CTRLASMAINWIN))
|
||||
return ;
|
||||
|
||||
|
||||
while ((pParent = pParent->pParent)) {
|
||||
prc->left += pParent->cl;
|
||||
prc->top += pParent->ct;
|
||||
prc->right += pParent->cl;
|
||||
prc->bottom += pParent->ct;
|
||||
}
|
||||
}
|
||||
|
||||
inline void WndClientRect(HWND hWnd, PRECT prc)
|
||||
{
|
||||
PCONTROL pCtrl;
|
||||
PCONTROL pParent;
|
||||
pParent = pCtrl = (PCONTROL) hWnd;
|
||||
|
||||
if (hWnd == HWND_DESKTOP) {
|
||||
*prc = g_rcScr;
|
||||
return;
|
||||
}
|
||||
|
||||
prc->left = pCtrl->cl;
|
||||
prc->top = pCtrl->ct;
|
||||
prc->right = pCtrl->cr;
|
||||
prc->bottom = pCtrl->cb;
|
||||
while ((pParent = pParent->pParent)) {
|
||||
prc->left += pParent->cl;
|
||||
prc->top += pParent->ct;
|
||||
prc->right += pParent->cl;
|
||||
prc->bottom += pParent->ct;
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL RestrictControlECRGNEx (RECT* minimal,
|
||||
PCONTROL pCtrl, CLIPRGN * ergn)
|
||||
{
|
||||
@@ -241,7 +184,7 @@ void mg_TerminateScreenDC (void)
|
||||
DESTROY_LOCK (&__mg_gdilock);
|
||||
DESTROY_LOCK (&dcslot);
|
||||
/* [2010/06/02] DongJunJie : fix a dead-lock bug of mgncs. */
|
||||
DestroyFreeClipRectList (&__mg_FreeClipRectList);
|
||||
DestroyFreeClipRectList (&__mg_FreeClipRectList);
|
||||
}
|
||||
|
||||
#define INIT_SPECIFICAL_FONTS(etc_section) \
|
||||
@@ -483,9 +426,9 @@ BOOL dc_GenerateECRgn(PDC pdc, BOOL fForce)
|
||||
* update pdc->DevRC, and restrict the effective
|
||||
*/
|
||||
if (pdc->bIsClient)
|
||||
WndClientRect (pdc->hwnd, &pdc->DevRC);
|
||||
gui_WndClientRect (pdc->hwnd, &pdc->DevRC);
|
||||
else
|
||||
WndRect (pdc->hwnd, &pdc->DevRC);
|
||||
gui_WndRect (pdc->hwnd, &pdc->DevRC);
|
||||
|
||||
/* copy local clipping region to effective clipping region. */
|
||||
ClipRgnCopy (&pdc->ecrgn, &pdc->lcrgn);
|
||||
@@ -1783,9 +1726,9 @@ static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient)
|
||||
|
||||
pdc->bIsClient = bIsClient;
|
||||
if (bIsClient)
|
||||
WndClientRect (pdc->hwnd, &pdc->DevRC);
|
||||
gui_WndClientRect (pdc->hwnd, &pdc->DevRC);
|
||||
else
|
||||
WndRect (pdc->hwnd, &pdc->DevRC);
|
||||
gui_WndRect (pdc->hwnd, &pdc->DevRC);
|
||||
|
||||
minimal = pdc->DevRC;
|
||||
|
||||
@@ -2109,9 +2052,9 @@ void GUIAPI ReleaseDC (HDC hDC)
|
||||
ClipRgnCopy (&pdc->ecrgn, &pdc->pGCRInfo->crgn);
|
||||
|
||||
if (pdc->bIsClient)
|
||||
WndClientRect (pdc->hwnd, &pdc->DevRC);
|
||||
gui_WndClientRect (pdc->hwnd, &pdc->DevRC);
|
||||
else
|
||||
WndRect (pdc->hwnd, &pdc->DevRC);
|
||||
gui_WndRect (pdc->hwnd, &pdc->DevRC);
|
||||
|
||||
minimal = pdc->DevRC;
|
||||
|
||||
@@ -2154,8 +2097,8 @@ static BOOL InitSubDC (HDC hdcDest, HDC hdc, int off_x, int off_y,
|
||||
PDC pdc;
|
||||
PDC pdc_parent;
|
||||
|
||||
if(hdcDest == 0) return FALSE;
|
||||
|
||||
if(hdcDest == 0) return FALSE;
|
||||
|
||||
pdc_parent = dc_HDC2PDC (hdc);
|
||||
if (pdc_parent == NULL || pdc_parent->DataType != TYPE_HDC
|
||||
|| pdc_parent->DCType == TYPE_SCRDC)
|
||||
@@ -2182,18 +2125,18 @@ static BOOL InitSubDC (HDC hdcDest, HDC hdc, int off_x, int off_y,
|
||||
pdc->DevRC.top = pdc_parent->DevRC.top + off_y;
|
||||
pdc->DevRC.right = pdc->DevRC.left + width;
|
||||
pdc->DevRC.bottom = pdc->DevRC.top + height;
|
||||
pdc->surface = pdc_parent->surface;
|
||||
pdc->pGCRInfo = pdc_parent->pGCRInfo;
|
||||
|
||||
dc_InitMemDCFrom(pdc, pdc_parent);
|
||||
pdc->surface = pdc_parent->surface;
|
||||
pdc->pGCRInfo = pdc_parent->pGCRInfo;
|
||||
|
||||
dc_InitMemDCFrom(pdc, pdc_parent);
|
||||
/* should set after InitMemDC.*/
|
||||
pdc->hwnd = pdc_parent->hwnd;
|
||||
pdc->hwnd = pdc_parent->hwnd;
|
||||
|
||||
CopyRegion (&pdc->lcrgn, &pdc_parent->lcrgn);
|
||||
CopyRegion (&pdc->ecrgn, &pdc_parent->ecrgn);
|
||||
IntersectClipRect (&pdc->ecrgn, &pdc->DevRC);
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2244,12 +2187,12 @@ HDC GUIAPI GetSubDC (HDC hdc, int off_x, int off_y, int width, int height)
|
||||
|
||||
if (pdc == NULL) return HDC_INVALID;
|
||||
|
||||
if(!InitSubDC((HDC)pdc, hdc, off_x, off_y, width, height))
|
||||
{
|
||||
pdc->inuse = FALSE;
|
||||
return HDC_INVALID;
|
||||
}
|
||||
return (HDC)pdc;
|
||||
if (!InitSubDC((HDC)pdc, hdc, off_x, off_y, width, height))
|
||||
{
|
||||
pdc->inuse = FALSE;
|
||||
return HDC_INVALID;
|
||||
}
|
||||
return (HDC)pdc;
|
||||
}
|
||||
|
||||
HDC GUIAPI CreatePrivateDC(HWND hwnd)
|
||||
@@ -2291,8 +2234,8 @@ HDC GUIAPI CreatePrivateClientDC(HWND hwnd)
|
||||
|
||||
HDC GUIAPI CreatePrivateSubDC(HDC hdc, int off_x, int off_y, int width, int height)
|
||||
{
|
||||
PDC pdc;
|
||||
if(!(pdc = malloc(sizeof(DC)))) return HDC_INVALID;
|
||||
PDC pdc;
|
||||
if(!(pdc = malloc(sizeof(DC)))) return HDC_INVALID;
|
||||
|
||||
InitClipRgn (&pdc->lcrgn, &__mg_FreeClipRectList);
|
||||
MAKE_REGION_INFINITE(&pdc->lcrgn);
|
||||
@@ -2302,12 +2245,12 @@ HDC GUIAPI CreatePrivateSubDC(HDC hdc, int off_x, int off_y, int width, int heig
|
||||
pdc->DataType = TYPE_HDC;
|
||||
pdc->DCType = TYPE_GENDC;
|
||||
|
||||
if(!InitSubDC((HDC)pdc, hdc, off_x,off_y, width, height))
|
||||
{
|
||||
free(pdc);
|
||||
return HDC_INVALID;
|
||||
}
|
||||
return (HDC)pdc;
|
||||
if(!InitSubDC((HDC)pdc, hdc, off_x,off_y, width, height))
|
||||
{
|
||||
free(pdc);
|
||||
return HDC_INVALID;
|
||||
}
|
||||
return (HDC)pdc;
|
||||
}
|
||||
|
||||
void GUIAPI DeletePrivateDC(HDC hdc)
|
||||
@@ -2667,14 +2610,14 @@ HDC GetSecondarySubDC (HDC secondary_dc, HWND hwnd_child, BOOL client)
|
||||
/* SubDC is relative the parent_dc's (0,0). */
|
||||
if (client) {
|
||||
/* 1.get child client_rc relative to screen. */
|
||||
WndClientRect (hwnd_child, &rc1);
|
||||
gui_WndClientRect (hwnd_child, &rc1);
|
||||
}
|
||||
else {
|
||||
/* 2.get child window rc relative to screen.*/
|
||||
WndRect (hwnd_child, &rc1);
|
||||
gui_WndRect (hwnd_child, &rc1);
|
||||
}
|
||||
/* 3.parent window relative to screen.*/
|
||||
WndRect (pdc_parent->hwnd, &rc2);
|
||||
gui_WndRect (pdc_parent->hwnd, &rc2);
|
||||
|
||||
/* 4.get the child's offset to the parent window rc.*/
|
||||
off_x = rc1.left - rc2.left;
|
||||
@@ -3053,22 +2996,22 @@ HDC GUIAPI CreateSubMemDC (HDC parent, int off_x, int off_y,
|
||||
PDC pdc_sub;
|
||||
GAL_Surface* surface;
|
||||
BYTE* sub_pixels;
|
||||
int parent_width;
|
||||
int parent_height;
|
||||
int parent_width;
|
||||
int parent_height;
|
||||
|
||||
pdc_parent = dc_HDC2PDC (parent);
|
||||
if (pdc_parent->DCType != TYPE_MEMDC)
|
||||
return HDC_INVALID;
|
||||
|
||||
parent_width = RECTW (pdc_parent->DevRC);
|
||||
parent_height = RECTH (pdc_parent->DevRC);
|
||||
parent_width = RECTW (pdc_parent->DevRC);
|
||||
parent_height = RECTH (pdc_parent->DevRC);
|
||||
|
||||
if (off_x < 0) off_x = 0;
|
||||
else if(off_x > parent_width) off_x = parent_width;
|
||||
if (off_y < 0) off_y = 0;
|
||||
else if(off_y > parent_height) off_y = parent_height;
|
||||
if (width < 0) width = 0;
|
||||
if (height < 0) height = 0;
|
||||
if (off_x < 0) off_x = 0;
|
||||
else if(off_x > parent_width) off_x = parent_width;
|
||||
if (off_y < 0) off_y = 0;
|
||||
else if(off_y > parent_height) off_y = parent_height;
|
||||
if (width < 0) width = 0;
|
||||
if (height < 0) height = 0;
|
||||
|
||||
|
||||
if (off_x + width > pdc_parent->DevRC.right)
|
||||
|
||||
Reference in New Issue
Block a user