示例#1
0
void draw_title_bar(RoadMapGuiRect *rect){

	static RoadMapImage header_image;
	RoadMapGuiPoint point;
   static RoadMapImage cached_header_image;
   static int cached_width = -1;


	rect->miny -= 1;
   if (!header_image)
      header_image =    roadmap_res_get(
                                 RES_BITMAP,
                                 RES_SKIN|RES_NOCACHE,
                                 "header");


   point.x = rect->minx;
   point.y = rect->miny;
#if defined( OPENGL )
   draw_title_bar_image( header_image, rect, &point );
#else
   if ((cached_header_image == NULL) || (cached_width != roadmap_canvas_width())){
      if (cached_header_image != NULL)
         roadmap_canvas_free_image(cached_header_image);
      cached_header_image = create_title_bar_image  (header_image, rect);
      cached_width = roadmap_canvas_width();
   }
   roadmap_canvas_draw_image (cached_header_image, &point, 0, IMAGE_NORMAL);
#endif
}
示例#2
0
static void drawBarBGImage( const char* res, const RoadMapGuiPoint* pos ) {

   RoadMapImage image;
   int width = roadmap_canvas_width ();
   int height = roadmap_canvas_height();
   int num_images;
   int image_width, image_height;
   int i;
   RoadMapGuiPoint bottom_right_pos, BarLocation;
   RoadMapImage bgImage = (RoadMapImage) roadmap_res_get( RES_BITMAP, RES_SKIN, res );


   image_width = roadmap_canvas_image_width( bgImage );
   image_height = roadmap_canvas_image_height( bgImage );

   bottom_right_pos.x = roadmap_canvas_width ();
   bottom_right_pos.y = pos->y + image_height;

#ifdef OPENGL
   roadmap_canvas_draw_image_scaled( bgImage, pos, &bottom_right_pos, 0, IMAGE_NORMAL );
#else
   num_images = width / image_width ;
   BarLocation.y = pos->y;
   for ( i = 0; i < num_images; i++ )
   {
		BarLocation.x = pos->x + i * image_width;
		roadmap_canvas_draw_image( bgImage, &BarLocation, 0, IMAGE_NORMAL);
   }
#endif
}
示例#3
0
static const char *roadmap_splash_get_splash_name(BOOL wide){
   unsigned int i;
   const char *splash_file = NULL;

   int width = roadmap_canvas_width();
   int height = roadmap_canvas_height();

   if ((height < width) && !wide){
      width = height;
      height = roadmap_canvas_width();
   }
   else if ((width < height) && wide){
      width = height;
      height = roadmap_canvas_width();
   }

   for (i=0; i<sizeof(RoadMapSplashFiles)/sizeof(RoadMapSplashFiles[0]); i++) {

      if ((width >= RoadMapSplashFiles[i].min_screen_width) && (wide == RoadMapSplashFiles[i].is_wide)) {
         if ((RoadMapSplashFiles[i].height != -1) ){
            if (RoadMapSplashFiles[i].height == height){
               splash_file = RoadMapSplashFiles[i].name;
               break;
            }
         }
         else{
            splash_file = RoadMapSplashFiles[i].name;
            break;
         }
      }
   }

   if (!splash_file) {
      static char file_name[50];
      static char file_name_wide[50];
      roadmap_log
         (ROADMAP_ERROR, "Can't find splash file for screen width: %d height: %d (wide =%d)",
          width, height, wide);
      if (wide){
         sprintf(file_name_wide, "welcome_wide_%d_%d",width, height);
         return &file_name_wide[0];
      }else{
         sprintf(file_name,"welcome_%d_%d",width, height);
         return &file_name[0];
      }

   }

   // Remove this when splash bug will be fixed
   roadmap_log( ROADMAP_WARNING, "Downloading splash file: %s. Canvas: (%d, %d)", SAFE_STR( splash_file ),
                        roadmap_canvas_width(), roadmap_canvas_height() );

   return splash_file;
}
示例#4
0
void roadmap_bar_draw_top_bar (BOOL draw_bg) {
	int width;



	if (!bar_initialized)
		return;

	if ( gHideTopBar )
	      return;
   width = roadmap_canvas_width ();

      if (TopBarObjectTable.draw_bg && draw_bg){
      RoadMapGuiPoint BarLocation;
      BarLocation.y = 0;
      BarLocation.x = 0;
      //if ( TopBarFullBg )
      //{
    	 // roadmap_canvas_draw_image (TopBarFullBg, &BarLocation, 0, 2 );
      //}
      //else
      //{
    	 // drawBarBGImage(  TOP_BAR_IMAGE, &BarLocation );
      //}
   }

   draw_objects(&TopBarObjectTable);
}
示例#5
0
static void draw_title_bar_image ( RoadMapImage header_image, RoadMapGuiRect *rect, const RoadMapGuiPoint* pos )
{

   int width = roadmap_canvas_width ();
   int num_images;
   int image_width;
   RoadMapGuiPoint point, bottom_right_point;
   int i;


#ifdef OPENGL
   bottom_right_point.x = rect->maxx+1;
   bottom_right_point.y = rect->maxy;
   roadmap_canvas_draw_image_scaled( header_image, pos, &bottom_right_point, 0, IMAGE_NOBLEND );
#else
   image_width = roadmap_canvas_image_width(header_image);

   num_images = width / image_width;

   num_images = (rect->maxx/image_width)+1;

   if (header_image)
   {
      for ( i=0; i<=num_images; i++ )
      {
             point.x = pos->x + i * image_width;
             point.y = pos->y;
             roadmap_canvas_draw_image( header_image, &point, 0, IMAGE_NOBLEND );
       }
    }
#endif
}
示例#6
0
void roadmap_splash_display (void) {
#if !defined(ANDROID) && !defined(IPHONE) && !defined(GTK2_OGL)
   int height, width;
   RoadMapImage image;
   RoadMapGuiPoint pos;

   height = roadmap_canvas_height ();
   width = roadmap_canvas_width ();


   if (height > width)
      image = (RoadMapImage) roadmap_res_get(RES_BITMAP, RES_SKIN|RES_NOCACHE, "welcome");
   else
      image = (RoadMapImage) roadmap_res_get(RES_BITMAP, RES_SKIN|RES_NOCACHE, "welcome_wide");

   if( !image)
      return;

   pos.x = (width - roadmap_canvas_image_width(image)) / 2;
   pos.y = (height - roadmap_canvas_image_height(image)) / 2;
   roadmap_canvas_draw_image (image, &pos, 0, IMAGE_NORMAL);
   roadmap_canvas_free_image (image);
   roadmap_canvas_refresh ();
#endif
}
示例#7
0
void roadmap_bar_draw_bottom_bar (BOOL draw_bg) {

	int image_width, image_height;
	int screen_width, screen_height;

	if (!bar_initialized)
		return;

   if (gHideBottomBar)
      return;

	screen_width = roadmap_canvas_width ();
	screen_height = roadmap_canvas_height();

	image_width = BottomBarBgImageSize.width;
	image_height = BottomBarBgImageSize.height;

   if (BottomBarObjectTable.draw_bg && draw_bg){
      RoadMapGuiPoint BarLocation;
      BarLocation.y = screen_height - image_height;
      BarLocation.x = 0;
      if ( BottomBarFullBg )
      {
    	  roadmap_canvas_draw_image (BottomBarFullBg, &BarLocation, 0, IMAGE_NORMAL);
      }
      else
      {
    	  drawBarBGImage(  BOTTOM_BAR_IMAGE, &BarLocation );
      }
   }

   draw_objects(&BottomBarObjectTable);
}
示例#8
0
static RoadMapImage create_title_bar_image (RoadMapImage header_image, RoadMapGuiRect *rect) {

   RoadMapImage image;
   int width = roadmap_canvas_width ();
   int num_images;
   int image_width;
   RoadMapGuiPoint point;
   int i;

   image = roadmap_canvas_new_image (width,
               roadmap_canvas_image_height(header_image));
   image_width = roadmap_canvas_image_width(header_image);

   num_images = width / image_width;

   num_images = (rect->maxx/image_width)+1;
   if (header_image){
      for (i=0;i<=num_images;i++){
             point.x = i * image_width;
             point.y = 0;
             roadmap_canvas_copy_image (image, &point, NULL, header_image, CANVAS_COPY_NORMAL);
       }
    }

   return image;
}
示例#9
0
void ssd_widget_container_size (SsdWidget dialog, SsdSize *size) {

   SsdSize max_size;

   /* Calculate size recurisvely */
   if (dialog->parent) {
      ssd_widget_container_size (dialog->parent, size);
      max_size.width = size->width;
      max_size.height = size->height;

   } else {
      max_size.width = roadmap_canvas_width ();
#ifdef TOUCH_SCREEN
      max_size.height = roadmap_canvas_height ();
#else
      max_size.height = roadmap_canvas_height () - roadmap_bar_bottom_height();
#endif
   }

   ssd_widget_get_size (dialog, size, &max_size);

   if (dialog->draw) {
      RoadMapGuiRect rect;
      rect.minx = 0;
      rect.miny = 0;
      rect.maxx = size->width - 1;
      rect.maxy = size->height - 1;

      dialog->draw (dialog, &rect, SSD_GET_SIZE|SSD_GET_CONTAINER_SIZE);

      size->width = rect.maxx - rect.minx + 1;
      size->height = rect.maxy - rect.miny + 1;
   }
}
示例#10
0
void roadmap_canvas3_set3DMode(int is3D) {
	if (is3D== is3DMode)
		return;
   if ( !is_canvas_ready() )
      return;

	if (is3D) {
		set3D(roadmap_canvas_width(),
				roadmap_canvas_height(),0);
	}
	else {
		set2D(roadmap_canvas_width(),
				roadmap_canvas_height());
	}
	is3DMode= is3D;
}
示例#11
0
double roadmap_canvas_ogl_rotateMe(float ang_diff) {
    double distH;

   if ( !is_canvas_ready() )
      return 0;

	angle+= ang_diff;
    distH= set3D(roadmap_canvas_width(),
			roadmap_canvas_height(),1);
    if (!is3DMode) {
		set2D(roadmap_canvas_width(),
				roadmap_canvas_height());
    }

	return distH;
}
示例#12
0
static RoadMapImage createBGImage (RoadMapImage BarBgImage) {

   RoadMapImage image;
   int width = roadmap_canvas_width ();
   int height = roadmap_canvas_height();
   int num_images;
   int image_width;
   int i;

   if (height > width){
      width = width*2;
   }

   image = roadmap_canvas_new_image (width,
               roadmap_canvas_image_height(BarBgImage));

   image_width = roadmap_canvas_image_width(BarBgImage);

   num_images = width / image_width ;

   RoadMapGuiRect *rect = malloc(sizeof(RoadMapGuiRect));
   rect->minx = num_images;
   rect->miny = 0;

//   for (i = 0; i < num_images; i++){
      RoadMapGuiPoint BarLocation;
      BarLocation.y = 0;
      BarLocation.x = 0;//i * image_width;
         roadmap_canvas_copy_image
         (image, &BarLocation, rect, BarBgImage ,CANVAS_COPY_NORMAL);
//   }
   return image;
}
示例#13
0
void roadmap_bar_draw_bottom_bar (BOOL draw_bg) {
	int i;
	int num_images;
	int image_width, image_height;
	int screen_width, screen_height;

	screen_width = roadmap_canvas_width ();
	screen_height = roadmap_canvas_height();

	if (!bar_initialized)
		return;

   if (gHideBottomBar)
      return;
	image_width = roadmap_canvas_image_width(BottomBarBgImage);
	image_height = roadmap_canvas_image_height(BottomBarBgImage);

	if (BottomBarObjectTable.draw_bg && draw_bg){
		num_images = screen_width / image_width;
		for (i = 0; i < num_images; i++){
			RoadMapGuiPoint BarLocation;
			BarLocation.y = screen_height - image_height;
			BarLocation.x = i * image_width;
		   roadmap_canvas_draw_image (BottomBarBgImage, &BarLocation, 0,
	         IMAGE_NORMAL);
		}
	}
	draw_objects(&BottomBarObjectTable);

}
示例#14
0
void roadmap_bar_draw_top_bar (BOOL draw_bg) {
	int i;
	int num_images;
	static int image_width = -1;
	int width;

	width = roadmap_canvas_width ();


	if (!bar_initialized)
		return;

	if ( gHideTopBar )
	      return;

	if (TopBarObjectTable.draw_bg && draw_bg){
	   if (image_width == -1)
	      image_width = roadmap_canvas_image_width(TopBarBgImage);

		num_images = width / image_width + 1;

		for (i = 0; i < num_images; i++){
			RoadMapGuiPoint BarLocation;
			BarLocation.y = 0;
			BarLocation.x = i * image_width;
		   	roadmap_canvas_draw_image (TopBarBgImage, &BarLocation, 0,IMAGE_NORMAL);
		}
	}
	draw_objects(&TopBarObjectTable);
}
示例#15
0
static void roadmap_bar_pos (BarObject *object,
                             RoadMapGuiPoint *pos) {

   pos->x = object->pos_x;
   pos->y = object->pos_y;

   if (pos->x < 0)
      pos->x += roadmap_canvas_width ();

   if (pos->y < 0)
      pos->y += roadmap_canvas_height ();
}
示例#16
0
static void readMatsProject(GLdouble objX,GLdouble objY,GLdouble objZ,
		GLdouble *winX, GLdouble *winY, GLdouble *winZ) {
   roadmap_glmatrix_load_matrix( _gl_matrix_mode_modelview, modelMat3D );
   roadmap_glmatrix_load_matrix( _gl_matrix_mode_projection, projMat3D );

	glGetIntegerv(GL_VIEWPORT,viewport3D);
	if ( viewport3D[2] == 0 || viewport3D[3] == 0 )
	{
	   viewport3D[2] = roadmap_canvas_width();
	   viewport3D[3] = roadmap_canvas_height();
	}
	project(objX,objY,objZ,winX,winY,winZ);

}
示例#17
0
static void draw_shadow_bg (){
   static RoadMapPen pen = NULL;
   RoadMapGuiPoint fill_points[4];
   int count;
   if (!pen)
      pen = roadmap_canvas_create_pen ("fill_pop_up_pen");

   roadmap_canvas_set_foreground("#000000");
   roadmap_canvas_set_opacity(170);

   fill_points[0].x =0 ;
   fill_points[0].y =0;
   fill_points[1].x =roadmap_canvas_width();
   fill_points[1].y = 0;
   fill_points[2].x = roadmap_canvas_width();
   fill_points[2].y = roadmap_canvas_height();
   fill_points[3].x = 0;
   fill_points[3].y = roadmap_canvas_height();
   count = 4;

   roadmap_canvas_draw_multiple_polygons (1, &count, fill_points, 1,0 );

}
static void roadmap_screen_obj_reload (void) {

   const char *cursor;
   RoadMapFileContext file;
   unsigned int i;
   int height = roadmap_canvas_height ();
   int width = roadmap_canvas_width();
   const char *object_name = NULL;

   RoadMapObjectList = NULL;

   screen_height = height;
   screen_width = width;
   for (i=0; i<sizeof(RoadMapObjFiles)/sizeof(RoadMapObjFiles[0]); i++) {

      if (height >= RoadMapObjFiles[i].min_screen_height) {
         if (!strcmp(RoadMapObjFiles[i].name,"objects_wide") && (roadmap_softkeys_orientation() == SOFT_KEYS_ON_BOTTOM) )
        	 object_name = "objects_wide_softkeys_buttom";
         else
        	 object_name = RoadMapObjFiles[i].name;
         break;
      }
   }

   if (!object_name) {
      roadmap_log
         (ROADMAP_ERROR, "Can't find object file for screen height: %d",
          height);
      return;
   }

   if (current_object_name){
   		if (!strcmp(current_object_name, object_name))
   			road_screen_objects_delete();
   		else
   			return;
   }

   for (cursor = roadmap_file_map ("skin", object_name, NULL, "r", &file);
        cursor != NULL;
        cursor = roadmap_file_map ("skin", object_name, cursor, "r", &file)) {

      roadmap_screen_obj_load (roadmap_file_base(file), roadmap_file_size(file));

      roadmap_file_unmap (&file);
      return;
   }
}
示例#19
0
void ssd_dialog_redraw_screen_recursive( SsdDialog Dialog)
{
   RoadMapGuiRect rect;
   SsdWidget      container = Dialog->container;

   if( (SSD_DIALOG_FLOAT & container->flags) && Dialog->next)
      ssd_dialog_redraw_screen_recursive( Dialog->next);

   rect.minx = 0;
   rect.miny = 0;
   rect.maxx = roadmap_canvas_width() - 1;
   rect.maxy = roadmap_canvas_height() - 1;

   ssd_widget_reset_cache  ( container);
   ssd_widget_draw         ( container, &rect, 0);
}
示例#20
0
static const char * create_group_url(const char *group_name) {
   static char url[1024];
   snprintf(url, sizeof(url),"%s?sessionid=%d&cookie=%s&deviceid=%d&width=%d&height=%d&gotogroup=%s&client_version=%s&web_version=%s&lang=%s",
            roadmap_groups_get_url(),
            Realtime_GetServerId(),
            Realtime_GetServerCookie(),
            RT_DEVICE_ID,
            roadmap_canvas_width(),
            roadmap_canvas_height() - roadmap_bar_bottom_height(),
            group_name,
            roadmap_start_version(),
            BROWSER_WEB_VERSION,
            roadmap_lang_get_system_lang());
   append_current_location(url + strlen(url));
   return &url[0];
}
void roadmap_screen_obj_draw (void) {

   RoadMapScreenObj cursor;
   int height = roadmap_canvas_height ();
   int width = roadmap_canvas_width();

   if (!initialized)
      return;

   if ((height != screen_height) && (width != screen_width)){
	   roadmap_screen_obj_reload();
   }

   for (cursor = RoadMapObjectList; cursor != NULL; cursor = cursor->next) {
      int state = 0;
      int image_mode = IMAGE_NORMAL;
      RoadMapGuiPoint pos;

      if (cursor->state_fn) {
         state = (*cursor->state_fn) ();
         if ((state < 0) || (state >= MAX_STATES)) continue;
      }

      if (cursor == RoadMapScreenObjSelected) {
         image_mode = IMAGE_SELECTED;
      }

      roadmap_screen_obj_pos (cursor, &pos);

      if (cursor->images[state]) {

         roadmap_canvas_draw_image (cursor->images[state], &pos,
                                    cursor->opacity, image_mode);
      }

      if (cursor->sprites[state]) {

         if (cursor->flags & OBJ_FLAG_NO_ROTATE) {
            roadmap_sprite_draw (cursor->sprites[state], &pos,
                                 -roadmap_math_get_orientation());
         } else {
            roadmap_sprite_draw (cursor->sprites[state], &pos, 0);
         }
      }
   }
}
示例#22
0
static SsdWidget create_results_container()
{
   SsdWidget rcnt = NULL;
   SsdWidget list = NULL;
   SsdWidget title = NULL;
   SsdWidget bitmap = NULL;
   SsdWidget bitmap_cnt = NULL;
   SsdWidget text = NULL;

   rcnt = ssd_container_new(  LSD_RESULTS_CONT_NAME,
                              NULL,
                              SSD_MIN_SIZE,
                              SSD_MIN_SIZE,
                              0);
   ssd_widget_set_color(rcnt, NULL,NULL);


   title = ssd_container_new(  "Title box",
                   NULL,
                   roadmap_canvas_width()-8,
                   SSD_MIN_SIZE,
                   SSD_CONTAINER_BORDER|SSD_ROUNDED_CORNERS|SSD_ROUNDED_WHITE|SSD_ALIGN_CENTER);

   ssd_dialog_add_vspace( rcnt, 2, 0);
   bitmap_cnt = ssd_container_new( "Logo container", NULL, 80, SSD_MIN_SIZE, SSD_ALIGN_VCENTER );
   bitmap = ssd_bitmap_new( "local search icon", local_search_get_logo_name(), SSD_ALIGN_VCENTER|SSD_ALIGN_CENTER );
   ssd_widget_add( bitmap_cnt, bitmap );
   ssd_widget_add(title, bitmap_cnt);

   text = ssd_text_new("Local search text", roadmap_lang_get("Local search results"), 14, SSD_ALIGN_VCENTER );
   ssd_widget_add(title, text);
   ssd_widget_add( rcnt, title);
   ssd_dialog_add_vspace(rcnt, 5, 0);
   list = ssd_list_new(       LSD_RC_LIST_NAME,
                              SSD_MAX_SIZE,
                              SSD_MAX_SIZE,
                              inputtype_free_text,
                              SSD_CONTAINER_BORDER|SSD_ROUNDED_CORNERS|SSD_ROUNDED_WHITE,
                              NULL);
   //ssd_widget_set_color(list, NULL,NULL);
   ssd_list_resize( list, 80);
   ssd_widget_add( rcnt, list);

   return rcnt;
}
示例#23
0
static BOOL ssd_widget_rect_in_screen(const RoadMapGuiRect *rect){
    /* the whole rect of the widget will outside the screen when
     * case1 - it ends before the screen starts (0)
     * case2 - it begins after the screen ends roadmap_canvas_height
     * If one of the cases is true for one of the axes, the widget should not be drawn - Return false. Else return true.
     */
    int screen_width  = roadmap_canvas_width();
    int screen_height = roadmap_canvas_height();

    //y axis
    if ((rect->maxy<=0) || (screen_height<rect->miny))
        return FALSE;

    if (( rect->maxx<=0 )  || (screen_width<rect->minx))
        return FALSE;

    return TRUE;
}
示例#24
0
static const char *create_url(void) {
   static char url[1024];
   snprintf(url, sizeof(url),"%s?sessionid=%d&cookie=%s&deviceid=%d&width=%d&height=%d&client_version=%s&web_version=%s&lang=%s",
            roadmap_groups_get_url(),
            Realtime_GetServerId(),
            Realtime_GetServerCookie(),
#ifndef RIMAPI
            RT_DEVICE_ID,
#else
            20, // until server is changed. TODO : CHANGE!
#endif
            roadmap_canvas_width(),
            roadmap_canvas_height() - roadmap_bar_bottom_height(),
            roadmap_start_version(),
            BROWSER_WEB_VERSION,
            roadmap_lang_get_system_lang());
   append_current_location(url + strlen(url));
   return &url[0];
}
示例#25
0
void roadmap_display_image_sign(RoadMapSign *sign) {
	int screen_width;
	int screen_height;
	RoadMapGuiPoint position;
	RoadMapImage image;

	screen_width = roadmap_canvas_width();
	screen_height = roadmap_canvas_height();

	if (sign->where == SIGN_TOP){
		position.x = 3;
		position.y = roadmap_bar_top_height() + 3;
	}

	if (sign->image != NULL){
    		image =  (RoadMapImage) roadmap_res_get(RES_BITMAP, RES_SKIN, sign->image);
            roadmap_canvas_draw_image (image, &position, 0, IMAGE_NORMAL);
    }

}
static void roadmap_screen_obj_pos (RoadMapScreenObj object,
                                    RoadMapGuiPoint *pos) {

   pos->x = object->pos_x;
   pos->y = object->pos_y;

   if (pos->x < 0) {
      pos->x += roadmap_canvas_width ();
   } else {
      pos->x += OffsetX;
   }

   if (pos->y < 0) {
      pos->y += roadmap_canvas_height ();
   } else {
      pos->y += OffsetY;
   }

   /* Apply local offsets */
   pos->x += object->offset_x;
   pos->y += object->offset_y;
}
示例#27
0
// create the intro screen
static void create_intro_screen(){
	SsdWidget dialog;
	SsdWidget group;
	int tab_flag=0;
	int         width = roadmap_canvas_width() - 10;
	const char* system_lang;
#ifndef TOUCH_SCREEN
    tab_flag = SSD_WS_TABSTOP;
#endif
	system_lang = roadmap_lang_get("lang");
	dialog = ssd_dialog_new ("Intro_screen",
                            roadmap_lang_get ("Hi there!"),
                            NULL,
                            SSD_CONTAINER_TITLE|SSD_DIALOG_NO_BACK);
   group = ssd_container_new ("Welcome", NULL,
            width, SSD_MIN_SIZE,SSD_WIDGET_SPACE|SSD_ALIGN_CENTER|SSD_ALIGN_VCENTER|SSD_END_ROW|SSD_CONTAINER_BORDER|SSD_ROUNDED_CORNERS|SSD_ROUNDED_WHITE);
   ssd_widget_set_color (group, NULL,NULL);
   ssd_widget_add (group, space(8));
   add_intro_texts(group, tab_flag);
#ifdef TOUCH_SCREEN
   ssd_widget_add (group,
   ssd_button_label ("Next", roadmap_lang_get ("Next"),
                     SSD_WS_TABSTOP|SSD_ALIGN_CENTER|SSD_START_NEW_ROW, intro_screen_buttons_callback));

#else
   ssd_widget_set_right_softkey_text       ( dialog, roadmap_lang_get("Next"));
   ssd_widget_set_right_softkey_callback   ( dialog, callGlobalCallback);

   ssd_widget_set_left_softkey_text       ( dialog, roadmap_lang_get(""));
   ssd_widget_set_left_softkey_callback   ( dialog, intro_screen_left_key_callback);

#endif

   ssd_widget_add (group, space(20));
   ssd_widget_add( dialog, group);
   ssd_dialog_activate ("Intro_screen", NULL);
}
示例#28
0
static void create_login_dialog(void) {

   SsdWidget dialog;
   SsdWidget group;
   SsdWidget box, box2;
   SsdWidget bitmap;
   int width;
   int tab_flag = SSD_WS_TABSTOP;
   int disc_font_size = 16;
#ifdef RIMAPI
   disc_font_size = 14;
#endif
   width = roadmap_canvas_width()/2;

   dialog = ssd_dialog_new(FOURSQUARE_LOGIN_DIALOG_NAME,
         roadmap_lang_get(FOURSQUARE_TITLE), on_login_dlg_close, SSD_CONTAINER_TITLE);

#ifdef TOUCH_SCREEN
   ssd_widget_add (dialog, space(5));
#endif

   box = ssd_container_new("UN/PW group", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW | SSD_ROUNDED_CORNERS
               | SSD_ROUNDED_WHITE | SSD_POINTER_NONE | SSD_CONTAINER_BORDER);

   //Accound details header
   group = ssd_container_new("Foursquare Account Header group", NULL, SSD_MAX_SIZE,SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW);
   ssd_widget_set_color(group, "#000000", "#ffffff");
   ssd_widget_add(group, ssd_text_new("Label", roadmap_lang_get("Account details"),
         16, SSD_TEXT_LABEL | SSD_ALIGN_VCENTER));
   bitmap = ssd_bitmap_new ("foursquare_icon", "foursquare_logo",SSD_ALIGN_RIGHT|SSD_WS_TABSTOP);
   ssd_widget_add(group, bitmap);
   ssd_widget_add (group, ssd_separator_new ("separator", SSD_ALIGN_BOTTOM));
   ssd_widget_add(box, group);
   //Accound login status
   group = ssd_container_new("Foursquare Account Login group", NULL, SSD_MAX_SIZE,SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW);
   ssd_widget_set_color(group, "#000000", "#ffffff");
   ssd_widget_add(group, ssd_text_new("Login Status Label", "",
            16, SSD_TEXT_LABEL | SSD_ALIGN_VCENTER));
   ssd_widget_add (group, ssd_separator_new ("separator", SSD_ALIGN_BOTTOM));
   ssd_widget_add(box, group);
   //User name
   group = ssd_container_new("Foursquare Name group", NULL, SSD_MAX_SIZE,SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW);
   ssd_widget_set_color(group, "#000000", "#ffffff");
   ssd_widget_add(group, ssd_text_new("Label", roadmap_lang_get("Email/phone"),
         -1, SSD_TEXT_LABEL | SSD_ALIGN_VCENTER));
   ssd_widget_add(group, ssd_entry_new("FoursquareUserName", "", SSD_ALIGN_VCENTER
         | SSD_ALIGN_RIGHT | tab_flag, 0, width, SSD_MIN_SIZE,
         roadmap_lang_get("User name")));
   ssd_widget_add(box, group);

   //Password
   group = ssd_container_new("Foursquare PW group", NULL, SSD_MAX_SIZE, 40,
         SSD_WIDGET_SPACE | SSD_END_ROW);
   ssd_widget_set_color(group, "#000000", "#ffffff");

   ssd_widget_add(group, ssd_text_new("Label", roadmap_lang_get("Password"),
         12, SSD_TEXT_LABEL | SSD_ALIGN_VCENTER));
   ssd_widget_add(group, ssd_entry_new("FoursquarePassword", "", SSD_ALIGN_VCENTER
         | SSD_ALIGN_RIGHT | tab_flag, SSD_TEXT_PASSWORD, width, SSD_MIN_SIZE,
         roadmap_lang_get("Password")));
   ssd_widget_add(box, group);

   ssd_widget_add(dialog, box);


   //tweet settings header
   ssd_widget_add(dialog, space(5));
   box = ssd_container_new ("Foursquare auto settings header group", NULL, SSD_MIN_SIZE, SSD_MIN_SIZE,
            SSD_WIDGET_SPACE | SSD_END_ROW);

   ssd_widget_add (box, ssd_text_new ("foursquare_auto_settings_header",
         roadmap_lang_get ("Automatically tweet to my followers that I:"), disc_font_size, SSD_TEXT_LABEL | SSD_ALIGN_VCENTER | SSD_WIDGET_SPACE));
   ssd_widget_set_color (box, NULL, NULL);
   ssd_widget_add (dialog, box);
   ssd_widget_add(dialog, space(5));

   //Tweets
   box = ssd_container_new("Tweet toggles group", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE,
            SSD_WIDGET_SPACE | SSD_END_ROW | SSD_ROUNDED_CORNERS
                  | SSD_ROUNDED_WHITE | SSD_POINTER_NONE | SSD_CONTAINER_BORDER);

   group = ssd_container_new("Send_Tweets group", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW| tab_flag);
   ssd_widget_set_color(group, "#000000", "#ffffff");

   box2 = ssd_container_new ("box2", NULL, (2*roadmap_canvas_width())/3, SSD_MIN_SIZE,
                            SSD_ALIGN_VCENTER);
   ssd_widget_set_color (box2, NULL, NULL);

   ssd_widget_add(box2, ssd_text_new("Send_login_label", roadmap_lang_get(
         "Am checking out this integration"), -1, SSD_TEXT_LABEL
         | SSD_ALIGN_VCENTER | SSD_WIDGET_SPACE));
   ssd_widget_add(group, box2);

   ssd_widget_add(group, ssd_checkbox_new("FoursquareSendLogin", TRUE,
         SSD_END_ROW | SSD_ALIGN_RIGHT | SSD_ALIGN_VCENTER , NULL, NULL, NULL,
         CHECKBOX_STYLE_ON_OFF));

   ssd_widget_add(box, group);

   group = ssd_container_new("Send_Tweets group", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW| tab_flag);
   box2 = ssd_container_new ("box2", NULL, (2*roadmap_canvas_width())/3, SSD_MIN_SIZE,
                            SSD_ALIGN_VCENTER);
   ssd_widget_set_color (box2, NULL, NULL);
   ssd_widget_add(box2, ssd_text_new("Send_waze_badge_label", roadmap_lang_get(
         "Have unlocked the Roadwarrior Badge"), -1, SSD_TEXT_LABEL
         | SSD_ALIGN_VCENTER | SSD_WIDGET_SPACE));
   ssd_widget_add(group, box2);

   ssd_widget_add(group, ssd_checkbox_new("FoursquareSendBadgeUnlock", TRUE,
         SSD_END_ROW | SSD_ALIGN_RIGHT | SSD_ALIGN_VCENTER , NULL, NULL, NULL,
         CHECKBOX_STYLE_ON_OFF));

   ssd_widget_add(box, group);

   ssd_widget_add(dialog, box);


   //Foursquare comments
   ssd_widget_add(dialog, space(5));
   box = ssd_container_new ("Comments", NULL, SSD_MIN_SIZE, SSD_MIN_SIZE,
            SSD_WIDGET_SPACE | SSD_END_ROW);

   ssd_widget_add (box, ssd_text_new ("comment footer",
         roadmap_lang_get ("We've partnered with Foursquare to give you quick access to check-in to nearby venues."), disc_font_size, SSD_TEXT_LABEL | SSD_WIDGET_SPACE));
   ssd_widget_add (box, ssd_text_new ("comment footer",
         roadmap_lang_get ("What is Foursquare?"), disc_font_size, SSD_TEXT_LABEL | SSD_WIDGET_SPACE));
   ssd_widget_add (box, ssd_text_new ("comment footer",
        roadmap_lang_get ("It's a cool way to discover and promote cool places in your city and be rewarded for doing so."), disc_font_size, SSD_TEXT_LABEL | SSD_WIDGET_SPACE));
   ssd_widget_add (box, ssd_text_new ("comment footer",
        roadmap_lang_get ("Don't have an account? Sign up on:"), disc_font_size, SSD_TEXT_LABEL | SSD_WIDGET_SPACE));
   ssd_widget_add (box, ssd_text_new ("comment footer",
           roadmap_lang_get ("www.foursquare.com"), disc_font_size, SSD_TEXT_LABEL | SSD_WIDGET_SPACE|SSD_WS_TABSTOP));


   ssd_widget_set_color (box, NULL, NULL);
   ssd_widget_add (dialog, box);


#ifndef TOUCH_SCREEN
   ssd_widget_set_left_softkey_text ( dialog, roadmap_lang_get("Ok"));
   ssd_widget_set_left_softkey_callback ( dialog, on_ok_softkey);
#endif

}
示例#29
0
static void create_checkedin_dialog(void) {

   SsdWidget dialog;
   SsdWidget group;
   SsdWidget box;
   SsdWidget bitmap;
   int width;
   char text[256];

   width = roadmap_canvas_width()/2;

   dialog = ssd_dialog_new(FOURSQUARE_CHECKEDIN_DIALOG_NAME,
         roadmap_lang_get(FOURSQUARE_CHECKEDIN_TITLE), NULL, SSD_CONTAINER_TITLE);

#ifdef TOUCH_SCREEN
   ssd_widget_add (dialog, space(5));
#endif

   box = ssd_container_new("Checkin_result", NULL, SSD_MAX_SIZE, SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW | SSD_ROUNDED_CORNERS
               | SSD_ROUNDED_WHITE | SSD_POINTER_NONE | SSD_CONTAINER_BORDER);

   //Logo header
   group = ssd_container_new("Foursquare logo", NULL, SSD_MAX_SIZE,SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW);
   ssd_widget_set_color(group, "#000000", "#ffffff");
   bitmap = ssd_bitmap_new ("foursquare_icon", "foursquare_logo",SSD_WS_TABSTOP);
   ssd_widget_add(group, bitmap);
   ssd_widget_add(group, space(5));
   ssd_widget_add (group, ssd_separator_new ("separator", SSD_ALIGN_BOTTOM));
   ssd_widget_add(group, space(5));
   ssd_widget_add(box, group);
   //Checkin message
   group = ssd_container_new("Foursquare message group", NULL, SSD_MAX_SIZE,SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW);
   ssd_widget_set_color(group, "#000000", "#ffffff");
   ssd_widget_add(group, ssd_text_new("Checkin message lablel", gsCheckInInfo.sCheckinMessage,
            16, SSD_TEXT_LABEL | SSD_ALIGN_VCENTER));
   ssd_widget_add(box, group);
   //Address
   group = ssd_container_new("Foursquare address group", NULL, SSD_MAX_SIZE,SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW);
   ssd_widget_set_color(group, "#000000", "#ffffff");
   ssd_widget_add(group, ssd_text_new("Checkin address", gsCheckInInfo.sAddress,
            16, SSD_TEXT_LABEL | SSD_ALIGN_VCENTER));
   ssd_widget_add(box, group);
   //Points
   group = ssd_container_new("Foursquare points group", NULL, SSD_MAX_SIZE,SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW);
   ssd_widget_set_color(group, "#000000", "#ffffff");
   snprintf(text, sizeof(text), "%s %s", roadmap_lang_get("Points:"), gsCheckInInfo.sScorePoints);
   ssd_widget_add(group, ssd_text_new("Checkin points", text,
            16, SSD_TEXT_LABEL | SSD_ALIGN_VCENTER));
   ssd_widget_add(group, space(5));
   ssd_widget_add (group, ssd_separator_new ("separator", SSD_ALIGN_BOTTOM));
   ssd_widget_add(group, space(5));
   ssd_widget_add(box, group);

   //More details
   group = ssd_container_new("Foursquare more details group", NULL, SSD_MAX_SIZE,SSD_MIN_SIZE,
         SSD_WIDGET_SPACE | SSD_END_ROW);
   ssd_widget_set_color(group, "#000000", "#ffffff");
   ssd_widget_add(group, ssd_text_new("more details label", roadmap_lang_get("Full details on this check-in are available for you on foursquare.com."),
            16, SSD_TEXT_LABEL | SSD_ALIGN_VCENTER));
   ssd_widget_add(group, space(5));
   ssd_widget_add(box, group);


   //OK button
   ssd_widget_add (box,
         ssd_button_label ("confirm", roadmap_lang_get ("Ok"),
                     SSD_ALIGN_CENTER|SSD_START_NEW_ROW|SSD_WS_DEFWIDGET|
                     SSD_WS_TABSTOP,
                     on_checkin_ok_btn));

   ssd_widget_add (dialog, box);


#ifndef TOUCH_SCREEN
   ssd_widget_set_left_softkey_text ( dialog, roadmap_lang_get("Ok"));
   ssd_widget_set_left_softkey_callback ( dialog, on_ok_softkey);
#endif
}
示例#30
0
int roadmap_square_view (int *square, int size, RoadMapArea *squares_area) {

   RoadMapPosition origin;
   RoadMapPosition position;

   RoadMapArea screen;
   RoadMapArea	peripheral;
   int count;
   int index;
	int step;
	int slot;
   int filter_count = 0;

   if (RoadMapSquareActive == NULL) return 0;

   roadmap_math_screen_edges (&screen);

	position.longitude = screen.west;
	position.latitude = screen.south;

	roadmap_tile_get_origin (RoadMapScaleCurrent, &position, &origin);

   if (squares_area) {
      squares_area->west = origin.longitude;
      squares_area->south = origin.latitude;
   }

	step = roadmap_tile_get_size (RoadMapScaleCurrent);
	count = 0;

	peripheral.west = (screen.west * 9 - screen.east) / 8;
	peripheral.east = (screen.east * 9 - screen.west) / 8;
	peripheral.south = (screen.south * 9 - screen.north) / 8;
	peripheral.north = (screen.north * 9 - screen.south) / 8;

	for (position.longitude = origin.longitude; position.longitude < screen.east; position.longitude += step) {
		for (position.latitude = origin.latitude; position.latitude <= screen.north; position.latitude += step) {
			RoadMapArea edges;
			RoadMapPosition topleft, topright;
			RoadMapPosition bottomright, bottomleft;
			RoadMapGuiPoint points[4];
			int i, il, ir;

			index = roadmap_tile_get_id_from_position (RoadMapScaleCurrent, &position);
//			roadmap_log(ROADMAP_ERROR, "%d %d %d", position.latitude, position.longitude, RoadMapScaleCurrent);

			slot = roadmap_square_find (index);

			if (slot >= 0)
				roadmap_square_edges (index, &edges);
			else
				roadmap_tile_edges(index, &edges.west, &edges.east, &edges.south, &edges.north);
			topleft.longitude     = edges.west;
			topright.longitude		= edges.east;
			topleft.latitude      = edges.north;
			topright.latitude      = edges.north;
			bottomleft.longitude = edges.west;
			bottomright.longitude = edges.east;
			bottomleft.latitude  = edges.south;
			bottomright.latitude  = edges.south;
			roadmap_math_coordinate (&topleft, points);
			roadmap_math_coordinate (&bottomright, points+1);
			roadmap_math_coordinate (&topright, points+2);
			roadmap_math_coordinate (&bottomleft, points+3);
			for (i=0; i< 4; ++i) {
				roadmap_math_rotate_project_coordinate(points+i);
			}

			if ((abs(points[0].x - points[1].x) < 30 &&
					abs(points[0].y - points[1].y) < 30)) {
				filter_count++;
				continue;
			}
			for (il=0; il< 4; ++il) {
				if (points[il].x>= 0)
					break;
			}
			if (il==4) {
				filter_count++;
				continue;
			}
			for (ir=0; ir< 4; ++ir) {
				if (points[ir].x<= roadmap_canvas_width())
					break;
			}
			if (ir==4) {
				filter_count++;
				continue;
			}


			if (slot < 0) {
				roadmap_tile_request (index, ROADMAP_TILE_STATUS_PRIORITY_ON_SCREEN, 0, NULL);
				if (roadmap_square_set_current (index)) {
					slot = roadmap_square_find (index);
				}
			}

			if (slot >= 0) {

				if (RoadMapSquareForceUpdateMode ||
						((*roadmap_tile_status_get (index)) & ROADMAP_TILE_STATUS_FLAG_ROUTE)) {
					// force new version of route tiles when on screen
					roadmap_tile_request (index, ROADMAP_TILE_STATUS_PRIORITY_ON_SCREEN, 1, NULL);
				}
				if (count < size) {
					square[count] = index;
				}
				count += 1;

				if (size > 0 && count > size) {
					roadmap_log (ROADMAP_ERROR,
							"too many square are visible: %d is not enough",
							size);
				}
			}
		}
	}

   if (squares_area) {
      squares_area->east = position.longitude;
      squares_area->north = position.latitude;
   }

#ifndef J2ME
	roadmap_square_get_tiles (&peripheral, RoadMapScaleCurrent);
#endif
	RoadMapSquareForceUpdateMode = 0;
   //printf("count: %d filter: %d \n", count, filter_count);
   return count;
}