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...> - 2011-01-12 21:08:45
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv29118 Modified Files: buildmap_osm_text.c Log Message: Fix problem with a way counting only one node. One area of France, when pulled through splitter, had this. Index: buildmap_osm_text.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/buildmap_osm_text.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** buildmap_osm_text.c 4 Dec 2010 09:43:45 -0000 1.26 --- buildmap_osm_text.c 12 Jan 2011 21:08:36 -0000 1.27 *************** *** 887,890 **** --- 887,896 ---- } + if (nWayNodes < 1) { + WayNotInteresting = 1; + buildmap_osm_text_reset_way(); + return 0; + } + RoadMapString rms_dirp = str2dict(DictionaryPrefix, ""); RoadMapString rms_dirs = str2dict(DictionarySuffix, ""); |
From: Danny B. <dan...@us...> - 2011-01-09 20:11:24
|
Update of /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv633/src/net/sourceforge/projects/roadmap Modified Files: RoadMap.java Log Message: Clarify comment Index: RoadMap.java =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap/RoadMap.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** RoadMap.java 9 Jan 2011 18:42:19 -0000 1.10 --- RoadMap.java 9 Jan 2011 20:11:16 -0000 1.11 *************** *** 290,295 **** int sgpstime; ! /* Convert time units between Android and Unix */ ! /* Unix counts in seconds since the Epoch, Android in ms. */ sgpstime = (int)(gpstime / 1000); --- 290,296 ---- int sgpstime; ! /* Convert time units between the Android GPS interface and Unix. ! * Unix counts in seconds since the Epoch, this particular Android ! * provides ms since the Epoch. */ sgpstime = (int)(gpstime / 1000); |
From: Danny B. <dan...@us...> - 2011-01-09 18:42:26
|
Update of /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv9509/src/net/sourceforge/projects/roadmap Modified Files: RoadMap.java Log Message: Fix date calculation error. Index: RoadMap.java =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap/RoadMap.java,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** RoadMap.java 9 Jan 2011 13:48:53 -0000 1.9 --- RoadMap.java 9 Jan 2011 18:42:19 -0000 1.10 *************** *** 276,281 **** /* getTime() returns UTC of this fix in ms since 1/1/1970 */ ! int gpstime = (int) location.getTime(), ! lat = (int) (location.getLatitude() * 1000000), lon = (int) (location.getLongitude() * 1000000), /* getAltitude() returns m */ --- 276,281 ---- /* getTime() returns UTC of this fix in ms since 1/1/1970 */ ! long gpstime = location.getTime(); ! int lat = (int) (location.getLatitude() * 1000000), lon = (int) (location.getLongitude() * 1000000), /* getAltitude() returns m */ *************** *** 288,291 **** --- 288,296 ---- /* getBearing returns degrees East of true North */ steering = (int) location.getBearing(); + int sgpstime; + + /* Convert time units between Android and Unix */ + /* Unix counts in seconds since the Epoch, Android in ms. */ + sgpstime = (int)(gpstime / 1000); /* *************** *** 297,301 **** // The code in roadmap_gps.c requires 'A' as status. // See roadmap_gps_update_reception(). ! HereAmI('A', gpstime, lat, lon, alt, speed, steering); } --- 302,306 ---- // The code in roadmap_gps.c requires 'A' as status. // See roadmap_gps_update_reception(). ! HereAmI('A', sgpstime, lat, lon, alt, speed, steering); } |
From: Danny B. <dan...@us...> - 2011-01-09 13:49:01
|
Update of /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv5300/src/net/sourceforge/projects/roadmap Modified Files: RoadMap.java Log Message: Trivial fix, found the right syntax for one constant. Index: RoadMap.java =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap/RoadMap.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** RoadMap.java 9 Jan 2011 09:48:31 -0000 1.8 --- RoadMap.java 9 Jan 2011 13:48:53 -0000 1.9 *************** *** 307,319 **** 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++; --- 307,319 ---- GpsStatus status; ! if (event != GpsStatus.GPS_EVENT_SATELLITE_STATUS) ! return; status = mgr.getGpsStatus(null); ! Iterable<GpsSatellite> iter = status.getSatellites(); int active = 0, nsats = 0; ! for (GpsSatellite sat : iter) { nsats++; |
From: Danny B. <dan...@us...> - 2011-01-09 09:49:21
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27704 Modified Files: Makefile Log Message: Make the right Makefile target depend on files in the resource directory. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/Makefile,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile 30 Dec 2010 10:34:14 -0000 1.6 --- Makefile 9 Jan 2011 09:49:13 -0000 1.7 *************** *** 94,98 **** roadmap-1.apk: libs/armeabi/librmnative.so AndroidManifest.xml bin/classes.dex \ ! libs/armeabi/libexpat-1.so libs/armeabi/gdbserver libs/armeabi/gdb.setup -rm -f $@ ${AAPT} package -f -M AndroidManifest.xml -S res -I ${SDKPLAT}/android.jar -F roadmap-1.apk --- 94,99 ---- roadmap-1.apk: libs/armeabi/librmnative.so AndroidManifest.xml bin/classes.dex \ ! libs/armeabi/libexpat-1.so libs/armeabi/gdbserver libs/armeabi/gdb.setup \ ! res/values/strings.xml res/layout/list_item.xml -rm -f $@ ${AAPT} package -f -M AndroidManifest.xml -S res -I ${SDKPLAT}/android.jar -F roadmap-1.apk |
From: Danny B. <dan...@us...> - 2011-01-09 09:48:39
|
Update of /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27669/src/net/sourceforge/projects/roadmap Modified Files: RoadMap.java Log Message: Add XML file to customize layout of list items. Index: RoadMap.java =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap/RoadMap.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** RoadMap.java 8 Jan 2011 13:41:48 -0000 1.7 --- RoadMap.java 9 Jan 2011 09:48:31 -0000 1.8 *************** *** 967,971 **** // Log.e("RoadMap", " ListView " + lv); lv.setAdapter(new ArrayAdapter<String>(thiz, ! android.R.layout.simple_list_item_1, list)); } catch (Exception e) { --- 967,971 ---- // Log.e("RoadMap", " ListView " + lv); lv.setAdapter(new ArrayAdapter<String>(thiz, ! R.layout.list_item, // smaller than the big default list)); } catch (Exception e) { |
From: Danny B. <dan...@us...> - 2011-01-09 09:48:39
|
Update of /cvsroot/roadmap/roadmap/src/android/res/layout In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27669/res/layout Added Files: list_item.xml Log Message: Add XML file to customize layout of list items. --- NEW FILE: list_item.xml --- <?xml version="1.0" encoding="utf-8"?> <!-- Copyright (c) 2011, Danny Backx --> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:textAppearance="?android:attr/textAppearanceSmall" /> <!-- android:minHeight="?android:attr/listPreferredItemHeight" --> |
From: Danny B. <dan...@us...> - 2011-01-09 09:48:00
|
Update of /cvsroot/roadmap/roadmap/src/android/res/layout In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27557/res/layout Log Message: Directory /cvsroot/roadmap/roadmap/src/android/res/layout added to the repository |
From: Danny B. <dan...@us...> - 2011-01-08 14:26:16
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv11742 Modified Files: roadmap_dialog.c Log Message: Found out some more, fix accordingly. Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/roadmap_dialog.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_dialog.c 8 Jan 2011 13:41:48 -0000 1.3 --- roadmap_dialog.c 8 Jan 2011 14:26:08 -0000 1.4 *************** *** 264,267 **** --- 264,269 ---- parent = roadmap_dialog_get (RoadMapDialogCurrent, frame); child = roadmap_dialog_get (parent, name); + child->widget_type = ROADMAP_WIDGET_CONTAINER; /* Safe default. */ + // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_new_item(%s,%s) parent %d child %d", frame, name, parent->w, child ? child->w : -1); *************** *** 384,387 **** --- 386,391 ---- child->w = w; #endif + + child->widget_type = ROADMAP_WIDGET_ENTRY; // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_new_entry(%s,%s) child->w %d w %d", frame, name, child->w, w); } *************** *** 646,650 **** - #if 0 static char *ReturnStringDataHack = NULL; --- 650,653 ---- *************** *** 653,663 **** ReturnStringDataHack = (*env)->GetStringUTFChars(env, js, NULL); } - #endif /** ! * @brief Look up which selection has been made in this dialog * @param frame used to determine the dialog * @param name used to determine the dialog * @return pointer to the data passed back */ void *roadmap_dialog_get_data (const char *frame, const char *name) --- 656,671 ---- ReturnStringDataHack = (*env)->GetStringUTFChars(env, js, NULL); } /** ! * @brief Look up which selection has been made in this dialog, or retrieve the contents of a text entry field, or get the data we stored here. * @param frame used to determine the dialog * @param name used to determine the dialog * @return pointer to the data passed back + * + * Note the data is retrieved from the user interface only if the widget is ROADMAP_WIDGET_ENTRY. + * Also in that case we know it's a string. + * + * In other cases, we just pass pointers along from memory, and we're not sure about the data + * type (they're sometimes pointers to structures). */ void *roadmap_dialog_get_data (const char *frame, const char *name) *************** *** 669,686 **** this_item = roadmap_dialog_get (this_frame, name); ! if (RoadMapDialogCurrent->w == 0 && this_item->w == 0) { ! roadmap_log(ROADMAP_WARNING, "roadmap_dialog_get_data(%s,%s) null", frame, name); ! return NULL; ! } ! #if 0 ! jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogGetData", "(II)V"); ! (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, RoadMapThiz, mid, ! RoadMapDialogCurrent->w, ! this_item->w); - this_item->value = ReturnStringDataHack; - #endif roadmap_log(ROADMAP_WARNING, "roadmap_dialog_get_data(%s,%s) -> {%p,%s}", frame, name, this_item->value, this_item->value); --- 677,696 ---- this_item = roadmap_dialog_get (this_frame, name); ! if (this_item->widget_type == ROADMAP_WIDGET_ENTRY) { ! if (RoadMapDialogCurrent->w == 0 && this_item->w == 0) { ! roadmap_log(ROADMAP_WARNING, "roadmap_dialog_get_data(%s,%s) null", frame, name); ! return NULL; ! } ! jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogGetData", "(II)V"); ! ! (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, RoadMapThiz, mid, ! RoadMapDialogCurrent->w, ! this_item->w); ! ! this_item->value = ReturnStringDataHack; ! } roadmap_log(ROADMAP_WARNING, "roadmap_dialog_get_data(%s,%s) -> {%p,%s}", frame, name, this_item->value, this_item->value); *************** *** 689,692 **** --- 699,714 ---- + /** + * @brief Store some data. See notes below. + * @param frame used to determine the dialog + * @param name used to determine the dialog + * @return pointer to the data passed back + * + * Note the data is sent to the user interface only if the widget is ROADMAP_WIDGET_ENTRY or + * ROADMAP_WIDGET_LABEL. In those cases we know it's string data. + * + * In other cases, we just pass pointers along from memory, and we're not sure about the data + * type (they're sometimes pointers to structures). + */ void roadmap_dialog_set_data (const char *frame, const char *name, const void *data) { *************** *** 698,711 **** // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_set_data(%s,%s) cur %d fr %d it %d", frame, name, RoadMapDialogCurrent->w, this_frame->w, this_item->w); ! this_item->value = (char *)data; ! jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogSetData", "(IILjava/lang/String;)V"); ! jstring js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, (const char *)data); ! (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, RoadMapThiz, mid, /* dialog id */ RoadMapDialogCurrent->w, /* row id in the dialog */ this_item->w, js); } --- 720,742 ---- // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_set_data(%s,%s) cur %d fr %d it %d", frame, name, RoadMapDialogCurrent->w, this_frame->w, this_item->w); ! switch (this_item->widget_type) { ! case ROADMAP_WIDGET_ENTRY: ! case ROADMAP_WIDGET_LABEL: ! { ! jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogSetData", "(IILjava/lang/String;)V"); ! jstring js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, (const char *)data); ! (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, RoadMapThiz, mid, /* dialog id */ RoadMapDialogCurrent->w, /* row id in the dialog */ this_item->w, js); + break; + + } + } + + this_item->value = (char *)data; } |
From: Danny B. <dan...@us...> - 2011-01-08 13:41:57
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv1886 Modified Files: AndroidManifest.xml roadmap_dialog.c roadmap_main.c roadmap_messagebox.c Log Message: Work in progress. Much of the user interface is starting to work, too long since last commit of this stuff. Index: AndroidManifest.xml =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/AndroidManifest.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AndroidManifest.xml 14 Aug 2010 13:54:44 -0000 1.2 --- AndroidManifest.xml 8 Jan 2011 13:41:48 -0000 1.3 *************** *** 2,5 **** --- 2,6 ---- <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.sourceforge.projects.roadmap" + android:installLocation="internalOnly" android:versionCode="1" android:versionName="1.0"> Index: roadmap_dialog.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/roadmap_dialog.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_dialog.c 29 Aug 2010 12:30:11 -0000 1.2 --- roadmap_dialog.c 8 Jan 2011 13:41:48 -0000 1.3 *************** *** 3,7 **** * * Copyright 2002 Pascal F. Martin ! * Copyright (c) 2008, 2010, Danny Backx. * * This file is part of RoadMap. --- 3,7 ---- * * Copyright 2002 Pascal F. Martin ! * Copyright (c) 2008, 2010, 2011, Danny Backx. * * This file is part of RoadMap. *************** *** 73,76 **** --- 73,78 ---- typedef struct roadmap_dialog_item *RoadMapDialogItem; + #define MAX_CALLBACKS 3 + struct roadmap_dialog_item { *************** *** 85,89 **** int widget_type; ! int w; short rank; --- 87,91 ---- int widget_type; ! int w; /**< the dialog id */ short rank; *************** *** 93,96 **** --- 95,101 ---- RoadMapDialogCallback callback; + int nbutton; /**< number of buttons already seen */ + RoadMapDialogCallback callbacks[MAX_CALLBACKS]; /**< callbacks for buttons on some dialogs, Android supports up to three */ + char *value; RoadMapDialogSelection *choice; *************** *** 136,141 **** } ! /* ! * roadmap_dialog.c */ static RoadMapDialogItem roadmap_dialog_get (RoadMapDialogItem parent, --- 141,149 ---- } ! /** ! * @brief find the id of a dialog by name, create it if it doesn't exist yet ! * @param parent the dialog looked for should be a child of this parent (not recursive !) ! * @param name what are we looking fore ! * @return pointer to the dialog structure */ static RoadMapDialogItem roadmap_dialog_get (RoadMapDialogItem parent, *************** *** 143,146 **** --- 151,155 ---- // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_get(%s)", name); RoadMapDialogItem child; + int i; if (parent == NULL) { *************** *** 152,155 **** --- 161,165 ---- while (child != NULL) { if (strcmp (child->name, name) == 0) { + // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_get(%p,%s) -> %p", parent, name, child); return child; } *************** *** 166,170 **** child->widget_type = ROADMAP_WIDGET_CONTAINER; /* Safe default. */ ! child->w = NULL; child->count = 0; child->name = strdup(name); --- 176,180 ---- child->widget_type = ROADMAP_WIDGET_CONTAINER; /* Safe default. */ ! child->w = 0; child->count = 0; child->name = strdup(name); *************** *** 176,179 **** --- 186,193 ---- child->choice = NULL; + child->nbutton = 0; + for (i=0; i<MAX_CALLBACKS; i++) + child->callbacks[i] = NULL; + if (parent != NULL) { *************** *** 194,202 **** --- 208,245 ---- RoadMapDialogWindows = child; RoadMapDialogCurrent = child; + // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_get(%s) -> current", name); } + // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_get(%p,%s) -> %p", parent, name, child); return child; } + /** + * @brief lookup by number, don't create a new one if not found + * @param parent look in the hierarchy under this + * @param id look for this dialog + * @return the dialog pointer + */ + static RoadMapDialogItem roadmap_dialog_get_nr (RoadMapDialogItem parent, const int id) { + // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_get_nr(%d)", id); + RoadMapDialogItem child; + + if (parent == NULL) { + child = RoadMapDialogWindows; + } else { + child = parent->children; + } + + while (child != NULL) { + if (child->w == id) { + // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_get_nr -> %p", child); + return child; + } + // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_get_nr found %d", child->w); + child = child->next; + } + + return NULL; + } static void roadmap_dialog_hide_window (RoadMapDialogItem dialog) { *************** *** 208,232 **** } static RoadMapDialogItem roadmap_dialog_new_item (const char *frame, const char *name) { RoadMapDialogItem parent; RoadMapDialogItem child; - // __android_log_print (ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_new_item(%s,%s)", frame, name); parent = roadmap_dialog_get (RoadMapDialogCurrent, frame); child = roadmap_dialog_get (parent, name); ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_new_item -> parent->w %d", parent->w); ! // if (child) __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_new_item -> child->w %d", child->w); ! if (parent->w == NULL) { /* ! * New sub-dialog : create a separate Android dialog */ jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "CreateDialog", "(Ljava/lang/String;I)I"); jstring js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, frame); ! parent->w = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, js, ! parent->parent->w); // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "CreateDialog -> parent->w %d", parent->w); } --- 251,282 ---- } + /** + * @brief + * @param frame + * @param name + * @return + */ static RoadMapDialogItem roadmap_dialog_new_item (const char *frame, const char *name) { RoadMapDialogItem parent; RoadMapDialogItem child; parent = roadmap_dialog_get (RoadMapDialogCurrent, frame); child = roadmap_dialog_get (parent, name); ! // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_new_item(%s,%s) parent %d child %d", frame, name, parent->w, child ? child->w : -1); ! if (parent->w == 0) { /* ! * Create a heading, don't do structural changes so no additional level of hierarchy. ! * Because of "no additional level", the widget is copied from the parent */ + parent->w = parent->parent->w; + jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "CreateHeading", "(Ljava/lang/String;I)I"); jstring js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, frame); ! (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, js, ! parent->w); // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "CreateDialog -> parent->w %d", parent->w); } *************** *** 238,244 **** if (name[0] != '.') { jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogAddButton", "(ILjava/lang/String;)I"); jstring js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, name); child->w = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, parent->w, js); } else { --- 288,295 ---- if (name[0] != '.') { jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogAddLabel", "(ILjava/lang/String;)I"); jstring js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, name); + // child->w = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, RoadMapDialogCurrent->w, js); child->w = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, parent->w, js); } else { *************** *** 246,249 **** --- 297,301 ---- } + // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_new_item -> %d", child->w); return child; } *************** *** 256,260 **** * 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 --- 308,313 ---- * 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 current dialog. ! * * @param name * @param context *************** *** 263,272 **** int roadmap_dialog_activate (const char *name, void *context) { ! __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_activate(%s)", name); RoadMapDialogItem dialog = roadmap_dialog_get (NULL, name); dialog->context = context; ! if (dialog->w != NULL) { /* The dialog exists already: show it on top. */ RoadMapDialogCurrent = dialog; --- 316,325 ---- int roadmap_dialog_activate (const char *name, void *context) { ! roadmap_log(ROADMAP_WARNING, "roadmap_dialog_activate(%s)", name); RoadMapDialogItem dialog = roadmap_dialog_get (NULL, name); dialog->context = context; ! if (dialog->w != 0) { /* The dialog exists already: show it on top. */ RoadMapDialogCurrent = dialog; *************** *** 290,294 **** dialog->w = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, js, 0); ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "CreateDialog -> dialog->w %d, int name %s", dialog->w, dialog->name); return 1; /* Tell the caller this is a new, undefined, dialog. */ --- 343,347 ---- dialog->w = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, js, 0); ! // roadmap_log(ROADMAP_WARNING, "CreateDialog(%s) -> %d", name, dialog->w); return 1; /* Tell the caller this is a new, undefined, dialog. */ *************** *** 301,306 **** void roadmap_dialog_hide (const char *name) { ! __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_hide(%s)", name); ! roadmap_dialog_hide_window (roadmap_dialog_get (NULL, name)); } --- 354,359 ---- void roadmap_dialog_hide (const char *name) { ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_hide(%s)", name); ! // roadmap_dialog_hide_window (roadmap_dialog_get (NULL, name)); } *************** *** 311,327 **** */ void roadmap_dialog_new_entry (const char *frame, const char *name) { - // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_new_entry(%s,%s)", frame, name); - jclass cls = TheRoadMapClass(); - jmethodID mid = TheMethod(cls, "DialogAddTextEntry", "(ILjava/lang/String;)I"); - jstring js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, name); ! /* Side effect of .._new_item() : creates a widget with this name */ ! RoadMapDialogItem child = roadmap_dialog_new_item (frame, name); ! // RoadMapDialogItem parent = roadmap_dialog_get (NULL, frame); ! // RoadMapDialogItem child = roadmap_dialog_get (parent, name); ! RoadMapDialogItem parent = roadmap_dialog_get (RoadMapDialogCurrent, frame); ! /* Now also create the real "edit" widget */ ! int w = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, parent->w, js); } --- 364,388 ---- */ void roadmap_dialog_new_entry (const char *frame, const char *name) { ! // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_new_entry(%s,%s)", frame, name); ! jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogAddTextEntry", "(ILjava/lang/String;)I"); ! jstring js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, name); ! RoadMapDialogItem parent, child; ! #if 0 ! child = roadmap_dialog_new_item (frame, name); ! int w = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, child->w, js); ! /* Return value is the index of the text field in the container widget */ ! child->w = w; ! #else ! child = roadmap_dialog_new_item (frame, name); ! parent = roadmap_dialog_get (RoadMapDialogCurrent, frame); ! child = roadmap_dialog_get (parent, name); ! int w = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, parent->w, js); ! /* Return value is the index of the text field in the container widget */ ! child->w = w; ! #endif ! // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_new_entry(%s,%s) child->w %d w %d", frame, name, child->w, w); } *************** *** 386,390 **** void *values, RoadMapDialogCallback callback) { ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_new_choice(%s,%s)", frame, name); } --- 447,451 ---- void *values, RoadMapDialogCallback callback) { ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_new_choice(%s,%s) -> count %d", frame, name, count); } *************** *** 398,405 **** */ void roadmap_dialog_new_list (const char *frame, const char *name) { ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_new_list(%s,%s)", frame, name); } void roadmap_dialog_show_list (const char *frame, const char *name, --- 459,522 ---- */ void roadmap_dialog_new_list (const char *frame, const char *name) { ! // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_new_list(%s,%s)", frame, name); ! ! RoadMapDialogItem parent, child; ! if (name[0] == '.') name += 1; ! child = roadmap_dialog_new_item (frame, name); ! ! jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogCreateList", "(I)V"); ! ! parent = roadmap_dialog_get (RoadMapDialogCurrent, frame); ! (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, RoadMapThiz, mid, RoadMapDialogCurrent->w); ! ! // child->widget_type = ROADMAP_WIDGET_LIST; ! } + /* + * This used to be a local variable in roadmap_dialog_show_list but then roadmap_dialog_chosen + * can't use it, and the Android NDK/SDK pair aren't good at passing this type of info along. + */ + RoadMapDialogSelection *choice; + + void roadmap_dialog_chosen (int position, long id) { + + RoadMapDialogSelection *selection = &choice[position]; + + 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); + } + } + } + void Java_net_sourceforge_projects_roadmap_RoadMap_RoadMapDialogChosen(JNIEnv* env, jobject thiz, int position, long id) + { + roadmap_dialog_chosen(position, id); + } + + /** + * @brief show a list of items. + * When the user selects an item, the callback must be called with the name of that item and + * its context (used?). + * @param frame determine the dialog + * @param name determine the dialog + * @param count number of list items + * @param labels list item strings + * @param values + * @param callback to be called when user selects + */ void roadmap_dialog_show_list (const char *frame, const char *name, *************** *** 408,412 **** void **values, RoadMapDialogCallback callback) { ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_show_list(%s,%s)", frame, name); } --- 525,583 ---- void **values, RoadMapDialogCallback callback) { ! roadmap_log(ROADMAP_WARNING, "roadmap_dialog_show_list(%s,%s)", frame, name); ! int i; ! RoadMapDialogItem parent; ! RoadMapDialogItem child; ! ! parent = roadmap_dialog_get (RoadMapDialogCurrent, frame); ! child = roadmap_dialog_get (parent, name); ! ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_show_list(%s,%s) -> count %d, cur %d, par %d, child %d", frame, name, count, RoadMapDialogCurrent->w, parent->w, child->w); ! ! // 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); ! ! jstring js; ! jobjectArray joa; ! jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogSetListContents", "(I[Ljava/lang/String;)V"); ! ! joa = (*RoadMapJniEnv)->NewObjectArray(RoadMapJniEnv, count, cls, 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); ! ! js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, labels[i]); ! (*RoadMapJniEnv)->SetObjectArrayElement(RoadMapJniEnv, joa, i, js); ! } ! child->choice = choice; ! child->value = choice[0].value; ! ! // gtk_widget_show (parent->w); ! ! (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, RoadMapThiz, mid, RoadMapDialogCurrent->w, joa); ! // (*RoadMapJniEnv)->ReleaseObjectArrayElements(RoadMapJniEnv, NULL, joa, JNI_ABORT); } *************** *** 418,422 **** void roadmap_dialog_add_button (const char *label, RoadMapDialogCallback callback) { ! __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_add_button(%s)", label); } --- 589,625 ---- void roadmap_dialog_add_button (const char *label, RoadMapDialogCallback callback) { ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_add_button(%s,%p)", label, callback); ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", " Parent dialog %d {%s}", RoadMapDialogCurrent->w, RoadMapDialogCurrent->name); ! ! jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogAddSpecialButton", "(ILjava/lang/String;I)I"); ! jstring js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, label); ! ! if (RoadMapDialogCurrent->nbutton < 0 || RoadMapDialogCurrent->nbutton > MAX_CALLBACKS) { ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_add_button error nbutton %d", RoadMapDialogCurrent->nbutton); ! return; ! } ! ! (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, ! RoadMapDialogCurrent->w, /* which dialog */ ! js, ! RoadMapDialogCurrent->nbutton); /* which button */ ! ! RoadMapDialogCurrent->callbacks[RoadMapDialogCurrent->nbutton] = callback; ! RoadMapDialogCurrent->nbutton++; ! } ! ! /* ! * @brief callback from one of the "special" buttons in a dialog ! */ ! void ! Java_net_sourceforge_projects_roadmap_RoadMap_DialogSpecialCallback(JNIEnv* env, jobject thiz, int dlg, int btn) ! { ! RoadMapDialogItem dlgp; ! ! dlgp = roadmap_dialog_get_nr(NULL, dlg); ! ! if (dlgp && dlgp->callbacks && dlgp->callbacks[btn]) ! dlgp->callbacks[btn](dlgp->name, dlgp); } *************** *** 443,449 **** void *roadmap_dialog_get_data (const char *frame, const char *name) { ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_get_data(%s,%s)", frame, name); } --- 646,689 ---- + #if 0 + static char *ReturnStringDataHack = NULL; + + void Java_net_sourceforge_projects_roadmap_RoadMap_ReturnStringDataHack(JNIEnv* env, jobject thiz, jstring js) + { + ReturnStringDataHack = (*env)->GetStringUTFChars(env, js, NULL); + } + #endif + + /** + * @brief Look up which selection has been made in this dialog + * @param frame used to determine the dialog + * @param name used to determine the dialog + * @return pointer to the data passed back + */ void *roadmap_dialog_get_data (const char *frame, const char *name) { ! RoadMapDialogItem this_frame, this_item; ! ! // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_get_data(%s,%s)", frame, name); ! this_frame = roadmap_dialog_get (RoadMapDialogCurrent, frame); ! this_item = roadmap_dialog_get (this_frame, name); ! ! if (RoadMapDialogCurrent->w == 0 && this_item->w == 0) { ! roadmap_log(ROADMAP_WARNING, "roadmap_dialog_get_data(%s,%s) null", frame, name); ! return NULL; ! } ! #if 0 ! jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogGetData", "(II)V"); ! ! (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, RoadMapThiz, mid, ! RoadMapDialogCurrent->w, ! this_item->w); ! ! this_item->value = ReturnStringDataHack; ! #endif ! roadmap_log(ROADMAP_WARNING, "roadmap_dialog_get_data(%s,%s) -> {%p,%s}", frame, name, this_item->value, this_item->value); ! ! return (void *)this_item->value; } *************** *** 451,455 **** void roadmap_dialog_set_data (const char *frame, const char *name, const void *data) { - // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_dialog_set_data(%s,%s)", frame, name); RoadMapDialogItem this_frame, this_item; --- 691,694 ---- *************** *** 457,473 **** 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; } --- 696,711 ---- this_item = roadmap_dialog_get (this_frame, name); ! // roadmap_log(ROADMAP_WARNING, "roadmap_dialog_set_data(%s,%s) cur %d fr %d it %d", frame, name, RoadMapDialogCurrent->w, this_frame->w, this_item->w); ! this_item->value = (char *)data; ! jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "DialogSetData", "(IILjava/lang/String;)V"); ! jstring js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, (const char *)data); ! (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, RoadMapThiz, mid, ! /* dialog id */ RoadMapDialogCurrent->w, ! /* row id in the dialog */ this_item->w, ! js); } *************** *** 483,484 **** --- 721,770 ---- #warning implement roadmap_dialog_set_progress } + + void roadmap_dialog_shutdown(void) + { + RoadMapDialogWindows = NULL; + RoadMapDialogCurrent = NULL; + } + + #if 0 + /** + * @brief this is a debug function, recursive, prints the hierarchy of the Dialog table + * @param parent + * @param level how many levels deep are we already + */ + void roadmap_dialog_test_r(RoadMapDialogItem parent, int level) + { + RoadMapDialogItem p; + RoadMapDialogItem child; + char prefix[8]; + + strcpy(prefix, "\t\t\t\t\t\t\t"); + prefix[level] = '\0'; + + for (p = parent; p; p = p->next) { + roadmap_log(ROADMAP_WARNING, "%sDialog %p {%s} parent %p next %p widget %d", + prefix, + p, p->name, p->parent, p->next, p->w); + + child = p->children; + while (child != NULL) { + if (child->parent == parent) { + roadmap_log(ROADMAP_WARNING, "%s Child %p {%s}", + prefix, child, child->name); + roadmap_dialog_test_r(child, level + 1); + } + child = child->next; + } + } + } + + /** + * @brief Kickstart the recursive debug function to print the dialog table + */ + void roadmap_dialog_test(void) + { + roadmap_log(ROADMAP_WARNING, "\n OVERVIEW OF DIALOGS \n\tCurrent %p\n\n", RoadMapDialogCurrent); + roadmap_dialog_test_r(RoadMapDialogWindows, 0); + } + #endif Index: roadmap_messagebox.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/roadmap_messagebox.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** roadmap_messagebox.c 14 Aug 2010 06:22:54 -0000 1.1 --- roadmap_messagebox.c 8 Jan 2011 13:41:48 -0000 1.2 *************** *** 88,93 **** } void roadmap_messagebox_die (const char *title, const char *message) { ! exit(1); } --- 88,104 ---- } + /** + * @brief show a message, then terminate + * All of the real action is in Java, except the hard exit, which is in roadmap_main.c + */ void roadmap_messagebox_die (const char *title, const char *message) { ! jclass cls = TheRoadMapClass(); ! jmethodID mid = TheMethod(cls, "MessageBoxWait", "(Ljava/lang/String;Ljava/lang/String;)V"); ! jstring jstitle, jsmessage; ! ! jstitle = title ? (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, title) : NULL; ! jsmessage = message ? (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, message) : NULL; ! ! (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, RoadMapThiz, mid, jstitle, jsmessage); } Index: roadmap_main.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/roadmap_main.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_main.c 20 Aug 2010 18:27:33 -0000 1.2 --- roadmap_main.c 8 Jan 2011 13:41:48 -0000 1.3 *************** *** 135,139 **** /** * @brief Create a new menu. ! * Not used on Android, except ... * * @return returned value must be non-null for menus to work (see roadmap_factory.c) --- 135,139 ---- /** * @brief Create a new menu. ! * On Android, this doesn't do much except assigning a unique number. * * @return returned value must be non-null for menus to work (see roadmap_factory.c) *************** *** 145,149 **** jstring js; ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_main_new_menu(%s)", title); js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, title); --- 145,149 ---- jstring js; ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_main_new_menu(%s)", title); js = (*RoadMapJniEnv)->NewStringUTF(RoadMapJniEnv, title); *************** *** 162,165 **** --- 162,166 ---- void roadmap_main_add_menu (RoadMapMenu menu, const char *label) { + // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_main_add_menu(%d,%s)", (int)menu, label); /* int m = (int)menu; *************** *** 178,182 **** void roadmap_main_popup_menu (RoadMapMenu menu, const RoadMapGuiPoint *position) { ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_main_popup_menu FIX ME"); } --- 179,183 ---- void roadmap_main_popup_menu (RoadMapMenu menu, const RoadMapGuiPoint *position) { ! __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_main_popup_menu FIX ME"); } *************** *** 184,187 **** --- 185,189 ---- struct callback { RoadMapCallback callback; + char *label; // only for debug } callbacks[150] /* FIX ME make dynamic */; *************** *** 191,196 **** RoadMapCallback callback) { ! if (label == NULL) return; int m = (int)menu; --- 193,200 ---- RoadMapCallback callback) { ! if (label == NULL) { ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_main_add_menu_item(%d,NULL,cb %p)", menu, callback); return; + } int m = (int)menu; *************** *** 202,208 **** int i = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, m, js); ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_main_add_menu_item(%d,%s,cb %p) -> %d", m, label, callback, i); callbacks[i].callback = callback; } --- 206,213 ---- int i = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, RoadMapThiz, mid, m, js); ! // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_main_add_menu_item(%d,%s,cb %p) -> %d", m, label, callback, i); callbacks[i].callback = callback; + callbacks[i].label = strdup(label); // only for debug } *************** *** 216,227 **** int roadmap_main_callback(int item) { - // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_main_callback(%d)", item); if (callbacks[item].callback) { (*(callbacks[item].callback))(); return 1; } return 0; } void roadmap_main_add_separator (RoadMapMenu menu) { --- 221,243 ---- int roadmap_main_callback(int item) { if (callbacks[item].callback) { + // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_main_callback(%d,%s) %p", item, callbacks[item].label, callbacks[item].callback); (*(callbacks[item].callback))(); return 1; } + // __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "roadmap_main_callback(%d,%s) %p -> 0", item, callbacks[item].label, callbacks[item].callback); return 0; } + /** + * @brief + * @return 1 if ok, 0 if not found + */ + int + Java_net_sourceforge_projects_roadmap_RoadMap_MenuCallback(JNIEnv* env, jobject thiz, int id) + { + return roadmap_main_callback(id); + } + void roadmap_main_add_separator (RoadMapMenu menu) { *************** *** 508,513 **** --- 524,531 ---- int argc = 1; + roadmap_log(ROADMAP_ERROR, "RoadMap_roadmapStart"); roadmap_option(argc, argv, 0, NULL); roadmap_start(argc, argv); + roadmap_log(ROADMAP_ERROR, "RoadMap_roadmapStart (end)"); return (*env)->NewStringUTF(env, "Hello"); *************** *** 541,544 **** --- 559,565 ---- { RoadMapJniEnv = env; + + __android_log_print(ANDROID_LOG_ERROR, "RoadMap", "RoadMap->JniStart"); + RoadMapJniClass = (*env)->NewGlobalRef(env, (*env)->FindClass(env, "net/sourceforge/projects/roadmap/RoadMap")); *************** *** 597,610 **** /** ! * @brief * @return 1 if ok, 0 if not found */ ! int ! Java_net_sourceforge_projects_roadmap_RoadMap_MenuCallback(JNIEnv* env, jobject thiz, int id) { ! extern int roadmap_main_callback(int); ! ! return roadmap_main_callback(id); } /** * @brief Terminate RoadMap --- 618,630 ---- /** ! * @brief Hard exit * @return 1 if ok, 0 if not found */ ! void ! Java_net_sourceforge_projects_roadmap_RoadMap_HardExit(JNIEnv* env, jobject thiz, int rc) { ! exit(rc); } + /** * @brief Terminate RoadMap *************** *** 628,629 **** --- 648,655 ---- (*RoadMapJniEnv)->CallVoidMethod(RoadMapJniEnv, RoadMapThiz, mid); } + + void roadmap_android_test(void) + { + char *p = NULL; + *p = 'a'; + } |
From: Danny B. <dan...@us...> - 2011-01-08 13:41:57
|
Update of /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv1886/src/net/sourceforge/projects/roadmap Modified Files: Panel.java RoadMap.java Log Message: Work in progress. Much of the user interface is starting to work, too long since last commit of this stuff. Index: RoadMap.java =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap/RoadMap.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** RoadMap.java 29 Aug 2010 12:30:11 -0000 1.6 --- RoadMap.java 8 Jan 2011 13:41:48 -0000 1.7 *************** *** 1,2 **** --- 1,29 ---- + /* + * LICENSE: + * + * Copyright (c) 2010, 2011 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 Stuff to support the application on Android + * @ingroup android + */ package net.sourceforge.projects.roadmap; *************** *** 19,27 **** import android.widget.Button; import android.widget.ImageButton; - import android.widget.LinearLayout; import android.widget.TextView; import android.widget.EditText; import android.widget.Toast; import android.widget.ScrollView; import android.location.Location; --- 46,60 ---- import android.widget.Button; import android.widget.ImageButton; import android.widget.TextView; import android.widget.EditText; import android.widget.Toast; import android.widget.ScrollView; + import android.widget.ListView; + import android.widget.ArrayAdapter; + import android.widget.AdapterView; + import android.widget.AdapterView.OnItemClickListener; + + import android.widget.LinearLayout; + import android.widget.RelativeLayout; import android.location.Location; *************** *** 46,49 **** --- 79,88 ---- import android.view.Gravity; + import android.media.SoundPool; + import android.media.AudioManager; + import java.util.HashMap; + + import android.media.MediaPlayer; + public class RoadMap extends Activity { *************** *** 70,78 **** 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 --- 109,119 ---- int id, int elevation, int azimuth, int strength, int active); public native int MenuCallback(int item); public native void CallPeriodic(int index); public native void ToolbarCallback(int cb); + public native void HardExit(int rc); + public native void DialogSpecialCallback(int dlg, int btn); + public native void ReturnStringDataHack(String s); + public native void RoadMapDialogChosen(int position, long id); @Override *************** *** 81,85 **** super.onCreate(state); ! Log.e("RoadMap", "onCreate(" + state + ")"); ll = new LinearLayout(this); --- 122,126 ---- super.onCreate(state); ! // Log.e("RoadMap", "onCreate(" + state + ")"); ll = new LinearLayout(this); *************** *** 241,249 **** alt = (int) (location.getAltitude() * 1000000), /* getSpeed() returns m/s, this calculation ! * turns it into knots, see roadmap_gpsd2.c */ ! speed = (int) (1944 * location.getSpeed() / 1000), /* getBearing returns degrees East of true North */ steering = (int) location.getBearing(); // The code in roadmap_gps.c requires 'A' as status. // See roadmap_gps_update_reception(). --- 282,298 ---- alt = (int) (location.getAltitude() * 1000000), /* getSpeed() returns m/s, this calculation ! * turns it into knots, see roadmap_gpsd2.c . ! * Still need to divide by 1000, see below. ! * */ ! speed = (int) (1944 * location.getSpeed()), /* getBearing returns degrees East of true North */ steering = (int) location.getBearing(); + /* + * Hopefully cutting the calculation in two + * is enough to avoid precision loss. + */ + speed /= 1000; + // The code in roadmap_gps.c requires 'A' as status. // See roadmap_gps_update_reception(). *************** *** 293,296 **** --- 342,358 ---- } + public void MessageBoxWait(String title, String message) + { + new AlertDialog.Builder(thiz) + .setTitle("Fatal error") + .setMessage(message) + .setNeutralButton("Dismiss", new DialogInterface.OnClickListener() { + public void onClick(DialogInterface dlg, int ok) { + HardExit(1); + } + }) + .show(); + } + public void Finish() { *************** *** 505,508 **** --- 567,580 ---- int nToolbarCache = 0; + void JToolbarCallback(int i) + { + try { + ToolbarCallback(i); + } catch (Exception e) { + e.printStackTrace(); + Log.e("RoadMap", "Stack trace " + e.toString()); + }; + } + OnClickListener mToolbarClick = new OnClickListener() { public void onClick(View v) *************** *** 512,516 **** for (i=0; i<nToolbarCache; i++) if (v == toolBar[i].view) { ! ToolbarCallback(i); return; } --- 584,589 ---- for (i=0; i<nToolbarCache; i++) if (v == toolBar[i].view) { ! // ToolbarCallback(i); ! JToolbarCallback(i); return; } *************** *** 566,572 **** class Dialogs { ! String name; ! LinearLayout ll, row; ! AlertDialog ad; }; Dialogs dialogs[] = new Dialogs[maxdialogs]; --- 639,650 ---- class Dialogs { ! String name; ! LinearLayout ll, row; ! AlertDialog ad; ! AlertDialog.Builder db; ! String button0, button1, button2; ! int rowid; ! // int nrows, maxrows; ! // LinearLayout rows[]; }; Dialogs dialogs[] = new Dialogs[maxdialogs]; *************** *** 574,586 **** protected Dialog onCreateDialog(int dlg_id) { ! Log.e("RoadMap", "onCreateDialog(" + dlg_id + ")"); if (dlg_id <= 0 || dlg_id >= dialog_id) { - // Log.e("RoadMap", "onCreateDialog -> null 1"); return null; } if (dialogs[dlg_id] != null && dialogs[dlg_id].ad != null) { - // Log.e("RoadMap", "onCreateDialog -> null 2"); return dialogs[dlg_id].ad; } --- 652,662 ---- protected Dialog onCreateDialog(int dlg_id) { ! // Log.e("RoadMap", "onCreateDialog(" + dlg_id + ")"); if (dlg_id <= 0 || dlg_id >= dialog_id) { return null; } if (dialogs[dlg_id] != null && dialogs[dlg_id].ad != null) { return dialogs[dlg_id].ad; } *************** *** 590,602 **** ScrollView sv; ! // Log.e("RoadMap", "onCreateDialog build"); db.setMessage(dialogs[dlg_id].name) .setCancelable(true) ! .setNegativeButton("Close", new DialogInterface.OnClickListener() { ! public void onClick(DialogInterface dialog, int id) { ! dialog.cancel(); } } --- 666,699 ---- ScrollView sv; ! /* We need the "final" clause to pass the right value */ ! final int id = dlg_id; db.setMessage(dialogs[dlg_id].name) .setCancelable(true) ! .setPositiveButton(dialogs[dlg_id].button0, new DialogInterface.OnClickListener() { ! public void onClick(DialogInterface dialog, int btn) { ! DialogSpecialCallback(id, 0); ! } ! } ! ); ! db.setMessage(dialogs[dlg_id].name) ! .setCancelable(true) ! .setNeutralButton(dialogs[dlg_id].button1, ! new DialogInterface.OnClickListener() { ! public void onClick(DialogInterface dialog, int btn) ! { ! DialogSpecialCallback(id, 1); ! } ! } ! ); ! db.setMessage(dialogs[dlg_id].name) ! .setCancelable(true) ! .setNegativeButton(dialogs[dlg_id].button2, ! new DialogInterface.OnClickListener() { ! public void onClick(DialogInterface dialog, int btn) ! { ! DialogSpecialCallback(id, 2); } } *************** *** 611,614 **** --- 708,712 ---- dialogs[dlg_id].ad = d; + dialogs[dlg_id].db = db; return d; *************** *** 627,634 **** --- 725,735 ---- dialogs[dialog_id].name = name; dialogs[dialog_id].ll = new LinearLayout(this); + dialogs[dialog_id].rowid = 0; dialogs[dialog_id].ll.setOrientation(LinearLayout.VERTICAL); if (dialogs[parent] != null) { // Log.e("RoadMap", "Add button {" + name + "} in dlg " + parent + " (" + dialogs[parent].name + ")"); + + /* Put a button in the parent dialog ! */ Button b = new Button(thiz); b.setText(name); *************** *** 644,648 **** }); } else { ! Log.e("RoadMap", "CreateDialog(" + name + ") - no parent ??"); } --- 745,749 ---- }); } else { ! // Log.e("RoadMap", "CreateDialog(" + name + ") - no parent ??"); } *************** *** 650,697 **** } ! public void ShowDialog(int id) { ! showDialog(id); } /* * Add an object that shows a label ! * Precede this by creating a "row" object */ ! public int DialogAddButton(int id, String name) { ! // Log.e("RoadMap", "DialogAddButton(" + id + "," + name + ")"); try { LinearLayout row = new LinearLayout(this); row.setOrientation(LinearLayout.HORIZONTAL); - dialogs[id].ll.addView(row); dialogs[id].row = row; ! Button b = new Button(thiz); b.setText(name); ! row.addView(b); ! b.setGravity(Gravity.LEFT); } catch (Exception e) { ! Log.e("RoadMap", "DialogAddButton(" + id + "," + name + ") exception " + e); } return 1; } public int DialogAddTextEntry(int id, String name) { try { EditText tv = new EditText(thiz); tv.setGravity(Gravity.FILL_HORIZONTAL); - // tv.setLayoutGravity(Gravity.FILL_HORIZONTAL); tv.setLayoutParams(new ViewGroup.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); LinearLayout row = dialogs[id].row; row.addView(tv); } catch (Exception e) { Log.e("RoadMap", "DialogAddTextEntry(" + id + "," + name + ") exception " + e); } ! return 1; } } --- 751,994 ---- } ! /* ! * 2nd parameter is the reference to the parent dialog ! */ ! public int CreateHeading(String name, int id) { ! // Log.e("RoadMap", "CreateHeading(" + name + "," + id + ")"); ! ! try { ! /* ! LinearLayout row = new LinearLayout(this); ! row.setOrientation(LinearLayout.HORIZONTAL); ! dialogs[id].ll.addView(row); ! dialogs[id].row = row; ! */ ! ! TextView b = new TextView(thiz); ! b.setText(name); ! dialogs[id].ll.addView(b); ! // dialogs[id].row.addView(b); ! b.setGravity(Gravity.LEFT); ! } catch (Exception e) { ! Log.e("RoadMap", "CreateHeading(" + id + "," + name + ") exception " + e); ! return 0; ! } ! return 1; } /* * Add an object that shows a label ! * Precede this by creating a "row" object - currently moved to CreateHeading. */ ! public int DialogAddLabel(int id, String name) { ! // Log.e("RoadMap", "DialogAddLabel(" + id + "," + name + ")"); try { LinearLayout row = new LinearLayout(this); row.setOrientation(LinearLayout.HORIZONTAL); dialogs[id].ll.addView(row); dialogs[id].row = row; ! // Button b = new Button(thiz); ! TextView b = new TextView(thiz); b.setText(name); ! dialogs[id].row.addView(b); ! ! // b.setGravity(Gravity.RIGHT); ! // LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( ! // ViewGroup.LayoutParams.FILL_PARENT, ! // ViewGroup.LayoutParams.WRAP_CONTENT); ! // lp.weight = 1.0f; ! // b.setLayoutParams(lp); } catch (Exception e) { ! Log.e("RoadMap", "DialogAddLabel(" + id + "," + name + ") exception " + e); } return 1; } + /* + * @return the index of the text field in the container widget + */ public int DialogAddTextEntry(int id, String name) { try { EditText tv = new EditText(thiz); + tv.setGravity(Gravity.FILL_HORIZONTAL); tv.setLayoutParams(new ViewGroup.LayoutParams( ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); + LinearLayout row = dialogs[id].row; + row.addView(tv); + int r = dialogs[id].ll.indexOfChild(row); + + // dialogs[id].ll.addView(tv); + // int r = dialogs[id].ll.indexOfChild(tv); + + /* Change text size */ + tv.setTextSize(10); + // Log.e("RoadMap", "DialogAddTextEntry(" + id + "," + name + ") EditText " + tv + " row " + row + " added -> ix " + r); + return r; } catch (Exception e) { Log.e("RoadMap", "DialogAddTextEntry(" + id + "," + name + ") exception " + e); + return -1; } ! } ! ! public void ShowDialog(int id) ! { ! showDialog(id); ! } ! ! /* ! * Special buttons - the ones that belong to the dialog, and appear at the bottom. ! * ! * Note this happens before onCreateDialog so note the button names but do no more. ! * Also : depends on order of the calls in RoadMap. ! */ ! public int DialogAddSpecialButton(int id, String name, int btn) ! { ! try { ! switch (btn) { ! case 0: dialogs[id].button0 = name; ! break; ! case 1: dialogs[id].button1 = name; ! break; ! case 2: dialogs[id].button2 = name; ! break; ! } ! return 0; ! } catch (Exception e) { ! Log.e("RoadMap", "DialogAddSpecialButton(" + id + "," + name + ") exception " + e); ! return 0; ! } ! } ! ! /* ! * Manipulate field contents ! */ ! public void DialogSetData(int id, int rownr, String value) ! { ! try { ! LinearLayout ll = null, row; ! EditText tv = null; ! ! /* Assume EditText is a direct child of LinearLayout ! ll = dialogs[id].ll; ! tv = (EditText)ll.getChildAt(rownr); ! tv.setText(value); ! */ ! ! /* Assume EditText is in a row, so grandchild of LinearLayout */ ! ll = dialogs[id].ll; ! /* ! * The textView is always child #1, child 0 is the label in the row. ! */ ! row = (LinearLayout)ll.getChildAt(rownr); ! tv = (EditText)row.getChildAt(1); ! tv.setText(value); ! ! } catch (Exception e) { ! Log.e("RoadMap", "DialogSetData(" + id + "," + rownr + "," + value + ") " + e); ! } ! } ! ! public void DialogGetData(int id, int rownr) ! { ! try { ! LinearLayout ll = dialogs[id].ll; ! ! /* ! * See above, TextView is #1. ! */ ! LinearLayout row = (LinearLayout)ll.getChildAt(rownr); ! EditText tv = (EditText)row.getChildAt(1); ! ! /* ! EditText tv = (EditText)ll.getChildAt(rownr); ! /* ! * Instead of returning data in a parameter, we're calling C instead. ! * So after returning from this function, the data we want to pass is ! * in a global variable that we write into with this call. ! */ ! ReturnStringDataHack(tv.getText().toString()); ! } catch (Exception e) { ! ReturnStringDataHack(""); ! } ! } ! ! /* ! * Create ListView ! */ ! public void DialogCreateList(int id) ! { ! try { ! LinearLayout row = new LinearLayout(this); ! row.setOrientation(LinearLayout.HORIZONTAL); ! ! dialogs[id].ll.addView(row); ! dialogs[id].row = row; ! // Log.e("RoadMap", "DialogCreateList(" + id + ")"); ! ListView lv = new ListView(thiz); ! // Log.e("RoadMap", "DialogCreateList(" + id + "), row " + dialogs[id].row); ! dialogs[id].row.addView(lv); ! ! // lv.setOnItemClickListener(new AdapterView.OnItemClickListener() { }); ! lv.setOnItemClickListener(listener); ! } catch (Exception e) { ! Log.e("RoadMap", "DialogCreateList(" + id + ") : exception " + e); ! }; ! } ! ! OnItemClickListener listener = new OnItemClickListener() { ! public void onItemClick(AdapterView <?> parent, View view, int position, long id) { ! Log.e("RoadMap", "OnItemClickListener(" + position + "," + id + ")"); ! RoadMapDialogChosen(position, id); ! } ! }; ! ! /* ! * Set a list contents ! */ ! public void DialogSetListContents(int id, String[] list) ! { ! ! // Log.e("RoadMap", "DialogSetListContents(" + id + "," + list + " count " + list.length + ")"); ! // int i; ! // for (i=0; i<list.length; i++) { ! // Log.e("RoadMap", "\t" + i + " - " + list[i]); ! // } ! ! try { ! ListView lv = (ListView)dialogs[id].row.getChildAt(0); ! // Log.e("RoadMap", " ListView " + lv); ! lv.setAdapter(new ArrayAdapter<String>(thiz, ! android.R.layout.simple_list_item_1, ! list)); ! } catch (Exception e) { ! Log.e("RoadMap", "DialogSetListContents -> exception " + e); ! } ! } ! ! /* ! * Sound ! */ ! public int PlaySound(String fn) ! { ! MediaPlayer mp; ! ! try { ! mp = new MediaPlayer(); ! mp.setDataSource(fn); ! mp.prepare(); ! mp.start(); ! } catch (Exception e) { ! Log.e("RoadMap", "PlaySound exception " + e); ! return -1; ! }; ! return 0; } } Index: Panel.java =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap/Panel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Panel.java 12 Dec 2010 15:17:55 -0000 1.3 --- Panel.java 8 Jan 2011 13:41:48 -0000 1.4 *************** *** 40,43 **** --- 40,44 ---- import android.graphics.Paint; import android.graphics.Path; + import android.graphics.Typeface; import java.lang.Exception; *************** *** 193,199 **** --- 194,205 ---- { try { + // Typeface face = Typeface.createFromAsset(getAssets(), + // "fonts/HandmadeTypewriter.ttf"); + Typeface face = Typeface.create("sans", 0 /* NORMAL */); + paint = pen.GetPaint(); paint.setTextSize(size); + paint.setTypeface(face); // Copy from gtk2/roadmap_canvas.c:roadmap_canvas_draw_string() |
From: Danny B. <dan...@us...> - 2010-12-30 10:34:22
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv26669 Modified Files: Makefile Log Message: Remove duplicate option (is also in the AndroidManifest.xml). Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile 30 Dec 2010 10:33:07 -0000 1.5 --- Makefile 30 Dec 2010 10:34:14 -0000 1.6 *************** *** 96,100 **** libs/armeabi/libexpat-1.so libs/armeabi/gdbserver libs/armeabi/gdb.setup -rm -f $@ ! ${AAPT} package -f --debug-mode -M AndroidManifest.xml -S res -I ${SDKPLAT}/android.jar -F roadmap-1.apk libs/armeabi/libexpat-1.so: /opt/android/lib/libexpat-1.so --- 96,100 ---- libs/armeabi/libexpat-1.so libs/armeabi/gdbserver libs/armeabi/gdb.setup -rm -f $@ ! ${AAPT} package -f -M AndroidManifest.xml -S res -I ${SDKPLAT}/android.jar -F roadmap-1.apk libs/armeabi/libexpat-1.so: /opt/android/lib/libexpat-1.so |
From: Danny B. <dan...@us...> - 2010-12-30 10:33:15
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv26497 Modified Files: Makefile Log Message: Another round of small cleanup Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/Makefile,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile 23 Dec 2010 16:46:48 -0000 1.4 --- Makefile 30 Dec 2010 10:33:07 -0000 1.5 *************** *** 57,62 **** --- 57,68 ---- DX= ${SDKHOME}/platform-tools/dx AAPT= ${SDKHOME}/platform-tools/aapt + APKBUILDER= ${SDKHOME}/tools/apkbuilder ZIPALIGN= ${SDKHOME}/tools/zipalign ZIP_PARAM= -f 4 + # + # Note jarsigner is not an Android but a Java tool, so it's in the JDK, + # not in Android SDK or NDK. + # + JARSIGNER= jarsigner DIRHIER= net/sourceforge/projects/roadmap *************** *** 71,85 **** -include .depends.mk ! roadmap.apk: libs/armeabi/librmnative.so AndroidManifest.xml bin/classes.dex \ ! libs/armeabi/libexpat-1.so libs/armeabi/gdbserver libs/armeabi/gdb.setup ! rm -f roadmap-1.apk roadmap-2.apk roadmap-3.apk roadmap.apk # ! # Scripting tested with Android 2.3 toolchain ! # Note apkbuilder says it's deprecated, but there's no alternative and it just works. # ${AAPT} package -f --debug-mode -M AndroidManifest.xml -S res -I ${SDKPLAT}/android.jar -F roadmap-1.apk - apkbuilder roadmap-2.apk -u -z roadmap-1.apk -f bin/classes.dex -rf src -nf libs - ${ZIPALIGN} ${ZIP_PARAM} roadmap-2.apk roadmap-3.apk - jarsigner -verbose -keystore ${HOME}/.android/debug.keystore -storepass android -signedjar $@ roadmap-3.apk androiddebugkey libs/armeabi/libexpat-1.so: /opt/android/lib/libexpat-1.so --- 77,100 ---- -include .depends.mk ! roadmap.apk: roadmap-3.apk ! -rm -f $@ ! ${JARSIGNER} -verbose -keystore ${HOME}/.android/debug.keystore -storepass android -signedjar $@ roadmap-3.apk androiddebugkey ! ! roadmap-3.apk: roadmap-2.apk ! -rm -f $@ ! ${ZIPALIGN} ${ZIP_PARAM} roadmap-2.apk roadmap-3.apk ! # ! # Note Android 2.3 (SDK v9) apkbuilder says it's deprecated but it still works ! # and reply to inquiry in forums says there's no alternative. # + roadmap-2.apk: roadmap-1.apk + -rm -f $@ + ${APKBUILDER} roadmap-2.apk -u -z roadmap-1.apk -f bin/classes.dex -rf src -nf libs + + roadmap-1.apk: libs/armeabi/librmnative.so AndroidManifest.xml bin/classes.dex \ + libs/armeabi/libexpat-1.so libs/armeabi/gdbserver libs/armeabi/gdb.setup + -rm -f $@ ${AAPT} package -f --debug-mode -M AndroidManifest.xml -S res -I ${SDKPLAT}/android.jar -F roadmap-1.apk libs/armeabi/libexpat-1.so: /opt/android/lib/libexpat-1.so |
From: Danny B. <dan...@us...> - 2010-12-28 09:35:38
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv4467 Modified Files: roadmap_canvas.c Log Message: Remove some dead code. Index: roadmap_canvas.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/roadmap_canvas.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** roadmap_canvas.c 12 Dec 2010 15:17:55 -0000 1.3 --- roadmap_canvas.c 28 Dec 2010 09:35:30 -0000 1.4 *************** *** 131,172 **** } - #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 --- 131,134 ---- *************** *** 410,415 **** 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 --- 372,375 ---- *************** *** 429,433 **** 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); /* --- 389,392 ---- *************** *** 450,454 **** */ 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); --- 409,412 ---- *************** *** 482,486 **** */ 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); --- 440,443 ---- *************** *** 502,506 **** * 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, --- 459,462 ---- |
From: Danny B. <dan...@us...> - 2010-12-23 16:46:56
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27310 Modified Files: Makefile Log Message: Add stuff to be more compliant with the standard Android build process. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile 23 Dec 2010 08:31:22 -0000 1.3 --- Makefile 23 Dec 2010 16:46:48 -0000 1.4 *************** *** 5,9 **** # ! ADB= adb # # Produce a build timestamp --- 5,9 ---- # ! ADB= adb -e # # Produce a build timestamp *************** *** 72,76 **** roadmap.apk: libs/armeabi/librmnative.so AndroidManifest.xml bin/classes.dex \ ! libs/armeabi/libexpat-1.so rm -f roadmap-1.apk roadmap-2.apk roadmap-3.apk roadmap.apk # --- 72,76 ---- roadmap.apk: libs/armeabi/librmnative.so AndroidManifest.xml bin/classes.dex \ ! libs/armeabi/libexpat-1.so libs/armeabi/gdbserver libs/armeabi/gdb.setup rm -f roadmap-1.apk roadmap-2.apk roadmap-3.apk roadmap.apk # *************** *** 126,129 **** --- 126,133 ---- cp ${NDKHOME}/toolchains/arm-eabi-4.4.0/prebuilt/gdbserver libs/armeabi/gdbserver + libs/armeabi/gdb.setup: + echo "set solib-search-path libs/armeabi" >$@ + echo "" >>$@ + RMANDROID= ${RMASRC:.c=.o} *************** *** 147,150 **** --- 151,155 ---- rm -f libs/armeabi/gdbserver rm -f roadmap-1.apk roadmap-2.apk roadmap-3.apk + rm -f libs/armeabi/gdb.setup install: roadmap.apk libs/armeabi/gdbserver |
From: Danny B. <dan...@us...> - 2010-12-23 16:46:56
|
Update of /cvsroot/roadmap/roadmap/src/android/jni In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27310/jni Added Files: Android.mk Log Message: Add stuff to be more compliant with the standard Android build process. --- NEW FILE: Android.mk --- |
From: Danny B. <dan...@us...> - 2010-12-23 16:46:01
|
Update of /cvsroot/roadmap/roadmap/src/android/jni In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27184/jni Log Message: Directory /cvsroot/roadmap/roadmap/src/android/jni added to the repository |
From: Danny B. <dan...@us...> - 2010-12-23 08:31:31
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv26190/android Modified Files: Makefile Log Message: Build updates for the Android 2.3 based SDK/NDK. Index: Makefile =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Makefile 20 Aug 2010 18:27:33 -0000 1.2 --- Makefile 23 Dec 2010 08:31:22 -0000 1.3 *************** *** 5,9 **** # ! ADB= adb -e # # Produce a build timestamp --- 5,9 ---- # ! ADB= adb # # Produce a build timestamp *************** *** 32,35 **** --- 32,65 ---- # TARGETS += demomaps.apk + # + # I used this with Android 2.3 + # + + NDKHOME= /home/danny/src/android/android-ndk-r5 + NDK_LEVEL= 9 + NDK_ARCH= arm + NDK_NAME= arm-eabi-4.4.0 + NDK_PREFIX= linux-x86 + NDK_SYSROOT= ${NDKHOME}/platforms/android-${NDK_LEVEL}/arch-${NDK_ARCH} + NDK_CC= ${NDKHOME}/toolchains/${NDK_NAME}/prebuilt/${NDK_SYSTEM}/bin/${NDK_PREFIX}gcc --sysroot=${NDK_SYSROOT} + NDK_LDFLAGS= '-Wl,--fix-cortex-a8' + + SDKHOME= /home/danny/src/android/android-sdk-linux_86 + SDK_ANDV= android-9 + SDKPLAT= ${SDKHOME}/platforms/${SDK_ANDV} + NDK_CFLAGS= -I$(NDKHOME)/platforms/android-${NDK_LEVEL}/arch-${NDK_ARCH}/usr/include \ + -DANDROID -fno-short-enums -g + NDK_LDFLAGS= -nostdlib -Wl,-shared,-Bsymbolic -Wl,--no-undefined -Wl,-z,noexecstack + 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 + DX= ${SDKHOME}/platform-tools/dx + AAPT= ${SDKHOME}/platform-tools/aapt + ZIPALIGN= ${SDKHOME}/tools/zipalign + ZIP_PARAM= -f 4 + + DIRHIER= net/sourceforge/projects/roadmap + # --- The real targets -------------------------------------------- *************** *** 41,81 **** -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-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 \ ! -DANDROID -fno-short-enums -g ! NDK_LDFLAGS= -nostdlib -Wl,-shared,-Bsymbolic -Wl,--no-undefined -Wl,-z,noexecstack ! 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 --- 71,94 ---- -include .depends.mk ! roadmap.apk: libs/armeabi/librmnative.so AndroidManifest.xml bin/classes.dex \ libs/armeabi/libexpat-1.so ! rm -f roadmap-1.apk roadmap-2.apk roadmap-3.apk roadmap.apk ! # ! # Scripting tested with Android 2.3 toolchain ! # Note apkbuilder says it's deprecated, but there's no alternative and it just works. # + ${AAPT} package -f --debug-mode -M AndroidManifest.xml -S res -I ${SDKPLAT}/android.jar -F roadmap-1.apk + apkbuilder roadmap-2.apk -u -z roadmap-1.apk -f bin/classes.dex -rf src -nf libs + ${ZIPALIGN} ${ZIP_PARAM} roadmap-2.apk roadmap-3.apk + jarsigner -verbose -keystore ${HOME}/.android/debug.keystore -storepass android -signedjar $@ roadmap-3.apk androiddebugkey libs/armeabi/libexpat-1.so: /opt/android/lib/libexpat-1.so cp /opt/android/lib/libexpat-1.so libs/armeabi/libexpat-1.so ! bin/classes.dex: ${CLSES} ! ${DX} --dex --output=$@ ${DIRHIER}/*.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 *************** *** 98,108 **** 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} --- 111,128 ---- 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 \ ! roadmap_sound.c \ ! roadmap_menu.c ! libs/armeabi/gdbserver: ${NDKHOME}/toolchains/arm-eabi-4.4.0/prebuilt/gdbserver ! cp ${NDKHOME}/toolchains/arm-eabi-4.4.0/prebuilt/gdbserver libs/armeabi/gdbserver RMANDROID= ${RMASRC:.c=.o} *************** *** 114,125 **** ${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_ --- 134,143 ---- ${RMLIBS} \ -lgcc \ ! -L${NDKHOME}/platforms/android-${NDK_LEVEL}/arch-${NDK_ARCH}/usr/lib -llog -lc -lm clean: rm -f *.o *.a *.so .depends.mk *.class *.apk rm -f *~ jni/*~ src/${DIRHIER}/*~ ! rm -f bin/classes.dex rm -f gen/${DIRHIER}/R.java rm -f bin/${SRCNAME}.ap_ *************** *** 128,131 **** --- 146,150 ---- rm -f ${DIRHIER}/*.class rm -f libs/armeabi/gdbserver + rm -f roadmap-1.apk roadmap-2.apk roadmap-3.apk install: roadmap.apk libs/armeabi/gdbserver |
From: Danny B. <dan...@us...> - 2010-12-23 08:31:30
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv26190 Modified Files: config.mk Log Message: Build updates for the Android 2.3 based SDK/NDK. Index: config.mk =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/config.mk,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** config.mk 17 Aug 2010 18:57:10 -0000 1.38 --- config.mk 23 Dec 2010 08:31:22 -0000 1.39 *************** *** 37,54 **** # 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. --- 37,56 ---- # DESKTOP = ANDROID + # # Support for Android # ! # Note the application is capable of running in a device with e.g. Android 1.6, it ! # uses no APIs or features from 2.* versions of Android. # ! # For the SDK/NDK development environments used, I recomment the latest. ! # Currently this has been tested with the tools for Android 2.3 (SDK r9, NDK r5). ! # ! NDK = /home/danny/src/android/android-ndk-r5 ! CROSS=arm-eabi- ! CFLAGS += -I$(NDK)/platforms/android-9/arch-arm/usr/include \ ! -I$(NDK)/apps/ndk_demo/project/jni \ ! -DANDROID \ ! -fno-short-enums -g -Wl,--fix-cortex-a8 ! LIBS += # Support for WINCE is still a work in progress. |
From: Danny B. <dan...@us...> - 2010-12-21 10:26:32
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15496 Modified Files: roadmap_plugin.c Log Message: Add a test : a plugin can only register once. Index: roadmap_plugin.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_plugin.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** roadmap_plugin.c 18 Apr 2009 05:46:07 -0000 1.8 --- roadmap_plugin.c 21 Dec 2010 10:26:24 -0000 1.9 *************** *** 3,7 **** * * Copyright 2005 Ehud Shabtai ! * Copyright (c) 2008, 2009, Danny Backx. * * This file is part of RoadMap. --- 3,7 ---- * * Copyright 2005 Ehud Shabtai ! * Copyright (c) 2008, 2009, 2010, Danny Backx. * * This file is part of RoadMap. *************** *** 97,100 **** --- 97,104 ---- for (i=1; i<MAX_PLUGINS; i++) { + /* Register a plugin only once */ + if (hooks[i].plugin == hook) + return i; + if (hooks[i].plugin == NULL) { hooks[i].plugin= hook; |
From: Danny B. <dan...@us...> - 2010-12-12 15:34:33
|
Update of /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27871/src/net/sourceforge/projects/roadmap Modified Files: Panel.java Log Message: Enable font sizes on Android. Index: Panel.java =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap/Panel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Panel.java 22 Aug 2010 09:06:46 -0000 1.2 --- Panel.java 12 Dec 2010 15:17:55 -0000 1.3 *************** *** 1,2 **** --- 1,29 ---- + /* + * LICENSE: + * + * 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 Panel abstraction - stuff to draw on Android + * @ingroup android + */ package net.sourceforge.projects.roadmap; *************** *** 168,171 **** --- 195,200 ---- paint = pen.GetPaint(); + paint.setTextSize(size); + // Copy from gtk2/roadmap_canvas.c:roadmap_canvas_draw_string() int width = (int)paint.measureText(text); *************** *** 301,308 **** } ! public int MeasureWidth(String text, int s) { try { paint = pen.GetPaint(); // Log.e("RoadMap", "Measure(" + text + ") -> " + paint.measureText(text)); return (int) paint.measureText(text); --- 330,338 ---- } ! public int MeasureWidth(String text, int size) { try { paint = pen.GetPaint(); + paint.setTextSize(size); // Log.e("RoadMap", "Measure(" + text + ") -> " + paint.measureText(text)); return (int) paint.measureText(text); |
From: Danny B. <dan...@us...> - 2010-12-12 15:18:03
|
Update of /cvsroot/roadmap/roadmap/src/android In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv27871 Modified Files: roadmap_canvas.c Log Message: Enable font sizes on Android. Index: roadmap_canvas.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/roadmap_canvas.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** roadmap_canvas.c 29 Aug 2010 12:30:11 -0000 1.2 --- roadmap_canvas.c 12 Dec 2010 15:17:55 -0000 1.3 *************** *** 186,190 **** int r; ! r = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, PanelThiz, mid, js); if (width) *width = r; --- 186,190 ---- int r; ! r = (*RoadMapJniEnv)->CallIntMethod(RoadMapJniEnv, PanelThiz, mid, js, size); if (width) *width = r; |
From: Danny B. <dan...@us...> - 2010-12-06 20:13:23
|
Update of /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv12072/android/src/net/sourceforge/projects/roadmap Modified Files: Pen.java Log Message: Add copyright Index: Pen.java =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/android/src/net/sourceforge/projects/roadmap/Pen.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Pen.java 29 Aug 2010 12:30:11 -0000 1.2 --- Pen.java 6 Dec 2010 20:13:15 -0000 1.3 *************** *** 1,2 **** --- 1,29 ---- + /* + * LICENSE: + * + * 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 Pen abstraction - defines a pen with some features + * @ingroup android + */ package net.sourceforge.projects.roadmap; |
From: Danny B. <dan...@us...> - 2010-12-06 20:11:25
|
Update of /cvsroot/roadmap/roadmap/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv11616 Modified Files: roadmap_display.c Log Message: Initialisation of this variable was forgotten (only impacts Android), resulting in colours that were wrong. Index: roadmap_display.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/roadmap_display.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** roadmap_display.c 13 Jul 2010 05:52:39 -0000 1.42 --- roadmap_display.c 6 Dec 2010 20:11:17 -0000 1.43 *************** *** 186,202 **** } static void roadmap_display_create_pens (void) { - static int RoadMapDisplayPensCreated = 0; - RoadMapSign *sign; - if (RoadMapDisplayPensCreated) return; RoadMapDisplayPensCreated = 1; - RoadMapMessageContour = roadmap_canvas_create_pen ("message.contour"); roadmap_canvas_set_foreground ("black"); --- 186,199 ---- } + static int RoadMapDisplayPensCreated = 0; static void roadmap_display_create_pens (void) { RoadMapSign *sign; if (RoadMapDisplayPensCreated) return; RoadMapDisplayPensCreated = 1; RoadMapMessageContour = roadmap_canvas_create_pen ("message.contour"); roadmap_canvas_set_foreground ("black"); *************** *** 553,557 **** roadmap_message_set ('C', properties.city); - if (! roadmap_message_format (text, sizeof(text), format)) { roadmap_log_pop (); --- 550,553 ---- *************** *** 798,801 **** --- 794,799 ---- RoadMapSign *sign; + RoadMapDisplayPensCreated = 0; + roadmap_config_declare ("preferences", &RoadMapConfigDisplayDuration, "10"); |
From: Danny B. <dan...@us...> - 2010-12-05 13:31:15
|
Update of /cvsroot/roadmap/roadmap/src/unix In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv7037 Modified Files: roadmap_path.c Log Message: Remove (part of) the platform dependency in the code by providing a poor man's implementation of ftw(3). Replace some tabs by spaces. Index: roadmap_path.c =================================================================== RCS file: /cvsroot/roadmap/roadmap/src/unix/roadmap_path.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** roadmap_path.c 16 Aug 2010 05:13:40 -0000 1.31 --- roadmap_path.c 5 Dec 2010 13:31:07 -0000 1.32 *************** *** 185,191 **** /* The default path for the skin files (the "skin" path): */ static const char *RoadMapPathSkin[] = { ! "&\\skins\\default\\day", ! "&\\skins\\default", ! NULL }; static const char RoadMapPathSkinPreferred[] = "&\\skins"; --- 185,191 ---- /* The default path for the skin files (the "skin" path): */ static const char *RoadMapPathSkin[] = { ! "&\\skins\\default\\day", ! "&\\skins\\default", ! NULL }; static const char RoadMapPathSkinPreferred[] = "&\\skins"; *************** *** 414,421 **** } /* Path lists operations. -------------------------------------------------- */ - #ifndef ANDROID /* bah. globals. too bad ftw() doesn't take a "void *cookie" argument */ static RoadMapList *RoadMapPathFTWDirList; --- 414,475 ---- } + #ifdef ANDROID + + #define FTW_F 1 + #define FTW_D 2 + + /* + * Android lookalike of the linux ftw function + * + * This does just what we need, by no means complete. + * Note that this can be tweaked much more (e.g. don't do anything for files) + * to improve startup time. + */ + int ftw(const char *path, + int (*fn)(const char *fpath, const struct stat *sb, int typeflag), + int nfds) + { + struct dirent *dp; + DIR *dirp; + int len; + + dirp = opendir(path); + len = strlen(path); + + /* Use the directory passed as well ... */ + (*fn)(path, NULL, FTW_D); + + /* + * Single pass over the directory, + * not sure if this obeys the ftw directory-first behaviour + */ + while (dirp && (dp = readdir(dirp))) { + char *p = malloc(len + strlen(dp->d_name) + 2); + + strcpy(p, path); + strcat(p, "/"); + strcat(p, dp->d_name); + + if (dp->d_type & DT_DIR) { + /* No infinite recursion, please */ + if (strcmp(dp->d_name, ".") != 0 && strcmp(dp->d_name, "..") != 0) { + (void) ftw(p, fn, nfds); + + /* Don't call (*fn), ftw() will start by doing this */ + } + } else if (dp->d_type & DT_REG) { + (*fn)(p, NULL, FTW_F); + } + + free(p); + } + if (dirp) + closedir(dirp); + return 0; + } + #endif /* Path lists operations. -------------------------------------------------- */ /* bah. globals. too bad ftw() doesn't take a "void *cookie" argument */ static RoadMapList *RoadMapPathFTWDirList; *************** *** 443,453 **** return 0; } - #endif static void roadmap_path_addlist(RoadMapList *list, char *path) { - #ifndef ANDROID int len; len = strlen(path); if (len > 4 && strcmp(&path[len-4], "/...") == 0) { path[len-4] = '\0'; --- 497,511 ---- return 0; } + /** + * @brief add path to list, also keep track of /... construction causing file tree walk + * @param list RoadMapList to which we're appending + * @param path this gets appended + */ static void roadmap_path_addlist(RoadMapList *list, char *path) { int len; len = strlen(path); + if (len > 4 && strcmp(&path[len-4], "/...") == 0) { path[len-4] = '\0'; *************** *** 465,484 **** roadmap_list_append(list, &pathitem->link); } - #else - /* Android : ignore the /... stuff */ - int len; - len = strlen(path); - if (len > 4 && strcmp(&path[len-4], "/...") == 0) { - path[len-4] = '\0'; - } - { - RoadMapPathItem *pathitem; - pathitem = malloc(sizeof(RoadMapPathItem)); - roadmap_check_allocated(pathitem); - - pathitem->path = path; - roadmap_list_append(list, &pathitem->link); - } - #endif } --- 523,526 ---- *************** *** 695,699 **** int l = strlen(entry->d_name); if (entry->d_name[l-1] == '~') ! continue; if (length > 0) { --- 737,741 ---- int l = strlen(entry->d_name); if (entry->d_name[l-1] == '~') ! continue; if (length > 0) { *************** *** 703,711 **** if (! strcmp (match, extension)) { *(cursor++) = strdup (entry->d_name); ! roadmap_log (ROADMAP_WARNING, "--> %s", entry->d_name); } } else { *(cursor++) = strdup (entry->d_name); ! roadmap_log (ROADMAP_WARNING, "--> %s", entry->d_name); } } --- 745,753 ---- if (! strcmp (match, extension)) { *(cursor++) = strdup (entry->d_name); ! roadmap_log (ROADMAP_WARNING, "--> %s", entry->d_name); } } else { *(cursor++) = strdup (entry->d_name); ! roadmap_log (ROADMAP_WARNING, "--> %s", entry->d_name); } } *************** *** 793,800 **** static void roadmap_path_cleanup_recursive (RoadMapPathList p) { ! if (p == NULL) ! return; ! roadmap_path_cleanup_recursive (p->next); ! free(p); } --- 835,842 ---- static void roadmap_path_cleanup_recursive (RoadMapPathList p) { ! if (p == NULL) ! return; ! roadmap_path_cleanup_recursive (p->next); ! free(p); } *************** *** 804,812 **** void roadmap_path_shutdown (void) { ! roadmap_path_cleanup_recursive (RoadMapPaths); ! RoadMapPaths = NULL; ! RoadMapUser = NULL; // this only points into a structure, free() happens elsewhere ! RoadMapTrips = NULL; // this only points into a structure, free() happens elsewhere ! RoadMapPathHome = NULL; // getenv() result or a constant : don't free } --- 846,854 ---- void roadmap_path_shutdown (void) { ! roadmap_path_cleanup_recursive (RoadMapPaths); ! RoadMapPaths = NULL; ! RoadMapUser = NULL; // this only points into a structure, free() happens elsewhere ! RoadMapTrips = NULL; // this only points into a structure, free() happens elsewhere ! RoadMapPathHome = NULL; // getenv() result or a constant : don't free } |