diff options
author | jandegr <jandegr@users.noreply.github.com> | 2018-05-02 10:02:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-02 10:02:46 +0200 |
commit | de4680665398c523dfaa0879c18b0f6e39264d57 (patch) | |
tree | 5769f2076e6e041c07ad7fd6fa052ae0b8e5b914 /navit/gui/win32 | |
parent | 53315091a2aa5a4469a743f29516cc1ae78b6b14 (diff) | |
parent | a9f61c26e31eca52b1bf1a444f6283bb26bc2391 (diff) | |
download | navit-Android_gradle.tar.gz |
Merge branch 'trunk' into Android_gradleAndroid_gradle
Diffstat (limited to 'navit/gui/win32')
-rw-r--r-- | navit/gui/win32/ceglue.c | 154 | ||||
-rw-r--r-- | navit/gui/win32/ceglue.h | 32 | ||||
-rw-r--r-- | navit/gui/win32/gui_win32.c | 6 | ||||
-rw-r--r-- | navit/gui/win32/win32_gui_destination.c | 6 |
4 files changed, 99 insertions, 99 deletions
diff --git a/navit/gui/win32/ceglue.c b/navit/gui/win32/ceglue.c index a0817f935..772eb782d 100644 --- a/navit/gui/win32/ceglue.c +++ b/navit/gui/win32/ceglue.c @@ -1,77 +1,77 @@ -#include <windows.h>
-#include "ceglue.h"
-
-BOOL FAR (*SHFullScreenPtr)(HWND hwnd, DWORD state) = NULL;
-
-void InitCeGlue (void)
-{
- HINSTANCE ayg = LoadLibraryW (TEXT ("aygshell.dll"));
- if (ayg != NULL) {
- SHFullScreenPtr = (BOOL (*)(HWND, DWORD))
- GetProcAddressW (ayg, TEXT ("SHFullScreen"));
- }
-}
-
-// code to turn of screen adopted from
-// http://msdn.microsoft.com/en-us/library/ms838354.aspx
-
-// GDI Escapes for ExtEscape()
-#define QUERYESCSUPPORT 8
-
-// The following are unique to CE
-#define GETVFRAMEPHYSICAL 6144
-#define GETVFRAMELEN 6145
-#define DBGDRIVERSTAT 6146
-#define SETPOWERMANAGEMENT 6147
-#define GETPOWERMANAGEMENT 6148
-
-
-typedef enum _VIDEO_POWER_STATE {
- VideoPowerOn = 1,
- VideoPowerStandBy,
- VideoPowerSuspend,
- VideoPowerOff
-} VIDEO_POWER_STATE, *PVIDEO_POWER_STATE;
-
-
-typedef struct _VIDEO_POWER_MANAGEMENT {
- ULONG Length;
- ULONG DPMSVersion;
- ULONG PowerState;
-} VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT;
-
-
-int CeEnableBacklight(int enable)
-{
- HDC gdc;
- int iESC=SETPOWERMANAGEMENT;
-
- gdc = GetDC(NULL);
- if (ExtEscape(gdc, QUERYESCSUPPORT, sizeof(int), (LPCSTR)&iESC,
- 0, NULL)==0)
- {
- MessageBox(NULL,
- L"Sorry, your Pocket PC does not support DisplayOff",
- L"Pocket PC Display Off Feature",
- MB_OK);
- ReleaseDC(NULL, gdc);
- return FALSE;
- }
- else
- {
- VIDEO_POWER_MANAGEMENT vpm;
- vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT);
- vpm.DPMSVersion = 0x0001;
- if (enable) {
- vpm.PowerState = VideoPowerOn;
- } else {
- vpm.PowerState = VideoPowerOff;
- }
- // Power off the display
- ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm,
- 0, NULL);
- ReleaseDC(NULL, gdc);
- return TRUE;
- }
-}
-
+#include <windows.h> +#include "ceglue.h" + +BOOL FAR (*SHFullScreenPtr)(HWND hwnd, DWORD state) = NULL; + +void InitCeGlue (void) +{ + HINSTANCE ayg = LoadLibraryW (TEXT ("aygshell.dll")); + if (ayg != NULL) { + SHFullScreenPtr = (BOOL (*)(HWND, DWORD)) + GetProcAddressW (ayg, TEXT ("SHFullScreen")); + } +} + +// code to turn of screen adopted from +// http://msdn.microsoft.com/en-us/library/ms838354.aspx + +// GDI Escapes for ExtEscape() +#define QUERYESCSUPPORT 8 + +// The following are unique to CE +#define GETVFRAMEPHYSICAL 6144 +#define GETVFRAMELEN 6145 +#define DBGDRIVERSTAT 6146 +#define SETPOWERMANAGEMENT 6147 +#define GETPOWERMANAGEMENT 6148 + + +typedef enum _VIDEO_POWER_STATE { + VideoPowerOn = 1, + VideoPowerStandBy, + VideoPowerSuspend, + VideoPowerOff +} VIDEO_POWER_STATE, *PVIDEO_POWER_STATE; + + +typedef struct _VIDEO_POWER_MANAGEMENT { + ULONG Length; + ULONG DPMSVersion; + ULONG PowerState; +} VIDEO_POWER_MANAGEMENT, *PVIDEO_POWER_MANAGEMENT; + + +int CeEnableBacklight(int enable) +{ + HDC gdc; + int iESC=SETPOWERMANAGEMENT; + + gdc = GetDC(NULL); + if (ExtEscape(gdc, QUERYESCSUPPORT, sizeof(int), (LPCSTR)&iESC, + 0, NULL)==0) + { + MessageBox(NULL, + L"Sorry, your Pocket PC does not support DisplayOff", + L"Pocket PC Display Off Feature", + MB_OK); + ReleaseDC(NULL, gdc); + return FALSE; + } + else + { + VIDEO_POWER_MANAGEMENT vpm; + vpm.Length = sizeof(VIDEO_POWER_MANAGEMENT); + vpm.DPMSVersion = 0x0001; + if (enable) { + vpm.PowerState = VideoPowerOn; + } else { + vpm.PowerState = VideoPowerOff; + } + // Power off the display + ExtEscape(gdc, SETPOWERMANAGEMENT, vpm.Length, (LPCSTR) &vpm, + 0, NULL); + ReleaseDC(NULL, gdc); + return TRUE; + } +} + diff --git a/navit/gui/win32/ceglue.h b/navit/gui/win32/ceglue.h index b0dc79d42..bb185dbed 100644 --- a/navit/gui/win32/ceglue.h +++ b/navit/gui/win32/ceglue.h @@ -1,16 +1,16 @@ -#ifndef CEGLUE_H
-#define CEGLUE_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-extern BOOL (*SHFullScreenPtr)(HWND hwnd, DWORD state);
-void InitCeGlue (void);
-
-int CeEnableBacklight(int enable);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+#ifndef CEGLUE_H +#define CEGLUE_H +#ifdef __cplusplus +extern "C" { +#endif + +extern BOOL (*SHFullScreenPtr)(HWND hwnd, DWORD state); +void InitCeGlue (void); + +int CeEnableBacklight(int enable); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/navit/gui/win32/gui_win32.c b/navit/gui/win32/gui_win32.c index 8a8cb37b9..7c964dbb9 100644 --- a/navit/gui/win32/gui_win32.c +++ b/navit/gui/win32/gui_win32.c @@ -185,7 +185,7 @@ static void window_layout( HWND hwnd ) rcClient.top += iToolHeight; - dbg(lvl_debug, "resize gui to: %d %d %d %d \n", rcClient.left, rcClient.right, rcClient.top, rcClient.bottom ); + dbg(lvl_debug, "resize gui to: %d %d %d %d ", rcClient.left, rcClient.right, rcClient.top, rcClient.bottom ); hChild = GetDlgItem(hwnd, ID_CHILD_GFX); @@ -285,7 +285,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l attr.type=attr_cursor; // TODO attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); if(!navit_set_attr(gui->nav, &attr)) { - dbg(lvl_error, "Failed to set attr_cursor\n"); + dbg(lvl_error, "Failed to set attr_cursor"); } return 0; } @@ -298,7 +298,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM l // attr.u.num=gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(w)); attr.u.num = 0; // TODO if(!navit_set_attr(gui->nav, &attr)) { - dbg(lvl_error, "Failed to set attr_orientation\n"); + dbg(lvl_error, "Failed to set attr_orientation"); } return 0; } diff --git a/navit/gui/win32/win32_gui_destination.c b/navit/gui/win32/win32_gui_destination.c index 115b9058b..e4a08072f 100644 --- a/navit/gui/win32/win32_gui_destination.c +++ b/navit/gui/win32/win32_gui_destination.c @@ -212,7 +212,7 @@ static void notify_textchange(struct datawindow_priv *datawindow, int param1, in (void)ListView_InsertItem(datawindow->hwndList, &lvI); ListView_SetItemText(datawindow->hwndList, listIndex, 1, tcharBuffer); g_free(tcharBuffer); - dbg(lvl_debug,"%s\n", res->country->name); + dbg(lvl_debug,"%s", res->country->name); listIndex++; } } @@ -307,7 +307,7 @@ BOOL register_destination_window() if (!RegisterClass(&wc)) { - dbg(lvl_error, "Window Registration Failed!\n"); + dbg(lvl_error, "Window Registration Failed!"); return FALSE; } return TRUE; @@ -339,7 +339,7 @@ HANDLE create_destination_window( struct navit *nav ) if (this_->hwnd == NULL) { - dbg(lvl_error, "Window Creation Failed!\n"); + dbg(lvl_error, "Window Creation Failed!"); return 0; } |