diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-04-16 23:28:45 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2011-11-02 14:05:34 +0000 |
commit | ee1985386700288af1a8b1789dcad0d7d9c97393 (patch) | |
tree | 7ffa577f44318d94af77b9fef5975fde045e11c7 | |
parent | e2e6fab1efa6895256ac0ed4d5b054a88ad18077 (diff) |
hw/xwin: Link directly to TrackMouseEvent()
TrackMouseEvent has existed in user32 since at least NT4, so
don't bother with jumping through all the ancient compatibility hoops
of finding if _TrackMouseEvent() exists in comctl32 so it can check
if TrackMouseEvent() exists in user32 to see if it needs to emulate
it...
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
-rw-r--r-- | hw/xwin/InitOutput.c | 35 | ||||
-rw-r--r-- | hw/xwin/win.h | 1 | ||||
-rw-r--r-- | hw/xwin/winglobals.c | 7 | ||||
-rw-r--r-- | hw/xwin/winmultiwindowwndproc.c | 4 | ||||
-rw-r--r-- | hw/xwin/winwin32rootlesswndproc.c | 4 | ||||
-rw-r--r-- | hw/xwin/winwndproc.c | 4 |
6 files changed, 6 insertions, 49 deletions
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c index 4fe5053b3..67961b721 100644 --- a/hw/xwin/InitOutput.c +++ b/hw/xwin/InitOutput.c @@ -70,12 +70,6 @@ extern HWND g_hwndClipboard; extern Bool g_fClipboard; #endif - -/* - module handle for dynamically loaded comctl32 library -*/ -static HMODULE g_hmodCommonControls = NULL; - /* * Function prototypes */ @@ -235,14 +229,6 @@ ddxGiveUp (enum ExitCode error) * we are guaranteed to not need the DirectDraw functions. */ winReleaseDDProcAddresses(); - - /* Unload our TrackMouseEvent function pointer */ - if (g_hmodCommonControls != NULL) - { - FreeLibrary (g_hmodCommonControls); - g_hmodCommonControls = NULL; - g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; - } /* Free concatenated command line */ free(g_pszCommandLine); @@ -979,27 +965,6 @@ InitOutput (ScreenInfo *screenInfo, int argc, char *argv[]) /* Detect supported engines */ winDetectSupportedEngines (); - /* Load common controls library */ - g_hmodCommonControls = LoadLibraryEx ("comctl32.dll", NULL, 0); - - /* Load TrackMouseEvent function pointer */ - g_fpTrackMouseEvent = GetProcAddress (g_hmodCommonControls, - "_TrackMouseEvent"); - if (g_fpTrackMouseEvent == NULL) - { - winErrorFVerb (1, "InitOutput - Could not get pointer to function\n" - "\t_TrackMouseEvent in comctl32.dll. Try installing\n" - "\tInternet Explorer 3.0 or greater if you have not\n" - "\talready.\n"); - - /* Free the library since we won't need it */ - FreeLibrary (g_hmodCommonControls); - g_hmodCommonControls = NULL; - - /* Set function pointer to point to no operation function */ - g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; - } - /* Store the instance handle */ g_hInstance = GetModuleHandle (NULL); diff --git a/hw/xwin/win.h b/hw/xwin/win.h index 445bcab48..e2e946fb5 100644 --- a/hw/xwin/win.h +++ b/hw/xwin/win.h @@ -673,7 +673,6 @@ extern DeviceIntPtr g_pwinKeyboard; extern FARPROC g_fpDirectDrawCreate; extern FARPROC g_fpDirectDrawCreateClipper; -extern FARPROC g_fpTrackMouseEvent; /* diff --git a/hw/xwin/winglobals.c b/hw/xwin/winglobals.c index 2909f371b..631f12e21 100644 --- a/hw/xwin/winglobals.c +++ b/hw/xwin/winglobals.c @@ -78,13 +78,6 @@ Bool g_fSoftwareCursor = FALSE; Bool g_fSilentDupError = FALSE; Bool g_fNativeGl = FALSE; -/* - * Global variables for dynamically loaded libraries and - * their function pointers - */ - -FARPROC g_fpTrackMouseEvent = (FARPROC) (void (*)(void))NoopDDA; - #ifdef XWIN_CLIPBOARD /* diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c index fb1938b3a..3d23e9746 100644 --- a/hw/xwin/winmultiwindowwndproc.c +++ b/hw/xwin/winmultiwindowwndproc.c @@ -549,8 +549,8 @@ winTopLevelWindowProc (HWND hwnd, UINT message, tme.hwndTrack = hwnd; /* Call the tracking function */ - if (!(*g_fpTrackMouseEvent) (&tme)) - ErrorF ("winTopLevelWindowProc - _TrackMouseEvent failed\n"); + if (!TrackMouseEvent(&tme)) + ErrorF ("winTopLevelWindowProc - TrackMouseEvent failed\n"); /* Flag that we are tracking now */ s_fTracking = TRUE; diff --git a/hw/xwin/winwin32rootlesswndproc.c b/hw/xwin/winwin32rootlesswndproc.c index 21506df15..c60a76cba 100644 --- a/hw/xwin/winwin32rootlesswndproc.c +++ b/hw/xwin/winwin32rootlesswndproc.c @@ -547,8 +547,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message, tme.hwndTrack = hwnd; /* Call the tracking function */ - if (!(*g_fpTrackMouseEvent) (&tme)) - ErrorF ("winMWExtWMWindowProc - _TrackMouseEvent failed\n"); + if (!TrackMouseEvent(&tme)) + ErrorF ("winMWExtWMWindowProc - TrackMouseEvent failed\n"); /* Flag that we are tracking now */ s_fTracking = TRUE; diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c index bccd6f9f2..a89857a14 100644 --- a/hw/xwin/winwndproc.c +++ b/hw/xwin/winwndproc.c @@ -776,8 +776,8 @@ winWindowProc (HWND hwnd, UINT message, tme.hwndTrack = hwnd; /* Call the tracking function */ - if (!(*g_fpTrackMouseEvent) (&tme)) - ErrorF ("winWindowProc - _TrackMouseEvent failed\n"); + if (!TrackMouseEvent(&tme)) + ErrorF ("winWindowProc - TrackMouseEvent failed\n"); /* Flag that we are tracking now */ s_fTracking = TRUE; |