You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(92) |
Dec
(141) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(126) |
Feb
(72) |
Mar
(31) |
Apr
(200) |
May
(81) |
Jun
(130) |
Jul
(112) |
Aug
(134) |
Sep
(76) |
Oct
(89) |
Nov
(153) |
Dec
(9) |
2007 |
Jan
(59) |
Feb
(82) |
Mar
(50) |
Apr
(20) |
May
(9) |
Jun
(81) |
Jul
(41) |
Aug
(109) |
Sep
(91) |
Oct
(87) |
Nov
(33) |
Dec
(60) |
2008 |
Jan
(21) |
Feb
(15) |
Mar
(38) |
Apr
(75) |
May
(59) |
Jun
(46) |
Jul
(30) |
Aug
(20) |
Sep
(35) |
Oct
(32) |
Nov
(34) |
Dec
(19) |
2009 |
Jan
(29) |
Feb
(71) |
Mar
(54) |
Apr
(17) |
May
(4) |
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
(58) |
Sep
(7) |
Oct
(7) |
Nov
(12) |
Dec
(18) |
2011 |
Jan
(17) |
Feb
(29) |
Mar
(11) |
Apr
(5) |
May
(1) |
Jun
|
Jul
|
Aug
(11) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(87) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(44) |
Jun
(79) |
Jul
(16) |
Aug
(31) |
Sep
|
Oct
(51) |
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Danny B. <dan...@us...> - 2010-08-16 05:04:17
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv18761 Modified Files: roadmap_screen.c Log Message: Add roadmap_screen_shutdown() and some comments. Index: roadmap_screen.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_screen.c,v retrieving revision 1.136 retrieving revision 1.137 diff -C2 -d -r1.136 -r1.137 *** roadmap_screen.c 29 Mar 2009 12:08:57 -0000 1.136 --- roadmap_screen.c 16 Aug 2010 05:04:08 -0000 1.137 *************** *** 3,6 **** --- 3,7 ---- * * Copyright 2002 Pascal F. Martin + * Copyright 2010 Danny Backx * * This file is part of RoadMap. *************** *** 183,187 **** static RoadMapPen RoadMapPenEdges = NULL; ! static void roadmap_screen_setfont(void) { --- 184,190 ---- static RoadMapPen RoadMapPenEdges = NULL; ! /** ! * @brief ! */ static void roadmap_screen_setfont(void) { *************** *** 212,215 **** --- 215,221 ---- } + /** + * @brief + */ static void roadmap_screen_start_progress () { *************** *** 228,231 **** --- 234,241 ---- } + /** + * @brief + * @param newcursor + */ void roadmap_screen_set_cursor (RoadMapCursor newcursor) { static RoadMapCursor lastcursor; *************** *** 251,255 **** } ! int roadmap_screen_busy_check(int total, int completed) { --- 261,270 ---- } ! /** ! * @brief ! * @param total ! * @param completed ! * @return ! */ int roadmap_screen_busy_check(int total, int completed) { *************** *** 287,290 **** --- 302,310 ---- } + /** + * @brief + * @param pb + * @param size + */ static void roadmap_screen_pb_init (struct roadmap_screen_point_buffer *pb, int size) { *************** *** 306,310 **** } ! static void roadmap_screen_flush_points (void) { --- 326,332 ---- } ! /** ! * @brief ! */ static void roadmap_screen_flush_points (void) { *************** *** 320,324 **** } ! static void roadmap_screen_flush_lines (void) { --- 342,348 ---- } ! /** ! * @brief ! */ static void roadmap_screen_flush_lines (void) { *************** *** 593,596 **** --- 617,623 ---- } + /** + * @brief + */ static int roadmap_screen_flush_polygons (void) { *************** *** 613,617 **** } ! static int roadmap_screen_draw_polygons (void) { --- 640,646 ---- } ! /** ! * @brief ! */ static int roadmap_screen_draw_polygons (void) { *************** *** 652,655 **** --- 681,685 ---- polycount = roadmap_polygon_count(); + roadmap_log(ROADMAP_DEBUG, "roadmap_screen_draw_polygons : %d polygons", polycount); if (polycount == 0) return 0; *************** *** 855,859 **** } ! static void roadmap_screen_draw_square_edges (int square) { --- 885,891 ---- } ! /** ! * @brief ! */ static void roadmap_screen_draw_square_edges (int square) { *************** *** 995,999 **** int drawn = 0; - roadmap_log_push ("roadmap_screen_draw_square"); --- 1027,1030 ---- *************** *** 1400,1403 **** --- 1431,1437 ---- } + /** + * @brief + */ void roadmap_screen_repaint (void) { *************** *** 1878,1881 **** --- 1912,1916 ---- roadmap_log_push ("roadmap_screen_refresh"); + roadmap_log(ROADMAP_DEBUG, "roadmap_screen_refresh"); if (roadmap_trip_is_focus_changed()) { *************** *** 2150,2153 **** --- 2185,2198 ---- } + /** + * @brief initialize + * @param id + * @param text + * @param size + * @param width + * @param ascent + * @param descent + * @param can_tilt + */ void roadmap_screen_text_extents (int id, const char *text, int size, *************** *** 2162,2169 **** --- 2207,2220 ---- } + /** + * @brief initialize + */ void roadmap_screen_state_refresh(void) { roadmap_start_request_repaint_map(REPAINT_MAYBE); } + /** + * @brief initialize + */ void roadmap_screen_initialize (void) { *************** *** 2243,2247 **** --- 2294,2343 ---- } + /** + * @brief cleanup + */ + void roadmap_screen_shutdown (void) + { + RoadMapScreenInitialized = 0; + RoadMapScreenFrozen = 0; + RoadMapScreenDragging = 0; + + RoadMapScreenViewMode = VIEW_MODE_2D; + RoadMapScreenOrientationDynamic = 1; + RoadMapScreen3dHorizon = 0; + RoadMapScreenLabels = 0; + RoadMapScreenRotation = 0; + RoadMapScreenWidth = 0; + RoadMapScreenHeight = 0; + + RoadMapLineFontSelect = 0; + RoadMapScreenDeltaX = 0; + RoadMapScreenDeltaY = 0; + + SquareOnScreen = NULL; + SquareOnScreenCount = 0; + + RoadMapScreenLastPen = NULL; + + RoadMapScreenBusyStart = 0; + RoadMapScreenBusyDelay = 0; + RoadMapScreenProgressStart = 0; + RoadMapScreenProgressDelay = 0; + RoadmapScreenProgressBar = 0; + + RoadMapScreenChordingEvent = 0; + // static RoadMapGuiPoint RoadMapScreenChordingAnchors[MAX_CHORDING_POINTS]; + + // LinePoints = NULL; + // Points = NULL; + + RoadMapBackground = NULL; + RoadMapPenEdges = NULL; + } + + /** + * @brief + */ void roadmap_screen_set_initial_position (void) { |
From: Danny B. <dan...@us...> - 2010-08-16 04:56:27
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv17704 Modified Files: roadmap_log.c Log Message: Add calls to Android specific logging. Index: roadmap_log.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_log.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** roadmap_log.c 7 Oct 2008 01:12:47 -0000 1.25 --- roadmap_log.c 16 Aug 2010 04:56:18 -0000 1.26 *************** *** 1,7 **** ! /* roadmap_log.c - a module for managing uniform error & info messages. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright 2010 Danny Backx * * This file is part of RoadMap. *************** *** 20,29 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * SYNOPSYS: ! * ! * #include "roadmap.h" ! * ! * void roadmap_log (int level, char *format, ...); * * This module is used to control and manage the appearance of messages --- 20,27 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! /** ! * @file ! * @brief roadmap_log.c - a module for managing uniform error & info messages. * * This module is used to control and manage the appearance of messages *************** *** 43,47 **** #include "roadmap_file.h" - #define ROADMAP_LOG_STACK_SIZE 256 --- 41,44 ---- *************** *** 149,152 **** --- 146,153 ---- vfprintf(file, format, ap); fprintf (file, "\n"); + #ifdef ANDROID + if (saved != ' ') + __android_log_vprint (ANDROID_LOG_ERROR, "RoadMap", format, ap); + #endif if (category->show_stack && RoadMapLogStackCursor > 0) { *************** *** 154,161 **** --- 155,171 ---- int indent = 8; + #ifndef ANDROID fprintf (file, " Call stack:\n"); + #else + __android_log_print (ANDROID_LOG_ERROR, "RoadMap", " Call stack:\n"); + #endif for (i = 0; i < RoadMapLogStackCursor; ++i) { + #ifndef ANDROID fprintf (file, "%*.*s %s\n", indent, indent, "", RoadMapLogStack[i]); + #else + __android_log_print (ANDROID_LOG_ERROR, "RoadMap", + "%*.*s %s\n", indent, indent, "", RoadMapLogStack[i]); + #endif indent += 3; } |
From: Danny B. <dan...@us...> - 2010-08-15 19:14:23
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv14911 Modified Files: roadmap.h Log Message: Add an include file for the logging API when on Android. Index: roadmap.h =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** roadmap.h 7 Aug 2008 04:09:11 -0000 1.27 --- roadmap.h 15 Aug 2010 19:14:15 -0000 1.28 *************** *** 1,7 **** ! /* roadmap.h - general definitions use by the RoadMap program. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright 2010 Danny Backx * * This file is part of RoadMap. *************** *** 22,25 **** --- 22,30 ---- */ + /** + * @file + * @brief roadmap.h - general definitions use by the RoadMap program. + */ + #ifndef INCLUDE__ROADMAP__H #define INCLUDE__ROADMAP__H *************** *** 29,32 **** --- 34,40 ---- #include "win32/roadmap_win32.h" #endif + #ifdef ANDROID + #include <android/log.h> + #endif |
From: Danny B. <dan...@us...> - 2010-08-15 19:13:09
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv14796 Modified Files: options.mk Log Message: Build support for Android. Index: options.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/options.mk,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** options.mk 9 Feb 2009 19:39:17 -0000 1.31 --- options.mk 15 Aug 2010 19:13:01 -0000 1.32 *************** *** 97,100 **** --- 97,103 ---- RDMODULES=iphone else + ifeq ($(DESKTOP),ANDROID) + RDMODULES=android + else RDMODULES=$(ALL_RDMODULES) endif *************** *** 107,110 **** --- 110,114 ---- endif endif + endif ifeq ($(DESKTOP),WINCE) *************** *** 256,262 **** LIBS := $(LIBS) -lm else ! CFLAGS += -I$(TOP) -I/usr/local/include \ ! -D_TXT=\"\" -D_EXE=\"\" ! LIBS := -L/usr/local/lib $(LIBS) -lm endif --- 260,272 ---- LIBS := $(LIBS) -lm else ! ifeq ($(DESKTOP),ANDROID) ! CFLAGS += -I$(TOP) -I/opt/android/include \ ! -D_TXT=\"\" -D_EXE=\"\" ! LIBS := -L/opt/android/lib $(LIBS) -lm ! else ! CFLAGS += -I$(TOP) -I/usr/local/include \ ! -D_TXT=\"\" -D_EXE=\"\" ! LIBS := -L/usr/local/lib $(LIBS) -lm ! endif endif |
From: Danny B. <dan...@us...> - 2010-08-15 19:11:46
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv14628 Modified Files: Makefile Log Message: Android changes, and a (harmless I hope) stub for an upcoming plugin. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/Makefile,v retrieving revision 1.142 retrieving revision 1.143 diff -C2 -d -r1.142 -r1.143 *** Makefile 11 Jul 2010 16:46:16 -0000 1.142 --- Makefile 15 Aug 2010 19:11:38 -0000 1.143 *************** *** 94,98 **** roadmap_copy.c \ roadmap_httpcopy.c \ ! $(EDITOR_PLUGINSRC) $(TRIP_PLUGINSRC) $(NAVIGATE_PLUGINSRC) RMPLUGINOBJS=$(RMPLUGINSRC:.c=.o) --- 94,101 ---- roadmap_copy.c \ roadmap_httpcopy.c \ ! $(EDITOR_PLUGINSRC) \ ! $(TRIP_PLUGINSRC) \ ! $(NAVIGATE_PLUGINSRC) \ ! $(POI_PLUGINSRC) RMPLUGINOBJS=$(RMPLUGINSRC:.c=.o) *************** *** 344,361 **** MANUAL = usermanual.html # more products ifeq ($(DESKTOP),WINCE) BUILD = # buildus else BUILD = buildmap buildmap_osm buildus buildplace dumpmap - # rdmindex -- removed from default build. it's unfinished s/w, and - # its presence is confusing. - endif - - RUNTIME = $(RDMLIBS) libguiroadmap.a - ifneq ($(DESKTOP),WINCE) RUNTIME += libguiroadgps.a DRIVERS = rdmkismet rdmghost rdmfriends rdmtrace rdmxchange TOOLS = sunrise endif --- 347,366 ---- MANUAL = usermanual.html + RUNTIME = $(RDMLIBS) libguiroadmap.a + # more products ifeq ($(DESKTOP),WINCE) BUILD = # buildus else + ifeq ($(DESKTOP),ANDROID) + BUILD = # buildus + else BUILD = buildmap buildmap_osm buildus buildplace dumpmap RUNTIME += libguiroadgps.a DRIVERS = rdmkismet rdmghost rdmfriends rdmtrace rdmxchange TOOLS = sunrise + # rdmindex -- removed from default build. it's unfinished s/w, and + # its presence is confusing. + endif endif *************** *** 401,404 **** --- 406,426 ---- endif + # --- Additions for POI plugin ------------------------------- + + ifeq ($(USE_POI_PLUGIN),yes) + POI_PLUGINSRC = \ + poi/poi_plugin.c \ + poi/poi.c + + POC_PLUGIN_HDR = \ + poi/poi.h \ + poi/poi_plugin.h + + CFLAGS += -DHAVE_POI_PLUGIN + PLUGIN_CLEAN += ${POI_PLUGINSRC:.c=.o} + else + POI_PLUGINSRC = + endif + # --- Additions for Navigate plugin ------------------------------- |
From: Danny B. <dan...@us...> - 2010-08-15 13:54:11
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv12396 Modified Files: config.mk roadmap_gpsd2.c Log Message: This should be the support for the new gpsd. This replaces most of roadmap_gpsd2.c with calls to libgps. Index: roadmap_gpsd2.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_gpsd2.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** roadmap_gpsd2.c 5 Apr 2008 02:36:50 -0000 1.11 --- roadmap_gpsd2.c 15 Aug 2010 13:54:03 -0000 1.12 *************** *** 1,7 **** ! /* roadmap_gpsd2.c - a module to interact with gpsd using its library. ! * * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. --- 1,7 ---- ! /* * LICENSE: * * Copyright 2002 Pascal F. Martin + * Copyright 2010, Danny Backx. * * This file is part of RoadMap. *************** *** 20,28 **** * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! * ! * ! * DESCRIPTION: ! * * This module hides the gpsd library API (version 2). */ --- 20,30 ---- * along with RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! */ ! ! /** ! * @file ! * @brief roadmap_gpsd2.c - a module to interact with gpsd using its library. * This module hides the gpsd library API (version 2). + * If ROADMAP_USES_LIBGPS is defined, use the (pre) version 3 libgps. */ *************** *** 36,39 **** --- 38,46 ---- #include "roadmap_math.h" + #ifdef ROADMAP_USES_LIBGPS + #include "errno.h" + #include "gps.h" + #endif + static RoadMapGpsdNavigation RoadmapGpsd2NavigationListener = NULL; *************** *** 97,103 **** RoadMapSocket gpsd2_socket; RoadMapSocket roadmap_gpsd2_connect (const char *name) { ! gpsd2_socket = roadmap_net_connect ("tcp", name, 2947); --- 104,119 ---- RoadMapSocket gpsd2_socket; + #ifdef ROADMAP_USES_LIBGPS + struct gps_data_t *gpsdp; + #endif RoadMapSocket roadmap_gpsd2_connect (const char *name) { ! #ifdef ROADMAP_USES_LIBGPS ! gpsdp = gps_open(name, "2947"); ! if (gpsdp == NULL) ! return ROADMAP_INVALID_SOCKET; ! gps_stream(gpsdp, WATCH_NMEA, NULL); ! return (RoadMapSocket)gpsdp->gps_fd; ! #else gpsd2_socket = roadmap_net_connect ("tcp", name, 2947); *************** *** 119,127 **** return gpsd2_socket; } void roadmap_gpsd2_periodic (void) { ! roadmap_net_send (gpsd2_socket, "q\n", 2); } --- 135,148 ---- return gpsd2_socket; + #endif } + /** + * @brief this is probably a keepalive FIX ME + */ void roadmap_gpsd2_periodic (void) { ! #ifndef ROADMAP_USES_LIBGPS roadmap_net_send (gpsd2_socket, "q\n", 2); + #endif } *************** *** 146,155 **** int roadmap_gpsd2_decode (void *user_context, void *decoder_context, char *sentence) { - - int got_navigation_data; - - int got_o = 0; - int got_q = 0; - int status; int latitude; --- 167,170 ---- *************** *** 159,162 **** --- 174,245 ---- int steering; + int gps_time = 0; + + #ifdef ROADMAP_USES_LIBGPS + int i, j, s; + static bool used[MAXCHANNELS]; + #define MAX_POSSIBLE_SATS (MAXCHANNELS - 2) + + if (gps_read(gpsdp) < 0) { + roadmap_log(ROADMAP_ERROR, "gpsd error %d", errno); + } + + if (gpsdp->satellites_visible == 0) + return 0; // No data + + roadmap_log(ROADMAP_WARNING, "gpsd sats %d", gpsdp->satellites_visible); + + status = (gpsdp->fix.mode >= MODE_2D) ? 'A' : 'V'; + + if (gpsdp->fix.mode >= MODE_2D) { + if (isnan(gpsdp->fix.longitude) == 0) { + longitude = 1000000 * gpsdp->fix.longitude; + } + if (isnan(gpsdp->fix.latitude) == 0) { + latitude = 1000000 * gpsdp->fix.latitude; + } + if (isnan(gpsdp->fix.speed) == 0) { + speed = gpsdp->fix.speed; + } + if (isnan(gpsdp->fix.altitude) == 0) { + altitude = gpsdp->fix.altitude; + } + if (isnan(gpsdp->fix.time) == 0) { + gps_time = gpsdp->fix.time; + } + } + + RoadmapGpsd2NavigationListener + (status, gps_time, latitude, longitude, altitude, speed, steering); + + /* See demo app cgps.c in gpsd source distribution */ + /* Must build bit vector of which satellites are used */ + for (i = 0; i < MAXCHANNELS; i++) { + used[i] = false; + for (j = 0; j < gpsdp->satellites_used; j++) + if (gpsdp->used[j] == gpsdp->PRN[i]) + used[i] = true; + } + + for (i=0, s=1; i<MAX_POSSIBLE_SATS; i++) { + if (gpsdp->used[i]) { + (*RoadmapGpsd2SatelliteListener) + (s, // sequence + gpsdp->PRN[i], // id + gpsdp->elevation[i], // elevation + gpsdp->azimuth[i], // azimuth + (int)gpsdp->ss[i], // strength + gpsdp->used[i]); // active + s++; + } + } + (*RoadmapGpsd2SatelliteListener) (0, 0, 0, 0, 0, 0); + return 1; + #else + int got_navigation_data; + + int got_o = 0; + int got_q = 0; + char *reply[256]; int reply_count; *************** *** 172,178 **** double vdop = 0.0; - int gps_time = 0; - - reply_count = roadmap_input_split (sentence, ',', reply, 256); --- 255,258 ---- *************** *** 405,408 **** return 0; } - --- 485,488 ---- return 0; + #endif } Index: config.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/config.mk,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** config.mk 14 Aug 2010 06:36:50 -0000 1.36 --- config.mk 15 Aug 2010 13:54:03 -0000 1.37 *************** *** 114,117 **** --- 114,122 ---- # EXPAT = NO + # Experimental code + # Use the new libgps + CFLAGS += -DROADMAP_USE_LIBGPS + LIBS += -lgps + # RoadMap users in the USA will probably use the Tiger maps from # the US Census bureau. These maps do not requre "shapefile" |
From: Danny B. <dan...@us...> - 2010-08-14 13:54:52
|
Update of /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv14144/src/net/sourceforge/projects/roadmap Modified Files: RoadMap.java Log Message: Keep the device backlight on, possibly dimmed. To be reviewed later. Index: RoadMap.java =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap/RoadMap.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RoadMap.java 14 Aug 2010 06:22:54 -0000 1.1 --- RoadMap.java 14 Aug 2010 13:54:45 -0000 1.2 *************** *** 33,36 **** --- 33,38 ---- import android.content.pm.ApplicationInfo; + import android.os.PowerManager; + public class RoadMap extends Activity { *************** *** 41,45 **** Menu myMenu = null; ! AssetManager asm; /* --- 43,49 ---- Menu myMenu = null; ! AssetManager asm; ! PowerManager power; ! PowerManager.WakeLock wl; /* *************** *** 83,86 **** --- 87,97 ---- /* + * Keep on the screen, possibly dimmed. + */ + power = (PowerManager)getSystemService(POWER_SERVICE); + wl = power.newWakeLock(PowerManager.SCREEN_DIM_WAKE_LOCK, "RoadMap"); + wl.acquire(); + + /* * Some experimental code - not really used yet - to try and * figure out stuff about Android packaging, bitmaps, .. *************** *** 115,118 **** --- 126,142 ---- } + @Override + public void onPause() + { + super.onPause(); + wl.release(); + } + + @Override + public void onRestart() + { + super.onRestart(); + wl.acquire(); + } private void displayFiles (AssetManager mgr, String path) { |
From: Danny B. <dan...@us...> - 2010-08-14 13:54:52
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv14144 Modified Files: AndroidManifest.xml Log Message: Keep the device backlight on, possibly dimmed. To be reviewed later. Index: AndroidManifest.xml =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/AndroidManifest.xml,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AndroidManifest.xml 14 Aug 2010 06:22:54 -0000 1.1 --- AndroidManifest.xml 14 Aug 2010 13:54:44 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- <uses-sdk android:minSdkVersion="3" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> + <uses-permission android:name="android.permission.WAKE_LOCK"/> <application android:label="@string/app_name" |
From: Danny B. <dan...@us...> - 2010-08-14 13:52:44
|
Update of /cvsroot/roadmap/roadmap/src/php In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv13853 Modified Files: osmgetbmapcore.php Log Message: Apply the workaround suggested by Paul Index: osmgetbmapcore.php =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/php/osmgetbmapcore.php,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** osmgetbmapcore.php 7 Jul 2009 01:53:08 -0000 1.3 --- osmgetbmapcore.php 14 Aug 2010 13:52:36 -0000 1.4 *************** *** 919,923 **** } fwrite($fp, "User-Agent: OSMtoCSV/1.0\r\n"); ! fwrite($fp, "Accept-encoding: gzip\r\n"); fwrite($fp, "Connection: Close\r\n"); fwrite($fp, "\r\n"); --- 919,925 ---- } fwrite($fp, "User-Agent: OSMtoCSV/1.0\r\n"); ! // ! // Don't accept gzip until we get this to work ! // fwrite($fp, "Accept-encoding: gzip\r\n"); fwrite($fp, "Connection: Close\r\n"); fwrite($fp, "\r\n"); |
From: Danny B. <dan...@us...> - 2010-08-14 06:36:58
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv26845 Modified Files: config.mk Log Message: Additional stub for Android Index: config.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/config.mk,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** config.mk 15 Feb 2009 16:31:54 -0000 1.35 --- config.mk 14 Aug 2010 06:36:50 -0000 1.36 *************** *** 34,37 **** --- 34,53 ---- # DESKTOP = WINCE # DESKTOP = IPHONE + # DESKTOP = ANDROID + + # Support for Android + # You'll need the NDK for this. + # NDK is the Native Development Kit - what you need to link Android + # apps with other programming languages than java. + # + # Don't use -O -mthumb together in the Android 2.1 NDK - this triggers a bug in the compiler. + # + # NDK = /home/danny/src/android/android-ndk-r4 + # CROSS=arm-eabi- + # CFLAGS += -I$(NDK)/build/platforms/android-5/arch-arm/usr/include \ + # -I$(NDK)/apps/ndk_demo/project/jni \ + # -DANDROID \ + # -fno-short-enums -g + # LIBS += # Support for WINCE is still a work in progress. |
From: Danny B. <dan...@us...> - 2010-08-14 06:23:04
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25221/android Added Files: AndroidManifest.xml Makefile roadmap_androidgps.c roadmap_androidgps.h roadmap_canvas.c roadmap_dialog.c roadmap_fileselection.c roadmap_jni.h roadmap_keyboard.c roadmap_keyboard.h roadmap_main.c roadmap_messagebox.c roadmap_progress.c Log Message: Add the android directory tree. --- NEW FILE: roadmap_keyboard.h --- /* * LICENSE: * * Copyright 2002 Pascal F. Martin * * This file is part of RoadMap. * * RoadMap 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. * * RoadMap 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 RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief Provide a keyboard widget for RoadMap dialogs. */ #ifndef INCLUDE__ROADMAP_KEYBOARD__H #define INCLUDE__ROADMAP_KEYBOARD__H // #include <gtk/gtk.h> struct roadmap_keyboard_context; typedef struct roadmap_keyboard_context *RoadMapKeyboard; RoadMapKeyboard roadmap_keyboard_new (void); // GtkWidget *roadmap_keyboard_widget (RoadMapKeyboard keyboard); // void roadmap_keyboard_set_focus (RoadMapKeyboard keyboard, GtkWidget *w); #endif // INCLUDE__ROADMAP_KEYBOARD__H --- NEW FILE: roadmap_dialog.c --- /* * LICENSE: * * Copyright 2002 Pascal F. Martin * Copyright (c) 2008, 2010, Danny Backx. * * This file is part of RoadMap. * * RoadMap 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. * * RoadMap 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 RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief roadmap_dialog.c - manage the Widget used in roadmap dialogs. * @ingroup android */ #include <string.h> #include <stdlib.h> // #include <gtk/gtk.h> #ifdef ROADMAP_USES_GPE #include <libdisplaymigration/displaymigration.h> #endif #include "roadmap.h" #include "roadmap_types.h" #include "roadmap_start.h" // #include "roadmap_gtkmain.h" // #include "roadmap_keyboard.h" #define __ROADMAP_DIALOG_NO_LANG #include "roadmap_dialog.h" #define ROADMAP_WIDGET_CONTAINER 0 #define ROADMAP_WIDGET_ENTRY 1 #define ROADMAP_WIDGET_CHOICE 2 #define ROADMAP_WIDGET_BUTTON 3 #define ROADMAP_WIDGET_LIST 4 #define ROADMAP_WIDGET_LABEL 5 #define ROADMAP_WIDGET_HIDDEN 6 enum { RM_LIST_WAYPOINT_NAME, RM_LIST_WAYPOINT_COLUMNS }; /* We maintain a three-level tree of lists: * level 1: list of dialogs. * level 2: for each dialog, list of frames. * level 3: for each frame, list of "input" items. * In addition, "choice" items have a list of values. */ typedef struct { char *typeid; struct roadmap_dialog_item *item; RoadMapDialogCallback callback; char *value; } RoadMapDialogSelection; struct roadmap_dialog_item; typedef struct roadmap_dialog_item *RoadMapDialogItem; struct roadmap_dialog_item { char *typeid; struct roadmap_dialog_item *next; struct roadmap_dialog_item *parent; char *name; void *context; /* References a caller-specific context. */ int widget_type; // GtkWidget *w; short rank; short count; RoadMapDialogItem children; RoadMapDialogCallback callback; char *value; RoadMapDialogSelection *choice; }; static RoadMapDialogItem RoadMapDialogWindows = NULL; static RoadMapDialogItem RoadMapDialogCurrent = NULL; static RoadMapDialogItem roadmap_dialog_get (RoadMapDialogItem parent, const char *name) { #if 0 RoadMapDialogItem child; if (parent == NULL) { child = RoadMapDialogWindows; } else { child = parent->children; } while (child != NULL) { if (strcmp (child->name, name) == 0) { return child; } child = child->next; } /* We did not find this child: create a new one. */ child = (RoadMapDialogItem) malloc (sizeof (*child)); roadmap_check_allocated(child); child->typeid = "RoadMapDialogItem"; child->widget_type = ROADMAP_WIDGET_CONTAINER; /* Safe default. */ child->w = NULL; child->count = 0; child->name = strdup(name); child->context = NULL; child->parent = parent; child->children = NULL; child->callback = NULL; child->value = ""; child->choice = NULL; if (parent != NULL) { child->rank = parent->count; child->next = parent->children; parent->children = child; parent->count += 1; } else { /* This is a top-level list element (dialog window). */ if (RoadMapDialogWindows == NULL) { child->rank = 0; } else { child->rank = RoadMapDialogWindows->rank + 1; } child->next = RoadMapDialogWindows; RoadMapDialogWindows = child; RoadMapDialogCurrent = child; } return child; #endif } static void roadmap_dialog_hide_window (RoadMapDialogItem dialog) { #if 0 if (dialog->w != NULL) { gtk_widget_hide (dialog->w); } #endif } #if 0 static gint roadmap_dialog_action (GtkWidget *w, gpointer data) { RoadMapDialogItem item = (RoadMapDialogItem)data; RoadMapDialogCallback callback = item->callback; if (callback != NULL) { while (item->parent != NULL) { item = item->parent; } RoadMapDialogCurrent = item; (*callback) (item->name, item->context); } return FALSE; } #endif #if 0 static gint roadmap_dialog_destroyed (GtkWidget *w, gpointer data) { RoadMapDialogItem item = (RoadMapDialogItem)data; RoadMapDialogItem child; /* Forget about the whole Gtk dialog: it is being destroyed. */ for (child = item->children; child != NULL; child = child->next) { roadmap_dialog_destroyed (w, child); } item->w = NULL; return TRUE; } static gint roadmap_dialog_selected (GtkWidget *w, GdkEventButton *event, gpointer data) { roadmap_keyboard_set_focus ((RoadMapKeyboard) data, w); return FALSE; } static gint roadmap_dialog_chosen (gpointer data, GtkMenuItem *w) { RoadMapDialogSelection *selection = (RoadMapDialogSelection *)data; if (selection != NULL) { selection->item->value = selection->value; if (selection->callback != NULL) { RoadMapDialogItem item = selection->item; while (item->parent != NULL) { item = item->parent; } RoadMapDialogCurrent = item; (*selection->callback) (item->name, item->context); } } return FALSE; } static gboolean roadmap_dialog_list_selected (GtkTreeSelection *selection, GtkTreeModel *model, GtkTreePath *path, gboolean path_currently_selected, gpointer data) { RoadMapDialogSelection *choice = (RoadMapDialogSelection *) data; if (! path_currently_selected) { int i = *gtk_tree_path_get_indices(path); if (choice != NULL && i >= 0) { roadmap_dialog_chosen (choice + i, NULL); } } return TRUE; } static RoadMapDialogItem roadmap_dialog_new_item (const char *frame, const char *name, GtkWidget *w, int expand) { RoadMapDialogItem parent; RoadMapDialogItem child; parent = roadmap_dialog_get (RoadMapDialogCurrent, frame); child = roadmap_dialog_get (parent, name); if (w == NULL) { child->w = w; return child; } if (parent->w == NULL) { /* This is a new frame: create the Gtk table for it. */ parent->w = gtk_table_new (1, 2, FALSE); gtk_table_set_row_spacings (GTK_TABLE(parent->w), 2); } else { /* This is an existing frame: increase the size of the frame. */ gtk_table_resize (GTK_TABLE(parent->w), parent->count, 2); } if (expand) { expand = GTK_EXPAND+GTK_FILL+GTK_SHRINK; } if (name[0] != '.') { GtkWidget *label; int length = strlen(name); char *title = malloc (length + 6); if (title != NULL) { title[0] = ' '; strcpy (title+1, name); if (name[length-1] != ':') { title[++length] = ':'; } title[++length] = ' '; title[++length] = 0; label = gtk_label_new (title); free(title); } else { label = gtk_label_new (name); } gtk_misc_set_alignment (GTK_MISC(label), 1.0, 0.5); gtk_table_attach (GTK_TABLE(parent->w), label, 0, 1, child->rank, child->rank+1, GTK_FILL, GTK_FILL, 2, 2); gtk_table_attach (GTK_TABLE(parent->w), w, 1, 2, child->rank, child->rank+1, GTK_EXPAND+GTK_FILL+GTK_SHRINK, expand, 2, 2); } else { gtk_table_attach (GTK_TABLE(parent->w), w, 0, 2, child->rank, child->rank+1, GTK_EXPAND+GTK_FILL+GTK_SHRINK, expand, 2, 2); } child->w = w; return child; } #endif /** * @brief This function activates a dialog: * If the dialog did not exist yet, it will create an empty dialog * and roadmap_dialog_activate() returns 1; the application must then * enumerate all the dialog's items. * If the dialog did exist already, it will be shown on top and * roadmap_dialog_activate() returns 0. * This function never fails. The given dialog becomes the curent dialog. * @param name * @param context * @return returns 1 if this is a new, undefined, dialog; 0 otherwise. */ int roadmap_dialog_activate (const char *name, void *context) { #if 0 RoadMapDialogItem dialog = roadmap_dialog_get (NULL, name); dialog->context = context; if (dialog->w != NULL) { /* The dialog exists already: show it on top. */ RoadMapDialogCurrent = dialog; gdk_window_show (dialog->w->window); gdk_window_raise (dialog->w->window); gtk_widget_show_all (GTK_WIDGET(dialog->w)); return 0; /* Tell the caller the dialog already exists. */ } /* Create the dialog's window. */ dialog->w = gtk_dialog_new(); #ifdef ROADMAP_USES_GPE displaymigration_mark_window (dialog->w); #endif gtk_window_set_title (GTK_WINDOW(dialog->w), roadmap_start_get_title(name)); gtk_button_box_set_layout (GTK_BUTTON_BOX(GTK_DIALOG(dialog->w)->action_area), GTK_BUTTONBOX_SPREAD); return 1; /* Tell the caller this is a new, undefined, dialog. */ #endif } /** * @brief Hide the given dialog, if it exists. * @param name the dialog name */ void roadmap_dialog_hide (const char *name) { roadmap_dialog_hide_window (roadmap_dialog_get (NULL, name)); } /** * @brief Add one text entry item to the current dialog * @param frame * @param name */ void roadmap_dialog_new_entry (const char *frame, const char *name) { #if 0 GtkWidget *w = gtk_entry_new (); RoadMapDialogItem child = roadmap_dialog_new_item (frame, name, w, 0); child->widget_type = ROADMAP_WIDGET_ENTRY; #endif } /** * @brief Add one text label item to the current dialog * @param frame * @param name */ void roadmap_dialog_new_label (const char *frame, const char *name) { #if 0 GtkWidget *w = gtk_label_new (name); RoadMapDialogItem child = roadmap_dialog_new_item (frame, name, w, 0); child->widget_type = ROADMAP_WIDGET_LABEL; #endif } /** * @brief Add one color selection item to to the current dialog * @param frame * @param name */ void roadmap_dialog_new_color (const char *frame, const char *name) { roadmap_dialog_new_entry (frame, name); } /** * @brief Add one hidden data item to the current dialog * @param frame * @param name */ void roadmap_dialog_new_hidden (const char *frame, const char *name) { #if 0 RoadMapDialogItem child = roadmap_dialog_new_item (frame, name, 0, 0); child->widget_type = ROADMAP_WIDGET_HIDDEN; #endif } /** * @brief Add one choice item (a selection box or menu). * The optional callback is called each time a new selection is being made, * not when the OK button is called--that is the job of the OK button callback. * @param frame * @param name * @param count * @param current * @param labels * @param values * @param callback */ void roadmap_dialog_new_choice (const char *frame, const char *name, int count, int current, char **labels, void *values, RoadMapDialogCallback callback) { #if 0 int i; GtkWidget *w = gtk_option_menu_new (); RoadMapDialogItem child = roadmap_dialog_new_item (frame, name, w, 0); GtkWidget *menu; GtkWidget *menu_item; RoadMapDialogSelection *choice; char **vals = (char **)values; child->widget_type = ROADMAP_WIDGET_CHOICE; menu = gtk_menu_new (); choice = (RoadMapDialogSelection *) calloc (count, sizeof(*choice)); roadmap_check_allocated(choice); for (i = 0; i < count; ++i) { choice[i].typeid = "RoadMapDialogSelection"; choice[i].item = child; choice[i].value = vals[i]; choice[i].callback = NULL; menu_item = gtk_menu_item_new_with_label (labels[i]); gtk_menu_shell_append (GTK_MENU_SHELL(menu), menu_item); g_signal_connect_swapped (menu_item, "activate", (GCallback) roadmap_dialog_chosen, (gpointer) (choice+i)); gtk_widget_show (menu_item); } gtk_option_menu_set_menu (GTK_OPTION_MENU(w), menu); gtk_option_menu_set_history (GTK_OPTION_MENU(w), current); if (child->choice != NULL) { free(child->choice); } child->choice = choice; child->value = choice[0].value; #endif } /** * @brief Add one list item. * This item is similar to the choice one, except for two things: * 1) it uses a scrollable list widget instead of a combo box. * 2) the list of items shown is dynamic and can be modified (it is initially empty). * @param frame * @param name */ void roadmap_dialog_new_list (const char *frame, const char *name) { #if 0 GtkWidget *listbox; GtkListStore *store; GtkTreeViewColumn *column; GtkWidget *scrollbox = gtk_scrolled_window_new (NULL, NULL); RoadMapDialogItem child = roadmap_dialog_new_item (frame, name, scrollbox, 1); store = gtk_list_store_new (RM_LIST_WAYPOINT_COLUMNS, G_TYPE_STRING); listbox = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); g_object_unref (G_OBJECT (store)); // gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(listbox), 0); gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW(scrollbox), listbox); child->w = listbox; child->widget_type = ROADMAP_WIDGET_LIST; if (name[0] == '.') name += 1; column = gtk_tree_view_column_new_with_attributes (name, gtk_cell_renderer_text_new (), "text", RM_LIST_WAYPOINT_NAME, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (listbox), column); gtk_tree_selection_set_mode (gtk_tree_view_get_selection (GTK_TREE_VIEW (listbox)), GTK_SELECTION_SINGLE); #endif } void roadmap_dialog_show_list (const char *frame, const char *name, int count, char **labels, void **values, RoadMapDialogCallback callback) { #if 0 int i; RoadMapDialogItem parent; RoadMapDialogItem child; RoadMapDialogSelection *choice; GtkTreeModel *model; GtkTreeIter iterator; parent = roadmap_dialog_get (RoadMapDialogCurrent, frame); if (parent->w == NULL) { roadmap_log (ROADMAP_ERROR, "list %s in dialog %s filled before built", name, frame); return; } child = roadmap_dialog_get (parent, name); if (child->w == NULL) { roadmap_log (ROADMAP_ERROR, "list %s in dialog %s filled before finished", name, frame); return; } model = gtk_tree_view_get_model (GTK_TREE_VIEW(child->w)); if (child->choice != NULL) { gtk_list_store_clear (GTK_LIST_STORE(model)); free (child->choice); child->choice = NULL; } choice = (RoadMapDialogSelection *) calloc (count, sizeof(*choice)); roadmap_check_allocated(choice); gtk_tree_selection_set_select_function (gtk_tree_view_get_selection (GTK_TREE_VIEW (child->w)), roadmap_dialog_list_selected, (gpointer)choice, NULL); for (i = 0; i < count; ++i) { choice[i].typeid = "RoadMapDialogSelection"; choice[i].item = child; choice[i].value = values[i]; choice[i].callback = callback; gtk_list_store_append (GTK_LIST_STORE(model), &iterator); gtk_list_store_set (GTK_LIST_STORE(model), &iterator, RM_LIST_WAYPOINT_NAME, labels[i], -1); } child->choice = choice; child->value = choice[0].value; gtk_widget_show (parent->w); #endif } /** * @brief Add one button to the bottom of the dialog * @param label * @param callback */ void roadmap_dialog_add_button (const char *label, RoadMapDialogCallback callback) { #if 0 RoadMapDialogItem dialog = RoadMapDialogCurrent; RoadMapDialogItem child; GtkWidget *button = gtk_button_new_with_label (label); child = roadmap_dialog_get (dialog, label); child->w = button; child->callback = callback; child->widget_type = ROADMAP_WIDGET_BUTTON; g_signal_connect (button, "clicked", (GCallback) roadmap_dialog_action, child); GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog->w)->action_area), button, TRUE, FALSE, 0); gtk_widget_grab_default (button); #endif } /** * @brief When all done with building the dialog, call this to finalize and show. * @param use_keyboard */ void roadmap_dialog_complete (int use_keyboard) { #if 0 int count; RoadMapDialogItem dialog = RoadMapDialogCurrent; RoadMapDialogItem frame; count = 0; for (frame = dialog->children; frame != NULL; frame = frame->next) { if (frame->widget_type == ROADMAP_WIDGET_CONTAINER) { count += 1; } } if (count > 1) { /* There are several frames in that dialog: use a notebook widget * to let the user access all of them. */ GtkWidget *notebook = gtk_notebook_new(); gtk_notebook_set_scrollable (GTK_NOTEBOOK(notebook), TRUE); gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog->w)->vbox), notebook, TRUE, TRUE, 0); for (frame = dialog->children; frame != NULL; frame = frame->next) { if (frame->widget_type == ROADMAP_WIDGET_CONTAINER) { GtkWidget *label = gtk_label_new (frame->name); gtk_notebook_append_page (GTK_NOTEBOOK(notebook), frame->w, label); } } } else if (count == 1) { /* There is only one frame in that dialog: show it straight. */ for (frame = dialog->children; frame != NULL; frame = frame->next) { if (frame->widget_type == ROADMAP_WIDGET_CONTAINER) { gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog->w)->vbox), frame->w, TRUE, TRUE, 0); break; } } } else { roadmap_log (ROADMAP_FATAL, "no frame defined for dialog %s", dialog->name); } if (use_keyboard) { RoadMapDialogItem last_item = NULL; RoadMapKeyboard keyboard = roadmap_keyboard_new (); gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog->w)->vbox), roadmap_keyboard_widget(keyboard), TRUE, TRUE, 0); for (frame = dialog->children; frame != NULL; frame = frame->next) { if (frame->widget_type == ROADMAP_WIDGET_CONTAINER) { RoadMapDialogItem item; for (item = frame->children; item != NULL; item = item->next) { if (item->widget_type == ROADMAP_WIDGET_ENTRY) { g_signal_connect (item->w, "button_press_event", (GCallback) roadmap_dialog_selected, keyboard); last_item = item; } } } } if (last_item != NULL) { roadmap_keyboard_set_focus (keyboard, last_item->w); } } gtk_container_set_border_width (GTK_CONTAINER(GTK_BOX(GTK_DIALOG(dialog->w)->vbox)), 4); g_signal_connect (dialog->w, "destroy", (GCallback) roadmap_dialog_destroyed, dialog); roadmap_main_set_window_size (dialog->w, roadmap_option_width(dialog->name), roadmap_option_height(dialog->name)); gtk_widget_show_all (GTK_WIDGET(dialog->w)); #endif } void roadmap_dialog_select (const char *dialog) { RoadMapDialogCurrent = roadmap_dialog_get (NULL, dialog); } void *roadmap_dialog_get_data (const char *frame, const char *name) { #if 0 RoadMapDialogItem this_frame; RoadMapDialogItem this_item; this_frame = roadmap_dialog_get (RoadMapDialogCurrent, frame); this_item = roadmap_dialog_get (this_frame, name); switch (this_item->widget_type) { case ROADMAP_WIDGET_ENTRY: return (void *)gtk_entry_get_text (GTK_ENTRY(this_item->w)); } return this_item->value; #endif } void roadmap_dialog_set_data (const char *frame, const char *name, const void *data) { #if 0 RoadMapDialogItem this_frame; RoadMapDialogItem this_item; this_frame = roadmap_dialog_get (RoadMapDialogCurrent, frame); this_item = roadmap_dialog_get (this_frame, name); switch (this_item->widget_type) { case ROADMAP_WIDGET_ENTRY: gtk_entry_set_text (GTK_ENTRY(this_item->w), (const char *)data); break; case ROADMAP_WIDGET_LABEL: gtk_label_set_text (GTK_LABEL(this_item->w), (const char *)data); break; } this_item->value = (char *)data; #endif } void roadmap_dialog_new_progress (const char *frame, const char *name) { #warning implement roadmap_dialog_new_progress } void roadmap_dialog_set_progress (const char *frame, const char *name, int progress) { #warning implement roadmap_dialog_set_progress } --- NEW FILE: roadmap_progress.c --- /* * RoadMap's progress bar implementation. GTK version originally * from "Yattm", by Torrey Searle * * Copyright (C) 1999, Torrey Searle <ts...@uc...> * * 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 * */ /** * @file * @brief progress bar implementation * @ingroup android */ // #include <gtk/gtk.h> #include <string.h> #include "roadmap_progress.h" #if 0 typedef struct { int tag; GtkWidget * progress_meter; GtkWidget * progress_window; } progress_window_data; static GList *bars = NULL; static int last = 0; static void destroy(GtkWidget * widget, gpointer data) { progress_window_data * pwd = data; GList * l; for(l = bars; l; l = l->next) { if(pwd == l->data) { bars = g_list_remove_link(bars, l); g_free(pwd); /* small hack - reset last if there are no more bars */ if(bars == NULL) last = 0; break; } } } #endif int roadmap_progress_new( void ) { #if 0 progress_window_data *pwd = g_new0(progress_window_data, 1); pwd->tag = ++last; pwd->progress_meter = gtk_progress_bar_new(); gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(pwd->progress_meter), GTK_PROGRESS_LEFT_TO_RIGHT ); pwd->progress_window = gtk_dialog_new(); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(pwd->progress_window)->vbox), pwd->progress_meter, FALSE, TRUE, 0); gtk_widget_show(pwd->progress_meter); gtk_signal_connect( GTK_OBJECT(pwd->progress_window), "destroy", GTK_SIGNAL_FUNC(destroy), pwd ); gtk_widget_show(pwd->progress_window); bars = g_list_append(bars, pwd); return pwd->tag; #endif } void roadmap_progress_update(int tag, int total, int progress) { #if 0 GList * l; for(l = bars; l; l=l->next) { progress_window_data * pwd = l->data; if(pwd->tag == tag) { gtk_progress_bar_update (GTK_PROGRESS_BAR(pwd->progress_meter), (double)progress/(double)total); break; } } #endif } void roadmap_progress_close(int tag) { #if 0 GList * l; for(l = bars; l; l=l->next) { progress_window_data * pwd = l->data; if(pwd->tag == tag) { gtk_widget_destroy(pwd->progress_window); break; } } #endif } --- NEW FILE: Makefile --- # # Android Makefile # # Requires the NDK # ADB= adb -e # # Produce a build timestamp # BUILD_DATETIME = `date +%Y%m%d.%H%M` TOP = .. include $(TOP)/options.mk # # No support for navigate plugin without trip plugin # ifeq ($(USE_TRIP_PLUGIN),yes) RMLIBSRC += roadmap_sound.c endif ifeq ($(USE_NAVIGATE_PLUGIN),yes) RMLIBSRC += roadmap_sound.c endif RMLIBOBJ = $(CANVAS_OBJS) $(RMLIBSRC:.c=.o) HEADERS = TARGETS = roadmap.apk # TARGETS += demomaps.apk # --- The real targets -------------------------------------------- all:: $(TARGETS) depends: $(MAKEDEPS) -Y -f - $(RMLIBSRC) > .depends.mk 2>/dev/null -include .depends.mk roadmap.apk: libs/armeabi/librmnative.so AndroidManifest.xml classes.dex \ libs/armeabi/libexpat-1.so rm -f bin/${SRCNAME}.ap_ ${SDKPLAT}/tools/aapt package -m -J gen -M AndroidManifest.xml -S res -I ${SDKPLAT}/android.jar -F bin/${SRCNAME}.ap_ apkbuilder roadmap.apk -z bin/${SRCNAME}.ap_ -f classes.dex -nf libs # -f demomaps/usc06075.rdm -f demomaps/usc81002.rdm -f demomaps/usdir.rdm # apkbuilder roadmap.apk -nf . -rj . -f librmnative.so -f classes.dex -f AndroidManifest.xml # apkbuilder roadmap.apk -z bin/${SRCNAME}.ap_ -f librmnative.so -f classes.dex # libs/armeabi/libexpat-1.so: /opt/android/lib/libexpat-1.so cp /opt/android/lib/libexpat-1.so libs/armeabi/libexpat-1.so # # I used this with Android 2.1 # #NDKHOME= /home/danny/src/android/android-ndk-r3 #SDKPLAT= ${SDKHOME}/platforms/android-7 #NDK_CFLAGS= -I$(NDKHOME)/build/platforms/android-5/arch-arm/usr/include \ # -I$(NDK)/apps/ndk_demo/project/jni \ # -DANDROID -fno-short-enums -g NDKHOME= /home/danny/src/android/android-ndk-r4 SDKHOME= /home/danny/src/android/android-sdk-linux_86 SDKPLAT= ${SDKHOME}/platforms/android-8 NDK_CFLAGS= -I$(NDKHOME)/build/platforms/android-5/arch-arm/usr/include \ -I$(NDK)/apps/ndk_demo/project/jni \ -DANDROID -fno-short-enums -g NDK_LDFLAGS= -nostdlib -Wl,-shared,-Bsymbolic -Wl,--no-undefined -Wl,-z,noexecstack #JAVAC_FLAGS= -cp ${SDKPLAT}/android.jar -sourcepath gen:src JAVA= /usr/share/java JAVAC_FLAGS= -cp ${JAVA}/jaxp_parser_impl.jar:${JAVA}/xml-commons-apis.jar:${JAVA}/antlr.jar:${JAVA}/ant/ant-antlr.jar:${JAVA}/regexp.jar:${JAVA}/ant/ant-apache-regexp.jar:${JAVA}/jakarta-commons-logging.jar:${JAVA}/ant/ant-commons-logging.jar:${JAVA}/javamail.jar:${JAVA}/jaf.jar:${JAVA}/ant/ant-javamail.jar:${JAVA}/jsch.jar:${JAVA}/ant/ant-jsch.jar:/usr/lib/jvm/java/lib/tools.jar:${SDKPLAT}/android.jar -sourcepath gen:src -bootclasspath ${SDKPLAT}/android.jar SRCNAME= RoadMap CLSES= ${DIRHIER}/RoadMap.class ${DIRHIER}/Panel.class ${DIRHIER}/Pen.class DIRHIER= net/sourceforge/projects/roadmap classes.dex: ${CLSES} # ${SDKPLAT}/tools/dx --dex --output=$@ ${DIRHIER} ${SDKPLAT}/tools/dx --dex --output=$@ ${DIRHIER}/*.class # ${SDKPLAT}/tools/dx --dex --output=$@ ${DIRHIER}/${SRCNAME}.class gen/net/sourceforge/projects/roadmap/R.java: AndroidManifest.xml Makefile aapt package -m -J gen -M AndroidManifest.xml -S res -I ${SDKPLAT}/android.jar ${DIRHIER}/RoadMap.class: src/${DIRHIER}/RoadMap.java gen/net/sourceforge/projects/roadmap/R.java javac ${JAVAC_FLAGS} -d . src/${DIRHIER}/RoadMap.java ${DIRHIER}/RoadMapCanvas.class: src/${DIRHIER}/RoadMapCanvas.java javac ${JAVAC_FLAGS} -d . src/${DIRHIER}/RoadMapCanvas.java ${DIRHIER}/Panel.class: src/${DIRHIER}/Panel.java javac ${JAVAC_FLAGS} -d . src/${DIRHIER}/Panel.java ${DIRHIER}/Pen.class: src/${DIRHIER}/Pen.java javac ${JAVAC_FLAGS} -d . src/${DIRHIER}/Pen.java ${DIRHIER}/TutorialThread.class: src/${DIRHIER}/TutorialThread.java javac ${JAVAC_FLAGS} -d . src/${DIRHIER}/TutorialThread.java RMLIBS= ../libguiroadmap.a ../libroadmap.a ../gpx/libgpx.a ../unix/libosroadmap.a \ -L/opt/android/lib -lexpat-1 RMDLIBS= ../libguiroadmap.a ../libroadmap.a ../gpx/libgpx.a ../unix/libosroadmap.a RMASRC= roadmap_canvas.c roadmap_dialog.c roadmap_fileselection.c \ roadmap_keyboard.c roadmap_main.c roadmap_messagebox.c \ roadmap_progress.c roadmap_androidgps.c \ ../win32/roadmap_colors.c libs/armeabi/gdbserver: ${NDKHOME}/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/gdbserver cp ${NDKHOME}/build/prebuilt/linux-x86/arm-eabi-4.4.0/bin/gdbserver libs/armeabi/gdbserver RMANDROID= ${RMASRC:.c=.o} libs/armeabi/librmnative.so: ${RMANDROID} ${RMDLIBS} arm-eabi-gcc --Wl,-soname,librmnative.so -o libs/armeabi/librmnative.so \ ${NDK_CFLAGS} ${NDK_LDFLAGS} \ ${RMANDROID} \ ${RMLIBS} \ -lgcc \ -L${NDKHOME}/build/platforms/android-5/arch-arm/usr/lib -llog -lc -lm # ${NDKHOME}/build/platforms/android-8/arch-arm/usr/lib/crtbegin_dynamic.o \ # ${NDKHOME}/build/platforms/android-8/arch-arm/usr/lib/crtend_android.o clean: rm -f *.o *.a *.so .depends.mk *.class *.apk rm -f *~ jni/*~ src/${DIRHIER}/*~ rm -f classes.dex rm -f gen/${DIRHIER}/R.java rm -f bin/${SRCNAME}.ap_ rm -f libs/armeabi/librmnative.so libs/armeabi/libexpat-1.so rm -f ${SRCNAME}.class rm -f ${DIRHIER}/*.class rm -f libs/armeabi/gdbserver install: roadmap.apk libs/armeabi/gdbserver ${ADB} install -r roadmap.apk ${ADB} push libs/armeabi/gdbserver /data/data/net.sourceforge.projects.roadmap/lib/gdbserver # copied from win32 # we aren't as rigorous about producing # this list of source as we are for the other RoadMap # directories. (basically, pick up everything.) sourcelist: @find . -name 'CVS' -prune -o -print --- NEW FILE: roadmap_keyboard.c --- /* * LICENSE: * * Copyright 2002 Pascal F. Martin * Copyright 2010 Danny Backx * * This file is part of RoadMap. * * RoadMap 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. * * RoadMap 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 RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief Provide a keyboard widget for RoadMap dialogs. * @ingroup android */ #include <math.h> #include <stdlib.h> #include "roadmap_keyboard.h" #include "roadmap.h" #define ROADMAP_KEYBOARD_ROWS 4 #define ROADMAP_KEYBOARD_COLUMNS 10 #define ROADMAP_KEYBOARD_KEYS (ROADMAP_KEYBOARD_ROWS*ROADMAP_KEYBOARD_COLUMNS) typedef struct { char character; // GtkWidget *button; RoadMapKeyboard keyboard; } RoadMapKey; struct roadmap_keyboard_context { // GtkWidget *frame; // GtkWidget *focus; RoadMapKey keys[ROADMAP_KEYBOARD_KEYS]; }; /** * @brief unused on Android * @return always null */ RoadMapKeyboard roadmap_keyboard_new (void) { return NULL; } --- NEW FILE: roadmap_fileselection.c --- /* * LICENSE: * * Copyright 2002 Pascal F. Martin * Copyright 2010 Danny Backx * * This file is part of RoadMap. * * RoadMap 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. * * RoadMap 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 RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief manage the Widget used in roadmap dialogs. * @ingroup android */ #include <string.h> #include <stdlib.h> #include <unistd.h> // #include <gtk/gtk.h> #include "roadmap_fileselection.h" #include "roadmap.h" #include "roadmap_types.h" #include "roadmap_file.h" /* Some cross compiler environment don't define this ? */ #ifndef PATH_MAX #define PATH_MAX 512 #endif /* We maintain a list of dialogs that have been created. */ struct roadmap_fileselection_item; typedef struct roadmap_fileselection_item RoadMapFileSelection; /** * @brief */ struct roadmap_fileselection_item { RoadMapFileSelection *next; const char *title; const char *mode; // GtkWidget *dialog; RoadMapFileCallback callback; }; static RoadMapFileSelection *RoadMapFileWindows = NULL; /** * @brief * @param title * @return */ static RoadMapFileSelection *roadmap_fileselection_search (const char *title) { RoadMapFileSelection *item; for (item = RoadMapFileWindows; item != NULL; item = item->next) { if (strcmp (title, item->title) == 0) { break; } } return item; } #if 0 static void roadmap_fileselection_ok (GtkFileSelection *selector, gpointer user_data) { RoadMapFileSelection *item = (RoadMapFileSelection *)user_data; if (item->callback != NULL) { item->callback (gtk_file_selection_get_filename (GTK_FILE_SELECTION(item->dialog)), item->mode); } } #endif void roadmap_fileselection_new (const char *title, const char *filter, const char *path, const char *mode, RoadMapFileCallback callback) { #if 0 RoadMapFileSelection *item = roadmap_fileselection_search (title); if (item == NULL) { char current_directory[PATH_MAX]; if (path == NULL) { current_directory[0] = 0; } else if (getcwd (current_directory, sizeof(current_directory)) == NULL) { roadmap_log (ROADMAP_ERROR, "getcwd failed"); current_directory[0] = 0; } else { chdir (path); } item = (RoadMapFileSelection *) malloc (sizeof (*item)); roadmap_check_allocated(item); item->title = strdup(title); item->dialog = gtk_file_selection_new (item->title); g_signal_connect (GTK_FILE_SELECTION(item->dialog)->ok_button, "clicked", (GCallback) roadmap_fileselection_ok, item); /* Ensure that the dialog box is hidden when the user clicks a button. */ g_signal_connect_swapped (GTK_FILE_SELECTION(item->dialog)->ok_button, "clicked", (GCallback) gtk_widget_hide_all, (gpointer) item->dialog); g_signal_connect_swapped (GTK_FILE_SELECTION(item->dialog)->cancel_button, "clicked", (GCallback) gtk_widget_hide_all, (gpointer) item->dialog); /* Restore the original directory path.. */ if (current_directory[0] != 0) { chdir (current_directory); } } item->mode = mode; item->callback = callback; if (filter != NULL) { gtk_file_selection_complete (GTK_FILE_SELECTION(item->dialog), filter); } if (item->dialog->window != NULL) { gdk_window_show (item->dialog->window); gdk_window_raise (item->dialog->window); } gtk_widget_show_all (GTK_WIDGET(item->dialog)); #endif } --- NEW FILE: AndroidManifest.xml --- <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.sourceforge.projects.roadmap" android:versionCode="1" android:versionName="1.0"> <uses-sdk android:minSdkVersion="3" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/> <application android:label="@string/app_name" android:debuggable="true" android:theme="@android:style/Theme.NoTitleBar" android:icon="@drawable/roadmap"> <activity android:name=".RoadMap" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> --- NEW FILE: roadmap_canvas.c --- /* * LICENSE: * * Copyright 2002 Pascal F. Martin * Copyright 2010 Danny Backx * * This file is part of RoadMap. * * RoadMap 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. * * RoadMap 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 RoadMap; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /** * @file * @brief manage the canvas that is used to draw the map. * @ingroup android */ #include <math.h> #include <stdio.h> #include <string.h> #include <stdlib.h> #include "roadmap.h" #include "roadmap_types.h" #include "roadmap_gui.h" #include "roadmap_canvas.h" #include <android/log.h> #include "roadmap_jni.h" #define ROADMAP_CURSOR_SIZE 10 #define ROADMAP_CANVAS_POINT_BLOCK 1024 #define MYCLS "net/sourceforge/projects/roadmap/Panel" /** * @brief cache for the reference to the Panel class. * * Make sure to clean this up when terminating the Activity, * but cache during one run. */ static jclass myPanelClass; static jclass TheClass() { if (myPanelClass == 0) { myPanelClass = (*RoadMapJniEnv)->FindClass(RoadMapJniEnv, MYCLS); myPanelClass = (*RoadMapJniEnv)->NewGlobalRef(RoadMapJniEnv, myPanelClass); } if (myPanelClass == 0) { __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "Class not found"); // throw (*RoadMapJniEnv)->ThrowNew(RoadMapJniEnv, (*RoadMapJniEnv)->FindClass(RoadMapJniEnv, "java/io/IOException"), "A JNI Exception occurred"); } return myPanelClass; } static jmethodID TheMethod(const jclass cls, const char *name, const char *signature) { jmethodID mid; mid = (*RoadMapJniEnv)->GetMethodID(RoadMapJniEnv, cls, name, signature); if (mid == 0) { (*RoadMapJniEnv)->ThrowNew(RoadMapJniEnv, (*RoadMapJniEnv)->FindClass(RoadMapJniEnv, "java/io/IOException"), "A JNI Exception occurred"); } return mid; } /** * @brief */ struct roadmap_canvas_pen { struct roadmap_canvas_pen *next; char *name; }; static RoadMapPen CurrentPen = NULL; static struct roadmap_canvas_pen *RoadMapPenList = NULL; static char *roadmap_canvas_lookup_colourname(const char *name); /* The canvas callbacks: all callbacks are initialized to do-nothing * functions, so that we don't care checking if one has been setup. */ static void roadmap_canvas_ignore_mouse (int button, RoadMapGuiPoint *point) {} static void roadmap_canvas_ignore_configure (void) {} static RoadMapCanvasMouseHandler RoadMapCanvasMouseButtonPressed = roadmap_canvas_ignore_mouse, RoadMapCanvasMouseButtonReleased = roadmap_canvas_ignore_mouse, RoadMapCanvasMouseMoved = roadmap_canvas_ignore_mouse, RoadMapCanvasMouseScroll = roadmap_canvas_ignore_mouse; static RoadMapCanvasConfigureHandler RoadMapCanvasConfigure = roadmap_canvas_ignore_configure; /** * @brief convert a list of points */ static void roadmap_canvas_convert_points (jfloatArray apoints, RoadMapGuiPoint *points, int count) { int i, j; float *tmp = (float *)malloc(2 * sizeof(float) * count); for (i=0, j=0; i<count; i++, points++) { tmp[j++] = points->x; tmp[j++] = points->y; } (*RoadMapJniEnv)->SetFloatArrayRegion(RoadMapJniEnv, apoints, 0, 2*count, tmp); free(tmp); } #if 0 /* * @brief convert a list of points, but make sure to duplicate all but the first and last points * because RoadMap and Android have different semantics here. */ static void roadmap_canvas_convert_lines (jfloatArray apoints, RoadMapGuiPoint *points, int count) { int i, j; float *tmp = (float *)malloc(4 * sizeof(float) * count); /* first entry : only once */ tmp[0] = points->x; tmp[1] = points->y; points++; for (i=1, j=2; i<count-1; i++, points++) { tmp[j++] = points->x; tmp[j++] = points->y; tmp[j++] = points->x; tmp[j++] = points->y; } /* last entry : only once */ tmp[j++] = points->x; tmp[j++] = points->y; (*RoadMapJniEnv)->SetFloatArrayRegion(RoadMapJniEnv, apoints, 0, 4 * count - 4, tmp); free(tmp); } static void roadmap_canvas_convert_ints (jintArray acenters, int *centers, int count) { (*RoadMapJniEnv)->SetIntArrayRegion(RoadMapJniEnv, acenters, 0, count, centers); } #endif /** * @brief * @param text * @param size * @param width * @param ascent * @param descent * @param can_tilt */ void roadmap_canvas_get_text_extents (const char *text, int size, int *width, int *ascent, int *descent, int *can_tilt) { jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "MeasureWidth", "(Ljava/lang/String;I)I"); jstring js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, text); int r; r = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, PanelThiz, mid, js); if (width) *width = r; mid = TheMethod(cls, "MeasureAscent", "()I"); if (ascent) *ascent = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, PanelThiz, mid); mid = TheMethod(cls, "MeasureDescent", "()I"); if (descent) *descent = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, PanelThiz, mid); if (can_tilt) *can_tilt = 0; // copied from Win32 implementation __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "text(%s) wid %d asc %d desc %d", text, *width, *ascent, *descent); return; } /** * @brief Cache for the Pen names in C so we only pass small numbers between Java and C. * This is much more efficient than converting strings all the time. */ typedef struct PenStruct { char *name; } PenStruct; static PenStruct *PenName = 0; static int nPens = 0, maxPen = 0; RoadMapPen roadmap_canvas_select_pen (RoadMapPen pen) { jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "SelectPen", "(I)V"); // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "select_pen(%d,%s)", (int)pen, PenName[(int)pen].name); CurrentPen = pen; // for debugging only (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, pen); return pen; } /** * @brief * @param name * @return a Pen (which is a numeric index in this implementation) */ RoadMapPen roadmap_canvas_create_pen (const char *name) { jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "CreatePen", "(I)V"); RoadMapPen pen; int i; for (i=0; i<nPens; i++) { if (strcmp(name, PenName[i].name) == 0) return (RoadMapPen)i; } if (nPens == maxPen) { maxPen += 100; PenName = (PenStruct *)realloc((void *)PenName, maxPen * sizeof(PenStruct)); } PenName[nPens].name = strdup(name); pen = (RoadMapPen)nPens; nPens++; // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "Create Pen(%s) -> %d", name, (int)pen); (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, pen); roadmap_canvas_select_pen (pen); return pen; } /** * @brief set the foreground colour * @param color the colour to be used */ void roadmap_canvas_set_foreground (const char *color) { jstring js; jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "SetForeground", "(Ljava/lang/String;)I"); int r; // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "set_foreground(%d,%s) - %s", (int)CurrentPen, PenName[(int)CurrentPen].name, color); js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, color); r = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, PanelThiz, mid, js); if (r == -1) { /* Colour name unknown, try to map it ourselves */ char *s = roadmap_canvas_lookup_colourname(color); if (s) { js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, s); r = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, PanelThiz, mid, js); } } } /** * @brief set the line style * @param style */ void roadmap_canvas_set_linestyle (const char *style) { int dashed = 0; jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "SetLinestyle", "(I)V"); // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "set_linestyle(%d,%s) - %s", (int)CurrentPen, PenName[(int)CurrentPen].name, style); if (strcasecmp(style, "dashed") == 0) dashed = 1; (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, dashed); } /** * @brief set line thickness * @param thickness */ void roadmap_canvas_set_thickness (int thickness) { jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "SetThickness", "(I)V"); // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "set_thickness(%d,%s) - %d", (int)CurrentPen, PenName[(int)CurrentPen].name, thickness); if (thickness < 2) thickness = 1; (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, thickness); } void roadmap_canvas_erase (void) { jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "Erase", "()V"); (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid); } void roadmap_canvas_draw_string (RoadMapGuiPoint *position, int corner, int size, const char *text) { jstring js; jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "DrawString", "(IIIILjava/lang/String;)V"); // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "draw_string(%s)", text); js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, text); (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, position->x, position->y, corner, size, js); } void roadmap_canvas_draw_string_angle (RoadMapGuiPoint *position, int size, int angle, const char *text) { jstring js; jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "DrawStringAngle", "(IIIILjava/lang/String;)V"); js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, text); (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, position->x, position->y, size, angle, js); } void roadmap_canvas_draw_multiple_points (int count, RoadMapGuiPoint *points) { jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "DrawPoints", "(I[F)V"); jfloatArray apoints; // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "draw_multiple_points(%d)", count); while (count > 1024) { apoints = (*RoadMapJniEnv)->NewFloatArray(RoadMapJniEnv, 2048); roadmap_canvas_convert_points (apoints, points, 1024); (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, 1024, apoints); points += 1024; count -= 1024; } apoints = (*RoadMapJniEnv)->NewFloatArray(RoadMapJniEnv, 2048); roadmap_canvas_convert_points (apoints, points, count); (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, count, apoints); } /** * @brief cut the buffer down to a number acceptable for the Android VM * Note this is not the number of lines but the size of the point buffer. * So actually number of lines (per Java call) is one fourth of this. * * Not doing this buffering gets the JNI into trouble. */ #define RM_MAXLINES 40 /** * @brief * @param count * @param lines * @param points * @param fast_draw */ void roadmap_canvas_draw_multiple_lines (int count, int *lines, RoadMapGuiPoint *points, int fast_draw) { jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "DrawLines", "(I[F)V"); jfloatArray apoints; int i, count_of_points; int j, ix_lines, ix_tmp, ix_points, nlines, npoints; float *tmp; // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "draw_multiple_lines(%d)", count); /* * Loop over the input, cut it up in chunks so we only use buffers of size * RM_MAXLINES. * In the process, convert it into pairs of points - RoadMap passes lines * that pass more than one point, like the example below. * E/RoadMap (11057): draw_line - line 1317 has 3 points * E/RoadMap (11057): - line 1317 point 0 - 125 232 * E/RoadMap (11057): - line 1317 point 1 - 128 235 * E/RoadMap (11057): - line 1317 point 2 - 128 235 * Convert these into pairs of points so the Java layer just calls simple * line draws. */ tmp = (float *)malloc(sizeof(float) * RM_MAXLINES); apoints = (*RoadMapJniEnv)->NewFloatArray(RoadMapJniEnv, RM_MAXLINES); for (i=0, ix_lines=0, ix_tmp=0, ix_points=0, nlines=0, npoints=0; i<count; i++) { count_of_points = lines[i]; // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "draw_multiple_lines{%d -> %d}", i, count_of_points); /* * Add current line to the buffer. Initial point : only once. */ tmp[ix_tmp++] = points[ix_points].x; tmp[ix_tmp++] = points[ix_points].y; npoints+=2; for (j=1; j<count_of_points-1; j++) { /* Intermediate points : added twice */ tmp[ix_tmp++] = points[ix_points+j].x; tmp[ix_tmp++] = points[ix_points+j].y; npoints+=2; /* * Odd as it may seem, this is one of the places where we have * to check for buffer overflow : between two (low level) lines. * (A low level line is what I called a pair of points above.) */ if (ix_tmp >= RM_MAXLINES - 6) { // int k; for (k=0; k<npoints; k+=4) __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "Line %d (%3.0f,%3.0f)-(%3.0f,%3.0f)", k/4, tmp[k], tmp[k+1], tmp[k+2], tmp[k+3]); (*RoadMapJniEnv)->SetFloatArrayRegion(RoadMapJniEnv, apoints, 0, npoints, tmp); (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, npoints, apoints); nlines=0; npoints=0; ix_tmp = 0; free(tmp); tmp = (float *)malloc(sizeof(float) * RM_MAXLINES); apoints = (*RoadMapJniEnv)->NewFloatArray(RoadMapJniEnv, RM_MAXLINES); } tmp[ix_tmp++] = points[ix_points+j].x; tmp[ix_tmp++] = points[ix_points+j].y; npoints+=2; } /* End point : once. */ tmp[ix_tmp++] = points[ix_points+count_of_points-1].x; tmp[ix_tmp++] = points[ix_points+count_of_points-1].y; npoints+=2; ix_points += count_of_points; /* * Once more : check for buffer overflow, this time between two * high level lines. */ if (ix_tmp >= RM_MAXLINES - 6) { // int k; for (k=0; k<npoints; k+=4) __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "Line %d (%3.0f,%3.0f)-(%3.0f,%3.0f)", k/4, tmp[k], tmp[k+1], tmp[k+2], tmp[k+3]); (*RoadMapJniEnv)->SetFloatArrayRegion(RoadMapJniEnv, apoints, 0, npoints, tmp); (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, npoints, apoints); nlines=0; npoints=0; ix_tmp = 0; free(tmp); tmp = (float *)malloc(sizeof(float) * RM_MAXLINES); apoints = (*RoadMapJniEnv)->NewFloatArray(RoadMapJniEnv, RM_MAXLINES); } } /* * Finish up, shove out remaining data. */ // int k; for (k=0; k<npoints; k+=4) __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "Line %d (%3.0f,%3.0f)-(%3.0f,%3.0f)", k/4, tmp[k], tmp[k+1], tmp[k+2], tmp[k+3]); (*RoadMapJniEnv)->SetFloatArrayRegion(RoadMapJniEnv, apoints, 0, npoints, tmp); (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, npoints, apoints); free(tmp); } void roadmap_canvas_draw_multiple_polygons (int count, int *polygons, RoadMapGuiPoint *points, int filled, int fast_draw) { jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "DrawPolygon", "(II[F)V"); jfloatArray apoints = 0; int i, count_of_points; // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "draw_multiple_polygons(%d)", count); for (i=0; i<count; i++) { count_of_points = *polygons; // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "draw_multiple_polygons{%d -> %d}", i, count_of_points); apoints = (*RoadMapJniEnv)->NewFloatArray(RoadMapJniEnv, count_of_points * 2); if (count_of_points > 1024) { __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "draw_polygon(%d) Cannot draw %d points ", i, count_of_points); } else { roadmap_canvas_convert_points (apoints, points, count_of_points); (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, filled, count_of_points, apoints); } polygons++; points += count_of_points; } } void roadmap_canvas_draw_multiple_circles (int count, RoadMapGuiPoint *centers, int *radius, int filled, int fast_draw) { jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "DrawCircle", "(IIIII)V"); int i; // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "draw_multiple_circles(%d)", count); for (i=0; i<count; i++) { (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid, centers[i].x, centers[i].y, radius[i], filled, fast_draw); } } /** * @brief register a function to be called when the canvas can be accessed by the app * @param handler function to be called */ void roadmap_canvas_register_configure_handler (RoadMapCanvasConfigureHandler handler) { RoadMapCanvasConfigure = handler; } /** * @brief called when appropriate (when the graphics apis can be used) * to configure the application based on screen characteristics */ void roadmap_canvas_configure(void) { (*RoadMapCanvasConfigure) (); } /** * @brief Register a button press handler */ void roadmap_canvas_register_button_pressed_handler (RoadMapCanvasMouseHandler handler) { RoadMapCanvasMouseButtonPressed = handler; } /** * @brief Register a button release handler */ void roadmap_canvas_register_button_released_handler (RoadMapCanvasMouseHandler handler) { RoadMapCanvasMouseButtonReleased = handler; } /** * @brief Register a mouse movement handler */ void roadmap_canvas_register_mouse_move_handler (RoadMapCanvasMouseHandler handler) { RoadMapCanvasMouseMoved = handler; } /** * @brief */ void Java_net_sourceforge_projects_roadmap_Panel_HandleTouchEvent(JNIEnv* env, jobject thiz, int x, int y, int ac) { RoadMapGuiPoint point; point.x = x; point.y = y; // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "Touch(%d,%d,%d)", ac, x, y); switch (ac) { case 2 /* ACTION_MOVE */: (*RoadMapCanvasMouseMoved) (0, &point); break; case 1 /* ACTION_UP */: case 6 /* ACTION_POINTER_UP */: (*RoadMapCanvasMouseButtonReleased) (1, &point); break; case 0 /* ACTION_DOWN */: case 5 /* ACTION_POINTER_DOWN */: (*RoadMapCanvasMouseButtonPressed) (1, &point); break; } } /** * @brief Register a mouse scroll handler * Not used on Android. */ void roadmap_canvas_register_mouse_scroll_handler (RoadMapCanvasMouseHandler handler) { RoadMapCanvasMouseScroll = handler; } /** * @brief query the canvas dimension * @return the canvas width, in pixels */ int roadmap_canvas_width (void) { int wid = 0; jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "GetWidth", "()I"); wid = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, PanelThiz, mid); return wid ? wid : 320; } /** * @brief query the canvas height * @return the canvas height, in pixels */ int roadmap_canvas_height (void) { int ht = 0; jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "GetHeight", "()I");; ht = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, PanelThiz, mid); return ht ? ht : 480; } /** * @brief force a redraw */ void roadmap_canvas_refresh (void) { jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "Refresh", "()V"); (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, PanelThiz, mid); } /** * @brief take a screenshot, stuff into this file */ void roadmap_canvas_save_screenshot (const char* filename) { jstring js; jclass cls = TheClass(); jmethodID mid = TheMethod(cls, "Screenshot", "(Ljava/lang/String;)I"); int r; js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, filename); r = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, PanelThiz, mid, js); /* FIX ME what to do with return value */ } #if defined(ROADMAP_ADVANCED_STYLE) /* these are stubs */ void roadmap_canvas_set_opacity (int opacity) {} void roadmap_canvas_set_linejoin(const char *join) {} void roadmap_canvas_set_linecap(const char *cap) {} void roadmap_canvas_set_brush_color(const char *color) {} void roadmap_canvas_set_brush_style(const char *style) {} void roadmap_canvas_set_brush_isbackground(int isbackground) {} void roadmap_canvas_set_label_font_name(const char *name) {} void roadmap_canvas_set_label_font_color(const char *color) {} void roadmap_canvas_set_label_font_size(int size) {} void roadmap_canvas_set_label_font_spacing(int spacing) {} void roadmap_canvas_set_label_font_weight(const char *weight) {} void roadmap_canvas_set_label_font_style(int style) {} void roadmap_canvas_set_label_buffer_color(const char *color) {} void roadmap_canvas_set_label_buffer_size(int size) {} #endif /* ROADMAP_ADVANCED_STYLE */ /** * @brief initialize the roadmap_canvas private variables */ void roadmap_canvas_initialize(void) { myPanelClass = 0; RoadMapPenList = NULL; } /** * @brief cleanup private variables */ void roadmap_canvas_shutdown(void) { int i; for (i=0; i<nPens; i++) { free(PenName[i].name); } free(PenName); PenName = 0; nPens = 0; maxPen = 0; myPanelClass = 0; RoadMapPenList = NULL; RoadMapCanvasMouseButtonPressed = roadmap_canvas_ignore_mouse; RoadMapCanvasMouseButtonReleased = roadmap_canvas_ignore_mouse; RoadMapCanvasMouseMoved = roadmap_canvas_ignore_mouse; RoadMapCanvasMouseScroll = roadmap_canvas_ignore_mouse; RoadMapCanvasConfigure = roadmap_canvas_ignore_configure; } /** * @brief helper function to look up colour names * @param name * @return -1 on failure, r * 2^16+ g * 2^8 + b otherwise */ #include "../win32/colors.h" static char *roadmap_canvas_lookup_colourname(const char *name) { int i; static char code[8]; for (i=0; i<r... [truncated message content] |
From: Danny B. <dan...@us...> - 2010-08-14 06:23:03
|
Update of /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25221/android/src/net/sourceforge/projects/roadmap Added Files: Panel.java Pen.java RoadMap.java Log Message: Add the android directory tree. --- NEW FILE: RoadMap.java --- package net.sourceforge.projects.roadmap; import android.os.Bundle; import android.app.Activity; import android.widget.TextView; import android.widget.Toast; import android.content.Context; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.ImageButton; import android.widget.LinearLayout; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.view.ContextMenu; import android.view.Menu; import android.view.MenuItem; import android.os.Handler; import android.os.Message; import android.location.Location; import android.location.LocationListener; import android.location.LocationManager; import android.location.GpsStatus; import android.location.GpsStatus.Listener; import android.location.GpsSatellite; import android.content.res.AssetManager; import android.content.pm.PackageManager; import android.content.pm.ApplicationInfo; public class RoadMap extends Activity { private LocationManager mgr = null; public RoadMap thiz = this; LinearLayout ll, buttons = null; Panel p; Menu myMenu = null; AssetManager asm; /* * References to native functions */ public native void DoubleJniTest(String s); public native void JniStart(); public native void CallIdleFunction(); public native void KickRedraw(); public native void HereAmI(int status, int gpstime, int lat, int lon, int alt, int speed, int steering); public native void AndroidgpsSatellites(int sequence, int id, int elevation, int azimuth, int strength, int active); public native void RoadMapStart(); public native void RoadMapStartWindow(); public native int MenuCallback(int item); public native void CallPeriodic(int index); public native void ToolbarCallback(int cb); @Override public void onCreate(Bundle state) { super.onCreate(state); Log.e("RoadMap", "onCreate(" + state + ")"); ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); buttons = new LinearLayout(this); buttons.setOrientation(LinearLayout.HORIZONTAL); ll.addView(buttons); p = new Panel(this); ll.addView(p); setContentView(ll); mgr = (LocationManager)getSystemService(LOCATION_SERVICE); /* * Some experimental code - not really used yet - to try and * figure out stuff about Android packaging, bitmaps, .. * try { asm = getAssets(); displayFiles(asm, "/"); } catch (Exception e) { Log.e("RoadMap Assets", "Exception " + e); }; try { PackageManager packMgr = this.getPackageManager(); ApplicationInfo appInfo = packMgr.getApplicationInfo("net.sourceforge.projects.roadmap", 0); String apkFilePath = appInfo.sourceDir; Log.e("RoadMap Assets 2", "Apk {" + apkFilePath + "}"); } catch (Exception e2) { Log.e("RoadMap Assets 2", "Exception " + e2); }; /* End experimental code */ /* * Start C code for RoadMap */ JniStart(); // Don't do this here - moved to Panel // so we're sure that the View is created first. // // RoadMapStart(); } private void displayFiles (AssetManager mgr, String path) { try { String list[] = mgr.list(path); if (list != null) for (int i=0; i<list.length; ++i) { Log.v("Assets", "{" + path +"/"+ list[i] + "}"); displayFiles(mgr, path + "/" + list[i]); } } catch (Exception e) { Log.v("List error:", "can't list" + path); } } @Override public void onSaveInstanceState(Bundle state) { super.onSaveInstanceState(state); Log.e("RoadMap", "onSaveInstanceState(" + state + ")"); // ... } @Override public void onRestoreInstanceState(Bundle state) { super.onRestoreInstanceState(state); Log.e("RoadMap", "onRestoreInstanceState(" + state + ")"); // ... } static { // // Currently this happens only once : not unloaded / cleaned up after // the activity is terminated by the user. // System.loadLibrary("expat-1"); System.loadLibrary("jni"); } public void StartGPS() { mgr.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, // updates as fast as possible onLocationChange); mgr.addGpsStatusListener(onGpsChange); } public void StopGPS() { mgr.removeUpdates(onLocationChange); mgr.removeGpsStatusListener(onGpsChange); } LocationListener onLocationChange = new LocationListener() { int mystatus; public void onProviderDisabled(String provider) { // required for interface, not used } public void onProviderEnabled(String provider) { // required for interface, not used } public void onStatusChanged(String provider, int status, Bundle extras) { mystatus = status; } @Override public void onLocationChanged(Location location) { /* Log.e("RoadMap", "GPS {" + location.getProvider() + "}, lat " + location.getLatitude() + ", lon " + location.getLongitude()); /* */ int gpstime = (int) location.getTime(), lat = (int) (location.getLatitude() * 1000000), lon = (int) (location.getLongitude() * 1000000), alt = (int) (location.getAltitude() * 1000000), speed = (int) (location.getSpeed() * 1000), steering = (int) location.getBearing(); // The code in roadmap_gps.c requires 'A' as status. // See roadmap_gps_update_reception(). HereAmI('A', gpstime, lat, lon, alt, speed, steering); } }; GpsStatus.Listener onGpsChange = new GpsStatus.Listener() { @Override public void onGpsStatusChanged(int event) { GpsStatus status; // Cannot resolve this symbol !! FIX ME // if (event != GPS_EVENT_SATELLITE_STATUS) return; status = mgr.getGpsStatus(null); // int maxsat = status.getMaxSatellites(); Iterable<GpsSatellite> iter = status.getSatellites(); int active = 0, nsats = 0; // int id = 0; for (GpsSatellite sat : iter) { nsats++; if (sat.usedInFix()) active++; // note the function called relies on the first parameter // really being a sequence that starts with 1, // and ending with sequence == 0. AndroidgpsSatellites(nsats, sat.getPrn(), (int)sat.getElevation(), (int)sat.getAzimuth(), (int)sat.getSnr(), sat.usedInFix() ? 1 : 0); } AndroidgpsSatellites(0, 0, 0, 0, 0, 0); // Log.e("RoadMap", "onGpsStatusChanged(" + event + "), " + active + "/" + nsats + " satellites"); } }; public void MessageBox(String title, String message) { Toast.makeText(thiz, message, 5000).show(); } public void Finish() { thiz.finish(); } /* * The code below implements a bunch of handlers so the UI actions happen * in the main thread. */ Handler periodicHandler = new Handler() { @Override public void handleMessage(Message msg) { /* schedule ourselves again */ Message m = periodicHandler.obtainMessage(); m.what = msg.what; m.arg1 = msg.arg1; /* This is the delay */ m.arg2 = msg.arg2; sendMessageDelayed(m, msg.arg1); /* do something useful */ CallPeriodic(msg.what); } }; /* * @brief call the periodicHandler from C */ public void SetPeriodic(int index, int interval) { Message m = periodicHandler.obtainMessage(); m.what = index; m.arg1 = interval; m.arg2 = 0; /* Not used */ periodicHandler.sendMessageDelayed(m, interval); } public void RemovePeriodic(int index) { periodicHandler.removeMessages(index); } /** * @brief Idle function handler : call this function once when idle */ Handler idleHandler = new Handler() { @Override public void handleMessage(Message msg) { CallIdleFunction(); } }; /** * @brief Trigger the idle function */ public void TriggerIdleFunction() { idleHandler.sendMessage(idleHandler.obtainMessage()); } /* * @brief Menu code - to be reviewed because no nesting possible on Android * * Note onCreateOptionsMenu needs to scan structures created from C * and build the menu from it. * Can't do this easily in one pass because we'd have to postpone much * configuration file reading until the user hits the menu button. */ @Override public boolean onCreateOptionsMenu(Menu menu) { boolean r; int i; Menu parent; myMenu = menu; r = super.onCreateOptionsMenu(menu); // add (sub)menus for (i=1; i<nMenuCache; i++) { if (menuCache[i].parent == 0) parent = myMenu; else parent = menuCache[i].menu; try { menuCache[i].menu = parent.addSubMenu(menuCache[i].label); } catch (Exception e) { Log.e("RoadMap", "AddSubMenu {" + i + "} (" + parent + "," + menuCache[i].label + ") : exception " + e); return false; } } // add menu items for (i=1; i<nMenuItemCache; i++) { if (menuItemCache[i].parent == 0) parent = myMenu; else { int iparent = menuItemCache[i].parent; parent = menuCache[iparent].menu; } try { menuItemCache[i].item = parent.add(Menu.NONE, i, Menu.NONE, menuItemCache[i].label); } catch (Exception e) { Log.e("RoadMap", "AddMenuItem {" + i + "} (" + parent + "," + menuItemCache[i].label + ") : exception " + e); return false; } } return r; } @Override public boolean onOptionsItemSelected(MenuItem item) { return(applyMenuChoice(item) || super.onOptionsItemSelected(item)); } /* * @brief * needs to return true if a menu was activated */ private boolean applyMenuChoice(MenuItem item) { if (MenuCallback(item.getItemId()) != 0) { return true; } return false; } class MenuCacheEntry { int parent; Menu menu; String label; // more FIX ME }; // FIX ME make dynamic final int maxMenuCacheEntry = 100; MenuCacheEntry menuCache[] = new MenuCacheEntry[maxMenuCacheEntry]; int nMenuCache = 1; public int CreateMenu(String s) { if (nMenuCache == maxMenuCacheEntry) { Log.e("RoadMap", "CreateMenu(" + s + ") : cache full"); return -1; } menuCache[nMenuCache] = new MenuCacheEntry(); menuCache[nMenuCache].parent = 0 /* m */; menuCache[nMenuCache].label = s; return nMenuCache++; } /* public void MenuParent(int m, String s) { try { } catch (Exception e) { Log.e("RoadMap", "LabelMenu(" + m + "," + s + ") : " + e); } } */ class MenuItemCacheEntry { int parent; MenuItem item; String label; // more FIX ME }; // FIX ME make dynamic final int maxMenuItemCache = 200; MenuItemCacheEntry menuItemCache[] = new MenuItemCacheEntry[maxMenuItemCache]; int nMenuItemCache = 1; public int AddMenuItem(int m, String s) { if (nMenuItemCache == maxMenuItemCache) { Log.e("RoadMap", "AddMenuItem(" + m + "," + s + ") : cache full"); return -1; } try { menuItemCache[nMenuItemCache] = new MenuItemCacheEntry(); menuItemCache[nMenuItemCache].parent = m; menuItemCache[nMenuItemCache].label = s; } catch (Exception e) { Log.e("RoadMap", "AddMenuItem(" + m + "," + s + ") : " + e); return -1; }; return nMenuItemCache++; } /* * @brief AddToolbar() - this is already performed in the constructor * Either leave it in the constructor, or find a way to alter the geometry * afterwards (if it needs to come on top). * FIX ME */ private void AddToolbar(String orientation) { } // Is there no better way to pass an id ? class ToolbarCacheEntry { View view; // int ix; }; // FIX ME make dynamic final int maxToolbarCache = 30; ToolbarCacheEntry toolBar[] = new ToolbarCacheEntry[maxToolbarCache]; int nToolbarCache = 0; OnClickListener mToolbarClick = new OnClickListener() { public void onClick(View v) { int i; for (i=0; i<nToolbarCache; i++) if (v == toolBar[i].view) { ToolbarCallback(i); return; } // FIX ME No button found, should we throw an exception ? Log.e("RoadMap", "mToolbarClick(" + v + ") : unregistered button"); } }; public void AddTool(String label, String icon, String tip, int cb) { ImageButton ib; Button tb; Bitmap bm; if (nToolbarCache == maxToolbarCache) { Log.e("RoadMap", "AddTool(" + label + "," + icon + ") : cache full"); return; } toolBar[nToolbarCache] = new ToolbarCacheEntry(); ib = new ImageButton(thiz); ib.setOnClickListener(mToolbarClick); // Need to make this device independent. // bm = BitmapFactory.decodeFile("/sdcard/roadmap/icons/" + icon + ".png"); // // Assume that the C layer has already located an icon, or passed NULL. // Note: it does that through roadmap_path_search_icon(). bm = BitmapFactory.decodeFile(icon); if (bm != null) { ib.setImageBitmap(bm); // ib.setMaxWidth(bm.getWidth()); // ib.setMaxHeight(bm.getHeight()); buttons.addView(ib); toolBar[nToolbarCache].view = ib; // Log.e("RoadMap", "AddTool(" + label + "," + icon + ") : image button {" + ib + "}"); } else { tb = new Button(thiz); tb.setText(label); buttons.addView(tb); toolBar[nToolbarCache].view = tb; // Log.e("RoadMap", "AddTool(" + label + "," + icon + ") : text button {" + tb + "}"); } nToolbarCache++; } } --- NEW FILE: Pen.java --- package net.sourceforge.projects.roadmap; import android.util.Log; import android.graphics.Color; import android.graphics.Paint; import android.graphics.PathEffect; import android.graphics.DashPathEffect; import java.lang.Exception; class Pen { private int current = -1; private Paint pens[]; private int maxPens = 0; private float[] dash = new float[] {5, 5}; private DashPathEffect dashEffect = null; public Pen() { pens = new Paint[200]; maxPens = 200; } public void Create(int index) { pens[index] = new Paint(); } public void SelectPen(int index) { if (index > maxPens) return; current = index; } public int SetForeground(String color) { int colorvalue; try { colorvalue = Color.parseColor(color); } catch (Exception e) { return -1; }; try { pens[current].setColor(colorvalue); } catch (Exception e) { Log.e("RoadMap", "SetForeground(" + color + ") failed : " + e); return -2; }; return 0; } public void SetLineStyle(int dashed) { try { if (dashed != 0) { if (dashEffect == null) dashEffect = new DashPathEffect(dash, 0); pens[current].setPathEffect(dashEffect); } else { pens[current].setPathEffect(null); } } catch (Exception e) { Log.e("RoadMap", "SetLineStyle failed : " + e); }; } public void SetThickness(int thickness) { try { pens[current].setStrokeWidth(thickness); } catch (Exception e) { Log.e("RoadMap", "SetThickness failed : " + e); }; } public Paint GetPaint() { try { // Log.e("RoadMap", "GetPaint(" + current + ")"); return pens[current]; } catch (Exception e) { Log.e("RoadMap", "GetPaint: failed (pen " + current + ")"); return pens[0]; } } } --- NEW FILE: Panel.java --- package net.sourceforge.projects.roadmap; import android.content.Context; import android.util.Log; import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.graphics.Bitmap; import android.graphics.Bitmap.CompressFormat; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Path; import java.lang.Exception; import java.io.File; import java.io.FileOutputStream; class Panel extends View implements View.OnClickListener, View.OnLongClickListener { public native void RoadMapStart(); public native void PanelJniStart(); public native void HandleTouchEvent(int x, int y, int ac); private Pen pen; private Bitmap cacheBitmap = null; private Canvas cacheCanvas = null; private Paint paint; private Paint drawPaint; private void doThisFirst() { if (cacheBitmap != null) return; Log.e("RoadMap Panel", "Size wid " + getWidth() + ", ht " + getHeight()); cacheBitmap = Bitmap.createBitmap(getWidth(), getHeight(), Bitmap.Config.ARGB_8888); cacheCanvas = new Canvas(cacheBitmap); RoadMapStart(); } public Panel(Context context) { super(context); PanelJniStart(); setFocusable(true); pen = new Pen(); drawPaint = new Paint(); } static float xp = 0, yp = 0; @Override public boolean onTouchEvent(MotionEvent event) { Float x = event.getX(), y = event.getY(); int ac = event.getAction(); switch (ac) { case 2 /* ACTION_MOVE */ : case 0 /* ACTION_DOWN */ : case 1 /* ACTION_UP */ : case 6 /* ACTION_POINTER_UP */ : case 5 /* ACTION_POINTER_DOWN */ : HandleTouchEvent(x.intValue(), y.intValue(), ac); return true; } return false; } public void onClick(View view) { } /* * for .. extends View.OnTouchListener * public boolean onTouch(View view, MotionEvent e) { return false; } /* */ public boolean onLongClick(View view) { return false; } public int GetHeight() { int r; try { return getHeight(); } catch (Exception e) { Log.e("RoadMap", "Panel GetHeight " + e.getMessage()); return 0; } } public int GetWidth() { int r; try { return getWidth(); } catch (Exception e) { Log.e("RoadMap", "Panel GetWidth " + e.getMessage()); return 0; } } public void Refresh() { invalidate(); } public void Erase() { try { cacheCanvas.drawColor(Color.WHITE); // cacheCanvas.drawColor(Color.RED); } catch (Exception e) { Log.e("RoadMap", "Panel Erase " + e.getMessage()); } } @Override public void onDraw(Canvas canvas) { doThisFirst(); super.onDraw(canvas); canvas.drawBitmap(cacheBitmap, 0, 0, drawPaint); } public void SetLinestyle(int dashed) { pen.SetLineStyle(dashed); } public void SetThickness(int thickness) { pen.SetThickness(thickness); } public int SetForeground(String color) { return pen.SetForeground(color); } public void DrawString(int x, int y, int corner, int size, String text) { DrawStringAngle(x, y, size, 0, text); } public int Screenshot(String filename) { try { File file; FileOutputStream os; file = new File(filename); file.getParentFile().mkdirs(); os = new FileOutputStream(file); cacheBitmap.compress(CompressFormat.PNG, 80, os); } catch (Exception e1) { Log.e("RoadMap", "Screenshot failed"); return -1; } Log.e("RoadMap", "Screenshot saved in " + filename); return 0; } /* * @return pointer to the pen * * Note we're relying on sizeof(int) >= sizeof(pointer) here. * Note we're not passing the pen name from C to Java, we're not using it anyway. */ public void CreatePen(int penNumber) { /* Should set defaults : * gdk_gc_set_fill (gc, GDK_SOLID); * pen->style = GDK_LINE_SOLID; */ pen.Create(penNumber); } public void SelectPen(int index) { pen.SelectPen(index); } public void DrawCircle(int x, int y, int radius, int filled, int fastdraw) { try { paint = pen.GetPaint(); if (filled == 1) paint.setStyle(Paint.Style.FILL_AND_STROKE); else paint.setStyle(Paint.Style.STROKE); cacheCanvas.drawCircle(x, y, radius, paint); } catch (Exception e) { Log.e("RoadMap", "Exception " + e + " in DrawCircle"); } } public void DrawPolygon(int filled, int count, float[] points) { // Log.e("Java", "DrawPolygon(count " + count + ", fill " + filled + ")"); try { int i; paint = pen.GetPaint(); if (filled == 1) paint.setStyle(Paint.Style.FILL_AND_STROKE); else paint.setStyle(Paint.Style.STROKE); Path path = new Path(); path.moveTo(points[0], points[1]); for (i=2; i<2*count; i+=2) { path.lineTo(points[i], points[i+1]); } path.close(); cacheCanvas.drawPath(path, paint); } catch (Exception e) { Log.e("RoadMap", "Exception " + e + " in DrawPolygon"); } } public void DrawLines(int count, float[] points) { try { paint = pen.GetPaint(); cacheCanvas.drawLines(points, paint); } catch (Exception e) { Log.e("RoadMap", "Exception " + e + " in DrawLines"); } } public void DrawStringAngle(int x, int y, int size, int angle, String text) { /* FIX ME Haven't looked into the angle yet */ try { paint = pen.GetPaint(); cacheCanvas.drawText(text, x, y, paint); } catch (Exception e) { Log.e("RoadMap", "Exception " + e + " in DrawStringAngle"); } } public void DrawPoints(int count, float[] points) { try { paint = pen.GetPaint(); cacheCanvas.drawPoints(points, paint); } catch (Exception e) { Log.e("RoadMap", "Exception " + e + " in DrawPoints"); } } public int MeasureWidth(String text, int s) { try { paint = pen.GetPaint(); // Log.e("RoadMap", "Measure(" + text + ") -> " + paint.measureText(text)); return (int) paint.measureText(text); } catch (Exception e) { Log.e("RoadMap", "MeasureWidth(" + text + ") : exception " + e); return 10; } } public int MeasureAscent() { try { paint = pen.GetPaint(); // Log.e("RoadMap", "MeasureAscent() -> " + paint.ascent()); return (int)-paint.ascent(); } catch (Exception e) { Log.e("RoadMap", "MeasureAscent() : exception " + e); return 10; } } public int MeasureDescent() { try { paint = pen.GetPaint(); // Log.e("RoadMap", "MeasureDescent() -> " + paint.descent()); return (int) paint.descent(); } catch (Exception e) { Log.e("RoadMap", "MeasureDescent() : exception " + e); return 10; } } } |
From: Danny B. <dan...@us...> - 2010-08-14 06:23:03
|
Update of /cvsroot/roadmap/roadmap/src/android/distribution In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25221/android/distribution Added Files: preferences roadmap.screenobjects roadmap.toolbar session sprites Log Message: Add the android directory tree. --- NEW FILE: session --- Delta.Rotate: 0 Delta.Y: 0 Delta.X: 0 Focus.Rotate: 0 Focus.Name: Address Hold.Direction: 0 Hold.Position: 0,0 Selection.Position: -122394181,37794928 Address.Position: -122394181,37794928 GPS.Direction: 0 GPS.Position: 0,0 General.Zoom: 150 --- NEW FILE: roadmap.toolbar --- # # Sample replacement toolbar for RoadMap. # # One button will invoke the menu system as a series of popups, and # the other buttons will perform specific actions. The button labels will # come from "roadmap.actionlabels". # If a "Menus..." button like that below is to be used, it may be # desireable to suppress the default "normal" menus. To do so, create # an empty "roadmap.menus" file. ->Menus... gps destination addaswaypoint resumeroute toggleview quit --- NEW FILE: sprites --- # # Sprites are small drawings (somewhat like icons) which RoadMap will put # on the screen in various roles. Some move, some are stationary. # # Syntax of the sprite description: # S <name> Start a sprite. The name is how RoadMap refers # to the sprite. These references are # hard-coded into RoadMap. # A <name> Defines this sprite as an alias for another sprite. # (An alias cannot itself have drawing directives). # F <color> <thickness> Start a new color plane. # X <percent> Optional scale factor, for resizing the entire sprite. # L <x>,<y> ... Defines a line. # P <x>,<y> ... Defines a (filled) polygon. # C <x>,<y> <radius> Defines a circle. # D <x>,<y> <radius> Defines a disk (i.e. a filled circle). # B <x>,<y> <x>,<y> Override the sprite's natural bounding box. # T <x>,<y> <s> text... Adds text to the sprite, of size 's'. "text" # can be ommitted, in cases where the sprite's # text will be provided by a screen object # definition. Text strings are fixed, with # no expansion of %-macros. # TR If the sprite has text, supply a backing rectangle # sized and positioned to match the text. # TB If the sprite has text, supply a box outline around # the text. # # The coordinates x and y are relative to the sprite's hot point. # Positive x and y values are towards the south-east. # # The natural "direction" for the sprite is north (e.g., for an arrow). # # The bounding box of sprite is normally calculated internally, # but can be overridden. If a sprite has text associated with # it, the text forms a second, separate, bounding box. Currently # these outlines are only used when sprite is referenced in # "roadmap.screenobjects". The bounding box can also be # overridden there. # # We use aliases to separate a sprite's usage from its actual drawing. # This makes it easier to change the representation of a specific object. S GPS A BlueDart S Friend A GreenTriangle S Selection A CrossHair S Direction A RedArrow S Destination A RedDotCircle S PointOfInterest A SmallRedDot S Waypoint A DarkGreenDot S Start A GreenTrianglePointer S RoutePoint A Circle-Pointer S SecondaryRoutePoint A Small-Circle-Pointer S PersonalLandmark A 5PointStar S TripLandmark A GreenSquare S Highlight A YellowDot S Kismet A RedDisk S Track A PurpleChevron S InactiveTrack A SmallPurpleChevron S BreadCrumb A PurpleDot S Departure A DottedSquare S Direction_Next A BigGreenDart S Direction_2nd A BigYellowDart S Direction_Dest A BigRedDart S ZoomIn A CirclePlus S ZoomOut A CircleMinus # The actual drawing sprites: S BlueDart F white 2 L 0,0 7,14 0,8 -7,14 F blue 1 P 0,1 6,13 0,10 -6,13 L 8,11 0,-3 -8,11 # same as "BlueDart", but with a bigger black # outline for visibility on low-contrast displays S OutlinedBlueDart F white 2 L 0,0 7,14 0,8 -7,14 L 11,17 0,-3 -11,17 0,14 11,17 F blue 1 P 0,1 6,13 0,10 -6,13 F black 1 L 11,17 0,-3 -11,17 0,14 11,17 S GreenTriangle F white 2 L 0,0 7,14 0,8 -7,14 F DarkGreen 2 L 0,1 6,13 0,10 -6,13 0,1 S PurpleTriangle F Purple 1 P 0,-10 -9,5 9,5 0,-10 S CrossHair F white 3 L 0,-10 0,-20 L 0,10 0,20 L 10,0 20,0 L -10,0 -20,0 C 0,0 15 F black 1 L 0,-10 0,-20 L 0,10 0,20 L 10,0 20,0 L -10,0 -20,0 C 0,0 15 S RedArrow F red 1 P -5,-20 0,-35 5,-20 F black 1 L -5,-20 0,-35 5,-20 -5,-20 S RedDotCircle F red 1 D 0,0 5 F black 1 C 0,0 5 C 0,0 7 S SmallRedDot F red 1 D 0,0 3 S GreenTrianglePointer F green 2 P 0,-9 -8,4 8,4 0,-9 F black 1 L 0,-9 -8,4 8,4 0,-9 L 1,-8 1,-16 L 1,-16 -1,-16 L -1,-16 -1,-8 S GreenDot F green 1 D 0,0 5 F black 1 C 0,0 5 S DarkGreenDot F darkgreen 1 D 0,0 5 F black 1 C 0,0 5 S GreenSquare F black 1 L 5,5 5,-5 -5,-5 -5,5 5,5 F green 1 P 4,4 4,-4 -4,-4 -4,4 4,4 S PurpleChevron F purple 2 L -4,6 0,-6 4,6 S SmallPurpleChevron F purple 2 L -4,4 0,-4 4,4 S PurpleCross F purple 2 L -4,0 4,0 L 0,-4 0,4 S PurpleDot F purple 1 D 0,0 3 S 5PointStar F darkred 1 L 0,-9 5,7 L 5,7 -8,-3 L -8,-3 8,-3 L 8,-3 -5,7 L -5,7 0,-9 S YellowDot F yellow 1 D 0,0 5 F black 1 C 0,0 5 S RedDisk F red 1 D 0,0 10 S Circle F black 1 C 0,0 7 S Circle-Pointer F green 1 D 0,0 7 F black 1 C 0,0 7 C 0,0 1 L 1,-7 1,-16 L 1,-16 -1,-16 L -1,-16 -1,-7 S Small-Circle-Pointer F green 1 D 0,0 6 F black 1 C 0,0 6 L 1,-6 1,-16 L 1,-16 -1,-16 L -1,-16 -1,-6 S DottedSquare F black 1 L 9,9 9,-9 -9,-9 -9,9 9,9 C 0,0 1 # These are very specific sprites we do not expect to change much. S Compass #F white 1 #D 0,0 13 F black 2 C 0,0 14 F white 1 C 0,0 15 F white 3 L -4,0 0,-13 4,0 L -4,0 0,13 4,0 F black 1 P -4,0 0,-13 4,0 F black 1 L -4,0 0,-13 4,0 L -4,0 0,13 4,0 L -17,0 -7,0 L 7,0 17,0 L 0,-13 0,-17 L 0,13 0,17 S Compass_fixed A BigBlackDart S BigBlackDart F black 1 P -9,13 0,8 9,13 0,-13 F white 1 L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 S BigGreenDart F green 1 P -9,13 0,8 9,13 0,-13 F black 2 L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 S BigYellowDart F yellow 1 P -9,13 0,8 9,13 0,-13 F black 2 L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 S BigRedDart F red 1 P -9,13 0,8 9,13 0,-13 F black 2 L 0,8 9,13 0,-13 L 0,8 -9,13 0,-13 S Download #F white 1 #D 0,0 14 F white 1 C 0,0 9 F red 1 C 0,0 8 P -7,-6 -12,4 -2,4 P 7,6 12,-4 2,-4 F white 1 L -7,-6 -12,4 L -7,-6 -2,4 L 7,6 12,-4 L 7,6 2,-4 F black 2 C 0,0 14 F white 1 C 0,0 15 # GPS Indication symbols: S Reception_na #F white 1 #D 0,0 15 F black 2 C 0,0 15 F white 1 C 0,0 16 F white 1 P -10,-5 -3,-12 0,-5 -2,-3 P 5,0 12,3 5,10 2,3 P 5,-10 10,-5 0,5 -5,0 F black 1 L -10,-5 -3,-12 0,-5 -2,-3 -10,-5 L 5,0 12,3 5,10 2,3 5,0 L 5,-10 10,-5 0,5 -5,0 5,-10 L -7,1 -6,3 -3,6 -1,7 L -10,1 -9,3 -3,9 -1,10 L -13,1 -12,3 -3,12 -1,13 F DarkRed 2 L -9,-9 9,9 L 9,-9 -9,9 S reception_none #F white 1 #D 0,0 15 F black 2 C 0,0 15 F white 1 C 0,0 16 F red 1 P -10,-5 -3,-12 0,-5 -2,-3 P 5,0 12,3 5,10 2,3 P 5,-10 10,-5 0,5 -5,0 F black 1 L -10,-5 -3,-12 0,-5 -2,-3 -10,-5 L 5,0 12,3 5,10 2,3 5,0 L 5,-10 10,-5 0,5 -5,0 5,-10 L -7,1 -6,3 -3,6 -1,7 L -10,1 -9,3 -3,9 -1,10 L -13,1 -12,3 -3,12 -1,13 F white 1 TR F black 1 TB F black 2 T 0,20 10 S reception_poor #F white 1 #D 0,0 15 F black 2 C 0,0 15 F white 1 C 0,0 16 F yellow 1 P -10,-5 -3,-12 0,-5 -2,-3 P 5,0 12,3 5,10 2,3 P 5,-10 10,-5 0,5 -5,0 F black 1 L -10,-5 -3,-12 0,-5 -2,-3 -10,-5 L 5,0 12,3 5,10 2,3 5,0 L 5,-10 10,-5 0,5 -5,0 5,-10 L -7,1 -6,3 -3,6 -1,7 L -10,1 -9,3 -3,9 -1,10 L -13,1 -12,3 -3,12 -1,13 F white 1 TR F black 1 TB F black 2 T 0,20 10 S reception_good #F green 1 #D 0,0 15 F black 2 C 0,0 15 F white 1 C 0,0 16 #F white 1 F green 1 P 10,-5 3,-12 0,-5 2,-3 P -5,0 -12,3 -5,10 -2,3 P -5,-10 -10,-5 0,5 5,0 F black 1 L 10,-5 3,-12 0,-5 2,-3 10,-5 L -5,0 -12,3 -5,10 -2,3 -5,0 L -5,-10 -10,-5 0,5 5,0 -5,-10 L 7,1 6,3 3,6 1,7 L 10,1 9,3 3,9 1,10 L 13,1 12,3 3,12 1,13 F white 1 TR F black 1 TB F black 2 T 0,20 10 # Red X S X F DarkRed 4 L 4,4 20,20 L 20,4 4,20 S CirclePlus #F white 1 #D 0,0 15 F black 2 C 0,0 15 F white 1 C 0,0 16 F black 1 P -2,2 -2,12 2,12 2,2 12,2 12,-2 2,-2 2,-12 -2,-12 -2,-2 -12,-2 -12,2 # F white 1 # L -3,3 -3,12 3,12 3,3 12,3 12,-3 3,-3 3,-12 -3,-12 -3,-3 -12,-3 -12,3 -3,3 S CircleMinus #F white 1 F black 1 #D 0,0 15 F black 2 C 0,0 15 F white 1 C 0,0 16 F black 1 P 12,2 12,-2 -12,-2 -12,2 # F white 1 # L 12,3 12,-3 -12,-3 -12,3 12,3 S Menu #F white 1 #D 0,0 15 F black 2 C 0,0 15 F white 1 C 0,0 16 P -5,-8 6,-8 2,8 -9,8 -5,-8 P 6,-8 5,7 8,7 6,-8 F black 1 L -5,-8 6,-8 2,8 -9,8 -5,-8 L 5,7 8,7 6,-8 L -3,-5 3,-5 L -3,-3 2,-3 L -4,-1 2,-1 L -5,1 1,1 L -5,3 1,3 # uncomment to add a text label # T 0,25 18 Menu # an empty textbox, which can be used as a screenobject S TextBox F white 1 TR F black 1 TB F black 2 T 0,0 20 # an empty textbox, which can be used as a screenobject S InfoBox F lightgreen 1 TR F black 1 TB F darkgreen 2 T 0,0 20 --- NEW FILE: roadmap.screenobjects --- # This file describes objects which can be displayed on the screen. # These objects can reflect the state of the program (e.g., which way # is north, how strong is the GPS signal), and/or allow actions to # be performed (e.g. zoom in, show the trip's destination). These # objects may be placed anywhere on the screen, but nothing prevents # them from being obscured by other popup messages and displays, so # their position should probably be along the sides of the screen. # # Syntax: # # N <name> Name of the object (unused, but starts a new object) # Specifying a name, and nothing else at all, will # define a null object which can be used to # override objects defined in other (e.g. system) # screenobjects files. # P <x> <y> The screen position of the sprite, measured from # the top left in pixels. Negative offsets measure # from the right and from the bottom. If the <x> or # <y> value begins with a 'C', then the remainder # is an offset from the center of the screen. # E <sprite> [text] The name of the sprite which will be drawn. # E <sprite> [text] Multiple sprites can be specified. Which one is # displayed is selected via the object's "state" # indicator. If "text" is specified, it will be # displayed with the sprite (assuming the sprite # has been defined to have text associated with it). # - The text can be divided into multiple lines. # Line breaks are indicated by inserting a '^'. # - The text can contain %-macros, just as defined # for other text displays, in order to display # dynamic content. The '|' "alternation" symbol # is also honored. See the documentation. # S <statename> The "state" indicator which will choose among # the listed sprites. For "constant" displays, this # is optional. # A <actionname> The action which should be invoked when the sprite # is selected. Optional. # R <angle> Sprites will normally rotate dynamically, either with # the screen, or based on an angle retrieved via the # state indicator. Specifying 'R' suppresses this # by forcing rotation to the given angle. (default 0) # B <x> <y> <x> <y> Optional -- the bounding box used to determine # whether a selection has taken place. (I.e., the # size of the sprite.) Normally the bounding box is # provided by the sprite itself, but irregularly # shaped sprites, combined with the rotation of the # sprite, may require that the box be overridden. # Note that the bounding box for any text associated # with the sprite is calculated and considered # separately. Also note that if sprite scaling is # used, this bounding box may need to be adjusted. # the Compass object shows which way is north. it changes from a # traditional "compass rose" to a simple arrow if "dynamic orientation" # is turned off. N Compass S get_orientation P 20 60 E Compass E Compass_fixed A toggleorientation # The GPS_reception object displays the relative GPS signal strength. # Selecting it will reposition the map to the current GPS position. # This version doesn't have a text object, the colour should suffice. N GPS_reception S get_GPS_reception P 20 100 E reception_na E reception_none E reception_poor E reception_good A gps R # When the Download object is visible, it indicates that RoadMap is # willing to download maps from the network. # N Download # S get_download_enabled # P -20, 60 # E Download # R # Uncomment this one to get an on-screen "Menu" icon. With this enabled, # you could then get rid of the normal drop-down menus, and the toolbar. # (You could also get rid of them and use a long-click to get menus.) # N Menus # P -20 -60 # E Menu # A ->Menus... # R 0 # The Direction_Next object points to the route's next waypoint, # relative to the current direction of travel (assuming the screen # is facing forward in the vehicle). N Direction_Next S get_direction_next P -20 100 E Direction_Next A nextpoint # # The Direction_2nd object points to waypoint after the next. # # relative to the current direction of travel. This can be # # useful to see which way the route will go at the next turning. N Direction_2nd S get_direction_2nd P -20 140 E Direction_2nd A 2ndpoint # The Direction_Dest object points to the route's last waypoint, # relative to the direction of travel. N Direction_Dest S get_direction_dest P -20 180 E Direction_Dest A destination # The ZoomIn/Out_Buttons do just that, when selected. N ZoomIn_Button P 20 -100 E ZoomIn A zoomin R 0 N ZoomOut_Button P 20 -60 E ZoomOut A zoomout R 0 # The next four are up/down/left/right controls, centered on # each edge of the screen, each rotated appropriately. # (Most devices have dedicated arrow keys, though, so these # are commented out by default.) # N UpArrow # P C0 20 # E PurpleTriangle # A up # R 0 # # N DownArrow # P C0 -20 # E PurpleTriangle # A down # R -180 # # N RightArrow # P -20 C0 # E PurpleTriangle # A right # R 90 # # N LeftArrow # P 20 C0 # E PurpleTriangle # A left # R -90 # # provide a labeled "button" to switch view modes # N 2D3D # P 20 180 # S view_mode # E TextBox 3D # E TextBox 2D # A toggleview # # show current time, along with either sunset or sunrise time N daylight P C-80 -40 E InfoBox Time: %T^Sunset:^%E|Time: %T^Sunrise:^%M --- NEW FILE: preferences --- Destination.Color: red Map.Cache: 8 Map.Background: LightYellow General.Default Zoom: 20 General.Keyboard: no General.Icons: yes General.Toolbar: yes General.Unit: imperial GPS.Source: gpsd2://localhost Highlight.Background: yellow Highlight.Duration: 10 Highlight.Thickness: 4 Location.Color: red Polygons.Declutter: 1300 Shapes.Declutter: 1300 Display.Rotate: yes General.Language: en_EN General.Sprite Scale: 100 GPS.Font Size: 15 Display.Font Size: 20 Labels.Font Size: 15 Landmarks.Font Size: 20 Map.DynamicOrientation: off |
From: Danny B. <dan...@us...> - 2010-08-14 06:23:02
|
Update of /cvsroot/roadmap/roadmap/src/android/distribution/default In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25221/android/distribution/default Added Files: All Log Message: Add the android directory tree. --- NEW FILE: All --- Class.Name: All Class.Lines: Freeways Ramps Highways Streets Trails Rivers Shore Railroads Boundaries Class.Polygons: Lakes Sea Parks Hospitals Airports Stations Malls Class.NavigationModes: Car Bike Foot Boat Navigation.Car: Freeways Ramps Highways Streets Navigation.Bike: Streets Trails Shore Parks Navigation.Foot: Streets Trails Shore Parks Stations Malls Hospitals Airports Navigation.Boat: Rivers Shore Lakes Sea Freeways.Color: black Freeways.Color1: IndianRed Freeways.Delta1: -2 Freeways.Color2: black Freeways.Delta2: 1 Freeways.Declutter: 10000 Freeways.Thickness: 6 Freeways.Speed: 120 Ramps.Color: black Ramps.Color1: red Ramps.Delta1: -2 Ramps.Declutter: 160 Ramps.Thickness: 3 Ramps.Speed: 120 Highways.Color: black Highways.Color1: yellow Highways.Delta1: -2 Highways.Declutter: 1300 Highways.Thickness: 3 Highways.Speed: 120 Streets.Color: black Streets.Color1: white Streets.Delta1: -2 Streets.Declutter: 160 Streets.Thickness: 2 Streets.Speed: 90 Trails.Color: DarkGrey Trails.Declutter: 160 Trails.Thickness: 1 Trails.Speed: 50 Railroads.Color: black Railroads.Declutter: 250 Railroads.Style: dashed Railroads.Thickness: 1 Railroads.Speeds: 1 Rivers.Color: LightBlue Rivers.Declutter: 300 Rivers.Thickness: 3 Rivers.Speed: 1 Shore.Color: LightSlateBlue Shore.Declutter: 2000 Shore.Thickness: 2 Shore.Speed: 30 Hospitals.Color: red Hospitals.Declutter: 4096 Hospitals.Thickness: 1 Hospitals.Speed: 1 Malls.Color: yellow Malls.Declutter: 4096 Malls.Thickness: 1 Malls.Speed: 1 Airports.Color: grey Airports.Declutter: 4096 Airports.Thickness: 1 Airports.Speed: 1 Stations.Color: grey Stations.Declutter: 4096 Stations.Thickness: 1 Stations.Speed: 1 Lakes.Color: LightBlue Lakes.Declutter: 1300 Lakes.Thickness: 1 Lakes.Speed: 1 Parks.Color: green Parks.Declutter: 4096 Parks.Thickness: 1 Parks.Speed: 30 Sea.Color: SlateBlue Sea.Declutter: 2147483647 Sea.Thickness: 1 Sea.Speed: 1 Boundaries.Color: darkgreen Boundaries.Thickness: 2 Boundaries.Declutter: 2147483647 Boundaries.Speed: 1 |
From: Danny B. <dan...@us...> - 2010-08-14 06:23:02
|
Update of /cvsroot/roadmap/roadmap/src/android/res/drawable In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25221/android/res/drawable Added Files: clockwise.png counterclockwise.png destination.png down.png full.png gps.png hold.png icon.png left.png location.png quit.png record.png right.png roadmap.png stop.png up.png zoom1.png zoomin.png zoomout.png Log Message: Add the android directory tree. --- NEW FILE: zoomout.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: roadmap.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: stop.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: quit.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: full.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: up.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: destination.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: hold.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: icon.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: left.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: zoomin.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: location.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: clockwise.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: zoom1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: record.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: down.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: gps.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: counterclockwise.png --- (This appears to be a binary file; contents omitted.) |
From: Danny B. <dan...@us...> - 2010-08-14 06:23:02
|
Update of /cvsroot/roadmap/roadmap/src/android/res/values In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25221/android/res/values Added Files: strings.xml Log Message: Add the android directory tree. --- NEW FILE: strings.xml --- <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">RoadMap</string> </resources> |
From: Danny B. <dan...@us...> - 2010-08-14 06:20:13
|
Update of /cvsroot/roadmap/roadmap/src/android/res/values In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv24908/res/values Log Message: Directory /cvsroot/roadmap/roadmap/src/android/res/values added to the repository |
From: Danny B. <dan...@us...> - 2010-08-14 06:20:05
|
Update of /cvsroot/roadmap/roadmap/src/android/res/drawable In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv24818/res/drawable Log Message: Directory /cvsroot/roadmap/roadmap/src/android/res/drawable added to the repository |
From: Danny B. <dan...@us...> - 2010-08-14 06:19:52
|
Update of /cvsroot/roadmap/roadmap/src/android/net/sourceforge/projects/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv24803/net/sourceforge/projects/roadmap Log Message: Directory /cvsroot/roadmap/roadmap/src/android/net/sourceforge/projects/roadmap added to the repository |
From: Danny B. <dan...@us...> - 2010-08-14 06:19:46
|
Update of /cvsroot/roadmap/roadmap/src/android/net/sourceforge/projects In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv24793/net/sourceforge/projects Log Message: Directory /cvsroot/roadmap/roadmap/src/android/net/sourceforge/projects added to the repository |
From: Danny B. <dan...@us...> - 2010-08-14 06:19:32
|
Update of /cvsroot/roadmap/roadmap/src/android/net/sourceforge In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv24747/net/sourceforge Log Message: Directory /cvsroot/roadmap/roadmap/src/android/net/sourceforge added to the repository |
From: Danny B. <dan...@us...> - 2010-08-14 06:19:23
|
Update of /cvsroot/roadmap/roadmap/src/android/libs/armeabi In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv24706/libs/armeabi Log Message: Directory /cvsroot/roadmap/roadmap/src/android/libs/armeabi added to the repository |
From: Danny B. <dan...@us...> - 2010-08-14 06:19:12
|
Update of /cvsroot/roadmap/roadmap/src/android/gen/net/sourceforge/projects/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv24692/gen/net/sourceforge/projects/roadmap Log Message: Directory /cvsroot/roadmap/roadmap/src/android/gen/net/sourceforge/projects/roadmap added to the repository |
From: Danny B. <dan...@us...> - 2010-08-14 06:19:04
|
Update of /cvsroot/roadmap/roadmap/src/android/gen/net/sourceforge/projects In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv24657/gen/net/sourceforge/projects Log Message: Directory /cvsroot/roadmap/roadmap/src/android/gen/net/sourceforge/projects added to the repository |
From: Danny B. <dan...@us...> - 2010-08-14 06:18:58
|
Update of /cvsroot/roadmap/roadmap/src/android/gen/net/sourceforge In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv24643/gen/net/sourceforge Log Message: Directory /cvsroot/roadmap/roadmap/src/android/gen/net/sourceforge added to the repository |