remove unnecessary kernel_GetGCRgnInfo functions

This commit is contained in:
Vincent Wei
2020-03-01 17:34:21 +08:00
parent 94b4a7eedb
commit 08506e3cbb
7 changed files with 18 additions and 24 deletions

View File

@@ -164,7 +164,7 @@ tab2space() {
# sed -i 's/\<get_valid_dc\>/get_effective_dc/g' `grep '\<get_valid_dc\>' -rl include/ src/`
# sed -i 's/\<release_valid_dc\>/release_effective_dc/g' `grep '\<release_valid_dc\>' -rl include/ src/`
sed -i 's/\<gui_GetMainWindowPtrOfControl\>/checkAndGetMainWindowPtrOfControl/g' `grep '\<gui_GetMainWindowPtrOfControl\>' -rl include/ src/`
sed -i 's/\<gui_CheckAndGetMainWindowPtr\>/checkAndGetMainWindowPtrOfMainWin/g' `grep '\<gui_CheckAndGetMainWindowPtr\>' -rl include/ src/`
# sed -i 's/\<gui_GetMainWindowPtrOfControl\>/checkAndGetMainWindowPtrOfControl/g' `grep '\<gui_GetMainWindowPtrOfControl\>' -rl include/ src/`
# sed -i 's/\<gui_CheckAndGetMainWindowPtr\>/checkAndGetMainWindowPtrOfMainWin/g' `grep '\<gui_CheckAndGetMainWindowPtr\>' -rl include/ src/`
exit 0

View File

@@ -110,7 +110,6 @@ PLOGFONT g_SysLogFont[1]; // TODO: bad coding
#define salone_StandAloneStartup() TRUE
#define salone_StandAloneCleanup()
#define salone_IdleHandler4StandAlone(qmsg) NULL
#define kernel_GetGCRgnInfo(hwnd) NULL
#define GetWindowFont(hwnd) NULL
#define mg_InitControlClass() TRUE
#define mg_InitAccel() TRUE

View File

@@ -578,11 +578,6 @@ PMAINWIN gui_GetMainWindowPtrUnderPoint (int x, int y);
/* return the next window need to repaint. */
HWND kernel_CheckInvalidRegion (PMAINWIN pWin);
#ifndef _MGSCHEMA_COMPOSITING
/* return global clipping region of window. */
PGCRINFO kernel_GetGCRgnInfo (HWND hWnd);
#endif
/* internal variables */
typedef struct _TRACKMENUINFO* PTRACKMENUINFO;

View File

@@ -563,7 +563,7 @@ static int dskScrollMainWindow (PMAINWIN pWin, PSCROLLWINDOWINFO pswi)
//hdc = GetClientDC ((HWND)pWin);
hdc = get_effective_dc(pWin, TRUE);
pcrc = kernel_GetGCRgnInfo ((HWND)pWin)->crgn.head;
pcrc = pWin->pGCRInfo->crgn.head;
while (pcrc) {
RECT rcMove;
@@ -625,7 +625,7 @@ static int dskScrollMainWindow (PMAINWIN pWin, PSCROLLWINDOWINFO pswi)
#endif
}
pcrc = kernel_GetGCRgnInfo ((HWND)pWin)->crgn.head;
pcrc = pWin->pGCRInfo->crgn.head;
while (pcrc) {
BOOL bNeedInvalidate = FALSE;
RECT rcMove;

View File

@@ -2526,7 +2526,7 @@ static int dskScrollMainWindow (PMAINWIN pWin, PSCROLLWINDOWINFO pswi)
//the update to client dc (dongjunjie 2010/7/28)
hdc = get_effective_dc(pWin, TRUE);
pcrc = kernel_GetGCRgnInfo ((HWND)pWin)->crgn.head;
pcrc = pWin->pGCRInfo->crgn.head;
while (pcrc) {
RECT rcMove;
@@ -2585,7 +2585,7 @@ static int dskScrollMainWindow (PMAINWIN pWin, PSCROLLWINDOWINFO pswi)
#endif
}
pcrc = kernel_GetGCRgnInfo ((HWND)pWin)->crgn.head;
pcrc = pWin->pGCRInfo->crgn.head;
while (pcrc) {
BOOL bNeedInvalidate = FALSE;
RECT rcMove;

View File

@@ -130,24 +130,24 @@ static const int _zof_types_for_level [] = {
typedef BOOL (* CB_ONE_ZNODE) (void* context,
const ZORDERINFO* zi, ZORDERNODE* node);
#if 0 /* deprecated code */
PGCRINFO kernel_GetGCRgnInfo (HWND hWnd)
{
return ((PMAINWIN)hWnd)->pGCRInfo;
}
#endif /* deprecated code */
typedef struct _DEF_CONTEXT
{
PBITMAP bg;
int x, y;
} DEF_CONTEXT;
#ifndef _MGSCHEMA_COMPOSITING
PGCRINFO kernel_GetGCRgnInfo (HWND hWnd)
{
return ((PMAINWIN)hWnd)->pGCRInfo;
}
#endif /* not defined _MGSCHEMA_COMPOSITING */
#if defined(_MGRM_PROCESSES)
static DEF_CONTEXT g_def_context;
#endif
static ZORDERINFO* get_zorder_info (int cli)
static inline ZORDERINFO* get_zorder_info (int cli)
{
#if defined (_MGRM_THREADS) || defined (_MGRM_STANDALONE)
return __mg_zorder_info;
@@ -697,7 +697,7 @@ static int dskScrollMainWindow (PMAINWIN pWin, PSCROLLWINDOWINFO pswi)
hdc = get_effective_dc (pWin, TRUE);
#ifndef _MGSCHEMA_COMPOSITING
pcrc = kernel_GetGCRgnInfo ((HWND)pWin)->crgn.head;
pcrc = pWin->pGCRInfo->crgn.head;
#else
crcOne.next = crcOne.prev = NULL;
crcOne.rc.left = pWin->pMainWin->left;
@@ -770,7 +770,7 @@ static int dskScrollMainWindow (PMAINWIN pWin, PSCROLLWINDOWINFO pswi)
#ifndef _MGSCHEMA_COMPOSITING
prgn = CreateClipRgn ();
lock_zi_for_read (__mg_zorder_info);
CopyRegion (prgn, &kernel_GetGCRgnInfo((HWND)pWin)->crgn);
CopyRegion (prgn, &pWin->pGCRInfo->crgn);
pcrc = prgn->head;
unlock_zi_for_read (__mg_zorder_info);
#else
@@ -882,8 +882,8 @@ void __mg_lock_recalc_gcrinfo (PDC pdc)
unsigned short idx;
CLIPRGN invisible_rgn;
gcrinfo = kernel_GetGCRgnInfo (pdc->hwnd);
mainwin = (PMAINWIN)(pdc->hwnd);
gcrinfo = mainwin->pGCRInfo;
#ifdef _MGRM_THREADS
pthread_mutex_lock (&pdc->pGCRInfo->lock);

View File

@@ -1875,7 +1875,7 @@ static void dc_InitDC (PDC pdc, HWND hWnd, BOOL bIsClient)
#else /* not defined _MGSCHEMA_COMPOSITING */
RECT minimal;
pdc->pGCRInfo = kernel_GetGCRgnInfo (hWnd);
pdc->pGCRInfo = ((PMAINWIN)hWnd)->pGCRInfo;
LOCK_GCRINFO (pdc);