void roadmap_layer_initialize (void) { if (RoadMapCategory != NULL) return; RoadMapCategoryCount = sizeof(RoadMapDefaultCategoryTable) / sizeof(char *); RoadMapCategory = calloc (RoadMapCategoryCount + 1, sizeof(*RoadMapCategory)); roadmap_check_allocated(RoadMapCategory); roadmap_config_declare_enumeration ("preferences", &RoadMapConfigStylePretty, NULL, "yes", "no", NULL); // TODO : Add Boolean that says if we use pen or pen new roadmap_layer_reload_internal(); roadmap_skin_register(roadmap_layer_reset); roadmap_skin_register (roadmap_layer_reload); }
void roadmap_display_initialize (void) { RoadMapSign *sign; roadmap_config_declare ("preferences", &RoadMapConfigDisplayDuration, "5", NULL); roadmap_config_declare ("preferences", &RoadMapConfigDisplayBottomRight, "%D (%W)|%D", NULL); roadmap_config_declare ("preferences", &RoadMapConfigDisplayBottomLeft, "%S", NULL); roadmap_config_declare ("preferences", &RoadMapConfigDisplayTopRight, "ETA: %A|%T", NULL); roadmap_config_declare ("schema", &RoadMapConfigConsoleBackground, "#ffff00", NULL); roadmap_config_declare ("schema", &RoadMapConfigConsoleForeground, "#000000", NULL); roadmap_config_declare ("schema", &RoadMapConfigWarningBackground, "#000000", NULL); roadmap_config_declare ("schema", &RoadMapConfigWarningForeground, "#FFFFFF", NULL); roadmap_config_declare ("schema", &RoadMapConfigActivityBackground, "#535252", NULL); roadmap_config_declare ("schema", &RoadMapConfigActivityForeground, "#FFFFFF", NULL); for (sign = RoadMapStreetSign; sign->title != NULL; ++sign) { if (sign->default_format != NULL) { roadmap_config_declare ("preferences", &sign->format_descriptor, sign->default_format, NULL); } roadmap_config_declare ("preferences", &sign->background_descriptor, sign->default_background, NULL); roadmap_config_declare ("preferences", &sign->foreground_descriptor, sign->default_foreground, NULL); } roadmap_skin_register (roadmap_display_create_pens); }
void roadmap_bar_initialize(void){ int width; int i; const char *cursor; RoadMapFileContext file; RoadMapImage topBarBgImg, bottomBarBgImg; TopBarObjectTable.count = 0; for (i=0; i< MAX_OBJECTS;i++){ TopBarObjectTable.object[i] = NULL; BottomBarObjectTable.object[i] = NULL; } TopBarObjectTable.draw_bg = TRUE; BottomBarObjectTable.draw_bg = TRUE; width = roadmap_canvas_width (); /* * The bar images not in cache (persistent). Possible memory optimization point * AGA */ topBarBgImg = (RoadMapImage) roadmap_res_get(RES_BITMAP, RES_SKIN|RES_NOCACHE, TOP_BAR_IMAGE); if (topBarBgImg == NULL){ return; } TopBarBgImageSize.width = roadmap_canvas_image_width( topBarBgImg ); TopBarBgImageSize.height = roadmap_canvas_image_height( topBarBgImg ); bottomBarBgImg = (RoadMapImage) roadmap_res_get(RES_BITMAP, RES_SKIN|RES_NOCACHE, BOTTOM_BAR_IMAGE); if (bottomBarBgImg == NULL){ return; } BottomBarBgImageSize.width = roadmap_canvas_image_width( bottomBarBgImg ); BottomBarBgImageSize.height = roadmap_canvas_image_height( bottomBarBgImg ); #ifdef TOUCH_SCREEN TopBarSelectedBg = ( RoadMapImage) roadmap_res_get(RES_BITMAP, RES_SKIN|RES_NOCACHE, TOP_BAR_SELECTED_BG_IMAGE ); #endif #if ! (defined(OPENGL)) // Draw directly TopBarFullBg = createBGImage( topBarBgImg ); BottomBarFullBg = createBGImage( bottomBarBgImg ); #endif /* * Deallocate the source images */ roadmap_canvas_free_image( topBarBgImg ); roadmap_canvas_free_image( bottomBarBgImg ); // Load top bar cursor = roadmap_file_map ("skin", "top_bar", NULL, "r", &file); if (cursor == NULL){ roadmap_log (ROADMAP_ERROR, "roadmap bar top_bar file is missing"); return; } roadmap_bar_load(roadmap_file_base(file), roadmap_file_size(file), &TopBarObjectTable); roadmap_file_unmap (&file); #ifndef J2ME // Load bottom bar cursor = roadmap_file_map ("skin", "bottom_bar", NULL, "r", &file); if (cursor == NULL){ roadmap_log (ROADMAP_ERROR, "roadmap bottom top_bar file is missing"); return; } roadmap_bar_load(roadmap_file_base(file), roadmap_file_size(file), &BottomBarObjectTable); roadmap_file_unmap (&file); #endif roadmap_bar_set_mode(TOPBAR_FLAG); roadmap_pointer_register_short_click (roadmap_bar_short_click, POINTER_HIGH); roadmap_pointer_register_long_click (roadmap_bar_long_click, POINTER_HIGH); roadmap_pointer_register_pressed (roadmap_bar_obj_pressed, POINTER_HIGH); roadmap_pointer_register_drag_start (roadmap_bar_drag_start, POINTER_HIGHEST); roadmap_pointer_register_released (roadmap_bar_obj_released, POINTER_HIGH); roadmap_skin_register (roadmap_bar_switch_skins); #ifdef ANDROID roadmap_androidmenu_initialize(); #endif bar_initialized = TRUE; }
void roadmap_bar_initialize(void){ int width; int image_width; int i; const char *cursor; RoadMapFileContext file; TopBarObjectTable.count = 0; for (i=0; i< MAX_OBJECTS;i++){ TopBarObjectTable.object[i] = NULL; BottomBarObjectTable.object[i] = NULL; } TopBarObjectTable.draw_bg = TRUE; BottomBarObjectTable.draw_bg = TRUE; width = roadmap_canvas_width (); TopBarBgImage = (RoadMapImage) roadmap_res_get(RES_BITMAP, RES_SKIN, TOP_BAR_IMAGE); if (TopBarBgImage == NULL){ return; } BottomBarBgImage = (RoadMapImage) roadmap_res_get(RES_BITMAP, RES_SKIN, BOTTOM_BAR_IMAGE); if (BottomBarBgImage == NULL){ return; } // Load top bar cursor = roadmap_file_map ("skin", "top_bar", NULL, "r", &file); if (cursor == NULL){ roadmap_log (ROADMAP_ERROR, "roadmap bar top_bar file is missing"); return; } roadmap_bar_load(roadmap_file_base(file), roadmap_file_size(file), &TopBarObjectTable); roadmap_file_unmap (&file); // Load bottom bar cursor = roadmap_file_map ("skin", "bottom_bar", NULL, "r", &file); if (cursor == NULL){ roadmap_log (ROADMAP_ERROR, "roadmap bottom top_bar file is missing"); return; } roadmap_bar_load(roadmap_file_base(file), roadmap_file_size(file), &BottomBarObjectTable); roadmap_file_unmap (&file); image_width = roadmap_canvas_image_width(TopBarBgImage); roadmap_bar_set_mode(TOPBAR_FLAG); roadmap_pointer_register_short_click (roadmap_bar_short_click, POINTER_HIGH); roadmap_pointer_register_long_click (roadmap_bar_long_click, POINTER_HIGH); roadmap_pointer_register_pressed (roadmap_bar_obj_pressed, POINTER_HIGH); roadmap_pointer_register_released (roadmap_bar_obj_released, POINTER_HIGH); roadmap_skin_register (roadmap_bar_switch_skins); bar_initialized = TRUE; }