/***************************************************************************
 *            wince_port.h
 *
 *  Thu Jul 19 19:00:10 2007
 *  Copyright  2007  Steffen Pohle
 *  steffen@gulpe.de
 ****************************************************************************/

/*
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */
 
 
#ifndef _WINCE_PORT_H_
#define _WINCE_PORT_H_

#define WINTIMER_CYCLICLOOP 1
#define MENU_HEIGHT 26

#include <windows.h>
#include <commctrl.h>
#include <winbase.h>
#if defined(__MINGW32CE__) || defined(_WIN32_WCE)
	#include <aygshell.h>
#endif

#include "wince_ressource.h"
#include "osmroute.h"
#include "map.h"
#include "gps.h"

/*****************************************************************************
 * gfx stuff... 
 */

struct color {
	unsigned short int r;
	unsigned short int g;
	unsigned short int b;
	int alloc;
	COLORREF col;
	HBRUSH brush;
	HPEN pen;
};


struct image {
	HBITMAP bitmap;
	HDC hdc;
	int width;
	int height;
};

#include "draw.h"


extern HINSTANCE	hi;
extern HWND		hMainWnd;
extern int draw_wm_paint;
extern iPoint draw_screensize;

extern int wchar2char (char *c, int clen, WCHAR *wc);
extern int char2wchar (WCHAR *wc, int wclen, char *c);
extern int wchar2oem (char *c, int clen, WCHAR *wc);

extern void GetDlgItemText_wa (HWND hwnd, int id, char *str, int cnt);
extern void SetDlgItemText_wa (HWND hwnd, int id, char *str);
extern void SendMessage_SetText_wa (HWND hwnd, UINT msg, WPARAM wParam, LPARAM str);
extern void SendMessage_GetText_wa (HWND hwnd, UINT msg, WPARAM wParam, LPARAM str, int cnt);

#if defined(__MINGW32CE__) || defined(_WIN32_WCE)
extern char *wince_get_path (HWND hWnd, WCHAR *filter, int selectpath);
extern char *wince_get_pathsave (HWND hWnd, WCHAR *filter, int selectpath);
#else
extern char *wince_get_path (HWND hWnd, char *filter, int selectpath);
extern char *wince_get_pathsave (HWND hWnd, char *filter, int selectpath);
#endif
// extern char *dialog_getfilename (char *caption, char *filter, int save);
extern char *textedit_dialog (char *cpation, char *label, char *data);
extern void wince_message_loop ();
extern char *select_dir_dialog (char *caption, char *data);

extern void wince_taskbar(HWND hWnd, int show);


/******************************************+
 * gps part
 */
extern int gps_serial_comport;
extern int gps_serial_baudrate;
extern char gps_wince_device[GPS_DEVICELEN];
extern int gps_serial_baudratearray[];
extern char gps_serial_device[LEN_FILENAME];
extern void gps_serial_settings_read_device ();
extern void gps_wince_settings ();
#endif



