tune code for 64-bit

This commit is contained in:
VincentWei
2018-01-17 18:51:41 +08:00
parent 2fbff87cb4
commit b59f0b6a93
61 changed files with 897 additions and 721 deletions
+203 -125
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -1102,7 +1102,7 @@ MG_EXPORT BOOL GUIAPI InitPolygonRegion (PCLIPRGN dst,
* \def HDC_INVALID
* \brief Indicates an invalid handle to device context.
*/
#define HDC_INVALID (HDC)UINT_PTR_MAX
#define HDC_INVALID (HDC)-1
#define GDCAP_COLORNUM 0
#define GDCAP_HPIXEL 1
@@ -2853,7 +2853,7 @@ static inline DWORD Pixel2DWORD (HDC hdc, gal_pixel pixel)
#define PIXEL2DWORD(hdc, pixel) Pixel2DWORD(hdc, pixel)
/**
* \fn gal_pixel DWORD2PIXEL (HDC hdc, DWORD dword)
* \fn gal_pixel DWORD2Pixel (HDC hdc, DWORD dword)
* \brief An inline function to convert DWORD color to gal_pixel.
*
* This function converts a color in DWORD to pixel value.
@@ -2862,7 +2862,7 @@ static inline DWORD Pixel2DWORD (HDC hdc, gal_pixel pixel)
* \param dword The color value in DWORD.
* \return The converted pixel value.
*/
static inline gal_pixel DWORD2PIXEL (HDC hdc, DWORD dword)
static inline gal_pixel DWORD2Pixel (HDC hdc, DWORD dword)
{
return RGBA2Pixel (hdc,
GetRValue(dword), GetGValue(dword),
+78 -78
View File
@@ -2165,15 +2165,15 @@ typedef struct _DRAGINFO {
typedef struct _MSG
{
/** The handle to the window which receives this message. */
HWND hwnd;
HWND hwnd;
/** The message identifier. */
int message;
UINT message;
/** The first parameter of the message (32-bit integer). */
WPARAM wParam;
WPARAM wParam;
/** The second parameter of the message (32-bit integer). */
LPARAM lParam;
/** Time*/
unsigned int time;
LPARAM lParam;
/** Time */
ULONG time;
#ifdef _MGRM_THREADS
/** Addtional data*/
void* pAdd;
@@ -2217,7 +2217,7 @@ typedef MSG* PMSG;
/**
* \fn BOOL PeekMessageEx (PMSG pMsg, HWND hWnd, \
* int iMsgFilterMin, int iMsgFilterMax, \
* UINT nMsgFilterMin, UINT nMsgFilterMax, \
* BOOL bWait, UINT uRemoveMsg)
* \brief Peeks a message from the message queue of a main window.
*
@@ -2226,8 +2226,8 @@ typedef MSG* PMSG;
*
* \param pMsg Pointer to the result message.
* \param hWnd The handle to the window.
* \param iMsgFilterMin The min identifier of the message that should be peeked.
* \param iMsgFilterMax The max identifier of the message that should be peeked.
* \param nMsgFilterMin The min identifier of the message that should be peeked.
* \param nMsgFilterMax The max identifier of the message that should be peeked.
* \param bWait Whether to wait for a message.
* \param uRemoveMsg Whether remove the message from the message queue.
* Should be the following values:
@@ -2243,7 +2243,7 @@ typedef MSG* PMSG;
* \sa GetMessage, PeekPostMessage, HavePendingMessage, PostMessage
*/
MG_EXPORT BOOL GUIAPI PeekMessageEx (PMSG pMsg, HWND hWnd,
int iMsgFilterMin, int iMsgFilterMax,
UINT nMsgFilterMin, UINT nMsgFilterMax,
BOOL bWait, UINT uRemoveMsg);
/**
@@ -2305,7 +2305,7 @@ MG_EXPORT BOOL GUIAPI HavePendingMessage (HWND hMainWnd);
/**
* \fn BOOL PeekMessage (PMSG pMsg, HWND hWnd, \
* int iMsgFilterMin, int iMsgFilterMax, UINT uRemoveMsg)
* UINT nMsgFilterMin, UINT nMsgFilterMax, UINT uRemoveMsg)
* \brief Peeks a message from the message queue of a main window
*
* This functions peek a message from the message queue of the window \a hWnd
@@ -2314,8 +2314,8 @@ MG_EXPORT BOOL GUIAPI HavePendingMessage (HWND hMainWnd);
*
* \param pMsg Pointer to the result message.
* \param hWnd The handle to the window.
* \param iMsgFilterMin The min identifier of the message that should be peeked.
* \param iMsgFilterMax The max identifier of the message that should be peeked.
* \param nMsgFilterMin The min identifier of the message that should be peeked.
* \param nMsgFilterMax The max identifier of the message that should be peeked.
* \param uRemoveMsg Whether remove the message from the message queue.
* Should be the following values:
* - PM_NOREMOVE\n
@@ -2329,16 +2329,16 @@ MG_EXPORT BOOL GUIAPI HavePendingMessage (HWND hMainWnd);
*
* \sa GetMessage, PeekPostMessage, HavePendingMessage, PostMessage
*/
static inline BOOL GUIAPI PeekMessage (PMSG pMsg, HWND hWnd, int iMsgFilterMin,
int iMsgFilterMax, UINT uRemoveMsg)
static inline BOOL GUIAPI PeekMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
UINT nMsgFilterMax, UINT uRemoveMsg)
{
return PeekMessageEx (pMsg, hWnd, iMsgFilterMin, iMsgFilterMax,
return PeekMessageEx (pMsg, hWnd, nMsgFilterMin, nMsgFilterMax,
FALSE, uRemoveMsg);
}
/**
* \fn BOOL PeekPostMessage (PMSG pMsg, HWND hWnd, \
int iMsgFilterMin, int iMsgFilterMax, UINT uRemoveMsg)
UINT nMsgFilterMin, UINT nMsgFilterMax, UINT uRemoveMsg)
* \brief Peeks a post message from the message queue of a main window
*
* This functions peek a message from the message queue of the window \a hWnd
@@ -2347,8 +2347,8 @@ static inline BOOL GUIAPI PeekMessage (PMSG pMsg, HWND hWnd, int iMsgFilterMin,
*
* \param pMsg Pointer to the result message.
* \param hWnd The handle to the window.
* \param iMsgFilterMin The min identifier of the message that should be peeked.
* \param iMsgFilterMax The max identifier of the message that should be peeked.
* \param nMsgFilterMin The min identifier of the message that should be peeked.
* \param nMsgFilterMax The max identifier of the message that should be peeked.
* \param uRemoveMsg Whether remove the message from the message queue.
* Should be the following values:
* - PM_NOREMOVE\n
@@ -2362,11 +2362,11 @@ static inline BOOL GUIAPI PeekMessage (PMSG pMsg, HWND hWnd, int iMsgFilterMin,
*
* \sa GetMessage, PeekMessage, HavePendingMessage, PostMessage
*/
MG_EXPORT BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, int iMsgFilterMin,
int iMsgFilterMax, UINT uRemoveMsg);
MG_EXPORT BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, UINT nMsgFilterMin,
UINT nMsgFilterMax, UINT uRemoveMsg);
/**
* \fn int PostMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam)
* \fn int PostMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
* \brief Posts a message into the message queue of a window and returns
* immediatly.
*
@@ -2374,7 +2374,7 @@ MG_EXPORT BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, int iMsgFilterMin,
* and returns immediately.
*
* \param hWnd The handle to the window.
* \param iMsg The identifier of the message.
* \param nMsg The identifier of the message.
* \param wParam The first parameter of the message.
* \param lParam The second parameter of the message.
*
@@ -2386,29 +2386,29 @@ MG_EXPORT BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, int iMsgFilterMin,
*
* \sa SendMessage
*/
MG_EXPORT int GUIAPI PostMessage (HWND hWnd, int iMsg,
MG_EXPORT int GUIAPI PostMessage (HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam);
/**
* \fn int SendMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam)
* \fn LRESULT SendMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
* \brief Sends a message to a window.
*
* This function sends a message to the window \a hWnd, and will return
* until the message-handling process returns.
*
* \param hWnd The handle to the window.
* \param iMsg The identifier of the message.
* \param nMsg The identifier of the message.
* \param wParam The first parameter of the message.
* \param lParam The second parameter of the message.
* \return The return value of the message handler.
*
* \sa PostMessage
*/
MG_EXPORT int GUIAPI SendMessage (HWND hWnd, int iMsg,
MG_EXPORT LRESULT GUIAPI SendMessage (HWND hWnd, UINT nMsg,
WPARAM wParam, LPARAM lParam);
/**
* \fn void GUIAPI SetAutoRepeatMessage (HWND hwnd, int msg, \
* \fn void GUIAPI SetAutoRepeatMessage (HWND hwnd, UINT msg, \
WPARAM wParam, LPARAM lParam)
* \brief Sets the auto-repeat message.
*
@@ -2422,7 +2422,7 @@ MG_EXPORT int GUIAPI SendMessage (HWND hWnd, int iMsg,
* \param wParam The first parameter of the auto-repeat message.
* \param lParam The second parameter of the auto-repeat message.
*/
MG_EXPORT void GUIAPI SetAutoRepeatMessage (HWND hwnd, int msg,
MG_EXPORT void GUIAPI SetAutoRepeatMessage (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam);
#ifndef _MGRM_THREADS
@@ -2475,13 +2475,13 @@ MG_EXPORT void GUIAPI SetAutoRepeatMessage (HWND hwnd, int msg,
int GUIAPI Send2Client (MSG* msg, int cli);
/**
* \fn BOOL Send2TopMostClients (int iMsg, WPARAM wParam, LPARAM lParam)
* \fn BOOL Send2TopMostClients (UINT nMsg, WPARAM wParam, LPARAM lParam)
* \brief Sends a message to all clients in the topmost layer.
*
* This function sends the message specified by (\a iMsg, \a wParam, \a lParam)
* This function sends the message specified by (\a nMsg, \a wParam, \a lParam)
* to all clients in the topmost layer.
*
* \param iMsg The message identifier.
* \param nMsg The message identifier.
* \param wParam The first parameter of the message.
* \param lParam The second parameter of the message.
* \return TRUE on success, FALSE on error.
@@ -2493,18 +2493,18 @@ int GUIAPI Send2Client (MSG* msg, int cli);
*
* \sa Send2Client, Send2ActiveWindow
*/
BOOL GUIAPI Send2TopMostClients (int iMsg, WPARAM wParam, LPARAM lParam);
BOOL GUIAPI Send2TopMostClients (UINT nMsg, WPARAM wParam, LPARAM lParam);
/**
* \fn BOOL Send2ActiveWindow (const MG_Layer* layer, \
int iMsg, WPARAM wParam, LPARAM lParam);
UINT nMsg, WPARAM wParam, LPARAM lParam);
* \brief Sends a message to the active window in layer.
*
* This function sends the message specified by (\a iMsg, \a wParam, \a lParam)
* This function sends the message specified by (\a nMsg, \a wParam, \a lParam)
* to the current active window in the specific layer (\a layer).
*
* \param layer The pointer to the layer.
* \param iMsg The message identifier.
* \param nMsg The message identifier.
* \param wParam The first parameter of the message.
* \param lParam The second parameter of the message.
*
@@ -2516,25 +2516,25 @@ BOOL GUIAPI Send2TopMostClients (int iMsg, WPARAM wParam, LPARAM lParam);
* \sa Send2Client
*/
BOOL GUIAPI Send2ActiveWindow (const MG_Layer* layer,
int iMsg, WPARAM wParam, LPARAM lParam);
UINT nMsg, WPARAM wParam, LPARAM lParam);
#endif /* _MGRM_PROCESSES */
#else /* !_MGRM_THREADS */
/**
* \fn int PostSyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam)
* \fn LRESULT PostSyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
* \brief Posts a synchronical message to a window which is in different thread.
*
* This function posts the synchronical message specified by
* (\a iMsg, \a wParam, \a lParam) to the window \a hWnd which
* (\a nMsg, \a wParam, \a lParam) to the window \a hWnd which
* is in different thread. This function will return until
* the message is handled by the window procedure.
*
* \note The destination window must belong to other thread.
*
* \param hWnd The handle to the window.
* \param iMsg The message identifier.
* \param nMsg The message identifier.
* \param wParam The first parameter of the message.
* \param lParam The second parameter of the message.
*
@@ -2542,19 +2542,19 @@ BOOL GUIAPI Send2ActiveWindow (const MG_Layer* layer,
*
* \sa SendMessage
*/
MG_EXPORT int GUIAPI PostSyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);
MG_EXPORT LRESULT GUIAPI PostSyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
/**
* \fn int SendAsyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam)
* \fn LRESULT SendAsyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
* \brief Sends an asynchronical message to a window.
*
* This function sends the asynchronical message specified by
* (\a iMsg, \a wParam, \a lParam) to the window \a hWnd
* (\a nMsg, \a wParam, \a lParam) to the window \a hWnd
* which is in different thread. This function calls
* the window procedure immediately, so it is very dangerous.
*
* \param hWnd The handle to the window.
* \param iMsg The message identifier.
* \param nMsg The message identifier.
* \param wParam The first parameter of the message.
* \param lParam The second parameter of the message.
*
@@ -2564,20 +2564,20 @@ MG_EXPORT int GUIAPI PostSyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM
*
* \sa PostSyncMessage
*/
MG_EXPORT int GUIAPI SendAsyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);
MG_EXPORT int GUIAPI SendAsyncMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
#endif
/**
* \fn int SendNotifyMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam)
* \fn int SendNotifyMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam)
* \brief Sends a notification message to a window.
*
* This function sends the notification message specified by
* (\a iMsg, \a wParam, \a lParam) to the window \a hWnd. This function
* (\a nMsg, \a wParam, \a lParam) to the window \a hWnd. This function
* puts the notication message in the message queue and then returns
* immediately.
*
* \param hWnd The handle to the window.
* \param iMsg The message identifier.
* \param nMsg The message identifier.
* \param wParam The first parameter of the message.
* \param lParam The second parameter of the message.
*
@@ -2585,23 +2585,23 @@ MG_EXPORT int GUIAPI SendAsyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARA
*
* \sa SendMessage, PostMessage
*/
MG_EXPORT int GUIAPI SendNotifyMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);
MG_EXPORT int GUIAPI SendNotifyMessage (HWND hWnd, UINT nMsg, WPARAM wParam, LPARAM lParam);
/**
* \fn int BroadcastMessage (int iMsg, WPARAM wParam, LPARAM lParam)
* \fn int BroadcastMessage (UINT nMsg, WPARAM wParam, LPARAM lParam)
* \brief Broadcasts a message to all main window on the desktop.
*
* This function posts the message specified by (\a iMsg, \a wParam, \a lParam)
* This function posts the message specified by (\a nMsg, \a wParam, \a lParam)
* to all the main windows on the desktop.
*
* \param iMsg The message identifier.
* \param nMsg The message identifier.
* \param wParam The first parameter of the message.
* \param lParam The second parameter of the message.
* \return 0 if all OK, < 0 on error.
*
* \sa PostMessage
*/
MG_EXPORT int GUIAPI BroadcastMessage (int iMsg, WPARAM wParam, LPARAM lParam);
MG_EXPORT int GUIAPI BroadcastMessage (UINT nMsg, WPARAM wParam, LPARAM lParam);
/**
* \fn int PostQuitMessage (HWND hWnd)
@@ -2799,22 +2799,22 @@ MG_EXPORT const char* GUIAPI Message2Str (int message);
/**
* \fn void GUIAPI PrintMessage (FILE* fp, HWND hWnd, \
int iMsg, WPARAM wParam, LPARAM lParam)
UINT nMsg, WPARAM wParam, LPARAM lParam)
* \brief Prints a message in readable string form to a stdio stream.
*
* This function prints the message specified by (\a iMsg, \a wParam, \a lParam)
* This function prints the message specified by (\a nMsg, \a wParam, \a lParam)
* in readable string form to the stdio stream \a fp.
*
* \param fp The pointer to the FILE object.
* \param hWnd The target window of the message.
* \param iMsg The message identifier.
* \param nMsg The message identifier.
* \param wParam The first parameter of the message.
* \param lParam The second parameter of the message.
*
* \sa Message2Str
*/
MG_EXPORT void GUIAPI PrintMessage (FILE* fp, HWND hWnd,
int iMsg, WPARAM wParam, LPARAM lParam);
UINT nMsg, WPARAM wParam, LPARAM lParam);
#endif
@@ -4879,7 +4879,7 @@ MG_EXPORT int GUIAPI SetWindowZOrder(HWND hWnd, int zorder);
* \var typedef int (* WNDPROC)(HWND, int, WPARAM, LPARAM)
* \brief Type of the window callback procedure.
*/
typedef int (* WNDPROC)(HWND, int, WPARAM, LPARAM);
typedef LRESULT (* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
extern MG_EXPORT HWND __mg_hwnd_desktop;
@@ -4899,9 +4899,9 @@ extern MG_EXPORT HWND __mg_hwnd_desktop;
* \def HWND_INVALID
* \brief Invalid window handle.
*/
#define HWND_INVALID (HWND)UINT_PTR_MAX
#define HWND_INVALID (HWND)-1
#define HWND_OTHERPROC (HWND)UINT_PTR_MAX
#define HWND_OTHERPROC (HWND)-1
/**
* Structure defines a main window.
@@ -4930,7 +4930,7 @@ typedef struct _MAINWINCREATE
HWND hHosting;
/** The window callback procedure */
int (*MainWindowProc)(HWND, int, WPARAM, LPARAM);
LRESULT (*MainWindowProc)(HWND, UINT, WPARAM, LPARAM);
/** The position of the main window in the screen coordinates */
int lx, ty, rx, by;
@@ -5139,17 +5139,17 @@ BOOL GUIAPI SetWindowRegion (HWND hWnd, const CLIPRGN* region);
*/
BOOL GUIAPI GetWindowRegion (HWND hWnd, CLIPRGN* region);
int GUIAPI PreDefMainWinProc (HWND hWnd, int message,
LRESULT GUIAPI PreDefMainWinProc (HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
int GUIAPI PreDefDialogProc (HWND hWnd,
int message, WPARAM wParam, LPARAM lParam);
LRESULT GUIAPI PreDefDialogProc (HWND hWnd,
UINT message, WPARAM wParam, LPARAM lParam);
int GUIAPI PreDefControlProc (HWND hWnd, int message,
LRESULT GUIAPI PreDefControlProc (HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
/**
* \fn int DefaultWindowProc (HWND hWnd, int message, \
* \fn LRESULT DefaultWindowProc (HWND hWnd, UINT message, \
WPARAM wParam, LPARAM lParam)
* \brief The default window callback procedure.
*
@@ -5165,7 +5165,7 @@ int GUIAPI PreDefControlProc (HWND hWnd, int message,
* \param wParam The first parameter of the message.
* \param lParam The second parameter of the message.
*/
MG_EXPORT int GUIAPI DefaultWindowProc (HWND hWnd, int message,
MG_EXPORT LRESULT GUIAPI DefaultWindowProc (HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam);
/**
@@ -6734,13 +6734,13 @@ static inline void GUIAPI ScrollWindow (HWND hWnd, int dx, int dy,
* \brief Get window element color.
*/
#define GetWindowElementColor(iItem) \
GetWindowElementPixelEx(HWND_NULL, -1, iItem)
GetWindowElementPixelEx(HWND_NULL, (HDC)-1, iItem)
#define GetWindowElementColorEx(hWnd, iItem) \
GetWindowElementPixelEx(hWnd, -1, iItem)
GetWindowElementPixelEx(hWnd, (HDC)-1, iItem)
#define GetWindowElementPixel(hWnd, iItem) \
GetWindowElementPixelEx(hWnd, -1, iItem)
GetWindowElementPixelEx(hWnd, (HDC)-1, iItem)
/** @} end of window_general_fns */
@@ -7289,7 +7289,7 @@ typedef struct _WNDCLASS
int iBkColor;
/** Window callback procedure of all instances of this window class */
int (*WinProc) (HWND, int, WPARAM, LPARAM);
LRESULT (*WinProc) (HWND, UINT, WPARAM, LPARAM);
/** The private additional data associated with this window class */
DWORD dwAddData;
@@ -8426,10 +8426,10 @@ typedef struct _MENUITEMINFO {
PBITMAP checkedbmp;
/** The private data attached to the menu item */
DWORD itemdata;
DWORD itemdata;
/** The data of this menu item, used to pass the string or the pointer to the BITMAP object of the menu item */
DWORD typedata;
DWORD typedata;
/**
* Used by \a GetMenuItemInfo function to indicate the maximal length
@@ -9056,7 +9056,7 @@ typedef struct _CTRLDATA
/** Control caption */
const char* caption;
/** Additional data */
DWORD dwAddData;
DWORD dwAddData;
/** Control extended style */
DWORD dwExStyle;
@@ -9431,8 +9431,8 @@ MG_EXPORT HWND GUIAPI GetNextDlgGroupItem (HWND hDlg,
MG_EXPORT HWND GUIAPI GetNextDlgTabItem (HWND hDlg, HWND hCtl, BOOL bPrevious);
/**
* \fn int GUIAPI SendDlgItemMessage (HWND hDlg, int nIDDlgItem, \
* int message, WPARAM wParam, LPARAM lParam)
* \fn LRESULT GUIAPI SendDlgItemMessage (HWND hDlg, int nIDDlgItem, \
* UINT message, WPARAM wParam, LPARAM lParam)
* \brief Sends a message to the specified control in a dialog box.
*
* This function sends a message specified by (\a message, \a wParam, \a lParam)
@@ -9449,8 +9449,8 @@ MG_EXPORT HWND GUIAPI GetNextDlgTabItem (HWND hDlg, HWND hCtl, BOOL bPrevious);
*
* \sa SendMessage, GetDlgItem
*/
MG_EXPORT int GUIAPI SendDlgItemMessage ( HWND hDlg, int nIDDlgItem,
int message, WPARAM wParam, LPARAM lParam);
MG_EXPORT LRESULT GUIAPI SendDlgItemMessage (HWND hDlg, int nIDDlgItem,
UINT message, WPARAM wParam, LPARAM lParam);
/**
* \fn BOOL GUIAPI SetDlgItemInt (HWND hDlg, int nIDDlgItem, \
+3 -3
View File
@@ -43,7 +43,7 @@
static void set_line_width (HWND hWnd, PBIDISLEDITDATA sled);
static void mySetCaretPos (HWND hWnd, PBIDISLEDITDATA sled, int x);
static int SLEditCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
static LRESULT SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
static void sledit_refresh_caret (HWND hWnd, PBIDISLEDITDATA sled, BOOL bInited);
#define check_caret() \
@@ -2316,8 +2316,8 @@ static int sledit_reset_text (HWND hWnd, PBIDISLEDITDATA sled, char* str)
return 0;
}
static int
SLEditCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT
SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
DWORD dwStyle;
HDC hdc;
+2 -2
View File
@@ -83,7 +83,7 @@
#define BUTTON_OFFSET 1
static int ButtonCtrlProc (HWND hWnd, int uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
static void btnGetRects (PCONTROL pctrl, RECT* prcClient,
RECT* prcContent,
RECT* prcBitmap);
@@ -652,7 +652,7 @@ static inline BOOL mouse_in_client(LPARAM lParam, PCONTROL pctrl)
return (PtInRect ((PRECT) &(pctrl->cl), x, y));
}
static int ButtonCtrlProc (HWND hWnd, int uMsg, WPARAM wParam, LPARAM lParam)
static LRESULT ButtonCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PCONTROL pctrl;
+3 -3
View File
@@ -47,7 +47,7 @@
#define DEC_BOX 2
static int mouse_old = 0;
static int ComboBoxCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
static LRESULT ComboBoxCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
BOOL RegisterComboBoxControl (void)
{
@@ -64,7 +64,7 @@ BOOL RegisterComboBoxControl (void)
return AddNewControlClass (&WndClass) == ERR_OK;
}
static int AutoSpinEditBoxProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT AutoSpinEditBoxProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
WNDPROC old_edit_proc;
@@ -315,7 +315,7 @@ static void OnSizeChanged (PCONTROL pCtrl, DWORD dwStyle, const RECT* rcClient)
}
}
static int ComboBoxCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT ComboBoxCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PCONTROL pCtrl = gui_Control (hwnd);
PCOMBOBOXDATA pData = (PCOMBOBOXDATA)pCtrl->dwAddData2;
+2 -2
View File
@@ -28,7 +28,7 @@
#define _ID_TIMER 100
static int ToolTipWinProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT ToolTipWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static int iBorder;
switch (message) {
@@ -253,7 +253,7 @@ DefaultPageProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
IncludeWindowStyle (hNewDef, BS_DEFPUSHBUTTON);
InvalidateRect (hNewDef, NULL, TRUE);
return (int)hOldDef;
return (LRESULT)hOldDef;
}
break;
}
+3 -3
View File
@@ -43,7 +43,7 @@
static void set_line_width (HWND hWnd, PSLEDITDATA sled);
static void mySetCaretPos (HWND hWnd, PSLEDITDATA sled, int x);
static int SLEditCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
static LRESULT SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
static void sledit_refresh_caret (HWND hWnd, PSLEDITDATA sled, BOOL bInited);
static BOOL make_charpos_visible (HWND hWnd, PSLEDITDATA sled, int charPos, int *cx);
@@ -1897,8 +1897,8 @@ sledit_insert_text (HWND hWnd, PSLEDITDATA sled, const char* newtext, int len)
return 0;
}
static int
SLEditCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT
SLEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
DWORD dwStyle;
HDC hdc;
+2 -2
View File
@@ -47,7 +47,7 @@
/** minimum height of checkmark */
#define LFRDR_LB_CHECKBMP_MIN 6
static int ListboxCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam);
static LRESULT ListboxCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
BOOL RegisterListboxControl (void)
{
@@ -850,7 +850,7 @@ static void lstSetScrollInfo (HWND hwnd, PLISTBOXDATA pData, BOOL fRedraw)
lstSetHScrollInfo (hwnd, pData, fRedraw);
}
static int ListboxCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT ListboxCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PCONTROL pCtrl;
+2 -2
View File
@@ -40,7 +40,7 @@
#define _INTER_BARTEXT 4
static int MenuButtonCtrlProc (HWND hWnd, int message, WPARAM wParam,
static LRESULT MenuButtonCtrlProc (HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam);
BOOL RegisterMenuButtonControl (void)
@@ -453,7 +453,7 @@ error:
return 0;
}
static int MenuButtonCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT MenuButtonCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PMENUBTNDATA mb_data;
WINDOWINFO *wnd_info;
+12 -12
View File
@@ -40,7 +40,7 @@
#define MARGIN_HORZ 5
#define MARGIN_V_VERT 5
#endif
static int NewToolbarCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam);
static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
BOOL RegisterNewToolbarControl (void)
{
@@ -87,8 +87,8 @@ static void draw_left_right_line_vert (HWND hwnd, HDC hdc, RECT *rc)
lighter_dword = pWin->we_rdr->calc_3dbox_color
(bgc_dword, LFRDR_3DBOX_COLOR_LIGHTEST);
darker_pixel = DWORD2PIXEL (hdc, darker_dword);
lighter_pixel = DWORD2PIXEL (hdc, lighter_dword);
darker_pixel = DWORD2Pixel (hdc, darker_dword);
lighter_pixel = DWORD2Pixel (hdc, lighter_dword);
rc->bottom -= 1;
rc->right -= 1;
@@ -182,8 +182,8 @@ static void draw_separator_vert (HWND hwnd, HDC hdc, int l, int t, NTBCTRLDATA *
lighter_dword = pWin->we_rdr->calc_3dbox_color
(bgc_dword, LFRDR_3DBOX_COLOR_LIGHTEST);
darker_pixel = DWORD2PIXEL (hdc, darker_dword);
lighter_pixel = DWORD2PIXEL (hdc, lighter_dword);
darker_pixel = DWORD2Pixel (hdc, darker_dword);
lighter_pixel = DWORD2Pixel (hdc, lighter_dword);
pta.x = l;
pta.y = t + 1;
@@ -230,7 +230,7 @@ static void draw_checked_item_vert (HWND hwnd, HDC hdc, PNTBCTRLDATA ntb_data,
bgc_dword = pWin->we_rdr->calc_3dbox_color
(bgc_dword, LFRDR_3DBOX_COLOR_DARKEST);
bgc_pixel = DWORD2PIXEL (hdc, bgc_dword);
bgc_pixel = DWORD2Pixel (hdc, bgc_dword);
pta.x = l; pta.y = t;
ptb.x = l; ptb.y = b;
@@ -446,8 +446,8 @@ static void draw_top_bottom_line_horz (HWND hwnd, HDC hdc, RECT *rc)
lighter_dword = pWin->we_rdr->calc_3dbox_color
(bgc_dword, LFRDR_3DBOX_COLOR_LIGHTEST);
darker_pixel = DWORD2PIXEL (hdc, darker_dword);
lighter_pixel = DWORD2PIXEL (hdc, lighter_dword);
darker_pixel = DWORD2Pixel (hdc, darker_dword);
lighter_pixel = DWORD2Pixel (hdc, lighter_dword);
rc->bottom -= 1;
rc->right -= 1;
@@ -506,8 +506,8 @@ static void draw_separator_horz (HWND hwnd, HDC hdc, int l, int t, NTBITEM *it)
lighter_dword = pWin->we_rdr->calc_3dbox_color
(bgc_dword, LFRDR_3DBOX_COLOR_LIGHTEST);
darker_pixel = DWORD2PIXEL (hdc, darker_dword);
lighter_pixel = DWORD2PIXEL (hdc, lighter_dword);
darker_pixel = DWORD2Pixel (hdc, darker_dword);
lighter_pixel = DWORD2Pixel (hdc, lighter_dword);
pta.x = l + 1;
pta.y = t;
@@ -568,7 +568,7 @@ static void draw_checked_item_horz (HWND hwnd, HDC hdc, PNTBCTRLDATA ntb_data,
bgc_dword = pWin->we_rdr->calc_3dbox_color
(bgc_dword, LFRDR_3DBOX_COLOR_DARKEST);
bgc_pixel = DWORD2PIXEL (hdc, bgc_dword);
bgc_pixel = DWORD2Pixel (hdc, bgc_dword);
pta.x = l; pta.y = t;
ptb.x = l; ptb.y = b;
@@ -1255,7 +1255,7 @@ static void ShowCurItemHintText (HWND hWnd, NTBCTRLDATA *ntb_data , NTBITEM * pi
}
}
static int NewToolbarCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT NewToolbarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PCONTROL myself;
PNTBCTRLDATA ntb_data;
+2 -2
View File
@@ -67,8 +67,8 @@ pbarOnNewPos (const CONTROL* pCtrl,
InvalidateRect ((HWND)pCtrl, NULL, FALSE);
}
static int
ProgressBarCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT
ProgressBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PCONTROL pCtrl;
+11 -13
View File
@@ -43,9 +43,8 @@
#define WEC_TAB_LIGHT 32
#define TAB_MARGIN 8
static int
PropSheetCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
static LRESULT
PropSheetCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
BOOL RegisterPropSheetControl (void)
{
@@ -112,7 +111,7 @@ static void show_hide_page (PPROPPAGE page, int show_cmd)
ShowWindow (page->hwnd, show_cmd);
focus = GetNextDlgTabItem (page->hwnd, (HWND)0, 0);
if (SendMessage (page->hwnd, MSG_SHOWPAGE, focus, show_cmd) &&
if (SendMessage (page->hwnd, MSG_SHOWPAGE, (WPARAM)focus, show_cmd) &&
show_cmd == SW_SHOW) {
if (focus) {
SetFocus (focus);
@@ -628,7 +627,7 @@ static void draw_propsheet (HWND hwnd, HDC hdc, PCONTROL ctrl,
scrollbtn_left = propsheet->head_rc.right - get_metrics (MWM_SB_WIDTH);
}
old_brush_c = SetBrushColor (hdc, DWORD2PIXEL (hdc, main_c));
old_brush_c = SetBrushColor (hdc, DWORD2Pixel (hdc, main_c));
while (page) {
if (((ctrl->dwStyle & 0x0fL) == PSS_SCROLLABLE) && propsheet->overload == TRUE)
if (((title_rc.right + page->width > scrollbtn_left) || (page->width == 0))
@@ -674,7 +673,7 @@ static void draw_propsheet (HWND hwnd, HDC hdc, PCONTROL ctrl,
propsheet->overload == TRUE)
draw_scroll_button (hwnd, hdc, &title_rc, propsheet, ctrl->dwStyle);
SetBrushColor (hdc, DWORD2PIXEL(hdc, old_brush_c));
SetBrushColor (hdc, DWORD2Pixel(hdc, old_brush_c));
}
static int insert_new_page_normal_style (HWND hwnd, PPROPSHEETDATA propsheet,
@@ -919,8 +918,8 @@ static BOOL delete_page (HWND hwnd, PCONTROL ctrl, PPROPSHEETDATA propsheet,
/* window procedure of the property sheet. */
static int
PropSheetCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT
PropSheetCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PCONTROL ctrl;
PPROPSHEETDATA propsheet;
@@ -1046,8 +1045,7 @@ PropSheetCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
}
case PSM_GETACTIVEPAGE: {
return (propsheet->active) ?
propsheet->active->hwnd : HWND_INVALID;
return (LRESULT)((propsheet->active) ? propsheet->active->hwnd : HWND_INVALID);
}
case PSM_GETPAGE: {
@@ -1055,19 +1053,19 @@ PropSheetCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
PPROPPAGE page = propsheet->head;
while (page) {
if (index == wParam) {
return page->hwnd;
return (LRESULT)page->hwnd;
}
index ++;
page = page->next;
}
return HWND_INVALID;
return (LRESULT)HWND_INVALID;
}
case PSM_GETPAGEINDEX: {
int index = 0;
PPROPPAGE page = propsheet->head;
while (page) {
if (page->hwnd == wParam) {
if (page->hwnd == (HWND)wParam) {
return index;
}
index ++;
+1 -1
View File
@@ -325,7 +325,7 @@ int track_thumb (HWND hwnd, PSCROLLBARDATA data, int x, int y)
return 0;
}
static int ScrollBarCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT ScrollBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PSCROLLBARDATA data;
PCONTROL pCtrl;
+1 -1
View File
@@ -430,7 +430,7 @@ void scrollview_destroy (PSVDATA psvdata)
}
/* --------------------------------------------------------------------------------- */
int ScrollViewCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT ScrollViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PSVDATA psvdata = NULL;
+1 -1
View File
@@ -185,7 +185,7 @@ void scrollwnd_reset_content (HWND hWnd, PSWDATA pswdata)
/* --------------------------------------------------------------------------------- */
int ScrollWndCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT ScrollWndCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PSWDATA pswdata = NULL;
+2 -2
View File
@@ -31,8 +31,8 @@
#include "static_impl.h"
static int
StaticControlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT
StaticControlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
RECT rcClient;
HDC hdc;
+3 -1
View File
@@ -31,7 +31,9 @@ typedef struct strbuffer_s
#if 1
#define te_alloc malloc
#define te_free free
#define te_realloc(ptr, size, cpysize) realloc(ptr, size)
static inline void* te_realloc (void* ptr, size_t size, size_t cpysize) {
return realloc (ptr, size);
}
#else
#define te_alloc FixStrAlloc
#define te_free FixStrFree
+1 -1
View File
@@ -3025,7 +3025,7 @@ static void init_bufdc (HWND hWnd, PTEDATA ptedata)
ReleaseDC(hdc);
}
static int TextEditCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT TextEditCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PTEDATA ptedata = NULL;
+1 -1
View File
@@ -185,7 +185,7 @@ static int NormalizeMousePos (HWND hwnd, TRACKBARDATA* pData, int mousepos)
return (int)((pData->nMax - pData->nMin) * pos / (float)len + 0.5) + pData->nMin;
}
static int TrackBarCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT TrackBarCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PCONTROL pCtrl;
TRACKBARDATA* pData;
+6 -6
View File
@@ -25,7 +25,7 @@
#include "ctrlclass.h"
#include "ctrl/animation.h"
static int AnimationCtrlProc (HWND hwnd, int uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT AnimationCtrlProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
BOOL RegisterAnimationControl (void)
{
@@ -266,7 +266,7 @@ static void setup_anim_mem_dc (HWND hwnd, ANIMATIONINFO* anim_info)
ReleaseDC (hdc);
}
static int AnimationCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT AnimationCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
ANIMATIONINFO* anim_info = (ANIMATIONINFO*)GetWindowAdditionalData2 (hwnd);
@@ -362,11 +362,11 @@ static int AnimationCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lPar
//SetTimer (hwnd, ID_TIMER, anim_info->anim->time_unit);
SetTimer (hwnd, ID_TIMER, 1);
}
return (int)old;
return (LRESULT)old;
}
case ANM_GETANIMATION:
return (int)anim_info->anim;
return (LRESULT)anim_info->anim;
case ANM_STARTPLAY: {
@@ -407,8 +407,8 @@ static int AnimationCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lPar
NotifyParent (hwnd, GetDlgCtrlID (hwnd), ANNC_CLICKED);
break;
default:
break;
default:
break;
}
return DefaultControlProc (hwnd, message, wParam, lParam);
+2 -2
View File
@@ -31,7 +31,7 @@
#define ITEMBARWIDTH 8
static int CoolBarCtrlProc (HWND hWnd, int uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT CoolBarCtrlProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
BOOL RegisterCoolBarControl (void)
{
@@ -317,7 +317,7 @@ static void set_item_rect (HWND hwnd, PCOOLBARCTRL TbarData, COOLBARITEMDATA* pt
ptemp->hinty = ptemp->RcTitle.bottom;
}
static int CoolBarCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT CoolBarCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PCOOLBARCTRL TbarData;
+1 -1
View File
@@ -1583,7 +1583,7 @@ void GridDataModalArray_delete_modal(gvGridDataModal* modal)
// }}}
static int GridViewCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT GridViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
gvGridViewData* view = NULL;
if (message != MSG_CREATE)
+1 -2
View File
@@ -466,8 +466,7 @@ void iconview_destroy (IconviewData* pivdata)
ivlist_reset_content (hivwnd, &pivdata->ivlist);
}
static int
IconViewCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT IconViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
IconviewData* pivdata = NULL;
IconviewList* pivlist = NULL;
+1 -1
View File
@@ -1314,7 +1314,7 @@ static void listview_destroy (HWND hWnd, PLVDATA plvdata)
#define RETURN_DIRECT return DefaultControlProc(hWnd, message, wParam, lParam)
static int ListViewCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT ListViewCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PLVDATA plvdata = NULL;
+2 -2
View File
@@ -72,7 +72,7 @@
#define MCCLR_DF_WEEKCAPTBK GetWindowElementPixel(hWnd, WE_BGC_HIGHLIGHT_ITEM)
#define MCCLR_DF_WEEKCAPTTEXT GetWindowElementPixel(hWnd, WE_FGC_HIGHLIGHT_ITEM)
static int MonthCalendarCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam);
static LRESULT MonthCalendarCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
BOOL RegisterMonthCalendarControl (void)
{
@@ -866,7 +866,7 @@ static void mcKeyOperations (HWND hWnd, PMONCALDDATA mc_data, WPARAM wParam)
/********************************************************************************/
static int MonthCalendarCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT MonthCalendarCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HDC hdc;
PMONCALDDATA mc_data = NULL;
+2 -2
View File
@@ -185,8 +185,8 @@ OnDownArrow (HWND hWnd, PSPINDATA pData, int id, DWORD dwStyle, DWORD wParam)
}
}
static int
SpinCtrlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT
SpinCtrlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PSPINDATA pData = (PSPINDATA) GetWindowAdditionalData2 (hWnd);
+2 -2
View File
@@ -46,7 +46,7 @@ static HICON icon_fold, icon_unfold;
#define FGC_HILIGHT_NORMAL WE_FGC_HIGHLIGHT_ITEM
#define FGC_CONTROL_NORMAL WE_FGC_WINDOW
static int TreeViewCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam);
static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
BOOL RegisterTreeViewControl (void)
{
@@ -803,7 +803,7 @@ static int set_item_text (HWND hwnd, PTVDATA pData, PTVITEM item, const char* te
return 0;
}
static int TreeViewCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PTVDATA pData = NULL;
DWORD dwStyle;
+2 -2
View File
@@ -36,7 +36,7 @@
#define TV_ICONGAP 3
#define TV_IDENT 4
static int TreeViewCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam);
static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
BOOL RegisterTreeViewRdrControl (void)
{
@@ -785,7 +785,7 @@ static int set_item_text (HWND hwnd, PTVDATA pData, PTVITEM item, const char* te
return 0;
}
static int TreeViewCtrlProc (HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT TreeViewCtrlProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PTVDATA pData = NULL;
DWORD dwStyle;
+1 -1
View File
@@ -271,7 +271,7 @@ unsigned short font_GetBestScaleFactor (int height, int expect)
{ \
devfont = head; \
while (devfont) { \
fprintf (stderr, " %d: %s, charsetname: %s, style: %#x\n", \
fprintf (stderr, " %d: %s, charsetname: %s, style: %lx\n", \
count, \
devfont->name, devfont->charset_ops->name, devfont->style); \
devfont = devfont->next; \
+2 -2
View File
@@ -102,7 +102,7 @@ static PLOGFONT gdiCreateLogFont (const char* type, const char* family,
log_font->sbc_scale = 1;
log_font->mbc_scale = 1;
_MG_PRINTF ("FONT>LogFont: requested info: type: %s, family: %s, style: %x, charset: %s, size: %d.\n",
_MG_PRINTF ("FONT>LogFont: requested info: type: %s, family: %s, style: %lx, charset: %s, size: %d.\n",
log_font->type, log_font->family, log_font->style, log_font->charset,
log_font->size);
@@ -223,7 +223,7 @@ static PLOGFONT gdiCreateLogFont (const char* type, const char* family,
log_font->style &= ~FS_FLIP_HORZVERT;
}
_MG_PRINTF ("FONT>LogFont: created info: type: %s, family: %s, style: %x, charset: %s, size: %d.\n",
_MG_PRINTF ("FONT>LogFont: created info: type: %s, family: %s, style: %lx, charset: %s, size: %d.\n",
log_font->type, log_font->family, log_font->style, log_font->charset,
log_font->size);
+1 -1
View File
@@ -527,7 +527,7 @@ BOOL SetWindowExStyle (HWND hWnd, DWORD dwExStyle)
void mnuDumpCtrlClassInfo (PCTRLCLASSINFO cci)
{
printf ("\tClass Name: %s\n", cci->name);
printf ("\tClass Cursor: %x\n", cci->hCursor);
printf ("\tClass Cursor: %p\n", cci->hCursor);
printf ("\tClass Background color: %d\n", cci->iBkColor);
printf ("\tClass Control Proc: %p\n", cci->ControlProc);
printf ("\tClass Use Count: %d\n", cci->nUseCount);
+8 -8
View File
@@ -120,7 +120,7 @@ HWND GUIAPI CreateMainWindowIndirectParamEx (PDLGTEMPLATE pDlgTemplate,
hFocus = (HWND)pCtrl;
}
#endif
if (SendMessage (hMainWin, MSG_INITDIALOG, hFocus, lParam)) {
if (SendMessage (hMainWin, MSG_INITDIALOG, (WPARAM)hFocus, lParam)) {
if (hFocus)
SetFocus (hFocus);
}
@@ -215,7 +215,7 @@ BOOL GUIAPI EndDialog (HWND hDlg, int endCode)
return TRUE;
}
int GUIAPI PreDefDialogProc (HWND hWnd, int message,
LRESULT GUIAPI PreDefDialogProc (HWND hWnd, UINT message,
WPARAM wParam, LPARAM lParam)
{
HWND hCurFocus;
@@ -285,7 +285,7 @@ int GUIAPI PreDefDialogProc (HWND hWnd, int message,
IncludeWindowStyle (hNewDef, BS_DEFPUSHBUTTON);
InvalidateRect (hNewDef, NULL, TRUE);
return (int)hOldDef;
return (LRESULT)hOldDef;
}
break;
}
@@ -628,8 +628,8 @@ HWND GUIAPI GetNextDlgTabItem (HWND hDlg, HWND hCtl, BOOL bPrevious)
return hCtl;
}
int GUIAPI SendDlgItemMessage (HWND hDlg, int nIDDlgItem,
int message, WPARAM wParam, LPARAM lParam)
LRESULT GUIAPI SendDlgItemMessage (HWND hDlg, int nIDDlgItem,
UINT message, WPARAM wParam, LPARAM lParam)
{
HWND hCtrl;
@@ -772,7 +772,7 @@ int GUIAPI IsDlgButtonChecked (HWND hDlg, int idButton)
}
#ifdef _MGCTRL_STATIC
static int MsgBoxProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
static LRESULT MsgBoxProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message) {
case MSG_INITDIALOG:
@@ -1077,14 +1077,14 @@ int GUIAPI MessageBox (HWND hParentWnd, const char* pszText,
if (IsTiny) {
if (id_icon != -1) {
CtrlData [i].dwAddData = GetSmallSystemIcon (id_icon);
CtrlData [i].dwAddData = (DWORD)GetSmallSystemIcon (id_icon);
}
rcIcon.right = 16;
rcIcon.bottom = 16;
}
else {
if (id_icon != -1) {
CtrlData [i].dwAddData = GetLargeSystemIcon (id_icon);
CtrlData [i].dwAddData = (DWORD)GetLargeSystemIcon (id_icon);
MsgBoxData.hIcon = GetSmallSystemIcon (id_icon);
}
rcIcon.right = 32;
+16 -16
View File
@@ -1034,7 +1034,7 @@ static void draw_normal_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1043,7 +1043,7 @@ static void draw_hilite_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1052,7 +1052,7 @@ static void draw_disabled_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1061,7 +1061,7 @@ static void draw_significant_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1070,7 +1070,7 @@ static void draw_normal_menu_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1079,7 +1079,7 @@ static void draw_hilite_menu_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1088,7 +1088,7 @@ static void draw_disabled_menu_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1125,7 +1125,7 @@ static void draw_push_button (HWND hWnd, HDC hdc, const RECT* pRect,
if (STATUS_GET_CHECK (status) != BST_UNCHECKED)
{
dark_color = calc_3dbox_color (color1, LFRDR_3DBOX_COLOR_DARKER);
dark_pixel = DWORD2PIXEL(hdc, dark_color);
dark_pixel = DWORD2Pixel(hdc, dark_color);
if (STATUS_GET_CHECK (status) == BST_CHECKED)
{
@@ -3216,10 +3216,10 @@ draw_tab (HWND hWnd, HDC hdc, RECT *rect, char *title, DWORD color, int flag, HI
/* draw the title's edge */
/* pc3d style & flat & grap */
if (flag & LFRDR_TAB_BOTTOM) {
SetPenColor(hdc, DWORD2PIXEL (hdc, light_c));
SetPenColor(hdc, DWORD2Pixel (hdc, light_c));
MoveTo (hdc, rect->left, ty);
LineTo (hdc, rect->left, by - 3 );
SetPenColor(hdc, DWORD2PIXEL (hdc, darker_c));
SetPenColor(hdc, DWORD2Pixel (hdc, darker_c));
MoveTo (hdc, rect->left + 2, by - 1);
LineTo (hdc, rect->right - 4, by - 1);
@@ -3227,7 +3227,7 @@ draw_tab (HWND hWnd, HDC hdc, RECT *rect, char *title, DWORD color, int flag, HI
LineTo (hdc, rect->left + 1, by - 2);
} else {
SetPenColor(hdc, DWORD2PIXEL (hdc, light_c));
SetPenColor(hdc, DWORD2Pixel (hdc, light_c));
MoveTo (hdc, rect->left, by - 1);
LineTo (hdc, rect->left, ty + 2);
MoveTo (hdc, rect->left + 2, ty);
@@ -3238,26 +3238,26 @@ draw_tab (HWND hWnd, HDC hdc, RECT *rect, char *title, DWORD color, int flag, HI
}
if (flag & LFRDR_TAB_BOTTOM) {
SetPenColor(hdc, DWORD2PIXEL (hdc, darkest_c));
SetPenColor(hdc, DWORD2Pixel (hdc, darkest_c));
MoveTo (hdc, rect->right - 2, by - 3);
LineTo (hdc, rect->right - 2, ty);
MoveTo (hdc, rect->right - 3, by - 2 );
LineTo (hdc, rect->right - 3, by - 2);
SetPenColor(hdc, DWORD2PIXEL (hdc, darker_c));
SetPenColor(hdc, DWORD2Pixel (hdc, darker_c));
MoveTo (hdc, rect->right - 3, by -3);
LineTo (hdc, rect->right - 3, ty);
}else {
SetPenColor(hdc, DWORD2PIXEL (hdc, darkest_c));
SetPenColor(hdc, DWORD2Pixel (hdc, darkest_c));
MoveTo (hdc, rect->right - 2, ty + 2 );
LineTo (hdc, rect->right - 2, by - 2);
MoveTo (hdc, rect->right - 3, ty + 1 );
LineTo (hdc, rect->right - 3, ty + 1);
SetPenColor(hdc, DWORD2PIXEL (hdc, darker_c));
SetPenColor(hdc, DWORD2Pixel (hdc, darker_c));
MoveTo (hdc, rect->right - 3, ty + 2 );
LineTo (hdc, rect->right - 3, by - 2);
@@ -3278,7 +3278,7 @@ draw_tab (HWND hWnd, HDC hdc, RECT *rect, char *title, DWORD color, int flag, HI
}
/* draw the TEXT */
SetBkColor (hdc, DWORD2PIXEL (hdc, color));
SetBkColor (hdc, DWORD2Pixel (hdc, color));
text_extent -= 4;
eff_len = GetTextExtentPoint (hdc, title, strlen(title),
text_extent, &eff_chars, NULL, NULL, &size);
+122 -122
View File
File diff suppressed because it is too large Load Diff
+11 -11
View File
@@ -540,7 +540,7 @@ static void draw_3dbox (HDC hdc, const RECT* pRect, DWORD color, DWORD flag)
pRect->right - 1, pRect->bottom - 1);
if (flag & LFRDR_3DBOX_FILLED) {
SetBrushColor(hdc, DWORD2PIXEL (hdc, color));
SetBrushColor(hdc, DWORD2Pixel (hdc, color));
FillBox(hdc, pRect->left + 1,
pRect->top + 1,
RECTWP(pRect) - 2,
@@ -567,7 +567,7 @@ static void draw_radio (HDC hdc, const RECT* pRect, DWORD color, int status)
if (w < 6 || h < 6)
return;
color_pixel = DWORD2PIXEL (hdc, color);
color_pixel = DWORD2Pixel (hdc, color);
radius = w>h ? (h>>1)-1 : (w>>1)-1;
center_x = pRect->left + (w>>1);
@@ -1101,7 +1101,7 @@ static void draw_normal_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1110,7 +1110,7 @@ static void draw_hilite_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1119,7 +1119,7 @@ static void draw_disabled_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1128,7 +1128,7 @@ static void draw_significant_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1137,7 +1137,7 @@ static void draw_normal_menu_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1146,7 +1146,7 @@ static void draw_hilite_menu_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1155,7 +1155,7 @@ static void draw_disabled_menu_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -3164,7 +3164,7 @@ draw_tab (HWND hWnd, HDC hdc, RECT *rect, char *title, DWORD color, int flag, HI
//fill background
if (!(flag & LFRDR_TAB_ACTIVE)) {
bkColor = GetWindowElementAttr(hWnd, WE_LFFLAT_TAB_NRMLCLR);
oldColor = SetBrushColor(hdc, DWORD2PIXEL(hdc, bkColor));
oldColor = SetBrushColor(hdc, DWORD2Pixel(hdc, bkColor));
}
else {
//for active
@@ -3243,7 +3243,7 @@ draw_tab (HWND hWnd, HDC hdc, RECT *rect, char *title, DWORD color, int flag, HI
if (title) {
/* draw the TEXT */
SetBkColor (hdc, DWORD2PIXEL (hdc, color));
SetBkColor (hdc, DWORD2Pixel (hdc, color));
SetBkMode (hdc, BM_TRANSPARENT);
SetRect(&rc, x+offset, ty, rect->right - offset, by);
DrawText(hdc, title, -1, &rc, DT_SINGLELINE | DT_VCENTER);
+5 -5
View File
@@ -600,7 +600,7 @@ void dump_window_element_data (HWND hwnd)
break;
case WE_ATTR_TYPE_COLOR:
_MG_PRINTF ("\tcolor in list: %x.\n", wed->data);
_MG_PRINTF ("\tcolor in list: %lx.\n", wed->data);
}
}
_MG_PRINTF ("GUI>DumpWED: Done\n");
@@ -636,7 +636,7 @@ DWORD GUIAPI SetWindowElementAttr (HWND hwnd, int we_attr_id, DWORD we_attr)
case WE_ATTR_TYPE_COLOR: {
int color_index = (we_attr_id & WE_ATTR_TYPE_COLOR_MASK) >> 8;
old_data = __mg_def_renderer->we_colors[index][color_index];
old_data = (DWORD)__mg_def_renderer->we_colors[index][color_index];
__mg_def_renderer->we_colors[index][color_index] = we_attr;
return old_data;
}
@@ -644,8 +644,8 @@ DWORD GUIAPI SetWindowElementAttr (HWND hwnd, int we_attr_id, DWORD we_attr)
case WE_ATTR_TYPE_ICON:
{
int icon_idx = (we_attr_id & WE_ATTR_TYPE_ICON_MASK) >> 8;
old_data = __mg_def_renderer->we_icon [icon_idx][index];
__mg_def_renderer->we_icon [icon_idx][index] = we_attr;
old_data = (DWORD)__mg_def_renderer->we_icon [icon_idx][index];
__mg_def_renderer->we_icon [icon_idx][index] = (HICON)we_attr;
return old_data;
}
@@ -711,7 +711,7 @@ GetWindowElementPixelEx (HWND hwnd, HDC hdc, int we_attr_id)
b = GetBValue (data);
a = GetAValue (data);
if (hdc == -1) {
if (hdc == HDC_INVALID) {
if (hwnd == HWND_NULL || hwnd == HWND_DESKTOP)
pixel = RGBA2Pixel (HDC_SCREEN, r, g, b, a);
else {
+8 -8
View File
@@ -1164,7 +1164,7 @@ draw_focus_frame (HDC hdc, const RECT *pRect, DWORD color)
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1173,7 +1173,7 @@ draw_focus_frame (HDC hdc, const RECT *pRect, DWORD color)
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1182,7 +1182,7 @@ draw_focus_frame (HDC hdc, const RECT *pRect, DWORD color)
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1191,7 +1191,7 @@ draw_focus_frame (HDC hdc, const RECT *pRect, DWORD color)
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1200,7 +1200,7 @@ draw_focus_frame (HDC hdc, const RECT *pRect, DWORD color)
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1209,7 +1209,7 @@ draw_focus_frame (HDC hdc, const RECT *pRect, DWORD color)
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1218,7 +1218,7 @@ draw_focus_frame (HDC hdc, const RECT *pRect, DWORD color)
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -3233,7 +3233,7 @@ draw_tab (HWND hWnd, HDC hdc, RECT *pRect, char *title, DWORD color, int flag, H
}
/* draw the TEXT */
//SetBkColor (hdc, DWORD2PIXEL (hdc, color));
//SetBkColor (hdc, DWORD2Pixel (hdc, color));
SetBkMode (hdc, BM_TRANSPARENT);
text_extent -= 4;
eff_len = GetTextExtentPoint (hdc, title, strlen(title),
+15 -15
View File
@@ -460,7 +460,7 @@ static void draw_3dbox (HDC hdc, const RECT* pRect, DWORD color, DWORD flag)
pRect->right - 1, pRect->bottom - 1);
if (flag & LFRDR_3DBOX_FILLED) {
SetBrushColor(hdc, DWORD2PIXEL (hdc, color));
SetBrushColor(hdc, DWORD2Pixel (hdc, color));
FillBox(hdc, pRect->left + 1,
pRect->top + 1,
RECTW((*pRect)) - 2,
@@ -487,7 +487,7 @@ static void draw_radio (HDC hdc, const RECT* pRect, DWORD color, int status)
if (w < 6 || h < 6)
return;
color_pixel = DWORD2PIXEL (hdc, color);
color_pixel = DWORD2Pixel (hdc, color);
radius = w>h ? (h>>1)-1 : (w>>1)-1;
center_x = pRect->left + (w>>1);
@@ -1007,7 +1007,7 @@ static void draw_normal_item
if (bg_bmp == NULL)
{
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
return;
@@ -1033,7 +1033,7 @@ static void draw_hilite_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1042,7 +1042,7 @@ static void draw_disabled_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1051,7 +1051,7 @@ static void draw_significant_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1060,7 +1060,7 @@ static void draw_normal_menu_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1069,7 +1069,7 @@ static void draw_hilite_menu_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -1078,7 +1078,7 @@ static void draw_disabled_menu_item
(HWND hWnd, HDC hdc, const RECT* pRect, DWORD color)
{
gal_pixel old_bc;
old_bc = SetBrushColor (hdc, DWORD2PIXEL (hdc, color));
old_bc = SetBrushColor (hdc, DWORD2Pixel (hdc, color));
FillBox (hdc, pRect->left, pRect->top, RECTWP (pRect), RECTHP (pRect));
SetBrushColor (hdc, old_bc);
}
@@ -3800,7 +3800,7 @@ draw_tab (HWND hWnd, HDC hdc, RECT *rect, char *title, DWORD color, int flag, HI
/* draw the title's edge */
/* pc3d style & tiny & grap */
SetPenColor(hdc, DWORD2PIXEL (hdc, light_c));
SetPenColor(hdc, DWORD2Pixel (hdc, light_c));
if (flag & LFRDR_TAB_BOTTOM) {
MoveTo (hdc, rect->left, ty);
LineTo (hdc, rect->left, by - 3 );
@@ -3819,26 +3819,26 @@ draw_tab (HWND hWnd, HDC hdc, RECT *rect, char *title, DWORD color, int flag, HI
}
if (flag & LFRDR_TAB_BOTTOM) {
SetPenColor(hdc, DWORD2PIXEL (hdc, darkest_c));
SetPenColor(hdc, DWORD2Pixel (hdc, darkest_c));
MoveTo (hdc, rect->right - 2, by - 3);
LineTo (hdc, rect->right - 2, ty);
MoveTo (hdc, rect->right - 3, by - 2 );
LineTo (hdc, rect->right - 3, by - 2);
SetPenColor(hdc, DWORD2PIXEL (hdc, darker_c));
SetPenColor(hdc, DWORD2Pixel (hdc, darker_c));
MoveTo (hdc, rect->right - 3, by -3);
LineTo (hdc, rect->right - 3, ty);
}else {
SetPenColor(hdc, DWORD2PIXEL (hdc, darkest_c));
SetPenColor(hdc, DWORD2Pixel (hdc, darkest_c));
MoveTo (hdc, rect->right - 2, ty + 2 );
LineTo (hdc, rect->right - 2, by - 2);
MoveTo (hdc, rect->right - 3, ty + 1 );
LineTo (hdc, rect->right - 3, ty + 1);
SetPenColor(hdc, DWORD2PIXEL (hdc, darker_c));
SetPenColor(hdc, DWORD2Pixel (hdc, darker_c));
MoveTo (hdc, rect->right - 3, ty + 2 );
LineTo (hdc, rect->right - 3, by - 2);
@@ -3859,7 +3859,7 @@ draw_tab (HWND hWnd, HDC hdc, RECT *rect, char *title, DWORD color, int flag, HI
}
/* draw the TEXT */
SetBkColor (hdc, DWORD2PIXEL (hdc, color));
SetBkColor (hdc, DWORD2Pixel (hdc, color));
text_extent -= 4;
eff_len = GetTextExtentPoint (hdc, title, strlen(title),
text_extent, &eff_chars, NULL, NULL, &size);
+13 -13
View File
@@ -1344,7 +1344,7 @@ static void mnuDrawMenuBarItem (HWND hwnd, HDC hdc, PMENUITEM pmi,
return;
if (!pWin->we_rdr) {
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %x\n", (int)pWin);
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return;
}
@@ -1408,8 +1408,8 @@ static void mnuDrawMenuBarItem (HWND hwnd, HDC hdc, PMENUITEM pmi,
lighter_dword = pWin->we_rdr->calc_3dbox_color
(bgc_dword, LFRDR_3DBOX_COLOR_LIGHTEST);
darker_pixel = DWORD2PIXEL (hdc, darker_dword);
lighter_pixel = DWORD2PIXEL (hdc, lighter_dword);
darker_pixel = DWORD2Pixel (hdc, darker_dword);
lighter_pixel = DWORD2Pixel (hdc, lighter_dword);
if (rect.top < rect.bottom - 2)
{
@@ -1991,7 +1991,7 @@ static int mnuDrawMenuPic (HWND hwnd, HDC hdc, RECT* rect,
if (!pWin->we_rdr)
{
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %x\n", (int)pWin);
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return -1;
}
@@ -2242,7 +2242,7 @@ static void draw_bottom_scroll_button(PTRACKMENUINFO ptmi)
if (!pWin->we_rdr)
{
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %x\n", (int)pWin);
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return;
}
@@ -2283,7 +2283,7 @@ static int mnuShowPopupMenu (PTRACKMENUINFO ptmi)
if (!pWin->we_rdr)
{
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %x\n", (int)pWin);
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return -1;
}
@@ -2331,8 +2331,8 @@ static int mnuShowPopupMenu (PTRACKMENUINFO ptmi)
lighter_dword = pWin->we_rdr->calc_3dbox_color
(bgc_dword, LFRDR_3DBOX_COLOR_LIGHTEST);
darker_pixel = DWORD2PIXEL (HDC_SCREEN_SYS, darker_dword);
lighter_pixel = DWORD2PIXEL (HDC_SCREEN_SYS, lighter_dword);
darker_pixel = DWORD2Pixel (HDC_SCREEN_SYS, darker_dword);
lighter_pixel = DWORD2Pixel (HDC_SCREEN_SYS, lighter_dword);
if ((ptmi->rc.bottom > g_rcScr.bottom)
&& ((ptmi->rc.bottom - ptmi->rc.top) > g_rcScr.bottom)){
@@ -2604,7 +2604,7 @@ static void draw_top_scroll_button(PTRACKMENUINFO ptmi)
if (!pWin->we_rdr)
{
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %x\n", (int)pWin);
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return;
}
@@ -2648,7 +2648,7 @@ static int show_scroll_popup_menu (PTRACKMENUINFO ptmi)
if (!pWin->we_rdr)
{
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %x\n", (int)pWin);
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return -1;
}
@@ -2668,8 +2668,8 @@ static int show_scroll_popup_menu (PTRACKMENUINFO ptmi)
lighter_dword = pWin->we_rdr->calc_3dbox_color
(bgc_dword, LFRDR_3DBOX_COLOR_LIGHTEST);
darker_pixel = DWORD2PIXEL (HDC_SCREEN_SYS, darker_dword);
lighter_pixel = DWORD2PIXEL (HDC_SCREEN_SYS, lighter_dword);
darker_pixel = DWORD2Pixel (HDC_SCREEN_SYS, darker_dword);
lighter_pixel = DWORD2Pixel (HDC_SCREEN_SYS, lighter_dword);
h = get_start_to_end_height(ptmi);
if ( (h + ptmi->top_scroll_rc.bottom) <= ptmi->bottom_scroll_rc.bottom){
@@ -3079,7 +3079,7 @@ static void mnuHiliteMenuItem (PTRACKMENUINFO ptmi, PMENUITEM pmi, BOOL bHilite)
if (!pWin->we_rdr)
{
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %x\n", (int)pWin);
_MG_PRINTF ("GUI>Menu: LFRDR is NULL for window: %p\n", pWin);
return;
}
+19 -17
View File
@@ -52,7 +52,7 @@ static void RecalcScrollInfo (PMAINWIN pWin, BOOL bIsHBar);
/* this message will auto-repeat when MSG_IDLE received */
static MSG sg_repeat_msg = {0, 0, 0, 0};
void GUIAPI SetAutoRepeatMessage (HWND hwnd, int msg,
void GUIAPI SetAutoRepeatMessage (HWND hwnd, UINT msg,
WPARAM wParam, LPARAM lParam)
{
PMAINWIN pWin = (PMAINWIN)hwnd;
@@ -345,7 +345,7 @@ void __mg_reset_mainwin_capture_info (PCONTROL ctrl)
}
}
static int DefaultDTMouseMsgHandler (PMAINWIN pWin, int message,
static LRESULT DefaultDTMouseMsgHandler (PMAINWIN pWin, UINT message,
WPARAM flags, int x, int y)
{
int hc_mainwin = HT_UNKNOWN;
@@ -440,7 +440,7 @@ static int DefaultDTMouseMsgHandler (PMAINWIN pWin, int message,
return 0;
}
static int DefaultMouseMsgHandler (PMAINWIN pWin, int message,
static LRESULT DefaultMouseMsgHandler (PMAINWIN pWin, UINT message,
WPARAM flags, int x, int y)
{
static PMAINWIN __mgs_captured_win = NULL;
@@ -1550,7 +1550,7 @@ static void wndHandleCustomHotspot (PMAINWIN pWin,
}
/* this function is CONTROL safe. */
static int DefaultNCMouseMsgHandler(PMAINWIN pWin, int message,
static LRESULT DefaultNCMouseMsgHandler(PMAINWIN pWin, UINT message,
int location, int x, int y)
{
static int downCode = HT_UNKNOWN;
@@ -1726,7 +1726,7 @@ static int DefaultNCMouseMsgHandler(PMAINWIN pWin, int message,
return 0;
}
static int DefaultKeyMsgHandler (PMAINWIN pWin, int message,
static LRESULT DefaultKeyMsgHandler (PMAINWIN pWin, UINT message,
WPARAM wParam, LPARAM lParam)
{
/*
@@ -1764,7 +1764,7 @@ static int DefaultKeyMsgHandler (PMAINWIN pWin, int message,
return 0;
}
static int DefaultCreateMsgHandler(PMAINWIN pWin, int message,
static LRESULT DefaultCreateMsgHandler(PMAINWIN pWin, UINT message,
WPARAM wParam, LPARAM lParam)
{
@@ -2099,7 +2099,7 @@ void gui_open_ime_window (PMAINWIN pWin, BOOL open_close, HWND rev_hwnd)
#endif
}
static int DefaultPostMsgHandler(PMAINWIN pWin, int message,
static LRESULT DefaultPostMsgHandler(PMAINWIN pWin, UINT message,
WPARAM wParam, LPARAM lParam)
{
switch (message)
@@ -2392,7 +2392,7 @@ static void wndActiveMainWindow (PMAINWIN pWin, BOOL fActive)
release_valid_dc (pWin, hdc);
}
static int DefaultPaintMsgHandler(PMAINWIN pWin, int message,
static LRESULT DefaultPaintMsgHandler(PMAINWIN pWin, UINT message,
WPARAM wParam, LPARAM lParam)
{
switch( message )
@@ -2430,7 +2430,7 @@ static int DefaultPaintMsgHandler(PMAINWIN pWin, int message,
return 0;
}
static int DefaultControlMsgHandler(PMAINWIN pWin, int message,
static LRESULT DefaultControlMsgHandler(PMAINWIN pWin, UINT message,
WPARAM wParam, LPARAM lParam)
{
HDC hdc;
@@ -2543,7 +2543,7 @@ static int DefaultControlMsgHandler(PMAINWIN pWin, int message,
return 0;
}
static int DefaultSessionMsgHandler(PMAINWIN pWin, int message,
static LRESULT DefaultSessionMsgHandler(PMAINWIN pWin, UINT message,
WPARAM wParam, LPARAM lParam)
{
@@ -2558,7 +2558,7 @@ static int DefaultSessionMsgHandler(PMAINWIN pWin, int message,
return 0;
}
static int DefaultSystemMsgHandler(PMAINWIN pWin, int message,
static LRESULT DefaultSystemMsgHandler(PMAINWIN pWin, UINT message,
WPARAM wParam, LPARAM lParam)
{
@@ -2595,7 +2595,7 @@ static int DefaultSystemMsgHandler(PMAINWIN pWin, int message,
** This default main window call-back procedure
** also implemented for control.
*/
int PreDefMainWinProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
LRESULT PreDefMainWinProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PMAINWIN pWin = (PMAINWIN)hWnd;
@@ -2632,7 +2632,7 @@ int PreDefMainWinProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
return 0;
}
int PreDefControlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
LRESULT PreDefControlProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if (message == MSG_SETTEXT)
return 0;
@@ -2651,7 +2651,7 @@ int PreDefControlProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
return DefaultMainWinProc (hWnd, message, wParam, lParam);
}
int DefaultWindowProc (HWND hWnd, int message, WPARAM wParam, LPARAM lParam)
LRESULT DefaultWindowProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if (IsMainWindow(hWnd)) {
return DefaultMainWinProc (hWnd, message, wParam, lParam);
@@ -2735,7 +2735,7 @@ HWND GUIAPI SetActiveWindow (HWND hMainWnd)
if (!MG_IS_NORMAL_WINDOW(hMainWnd) || !IsMainWindow (hMainWnd))
return HWND_INVALID;
return SendMessage (HWND_DESKTOP,
return (HWND)SendMessage (HWND_DESKTOP,
MSG_SETACTIVEMAIN, (WPARAM)hMainWnd, 0);
}
@@ -3494,7 +3494,7 @@ void GUIAPI MainWindowThreadCleanup (HWND hMainWnd)
if (!MG_IS_DESTROYED_WINDOW (hMainWnd)) {
#ifdef _DEBUG
fprintf (stderr, "GUI>Window: Unexpected calling of "
"(MainWindowThreadCleanup); Window (%x) "
"(MainWindowThreadCleanup); Window (%p) "
"not destroyed yet!\n",
hMainWnd);
#endif
@@ -4268,7 +4268,7 @@ HCURSOR GUIAPI SetWindowCursor (HWND hWnd, HCURSOR hNewCursor)
pWin = MG_GET_WINDOW_PTR (hWnd);
if (pWin->WinType == TYPE_MAINWIN)
return SendMessage (HWND_DESKTOP,
return (HCURSOR)SendMessage (HWND_DESKTOP,
MSG_SETWINCURSOR, (WPARAM)hWnd, (LPARAM)hNewCursor);
else if (pWin->WinType == TYPE_CONTROL) {
HCURSOR old = pWin->hCursor;
@@ -5838,9 +5838,11 @@ static RECT4MASK* CalcXYBannedRects (HDC hdc, const void* mask, int * rect_size,
int pitch = bmp->bmAlphaPitch;
sA = bmp->bmAlphaMask[y * pitch + x/bmp->bmBytesPerPixel];
DISEMBLE_RGB (p, bpp, pixfmt, pixel, sR, sG, sB);
sR += sG + sB; /* suspend the warning */
}
else {
DISEMBLE_RGBA (p, bpp, pixfmt, pixel, sR, sG, sB, sA);
sR += sG + sB; /* suspend the warning */
}
}
else {
+4
View File
@@ -99,12 +99,16 @@ static int EVENT_Open (const char *device)
*s++ = *p++;
}
*s = 0;
mknod (guess_device, S_IFCHR | 0x660, makedev (13, 64+id));
#if 0
{
char cmd[1024];
sprintf(cmd, "mknod %s c 13 %d > /dev/null 2>&1", guess_device, 64+id);
fprintf(stderr, "%s\n", cmd);
system(cmd);
}
#endif
break;
}
fclose(fp);
+3 -1
View File
@@ -78,7 +78,9 @@ static int IMPS2_Open (const char* mdev)
return -1;
}
else {
write (mouse_fd, IMPS2_Param, sizeof (IMPS2_Param));
if (write (mouse_fd, IMPS2_Param, sizeof (IMPS2_Param)) < sizeof (IMPS2_Param)) {
return -1;
}
}
return mouse_fd;
+3 -1
View File
@@ -94,7 +94,9 @@ static int PS2_Open(const char* mdev)
return -1;
}
else {
write (mouse_fd, initdata_ps2, sizeof(initdata_ps2));
if (write (mouse_fd, initdata_ps2, sizeof(initdata_ps2)) < sizeof(initdata_ps2)) {
return -1;
}
}
return mouse_fd;
+22 -9
View File
@@ -134,10 +134,12 @@ void VFBSetCaption(const char* caption)
strcpy(ced->buff,caption);
if(__mg_pcxvfb_client_sockfd == -1)
return ;
return;
/*one XVFBCaptionEventData struct costs 8 bytes,
* change that '8' below if the struct is changed*/
mg_writesocket(__mg_pcxvfb_client_sockfd, ced, 8+len);
if (mg_writesocket(__mg_pcxvfb_client_sockfd, ced, 8+len) < (8+len)) {
_MG_PRINTF ("IAL>PCXVFB: error occurred when calling VFBSetCaption.\n");
}
}
void VFBOpenIME(int bOpen)
@@ -148,8 +150,11 @@ void VFBOpenIME(int bOpen)
};
if(__mg_pcxvfb_client_sockfd == -1)
return ;
mg_writesocket(__mg_pcxvfb_client_sockfd, &ime, sizeof(ime));
return;
if (mg_writesocket(__mg_pcxvfb_client_sockfd, &ime, sizeof(ime)) < sizeof(ime)) {
_MG_PRINTF ("IAL>PCXVFB: error occurred when calling VFBOpenIME.\n");
}
}
void VFBShowWindow(int show)
@@ -159,8 +164,11 @@ void VFBShowWindow(int show)
show
};
if(__mg_pcxvfb_client_sockfd == -1)
return ;
mg_writesocket(__mg_pcxvfb_client_sockfd, info, sizeof(info));
return;
if (mg_writesocket(__mg_pcxvfb_client_sockfd, info, sizeof(info)) < sizeof(info)) {
_MG_PRINTF ("IAL>PCXVFB: error occurred when calling VFBShowWindow.\n");
}
}
void VFBAtExit(void (*callback)(void))
@@ -258,7 +266,9 @@ static void write_rec (const void* buf, size_t n)
#ifdef WIN32
/* TODO: */
#else
write(record_fd, buf, n);
if (write(record_fd, buf, n) < n) {
_MG_PRINTF ("IAL>PCXVFB: error occurred when calling write_rec.\n");
}
#endif
}
@@ -333,8 +343,11 @@ static void mouse_setxy (int x, int y)
int mouse_event[3] = {MOUSE_TYPE, x, y};
if(__mg_pcxvfb_client_sockfd == -1)
return ;
mg_writesocket(__mg_pcxvfb_client_sockfd, &mouse_event, sizeof(XVFBEVENT));
return;
if (mg_writesocket (__mg_pcxvfb_client_sockfd, &mouse_event, sizeof(XVFBEVENT)) < sizeof(XVFBEVENT)) {
_MG_PRINTF ("IAL>PCXVFB: error occurred when setting mouse position.\n");
}
}
static int mouse_getbutton (void)
+3 -3
View File
@@ -26,10 +26,10 @@ typedef struct _CTRLCLASSINFO
HCURSOR hCursor; // control cursor
int iBkColor; // control background color.
int (*ControlProc)(HWND, int, WPARAM, LPARAM);
LRESULT (*ControlProc)(HWND, UINT, WPARAM, LPARAM);
// control procedure.
DWORD dwAddData; // the additional data.
DWORD dwAddData; // the additional data.
int nUseCount; // use count.
struct _CTRLCLASSINFO* next;
@@ -85,7 +85,7 @@ typedef struct tagCONTROL
DWORD dwAddData; // the additional data.
DWORD dwAddData2; // the second addtional data.
int (*ControlProc) (HWND, int, WPARAM, LPARAM);
LRESULT (*ControlProc) (HWND, UINT, WPARAM, LPARAM);
PMAINWIN pMainWin; // the main window that contains this control.
+2 -2
View File
@@ -21,8 +21,8 @@ extern "C" {
typedef struct _wnd_element_data
{
list_t list; /* list pointer */
Uint32 id; /* the item type */
Uint32 data; /* the data of the item */
UINT id; /* the item type */
DWORD data; /* the data of the item */
} WND_ELEMENT_DATA;
#define WED_OK 0
+6 -6
View File
@@ -162,7 +162,7 @@ typedef MSGQUEUE* PMSGQUEUE;
typedef struct _SYNCMSG
{
MSG Msg;
int retval;
LRESULT retval;
sem_t* sem_handle;
struct _SYNCMSG* pNext;
}SYNCMSG;
@@ -338,7 +338,7 @@ typedef struct _MAINWIN
DWORD dwAddData; // the additional data.
DWORD dwAddData2; // the second addtional data.
int (*MainWindowProc)(HWND, int, WPARAM, LPARAM);
LRESULT (*MainWindowProc)(HWND, UINT, WPARAM, LPARAM);
// the address of main window procedure.
struct _MAINWIN* pMainWin;
@@ -482,10 +482,10 @@ extern PTRACKMENUINFO __mg_ptmi;
extern PMAINWIN __mg_dsk_win;
extern HWND __mg_hwnd_desktop;
extern int DesktopWinProc (HWND hWnd,
int message, WPARAM wParam, LPARAM lParam);
extern int SendSyncMessage (HWND hWnd, int msg, WPARAM wParam, LPARAM lParam);
extern LRESULT DesktopWinProc (HWND hWnd,
UINT message, WPARAM wParam, LPARAM lParam);
extern LRESULT SendSyncMessage (HWND hWnd,
UINT msg, WPARAM wParam, LPARAM lParam);
#ifndef _MGRM_THREADS
extern unsigned int __mg_csrimgsize;
+16 -16
View File
@@ -229,23 +229,23 @@ HCURSOR GUIAPI CreateCursor (int xhotspot, int yhotspot, int w, int h,
static HCURSOR srvLoadCursorFromFile (const char* filename)
{
FILE* fp;
WORD wTemp;
WORD16 wTemp;
int ret = 0;
int w, h, xhot, yhot, colornum;
DWORD size, offset;
DWORD imagesize, imagew, imageh;
DWORD32 size, offset;
DWORD32 imagesize, imagew, imageh;
BYTE* image;
if( !(fp = fopen(filename, "rb")) ) return 0;
fseek(fp, sizeof(WORD), SEEK_SET);
fseek(fp, sizeof(WORD16), SEEK_SET);
/* the cbType of struct CURSORDIR. */
wTemp = MGUI_ReadLE16FP (fp);
if(wTemp != 2) goto error;
/* skip the cdCount of struct CURSORDIR, we always use the first cursor. */
fseek(fp, sizeof(WORD), SEEK_CUR);
fseek(fp, sizeof(WORD16), SEEK_CUR);
/* cursor info, read the members of struct CURSORDIRENTRY. */
w = fgetc (fp); /* the width of first cursor. */
@@ -261,7 +261,7 @@ static HCURSOR srvLoadCursorFromFile (const char* filename)
/* read the cursor image info. */
fseek(fp, offset, SEEK_SET);
fseek(fp, sizeof(DWORD), SEEK_CUR); /* skip biSize member. */
fseek(fp, sizeof(DWORD32), SEEK_CUR); /* skip biSize member. */
imagew = MGUI_ReadLE32FP (fp);
imageh = MGUI_ReadLE32FP (fp);
/* check the biPlanes member; */
@@ -271,11 +271,11 @@ static HCURSOR srvLoadCursorFromFile (const char* filename)
wTemp = MGUI_ReadLE16FP (fp);
if(wTemp > 4) goto error;
colornum = (int)wTemp;
fseek(fp, sizeof(DWORD), SEEK_CUR); /* skip the biCompression members. */
fseek(fp, sizeof(DWORD32), SEEK_CUR); /* skip the biCompression members. */
imagesize = MGUI_ReadLE32FP (fp);
/* skip the rest members and the color table. */
fseek(fp, sizeof(DWORD)*4 + sizeof(BYTE)*(4<<colornum), SEEK_CUR);
fseek(fp, sizeof(DWORD32)*4 + sizeof(BYTE)*(4<<colornum), SEEK_CUR);
/* allocate memory for image. */
if ((image = (BYTE*)ALLOCATE_LOCAL (imagesize)) == NULL)
@@ -316,18 +316,18 @@ HCURSOR GUIAPI LoadCursorFromFile (const char* filename)
HCURSOR GUIAPI LoadCursorFromMem (const void* area)
{
const Uint8* p = (Uint8*)area;
WORD wTemp;
WORD16 wTemp;
int w, h, xhot, yhot, colornum;
DWORD size, offset;
DWORD imagesize, imagew, imageh;
DWORD32 size, offset;
DWORD32 imagesize, imagew, imageh;
p += sizeof (WORD);
p += sizeof (WORD16);
wTemp = MGUI_ReadLE16Mem (&p);
if(wTemp != 2) goto error;
/* skip the cdCount of struct CURSORDIR, we always use the first cursor. */
p += sizeof (WORD);
p += sizeof (WORD16);
/* cursor info, read the members of struct CURSORDIRENTRY. */
w = *p++; /* the width of first cursor. */
@@ -346,7 +346,7 @@ HCURSOR GUIAPI LoadCursorFromMem (const void* area)
p = (Uint8*)area + offset;
/* skip the biSize member. */
p += sizeof (DWORD);
p += sizeof (DWORD32);
imagew = MGUI_ReadLE32Mem (&p);
imageh = MGUI_ReadLE32Mem (&p);
@@ -360,11 +360,11 @@ HCURSOR GUIAPI LoadCursorFromMem (const void* area)
colornum = wTemp;
/* skip the biCompression members. */
p += sizeof (DWORD);
p += sizeof (DWORD32);
imagesize = MGUI_ReadLE32Mem (&p);
/* skip the rest members and the color table. */
p += sizeof(DWORD)*4 + sizeof(BYTE)*(4<<colornum);
p += sizeof(DWORD32)*4 + sizeof(BYTE)*(4<<colornum);
return CreateCursor (xhot, yhot, w, h,
p + (imagesize - MONOSIZE), p, colornum);
+16 -16
View File
@@ -61,23 +61,23 @@ static PCURSOR pCurCsr = NULL;
HCURSOR GUIAPI LoadCursorFromFile(const char* filename)
{
FILE* fp;
WORD wTemp;
WORD16 wTemp;
int w, h, xhot, yhot, colornum;
DWORD size, offset;
DWORD imagesize, imagew, imageh;
DWORD32 size, offset;
DWORD32 imagesize, imagew, imageh;
BYTE* image;
HCURSOR csr = 0;
if( !(fp = fopen(filename, "rb")) ) return 0;
fseek(fp, sizeof(WORD), SEEK_SET);
fseek(fp, sizeof(WORD16), SEEK_SET);
/* the cbType of struct CURSORDIR. */
wTemp = MGUI_ReadLE16FP (fp);
if(wTemp != 2) goto error;
/* skip the cdCount of struct CURSORDIR, we always use the first cursor. */
fseek(fp, sizeof(WORD), SEEK_CUR);
fseek(fp, sizeof(WORD16), SEEK_CUR);
/* cursor info, read the members of struct CURSORDIRENTRY. */
w = fgetc (fp); /* the width of first cursor. */
@@ -93,7 +93,7 @@ HCURSOR GUIAPI LoadCursorFromFile(const char* filename)
/* read the cursor image info. */
fseek(fp, offset, SEEK_SET);
fseek(fp, sizeof(DWORD), SEEK_CUR); /* skip the biSize member. */
fseek(fp, sizeof(DWORD32), SEEK_CUR); /* skip the biSize member. */
imagew = MGUI_ReadLE32FP (fp);
imageh = MGUI_ReadLE32FP (fp);
/* check the biPlanes member; */
@@ -103,11 +103,11 @@ HCURSOR GUIAPI LoadCursorFromFile(const char* filename)
wTemp = MGUI_ReadLE16FP (fp);
if(wTemp > 4) goto error;
colornum = (int)wTemp;
fseek(fp, sizeof(DWORD), SEEK_CUR); /* skip the biCompression members. */
fseek(fp, sizeof(DWORD32), SEEK_CUR); /* skip the biCompression members. */
imagesize = MGUI_ReadLE32FP (fp);
/* skip the rest members and the color table. */
fseek(fp, sizeof(DWORD)*4 + sizeof(BYTE)*(4<<colornum), SEEK_CUR);
fseek(fp, sizeof(DWORD32)*4 + sizeof(BYTE)*(4<<colornum), SEEK_CUR);
/* allocate memory for image. */
if ((image = (BYTE*)ALLOCATE_LOCAL (imagesize)) == NULL)
@@ -129,18 +129,18 @@ error:
HCURSOR GUIAPI LoadCursorFromMem (const void* area)
{
const Uint8* p = (Uint8*)area;
WORD wTemp;
WORD16 wTemp;
int w, h, xhot, yhot, colornum;
DWORD size, offset;
DWORD imagesize, imagew, imageh;
DWORD32 size, offset;
DWORD32 imagesize, imagew, imageh;
p += sizeof (WORD);
p += sizeof (WORD16);
wTemp = MGUI_ReadLE16Mem (&p);
if(wTemp != 2) goto error;
/* skip the cdCount of struct CURSORDIR, we always use the first cursor. */
p += sizeof (WORD);
p += sizeof (WORD16);
/* cursor info, read the members of struct CURSORDIRENTRY. */
w = *p++; /* the width of first cursor. */
@@ -159,7 +159,7 @@ HCURSOR GUIAPI LoadCursorFromMem (const void* area)
p = (Uint8*)area + offset;
/* skip the biSize member. */
p += sizeof (DWORD);
p += sizeof (DWORD32);
imagew = MGUI_ReadLE32Mem (&p);
imageh = MGUI_ReadLE32Mem (&p);
@@ -173,11 +173,11 @@ HCURSOR GUIAPI LoadCursorFromMem (const void* area)
colornum = wTemp;
/* skip the biCompression members. */
p += sizeof (DWORD);
p += sizeof (DWORD32);
imagesize = MGUI_ReadLE32Mem (&p);
/* skip the rest members and the color table. */
p += sizeof(DWORD)*4 + sizeof(BYTE)*(4<<colornum);
p += sizeof(DWORD32)*4 + sizeof(BYTE)*(4<<colornum);
return CreateCursor (xhot, yhot, w, h,
p + (imagesize - MONOSIZE), p, colornum);

Some files were not shown because too many files have changed in this diff Show More