mirror of
https://github.com/VincentWei/MiniGUI.git
synced 2026-09-26 12:27:58 +08:00
use field ct instead of znode flag
This commit is contained in:
+5
-8
@@ -81,14 +81,6 @@ extern "C" {
|
||||
#define ZOF_MAXIMIZED 0x00000004 /* Since 4.2.0 */
|
||||
#define ZOF_MINIMIZED 0x00000008 /* Since 4.2.0 */
|
||||
|
||||
/* Since 4.2.0 */
|
||||
#define ZOF_COMPOSITING_MASK 0x000000F0
|
||||
#define ZOF_COMPOS_OPAQUE 0x00000000
|
||||
#define ZOF_COMPOS_COLORKEY 0x00000010
|
||||
#define ZOF_COMPOS_ALPHACHANNEL 0x00000020
|
||||
#define ZOF_COMPOS_ALPHAPIXEL 0x00000030
|
||||
#define ZOF_COMPOS_BLURRED 0x00000040
|
||||
|
||||
/* Since 4.2.0 */
|
||||
#define ZOF_INTERNAL_FLAGS_MASK 0X000F0000
|
||||
#define ZOF_IF_REFERENCE 0x00010000
|
||||
@@ -1069,6 +1061,11 @@ typedef struct _ZNODEINFO {
|
||||
* For more information, see \a SetMainWindowCompositing.
|
||||
*/
|
||||
DWORD ct_arg;
|
||||
/**
|
||||
* The compositing type for this znode.
|
||||
* For more information, see \a SetMainWindowCompositing.
|
||||
*/
|
||||
int ct;
|
||||
#endif
|
||||
} ZNODEINFO;
|
||||
|
||||
|
||||
@@ -5941,6 +5941,7 @@ MG_EXPORT void GUIAPI MainWindowThreadCleanup(HWND hMainWnd);
|
||||
#define CT_ALPHACHANNEL 0x02
|
||||
#define CT_ALPHAPIXEL 0x03
|
||||
#define CT_BLURRED 0x04
|
||||
#define CT_MAX_VALUE 0x04
|
||||
|
||||
/**
|
||||
* \fn HWND GUIAPI CreateMainWindowEx2 (PMAINWINCREATE pCreateInfo,
|
||||
|
||||
@@ -85,9 +85,11 @@ typedef struct _ZORDERNODE {
|
||||
int cli; /* which client? */
|
||||
HWND hwnd; /* which window of the client? */
|
||||
HWND main_win; /* handle to the main window */
|
||||
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
HDC mem_dc; /* The memory DC for this znode. */
|
||||
DWORD ct_arg; /* the argument for compositing. */
|
||||
HDC mem_dc; /* the memory DC for this znode */
|
||||
DWORD ct_arg; /* the argument for compositing */
|
||||
int ct; /* the compositing type */
|
||||
#endif
|
||||
|
||||
int next;
|
||||
|
||||
+9
-22
@@ -1622,23 +1622,12 @@ int CreateNodeRoundMaskRect (ZORDERINFO* zi, ZORDERNODE* node,
|
||||
}
|
||||
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
static inline DWORD compositing_type_to_flag (int type)
|
||||
static inline int validate_compositing_type (int type)
|
||||
{
|
||||
switch (type) {
|
||||
case CT_OPAQUE:
|
||||
default:
|
||||
return ZOF_COMPOS_OPAQUE;
|
||||
case CT_COLORKEY:
|
||||
return ZOF_COMPOS_COLORKEY;
|
||||
case CT_ALPHACHANNEL:
|
||||
return ZOF_COMPOS_ALPHACHANNEL;
|
||||
case CT_ALPHAPIXEL:
|
||||
return ZOF_COMPOS_ALPHAPIXEL;
|
||||
case CT_BLURRED:
|
||||
return ZOF_COMPOS_BLURRED;
|
||||
}
|
||||
if (type < CT_OPAQUE || type > CT_MAX_VALUE)
|
||||
return CT_OPAQUE;
|
||||
|
||||
return ZOF_COMPOS_OPAQUE;
|
||||
return type;
|
||||
}
|
||||
#endif /* defined _MGSCHEMA_COMPOSITING */
|
||||
|
||||
@@ -1722,7 +1711,7 @@ static int AllocZOrderNode (int cli, HWND hwnd, HWND main_win,
|
||||
nodes [free_slot].main_win = main_win;
|
||||
#ifdef _MGSCHEMA_COMPOSITING
|
||||
nodes [free_slot].mem_dc = mem_dc;
|
||||
nodes [free_slot].flags |= compositing_type_to_flag(ct);
|
||||
nodes [free_slot].ct = validate_compositing_type (ct);
|
||||
nodes [free_slot].ct_arg = ct_arg;
|
||||
#endif
|
||||
nodes [free_slot].idx_mask_rect = 0;
|
||||
@@ -2317,7 +2306,6 @@ static int dskSetZNodeCompositing (int cli, int idx_znode, int ct, DWORD ct_arg)
|
||||
{
|
||||
ZORDERINFO* zi = _get_zorder_info (cli);
|
||||
DWORD type;
|
||||
DWORD flag, old_flag;
|
||||
ZORDERNODE* nodes;
|
||||
|
||||
if (idx_znode > (zi->max_nr_globals
|
||||
@@ -2332,19 +2320,18 @@ static int dskSetZNodeCompositing (int cli, int idx_znode, int ct, DWORD ct_arg)
|
||||
return -1;
|
||||
}
|
||||
|
||||
flag = compositing_type_to_flag (ct);
|
||||
old_flag = nodes [idx_znode].flags & ZOF_COMPOSITING_MASK;
|
||||
if ((flag == old_flag) && (nodes [idx_znode].ct_arg == ct_arg)) {
|
||||
if ((nodes [idx_znode].ct == ct) && (nodes [idx_znode].ct_arg == ct_arg)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* lock zi for change */
|
||||
lock_zi_for_change (zi);
|
||||
|
||||
nodes [idx_znode].flags &= ~ZOF_COMPOSITING_MASK;
|
||||
nodes [idx_znode].flags |= flag;
|
||||
nodes [idx_znode].ct = ct;
|
||||
nodes [idx_znode].ct_arg = ct_arg;
|
||||
|
||||
/* TODO */
|
||||
|
||||
/* unlock zi for change */
|
||||
unlock_zi_for_change (zi);
|
||||
return 0;
|
||||
|
||||
@@ -279,6 +279,8 @@ ret:
|
||||
return ServerSendReply (clifd, &hcsr, sizeof (HCURSOR));
|
||||
}
|
||||
|
||||
#endif /* IS_COMPOSITING_SCHEMA */
|
||||
|
||||
static int move_to_layer (int cli, int clifd, void* buff, size_t len)
|
||||
{
|
||||
MOVETOLAYERINFO* info = (MOVETOLAYERINFO*)buff;
|
||||
@@ -309,8 +311,6 @@ ret:
|
||||
return ServerSendReply (clifd, &moved_info, sizeof (MOVEDCLIENTINFO));
|
||||
}
|
||||
|
||||
#endif /* IS_COMPOSITING_SCHEMA */
|
||||
|
||||
static int create_cursor (int cli, int clifd, void* buff, size_t len)
|
||||
{
|
||||
HCURSOR hcsr;
|
||||
|
||||
Reference in New Issue
Block a user