本文整理汇总了C++中roadmap_log函数的典型用法代码示例。如果您正苦于以下问题:C++ roadmap_log函数的具体用法?C++ roadmap_log怎么用?C++ roadmap_log使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了roadmap_log函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dummy_handler
static void dummy_handler(NOPH_Exception_t exception, void *arg) {
if (arg) {
RoadMapImage i = (RoadMapImage) arg;
roadmap_log(ROADMAP_ERROR, "Error drawing image: %s\n", i->file_name);
}
NOPH_delete(exception);
}
示例2: FreeMapNativeManager_OpenExternalBrowser
/*************************************************************************************************
* FreeMapNativeManager_OpenExternalBrowser
* Loads the url to the external browser
*
*/
void FreeMapNativeManager_OpenExternalBrowser( const char* aUrl )
{
android_method_context_type lMthdContext;
int retVal = -1;
jmethodID mid;
jstring url = NULL;
JNI_LOG( ROADMAP_INFO, "Trying to call method %s through JNI", JNI_CALL_FreeMapNativeManager_OpenExternalBrowser );
mid = InitJNIMethodContext( &gJniObj, &lMthdContext, JNI_CALL_FreeMapNativeManager_OpenExternalBrowser,
JNI_CALL_FreeMapNativeManager_OpenExternalBrowser_Sig );
if ( !mid || !lMthdContext.env )
{
roadmap_log( ROADMAP_ERROR, "Failed to obtain method context!" );
return;
}
if ( aUrl != NULL )
{
url = (*lMthdContext.env)->NewStringUTF( lMthdContext.env, aUrl );
}
// Calling the method
(*lMthdContext.env)->CallVoidMethod( lMthdContext.env, gJniObj.obj, lMthdContext.mid, url );
// Release local references
if ( url )
(*lMthdContext.env)->DeleteLocalRef( lMthdContext.env, url );
}
示例3: FreeMapNativeManager_GetThumbnail
/*************************************************************************************************
* FreeMapNativeManager_GetThumbnail
* Returns the thumbnail in the supplied byte buffer with the last taken image
*
*/
int FreeMapNativeManager_GetThumbnail( int aThumbWidth, int aThumbHeight, int bytePP, int* aBuf )
{
android_method_context_type lMthdContext;
int retVal = -1;
int buf_size;
jmethodID mid;
jintArray bufJNI;
JNI_LOG( ROADMAP_INFO, "Trying to call method %s through JNI", JNI_CALL_FreeMapNativeManager_GetThumbnail );
mid = InitJNIMethodContext( &gJniObj, &lMthdContext, JNI_CALL_FreeMapNativeManager_GetThumbnail,
JNI_CALL_FreeMapNativeManager_GetThumbnail_Sig );
if ( !mid || !lMthdContext.env )
{
roadmap_log( ROADMAP_ERROR, "Failed to obtain method context!" );
return retVal;
}
buf_size = aThumbHeight*aThumbWidth;
bufJNI = (*lMthdContext.env)->NewIntArray( lMthdContext.env, buf_size );
// Calling the method
retVal = (*lMthdContext.env)->CallIntMethod( lMthdContext.env, gJniObj.obj, lMthdContext.mid,
aThumbWidth, aThumbHeight, bufJNI );
// Copy the elements
(*lMthdContext.env)->GetIntArrayRegion( lMthdContext.env, bufJNI, 0, buf_size, aBuf );
return retVal;
}
示例4: FreeMapNativeManager_TakePictureAsync
/*************************************************************************************************
* FreeMapNativeManager_TakePictureAsync()
* Shows the camera capture preview and saves the taken image
*
*/
int FreeMapNativeManager_TakePictureAsync( int aImageWidth, int aImageHeight, int aImageQuality,
char* aImageFolder, char* aImageFile )
{
android_method_context_type lMthdContext;
int retVal = -1;
jmethodID mid;
jbyteArray imageFolder, imageFile;
JNI_LOG( ROADMAP_INFO, "Trying to call method %s through JNI", JNI_CALL_FreeMapNativeManager_TakePictureAsync );
mid = InitJNIMethodContext( &gJniObj, &lMthdContext, JNI_CALL_FreeMapNativeManager_TakePictureAsync,
JNI_CALL_FreeMapNativeManager_TakePictureAsync_Sig );
if ( !mid || !lMthdContext.env )
{
roadmap_log( ROADMAP_ERROR, "Failed to obtain method context!" );
return retVal;
}
imageFolder = (*lMthdContext.env)->NewByteArray( lMthdContext.env, strlen( aImageFolder ) );
(*lMthdContext.env)->SetByteArrayRegion( lMthdContext.env, imageFolder, 0, strlen( aImageFolder ), aImageFolder );
imageFile = (*lMthdContext.env)->NewByteArray( lMthdContext.env, strlen( aImageFile ) );
(*lMthdContext.env)->SetByteArrayRegion( lMthdContext.env, imageFile, 0, strlen( aImageFile ), aImageFile );
// Calling the method
retVal = (*lMthdContext.env)->CallIntMethod( lMthdContext.env, gJniObj.obj, lMthdContext.mid,
aImageWidth, aImageHeight, aImageQuality, imageFolder, imageFile );
return retVal;
}
示例5: upload_error_callback
static void upload_error_callback( void *context, int connection_failure, const char *format, ...) {
upload_context * ctx = (upload_context *)context;
roadmap_log(ROADMAP_ERROR,"error in uploading voice : %s",ctx->full_path);
(*ctx->cb ) (ctx->context);
roadmap_path_free(ctx->full_path);
free(ctx);
}
示例6: roadmap_plugin_get_direction
int roadmap_plugin_get_direction (PluginLine *line, int who) {
if (line->plugin_id == ROADMAP_PLUGIN_ID) {
roadmap_square_set_current (line->square);
return roadmap_line_route_get_direction (line->line_id, who);
} else {
RoadMapPluginHooks *hooks = get_hooks (line->plugin_id);
if (hooks == NULL) {
roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.",
line->plugin_id);
return 0;
}
if (hooks->route_direction != NULL) {
return (*hooks->route_direction) (line, who);
}
return 0;
}
}
示例7: roadmap_main_start_init
/*************************************************************************************************
* Java_com_waze_FreeMapNativeManager_AppStartNTV
* Starts the application
*
*/
JNIEXPORT void JNICALL Java_com_waze_FreeMapNativeManager_AppStartNTV
( JNIEnv* aJNIEnv, jobject aJObj, jstring aUrl, int aAppMode )
{
roadmap_main_start_init();
const char* url = NULL;
if ( aUrl )
{
char query[URL_MAX_LENGTH];
jboolean isCopy;
url = (*aJNIEnv)->GetStringUTFChars( aJNIEnv, aUrl, &isCopy );
roadmap_urlscheme_remove_prefix( query, url );
roadmap_urlscheme_init( query );
(*aJNIEnv)->ReleaseStringUTFChars( aJNIEnv, aUrl, url );
}
roadmap_log( ROADMAP_WARNING, "Applicaiton started with URL string: %s", url );
roadmap_main_set_app_mode( aAppMode );
// Widget Mode
if ( aAppMode == 1 )
{
roadmap_screen_set_background_run( TRUE );
}
roadmap_start(0, NULL);
}
示例8: roadmap_square_set_current
const char *roadmap_plugin_street_full_name (const PluginLine *line) {
if (line->plugin_id == ROADMAP_PLUGIN_ID) {
RoadMapStreetProperties properties;
roadmap_square_set_current (line->square);
roadmap_street_get_properties (line->line_id, &properties);
return roadmap_street_get_full_name (&properties);
} else {
RoadMapPluginHooks *hooks = get_hooks (line->plugin_id);
if (hooks == NULL) {
roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.",
line->plugin_id);
return "";
}
if (hooks->get_street_full_name != NULL) {
return (*hooks->get_street_full_name) (line);
}
return "";
}
}
示例9: roadmap_log
/*************************************************************************************************
* Java_com_waze_FreeMapNativeManager_UrlHandlerNTV
* JNI wrapper for
*
*/
JNIEXPORT jboolean JNICALL Java_com_waze_FreeMapNativeManager_UrlHandlerNTV
( JNIEnv* aJNIEnv, jobject aJObj, jstring aUrl )
{
jboolean isCopy;
jboolean res = JNI_FALSE;
const char* url = (*aJNIEnv)->GetStringUTFChars( aJNIEnv, aUrl, &isCopy );
/*
* Try to handle by browser
*/
roadmap_log( ROADMAP_INFO, "Processing url: %s", url );
if ( roadmap_browser_url_handler( url ) == TRUE )
{
res = JNI_TRUE;
}
/*
* Try to handle by url scheme
*/
if ( ( res == JNI_FALSE ) && roadmap_urlscheme_valid( url ) )
{
char query[URL_MAX_LENGTH];
roadmap_urlscheme_remove_prefix( query, url );
roadmap_urlscheme_init( query );
res = JNI_TRUE;
}
(*aJNIEnv)->ReleaseStringUTFChars( aJNIEnv, aUrl, url );
return res;
}
示例10: roadmap_plugin_get_street
void roadmap_plugin_get_street (const PluginLine *line, PluginStreet *street) {
if (line->plugin_id == ROADMAP_PLUGIN_ID) {
RoadMapStreetProperties properties;
roadmap_square_set_current (line->square);
roadmap_street_get_properties (line->line_id, &properties);
street->plugin_id = ROADMAP_PLUGIN_ID;
street->street_id = properties.street;
street->square = line->square;
} else {
RoadMapPluginHooks *hooks = get_hooks (line->plugin_id);
street->plugin_id = line->plugin_id;
street->square = line->square;
if (hooks == NULL) {
roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.",
line->plugin_id);
street->street_id = -1;
return;
}
if (hooks->get_street != NULL) {
(*hooks->get_street) (line, street);
} else {
street->street_id = -1;
}
return;
}
}
示例11: roadmap_plugin_activate_db
int roadmap_plugin_activate_db (const PluginLine *line) {
if (line->plugin_id == ROADMAP_PLUGIN_ID) {
if (roadmap_locator_activate (line->fips) != ROADMAP_US_OK) {
return -1;
}
return 0;
} else {
RoadMapPluginHooks *hooks = get_hooks (line->plugin_id);
if (hooks == NULL) {
roadmap_log (ROADMAP_ERROR, "plugin id:%d is missing.",
line->plugin_id);
return -1;
}
if (hooks->activate_db != NULL) {
return (*hooks->activate_db) (line);
}
return 0;
}
}
示例12: roadmap_main_set_input
void roadmap_main_set_input (RoadMapIO *io, RoadMapInput callback)
{
int i;
for (i = 0; i < ROADMAP_MAX_IO; ++i) {
if (RoadMapMainIo[i] == NULL) {
RoadMapMainIo[i] = (roadmap_main_io *) malloc (sizeof(roadmap_main_io));
RoadMapMainIo[i]->io = io;
RoadMapMainIo[i]->callback = callback;
RoadMapMainIo[i]->is_valid = 1;
break;
}
}
if (i == ROADMAP_MAX_IO) {
roadmap_log (ROADMAP_FATAL, "Too many set input calls");
return;
}
if ( io == NULL || callback == NULL ) return;
if ( io->subsystem != ROADMAP_IO_NET ) return;
CRoadMapNativeNet* net = (CRoadMapNativeNet*)(io->os.socket);
if ( net == NULL ) return;
net->StartPolling((void*)callback, (void*)RoadMapMainIo[i]);
}
示例13: WazeSoundRecorder_Start
/*************************************************************************************************
* WazeSoundRecorder_Start()
* Starts the audio recorder
* aPath - path to
* aTimeout - timeout for recording in ms
*/
int WazeSoundRecorder_Start( const char* aPath, int aTimeout )
{
jmethodID mid;
android_method_context_type lMthdContext;
jstring path = NULL;
int res;
JNI_LOG( ROADMAP_INFO, "Trying to call method %s through JNI", JNI_CALL_WazeSoundRecorder_Start );
mid = InitJNIMethodContext( &gJniObj, &lMthdContext, JNI_CALL_WazeSoundRecorder_Start,
JNI_CALL_WazeSoundRecorder_Start_Sig );
if ( !mid || !lMthdContext.env )
{
roadmap_log( ROADMAP_ERROR, "Failed to obtain method context!" );
return -1;
}
if ( aPath != NULL )
{
path = (*lMthdContext.env)->NewStringUTF( lMthdContext.env, aPath );
}
// Call the method
res = (*lMthdContext.env)->CallIntMethod( lMthdContext.env, gJniObj.obj, mid, path, aTimeout );
// Release local references
if ( path )
(*lMthdContext.env)->DeleteLocalRef( lMthdContext.env, path );
return res;
}
示例14: roadmap_lang_get
const char* roadmap_lang_get (const char *name) {
int hash;
int i;
if (!RoadMapLangLoaded) return name;
if ( name == NULL )
{
roadmap_log( ROADMAP_ERROR, "String is not initialized! Language module can't work with NULL strings" );
return ("");
}
hash = roadmap_hash_string (name);
for (i = roadmap_hash_get_first (RoadMapLangHash, hash);
i >= 0;
i = roadmap_hash_get_next (RoadMapLangHash, i)) {
if (!strcmp(name, RoadMapLangItems[i].name)) {
return RoadMapLangItems[i].value;
}
}
return name;
}
示例15: roadmap_canvas3_ogl_updateScale
void roadmap_canvas3_ogl_updateScale(int zoom) {
float angRad;
//static float maxAngle= 67.3;
static float maxAngle= 62;
float ang= 24;
//float angZoom= 384;
float angZoom= 3000;
if (!isInitialized || zoom== 0)
return;
if ( !is_canvas_ready() )
return;
if ( roadmap_screen_is_hd_screen() ) {
zoom /= 2;
}
while (angZoom > zoom) {
angZoom/= 1.1;
ang= ang* 1.026; // (5/4)^(ln(1.1)/ln(2))
}
if (ang > maxAngle)
ang= maxAngle;
angRad= ang*M_PI/180;
if (angRad!= angle) {
double distH;
angle= angRad;
distH= roadmap_canvas_ogl_rotateMe(0);
roadmap_log(ROADMAP_DEBUG,"zoom= %d angle= %lf y dist= %lg\n",zoom,ang,distH);
}
}