#include "plugin.h"
#include "item.h"
#include "window.h"
-#include "win32_gui.h"
+#include "graphics_win32.h"
#include "xpm2bmp.h"
#include "support/win32/ConvertUTF.h"
break;
case WM_LBUTTONDOWN:
+ {
dbg(1, "LBUTTONDOWN\n");
HandleButtonClick( gra_priv, 1, 1, lParam);
+ }
break;
case WM_LBUTTONUP:
+ {
dbg(1, "LBUTTONUP\n");
HandleButtonClick( gra_priv, 0, 1, lParam);
+ }
break;
case WM_RBUTTONDOWN:
HandleButtonClick( gra_priv, 1, 3,lParam );
TEXT(""),
#ifdef HAVE_API_WIN32_CE
WS_VISIBLE,
-#elif 0
+#elif 1
WS_CHILD,
#else
WS_OVERLAPPEDWINDOW,
0,
gr->width,
gr->height,
-#if 0
+#if 1
gr->wnd_parent_handle,
#else
NULL,
#endif
-#if 0
+#if 1
(HMENU)ID_CHILD_GFX,
#else
NULL,
static void * get_data(struct graphics_priv *this_, char *type)
{
- if ( strcmp( "wnd_parent_handle_ptr", type ) == 0 ) {
- return &( this_->wnd_parent_handle );
- }
- if ( strcmp( "START_CLIENT", type ) == 0 ) {
- CreateGraphicsWindows( this_ );
- return NULL;
- }
- if (!strcmp(type, "window")) {
+ if ( strcmp( "wnd_parent_handle_ptr", type ) == 0 ) {
+ return &( this_->wnd_parent_handle );
+ }
+ if ( strcmp( "START_CLIENT", type ) == 0 ) {
+ CreateGraphicsWindows( this_ );
+ return NULL;
+ }
+ if (!strcmp(type, "window")) {
#ifdef HAVE_API_WIN32_CE
WNDCLASS wc;
#else
if(!RegisterClassEx(&wc))
#endif
{
- ErrorExit( TEXT("Window Registration Failed!") );
- return NULL;
+ ErrorExit( TEXT("Window Registration Failed!") );
+ return NULL;
}
callback_list_call_attr_2(this_->cbl, attr_resize, (void *)this_->width, (void *)this_->height);
g_hwnd = hwnd = CreateWindow(g_szClassName,
- TEXT(""),
+ TEXT(""),
#ifdef HAVE_API_WIN32_CE
- WS_VISIBLE,
-#elif 0
- WS_CHILD,
+ WS_VISIBLE,
#else
- WS_OVERLAPPEDWINDOW,
+ WS_OVERLAPPEDWINDOW,
#endif
- 0,
- 0,
- this_->width,
- this_->height,
-#if 0
- this_->wnd_parent_handle,
-#else
- NULL,
-#endif
-#if 0
- (HMENU)ID_CHILD_GFX,
-#else
- NULL,
-#endif
- GetModuleHandle(NULL),
- NULL);
+ 0,
+ 0,
+ this_->width,
+ this_->height,
+ this_->wnd_parent_handle,
+ NULL,
+ GetModuleHandle(NULL),
+ NULL);
if(hwnd == NULL)
{
- ErrorExit( TEXT("Window Creation Failed!") );
- return NULL;
+ ErrorExit( TEXT("Window Creation Failed!") );
+ return NULL;
}
this_->wnd_handle = hwnd;
PostMessage( this_->wnd_parent_handle, WM_USER + 1, 0, 0 );
- this_->window.priv=this_;
- return &this_->window;
- }
- return NULL;
+ this_->window.priv=this_;
+ return &this_->window;
+ }
+ return NULL;
}
#define ID_FILE_EXIT 9001
#define ID_STUFF_GO 9002
-#define _(text) gettext(text)
+//#define _(text) gettext(text)
#define POPUP_MENU_OFFSET 4000
#include "config.h"
#include "plugin.h"
#include "gui.h"
-#include "win32_gui.h"
+#include "../../graphics/win32/graphics_win32.h"
#include "point.h"
#include "menu.h"
#include "item.h"
#include "callback.h"
#include <commctrl.h>
#include "debug.h"
+#include "util.h"
+#include "navit.h"
#include "navit_nls.h"
#ifdef __CEGCC__
#include <sipapi.h>
const TCHAR g_szClassName[] = TEXT("navit_gui_class");
-static menu_id = 0;
-static POINT menu_pt;
+static UINT_PTR menu_id = 0;
-
-gboolean message_pump( gpointer data )
+#if 0
+static gboolean message_pump( gpointer data )
{
MSG messages;
return TRUE;
}
-
-
-//extern struct graphics_priv *g_gra;
-
-BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam)
+static BOOL CALLBACK EnumChildProc(HWND hwndChild, LPARAM lParam)
{
LPRECT rcParent;
int idChild;
return TRUE;
}
+#endif
#ifndef GET_WHEEL_DELTA_WPARAM
#define GET_WHEEL_DELTA_WPARAM(wParam) ((short)HIWORD(wParam))
return 0;
}
-HANDLE CreateWin32Window( void )
+static HANDLE CreateWin32Window( void )
{
#ifdef HAVE_API_WIN32_CE
WNDCLASS wc;
wc.hIconSm = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_NAVIT));
#endif
HWND hwnd;
- MSG Msg;
+// MSG Msg;
wc.style = 0;
wc.lpfnWndProc = WndProc;
DestroyMenu( menu->hMenu );
}
-struct menu_priv* win32_gui_popup_new(struct gui_priv *this_, struct menu_methods *meth)
+static struct menu_priv* win32_gui_popup_new(struct gui_priv *this_, struct menu_methods *meth)
{
struct menu_priv* ret = NULL;
this_->nav=nav;
this_->hwnd = CreateWin32Window();
- SetWindowLongPtr( this_->hwnd , DWLP_USER, this_ );
+ SetWindowLongPtr( this_->hwnd , DWLP_USER, (LONG_PTR)this_ );
return this_;
}
+++ /dev/null
-#ifndef WIN32_GUI_INCLUDED
-#define WIN32_GUI_INCLUDED
-
-#include "resources/resource.h"
-#include "coord.h"
-#include "point.h"
-#include "graphics.h"
-
-#define ID_CHILD_GFX 100
-#define ID_CHILD_TOOLBAR (ID_CHILD_GFX + 1)
-#define ID_CHILD_1 (ID_CHILD_TOOLBAR + 1)
-#define ID_CHILD_2 (ID_CHILD_1 + 1)
-#define ID_CHILD_3 (ID_CHILD_2 + 1)
-#define ID_CHILD_4 (ID_CHILD_4 + 1)
-
-#define ID_DISPLAY_ZOOMIN 200
-#define ID_DISPLAY_ZOOMOUT 201
-#define ID_DISPLAY_REFRESH 202
-#define ID_DISPLAY_CURSOR 203
-#define ID_DISPLAY_ORIENT 204
-
-#define ID_FILE_EXIT 9001
-#define ID_STUFF_GO 9002
-
-#define _(text) gettext(text)
-
-#define POPUP_MENU_OFFSET 4000
-
-struct statusbar_methods;
-struct menu_methods;
-struct datawindow_methods;
-struct navit;
-struct callback;
-
-
-struct menu_priv {
- HWND wnd_handle;
- HMENU hMenu;
- struct callback* cb;
-};
-
-struct gui_priv {
- struct navit *nav;
- HANDLE hwnd;
-};
-
-
-struct graphics_priv {
- struct point p;
- int width;
- int height;
- int library_init;
- int visible;
- HANDLE wnd_parent_handle;
- HANDLE wnd_handle;
- COLORREF bg_color;
-
-
- void (*resize_callback)(void *data, int w, int h);
- void *resize_callback_data;
- void (*motion_callback)(void *data, struct point *p);
- void *motion_callback_data;
- void (*button_callback)(void *data, int press, int button, struct point *p);
- void *button_callback_data;
- enum draw_mode_num mode;
-};
-
-struct menu_priv *gui_gtk_menubar_new(struct gui_priv *gui, struct menu_methods *meth);
-struct menu_priv *gui_gtk_toolbar_new(struct gui_priv *gui, struct menu_methods *meth);
-struct statusbar_priv *gui_gtk_statusbar_new(struct gui_priv *gui, struct statusbar_methods *meth);
-struct menu_priv *gui_gtk_popup_new(struct gui_priv *gui, struct menu_methods *meth);
-struct datawindow_priv *gui_gtk_datawindow_new(struct gui_priv *gui, char *name, struct callback *click, struct callback *close, struct datawindow_methods *meth);
-
-struct graphics_priv* win32_graphics_new( struct graphics_methods *meth, struct attr **attrs);
-
-#endif
GList * g_hash_to_list(GHashTable *h);
GList * g_hash_to_list_keys(GHashTable *h);
gchar * g_strconcat_printf(gchar *buffer, gchar *fmt, ...);
+#if defined(_WIN32) || defined(__CEGCC__) || defined (__APPLE__)
+#if defined(_UNICODE)
+wchar_t* newSysString(const char *toconvert);
+#else
+char * newSysString(const char *toconvert);
+#endif
+#endif
unsigned int iso8601_to_secs(char *iso8601);
#endif