1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
/**************************************************************************\
Miranda IM: the free IM client for Microsoft* Windows*
Copyright 2000-2008 Miranda ICQ/IM project,
all portions of this code base are copyrighted to Artem Shpynov and/or
the people listed in contributors.txt.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
****************************************************************************
Created: Mar 19, 2007
Author and Copyright: Artem Shpynov aka FYR: ashpynov@gmail.com
\**************************************************************************/
#define eflock EnterCriticalSection(&ExtFrames.CS)
#define efunlock LeaveCriticalSection(&ExtFrames.CS)
#define efcheck if (!ExtFrames.bModuleActive) return
#define EFT_VERTICAL 1
#define EFT_HORIZONTAL 0
#define EFP_LEFT alLeft
#define EFP_TOP alTop
#define EFP_RIGHT alRight
#define EFP_BOTTOM alBottom
#define EXTFRAMEMODULE "ExtFrames"
#define EXTFRAMEORDERDBPREFIX "FrameOrder/"
typedef struct tagExtFrameRectDef
{
DWORD dwOrder;
/* Used in both for frames and for options */
int minCX;
int minCY;
BYTE nType;
BYTE nEdge;
BOOL bInPrevious;
RECT rcFrameRect;
char *szFrameNameID; //to be dealloced in destructor
/* Used for real frames and faked in options */
DWORD dwFlags;
BOOL bFloat;
BOOL bNotRegistered; // for options means frame is Not Registered
} EXTFRAME;
typedef struct tagExtFrameWndDef
{
EXTFRAME efrm; //have to be first element
//EXTFRAMEWND* can be directly type casted to EXTFRAME*
/* Used Only for real frames */
HWND hwndFrame;
HWND hwndTitle;
DWORD dwFrameID;
} EXTFRAMEWND;
typedef struct tagExtFrameModule
{
CRITICAL_SECTION CS;
BOOL bModuleActive;
SortedList * List;
HANDLE hookSBShowTooltip; // ME_CLIST_FRAMES_SB_SHOW_TOOLTIP
HANDLE hookSBHideTooltip; // ME_CLIST_FRAMES_SB_HIDE_TOOLTIP
HANDLE hookPrebuildFrameMenu; // ME_CLIST_PREBUILDFRAMEMENU
DWORD dwNextFrameID; // unique number of registered frames
}EXTFRAMESMODULE;
typedef struct tagExtFramesOptDBEnumeration
{
HWND hwndDlg;
SortedList * pFrameList;
}EXTFRAMEOPTDBENUMERATION;
//////////////////////////////////////////////////////////////////////////
// Static Declarations
// modern_ext_frames_intern.c
static void _ExtFrames_DestructorOf_EXTFRAMEWND(void * extFrame);
static int _ExtFrames_CalcFramesRect( IN SortedList* pList, IN int width, IN int height, OUT RECT * pWndRect );
static int _ExtFrames_GetMinParentSize( IN SortedList* pList, OUT SIZE * size );
static void _ExtFrames_GetFrameDBOption( IN OUT EXTFRAMEWND * pExtFrm );
static void _ExtFramesUtils_CheckAlighment( IN OUT EXTFRAMEWND * extFrame );
static int _ExtFramesUtils_CopmareFrames(void * first, void * last);
// modern_ext_frames_services.c
static void _ExtFrames_InitServices();
static void _ExtFrames_UninitServices();
// modern_ext_frames_opt.c
static int _ExtFrames_OptionsDlgInit(WPARAM wParam,LPARAM lParam);
static BOOL CALLBACK _ExtFrames_DlgProcFrameOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
//
/**static*/ int _ExtFramesSrv_AddFrame(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_RemoveFrame(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_ShowAllFrames(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_ShowAllFramesTB(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_HideAllFramesTB(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_SHFrame(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_SHFrameTitleBar(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_ULFrame(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_UCollFrame(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_SetUnBorder(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_UpdateFrame(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_GetFrameOptions(WPARAM wParam, LPARAM lParam);
static int _ExtFramesSrv_SetFrameOptions(WPARAM wParam, LPARAM lParam);
//////////////////////////////////////////////////////////////////////////
// Static Local Global Variable
static EXTFRAMESMODULE ExtFrames={0};
|