• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ resource_init_current_app函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中resource_init_current_app函数的典型用法代码示例。如果您正苦于以下问题:C++ resource_init_current_app函数的具体用法?C++ resource_init_current_app怎么用?C++ resource_init_current_app使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了resource_init_current_app函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: handle_init

void handle_init(AppContextRef ctx) {
  // Create the main window and push it in fullscreen mode
  window_init(&window, "Window Name");
  window_stack_push(&window, true /* Animated */);
  window_set_fullscreen(&window, true);

  // Initialize ressources and load the background image
  resource_init_current_app(&APP_RESOURCES);
  bmp_init_container(RESOURCE_ID_BACKGROUND_IMAGE, &background_image);
  layer_add_child(&window.layer, &background_image.layer.layer);

  // Create a text field to display the time until the next pass
  text_layer_init(&nextpass_text_layer, GRect(0, 126, 144, 34));
  text_layer_set_font(&nextpass_text_layer, fonts_get_system_font(FONT_KEY_BITHAM_34_MEDIUM_NUMBERS));
  text_layer_set_text_alignment(&nextpass_text_layer, GTextAlignmentCenter);
  text_layer_set_background_color(&nextpass_text_layer, GColorClear);
  layer_add_child(window_get_root_layer(&window), (Layer*)&time_text_layer);

  // Create a text field to display the current time
  text_layer_init(&time_text_layer, GRect(37, 0, 70, 24));
  text_layer_set_font(&time_text_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24));
  text_layer_set_text_alignment(&time_text_layer, GTextAlignmentCenter);
  text_layer_set_background_color(&time_text_layer, GColorClear);
  layer_add_child(window_get_root_layer(&window), (Layer*)&nextpass_text_layer);


  // Add background and both text fields to the window

  // Start an HTTP Request
  start_http_request();
}
开发者ID:mohitsoni,项目名称:hackmit-2013,代码行数:31,代码来源:isstracker-http.c


示例2: handle_init

void handle_init(AppContextRef ctx) {
  (void)ctx;

  window_init(&window, "Plain Watch");
  window_stack_push(&window, true /* Animated */);
  window_set_background_color(&window, GColorBlack);

  resource_init_current_app(&APP_RESOURCES);

  layer_init(&hour_display_layer, window.layer.frame);
  hour_display_layer.update_proc = &hour_display_layer_update_callback;
  layer_add_child(&window.layer, &hour_display_layer);

  gpath_init(&hour_hand_outline_path, &HOUR_HAND_OUTLINE_PATH_POINTS);
  gpath_move_to(&hour_hand_outline_path, grect_center_point(&hour_display_layer.frame));
  gpath_init(&hour_hand_path, &HOUR_HAND_PATH_POINTS);
  gpath_move_to(&hour_hand_path, grect_center_point(&hour_display_layer.frame));

  layer_init(&minute_display_layer, window.layer.frame);
  minute_display_layer.update_proc = &minute_display_layer_update_callback;
  layer_add_child(&window.layer, &minute_display_layer);

  gpath_init(&minute_hand_outline_path, &MINUTE_HAND_OUTLINE_PATH_POINTS);
  gpath_move_to(&minute_hand_outline_path, grect_center_point(&minute_display_layer.frame));
  gpath_init(&minute_hand_path, &MINUTE_HAND_PATH_POINTS);
  gpath_move_to(&minute_hand_path, grect_center_point(&minute_display_layer.frame));
}
开发者ID:7bp,项目名称:pebble,代码行数:27,代码来源:plain.c


示例3: handle_init

void handle_init(AppContextRef ctx) {
  (void)ctx;

  window_init(&window, "Main");
  window_stack_push(&window, true /* Animated */);
  window_set_background_color(&window, GColorBlack);
  resource_init_current_app(&APP_RESOURCES);

  frame_animation_init(&gif_animation, &window.layer, GPoint(0,0), RESOURCE_ID_FRAME_1, 12, false, true);
  timer_handle = app_timer_send_event(ctx, 100, 1);


  text_layer_init(&text_time_layer, GRect(0, 5, 144, 30));
  text_layer_set_text_color(&text_time_layer, GColorWhite);
  text_layer_set_background_color(&text_time_layer, GColorClear);
  text_layer_set_text_alignment(&text_time_layer, GTextAlignmentCenter);
  text_layer_set_font(&text_time_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));
  layer_add_child(&window.layer, &text_time_layer.layer);

  text_layer_init(&date_layer, GRect(0, 130, 144, 30));
  text_layer_set_text_color(&date_layer, GColorWhite);
  text_layer_set_background_color(&date_layer, GColorClear);
  text_layer_set_text_alignment(&date_layer, GTextAlignmentCenter);
  text_layer_set_font(&date_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));
  layer_add_child(&window.layer, &date_layer.layer);

}
开发者ID:MWells14,项目名称:Nyan-Watch,代码行数:27,代码来源:nyan_watch.c


示例4: handle_init

void handle_init(AppContextRef ctx) {
	(void)ctx;
	
	app_ctx = ctx;

	window_init(&window, "Vibe");
	window_stack_push(&window, true /* Animated */);
    
	power = 3;
	on = false;
	
	resource_init_current_app(&APP_RESOURCES);
	
	layer_init(&controls_layer, GRect(124, 3, 20, 146));
	controls_layer.update_proc = &controls_update_callback;
	layer_add_child(&window.layer, &controls_layer);
	
	layer_init(&bars_layer, GRect(22, 22, 85, 115));
	bars_layer.update_proc = &bars_update_callback;
	layer_add_child(&window.layer, &bars_layer);
	
	bmp_init_container(RESOURCE_ID_IMAGE_CONTROLS, &controls);
	bmp_init_container(RESOURCE_ID_IMAGE_BAR_ON,   &bar_on);
	bmp_init_container(RESOURCE_ID_IMAGE_BAR_OFF,  &bar_off);
	
	window_set_click_config_provider(&window, (ClickConfigProvider) click_config_provider);
}
开发者ID:fuzzie360,项目名称:pebble-vibe,代码行数:27,代码来源:pebble-vibe.c


示例5: handle_init

static void
handle_init(
	AppContextRef ctx
)
{
	(void) ctx;

	window_init(&window, "Main");
	window_stack_push(&window, true);
	window_set_background_color(&window, GColorBlack);

//	resource_init_current_app(&RESOURCES);
	resource_init_current_app(&APP_RESOURCES);
	
	int y = 15;
	int h = 30;

	font_small = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_22));
	font_thin = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_28));
	font_thick = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_BLACK_30));

	// Stack top to bottom.  Note that the hour can take up
	// two rows at midnight.
	text_layer(&ampm_small_word, GRect(4, y + 3*h+2, 144, h+8), font_small);
	text_layer(&ampm_word, GRect(4, y + 3*h, 144, h+8), font_thin);

	text_layer(&hour_word, GRect(4, y + 2*h-2, 144, 2*h+8), font_thick);

	text_layer(&rel_small_word, GRect(4, y + 1*h+2, 144, h+8), font_small);
	text_layer(&rel_word, GRect(4, y + 1*h, 144, h+8), font_thin);

	text_layer(&min_word, GRect(4, y + 0*h, 144, h+8), font_thin);


}
开发者ID:Jandhell,项目名称:smd_pebble_watchfaces,代码行数:35,代码来源:gertext.c


示例6: handle_init

void handle_init(AppContextRef ctx) {

  window_init(&window, "Simplicity");
  window_stack_push(&window, true /* Animated */);
  window_set_background_color(&window, GColorBlack);

  resource_init_current_app(&APP_RESOURCES);

  layer_init(&time_layer, GRect(0, 12, 144, 168-68));
  layer_add_child(&window.layer, &time_layer);

  text_layer_init(&text_date_layer, window.layer.frame);
  text_layer_set_text_color(&text_date_layer, GColorWhite);
  text_layer_set_background_color(&text_date_layer, GColorClear);
  layer_set_frame(&text_date_layer.layer, GRect(8, 0, 144-8, 168-68));
  text_layer_set_font(&text_date_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_21)));
  layer_add_child(&time_layer, &text_date_layer.layer);


  text_layer_init(&text_time_layer, window.layer.frame);
  text_layer_set_text_color(&text_time_layer, GColorWhite);
  text_layer_set_background_color(&text_time_layer, GColorClear);
  layer_set_frame(&text_time_layer.layer, GRect(7, 24, 144-7, 168-92));
  text_layer_set_font(&text_time_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_BOLD_SUBSET_49)));
  layer_add_child(&time_layer, &text_time_layer.layer);


  layer_init(&line_layer, window.layer.frame);
  line_layer.update_proc = &line_layer_update_callback;
  layer_add_child(&time_layer, &line_layer);

  layer_init(&car_layer, GRect(0, 90, 144, 168-90));
  layer_add_child(&window.layer, &car_layer);

  text_layer_init(&text_rated_layer, window.layer.frame);
  text_layer_set_text_color(&text_rated_layer, GColorWhite);
  text_layer_set_background_color(&text_rated_layer, GColorClear);
  layer_set_frame(&text_rated_layer.layer, GRect(8, 0, 144-8, 168-68));
  text_layer_set_font(&text_rated_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_21)));
  layer_add_child(&car_layer, &text_rated_layer.layer);
	
  text_layer_init(&text_state_layer, window.layer.frame);
  text_layer_set_text_color(&text_state_layer, GColorWhite);
  text_layer_set_background_color(&text_state_layer, GColorClear);
  layer_set_frame(&text_state_layer.layer, GRect(8, 20, 144-8, 168-68));
  text_layer_set_font(&text_state_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_21)));
  layer_add_child(&car_layer, &text_state_layer.layer);
	
  layer_init(&battery_layer, GRect(72, 10, 144-70, 10));
  battery_layer.update_proc = &battery_layer_update_callback;
  layer_add_child(&car_layer, &battery_layer);

  Tuplet initial_values[] = {
    TupletInteger(TESLA_RATED_REMAIN_KEY, (uint16_t) 148),
    TupletCString(TESLA_STATE_STRING_KEY, "Charging"),
	TupletInteger(TESLA_BATTERY_PERCENT_KEY, (uint8_t) 72),
  };
  app_sync_init(&sync, sync_buffer, sizeof(sync_buffer), initial_values, ARRAY_LENGTH(initial_values),
                sync_tuple_changed_callback, sync_error_callback, NULL);
}
开发者ID:banahogg,项目名称:TeslaPebble-Pebble,代码行数:60,代码来源:main.c


示例7: handle_init

void handle_init(AppContextRef ctx) {
    (void)ctx;
    
    firstblood = true;
    
    window_init(&window, "Clock_Window");
    window_stack_push(&window, true /* Animated */);
    window_set_background_color(&window, GColorBlack);
    resource_init_current_app(&APP_RESOURCES);
    
    fontHour = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_BOLDITALIC_35));
    fontUhr = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_LIGHTITALIC_30));
    fontMinutes = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_ITALIC_33));
    fontDate = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_ITALIC_13));
    
    memset(row_1_buffer,0,20);
    memset(row_3_buffer,0,20);
    memset(row_4_buffer,0,20);
    memset(row_5_buffer,0,20);
    
    text_layer_init(&row_2, window.layer.frame);
    text_layer_init(&row_3, window.layer.frame);
    text_layer_init(&row_4, window.layer.frame);
    text_layer_init(&row_5, window.layer.frame);
    text_layer_init(&row_3b, window.layer.frame);
    text_layer_init(&row_4b, window.layer.frame);
    text_layer_init(&row_5b, window.layer.frame);
    
    text_layer_init(&row_1, window.layer.frame);
    text_layer_init(&row_1b, window.layer.frame);
    
    get_time(&t);
}
开发者ID:AndiEnders,项目名称:Pebble-Watchface---Filmplakat,代码行数:33,代码来源:filmplakat.c


示例8: handle_init

void handle_init(AppContextRef ctx) {
	Layer *rootLayer;
	int i;
	
	window_init(&window, "Minimalist");
	window_stack_push(&window, true /* Animated */);
	window_set_background_color(&window, GColorBlack);
	
	clock12 = !clock_is_24h_style();
	
	resource_init_current_app(&APP_RESOURCES);
	
	for (i=0; i<NUM_IMAGES; i++) {
		heap_bitmap_init(&digitBmp[i], digitId[i]);
#if WHITE_BACKGROUND
		bmpNegative(&digitBmp[i].bmp);
#endif
	}
	
	rootLayer = window_get_root_layer(&window);
	layer_init(&layer, GRect(0,0,SCREENW,SCREENH));
	layer_set_update_proc(&layer, &update_display);
	layer_add_child(rootLayer, &layer);
	
	handle_tick(ctx, NULL);
	//layer_mark_dirty(&layer);
}
开发者ID:Jnmattern,项目名称:Minimalist,代码行数:27,代码来源:Minimalist.c


示例9: handle_init

void handle_init(AppContextRef ctx) {
  (void)ctx;

  window_init(&window, "Orbit");
  window_stack_push(&window, false /* Not Animated */);
  window_set_background_color(&window, GColorBlack);

  resource_init_current_app(&RESOURCES);

  bmp_init_container(RESOURCE_ID_IMAGE_FACE, &faceImage);
  layer_add_child(&window.layer, &faceImage.layer.layer);

  rotbmp_pair_init_container(RESOURCE_ID_IMAGE_MINUTE_PLANET_WHITE, RESOURCE_ID_IMAGE_MINUTE_PLANET_BLACK, &minuteImage);
  layer_add_child(&window.layer, &minuteImage.layer.layer);

  rotbmp_pair_init_container(RESOURCE_ID_IMAGE_HOUR_PLANET_WHITE, RESOURCE_ID_IMAGE_HOUR_PLANET_BLACK, &hourImage);
  layer_add_child(&window.layer, &hourImage.layer.layer);

  text_layer_init(&minuteText, GRect(0,0,0,0));
  text_layer_set_text_color(&minuteText, GColorWhite);
  text_layer_set_background_color(&minuteText, GColorClear);
  text_layer_set_text_alignment(&minuteText, GTextAlignmentCenter);
  text_layer_set_font(&minuteText, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_14)));
  layer_add_child(&window.layer, &minuteText.layer);

  text_layer_init(&hourText, GRect(0,0,0,0));
  text_layer_set_text_color(&hourText, GColorWhite);
  text_layer_set_background_color(&hourText, GColorClear);
  text_layer_set_text_alignment(&hourText, GTextAlignmentCenter);
  text_layer_set_font(&hourText, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_22)));
  layer_add_child(&window.layer, &hourText.layer);

  update_rings();
}
开发者ID:juliengrenier,项目名称:pebble,代码行数:34,代码来源:orbit.c


示例10: handle_init

// Handle the start-up of the app
void handle_init(AppContextRef app_ctx) {

	// Create our app's base window
	window_init(&window, "Silly Walk");
	window_stack_push(&window, true);
	window_set_background_color(&window, GColorBlack);

	resource_init_current_app(&APP_RESOURCES);

	// Set up a layer for the static watch face background
	bmp_init_container(RESOURCE_ID_IMAGE_BACKGROUND, &background_image_container);
	layer_add_child(&window.layer, &background_image_container.layer.layer);


	// Set up a layer for the hour hand
	rotbmp_pair_init_container(RESOURCE_ID_IMAGE_HOUR_HAND_WHITE, RESOURCE_ID_IMAGE_HOUR_HAND_BLACK, &hour_hand_image_container);
	rotbmp_pair_layer_set_src_ic(&hour_hand_image_container.layer, GPoint(33, 40));
	layer_add_child(&window.layer, &hour_hand_image_container.layer.layer);


	// Set up a layer for the minute hand
	rotbmp_pair_init_container(RESOURCE_ID_IMAGE_MINUTE_HAND_WHITE, RESOURCE_ID_IMAGE_MINUTE_HAND_BLACK, &minute_hand_image_container);
	rotbmp_pair_layer_set_src_ic(&minute_hand_image_container.layer, GPoint(16, 60));
	layer_add_child(&window.layer, &minute_hand_image_container.layer.layer);


	PblTm t;
	get_time(&t);
	update_watch(&t);

}
开发者ID:dansl,项目名称:pebble-silly-walk,代码行数:32,代码来源:silly_walk_simple_no_seconds.c


示例11: handle_init

void handle_init(AppContextRef ctx) {
    memset(&background_image, 0, sizeof(background_image));
    memset(&day_name_image, 0, sizeof(day_name_image));
    memset(&date_digits_images, 0, sizeof(date_digits_images));
    memset(&time_digits_images, 0, sizeof(time_digits_images));
    memset(&digits, 0, sizeof(digits));
    memset(&display_layer, 0, sizeof(display_layer));
    
    
    window_init(&window, "LCAR");
    window_stack_push(&window, true /* Animated */);
    
    resource_init_current_app(&APP_RESOURCES);
    
    bmp_init_container(RESOURCE_ID_IMAGE_BACKGROUND, &background_image);
    layer_init(&display_layer, GRect(43, 110, 82, 35));
    display_layer.update_proc = &display_layer_update_callback;
    
    layer_add_child(&window.layer, &background_image.layer.layer);
    
    
    layer_add_child(&window.layer, &background_image.layer.layer);
    layer_add_child(&window.layer,&display_layer);
    
 
    
    
    // Avoids a blank screen on watch start.
    PblTm tick_time;
    
    get_time(&tick_time);
    update_display(&tick_time);
    
}
开发者ID:KhasMek,项目名称:LCARS,代码行数:34,代码来源:LCARS.c


示例12: handle_init

void handle_init(AppContextRef ctx) {
  (void)ctx;

  window_init(&window, "Bar Graph");
  window_stack_push(&window, true /* Animated */);

  resource_init_current_app(&APP_RESOURCES);

  bmp_init_container(RESOURCE_ID_IMAGE_FACE, &faceImage);
  layer_add_child(&window.layer, &faceImage.layer.layer);

  layer_init(&hourLayer, window.layer.frame);
  hourLayer.update_proc = &update_hour;
  layer_add_child(&window.layer, &hourLayer);

  layer_init(&minLayer, window.layer.frame);
  minLayer.update_proc = &update_minute;
  layer_add_child(&window.layer, &minLayer);

  text_layer_init(&dateText, GRect(0,138,144,30));
  text_layer_set_text_color(&dateText, GColorWhite);
  text_layer_set_background_color(&dateText, GColorClear);
  text_layer_set_text_alignment(&dateText, GTextAlignmentCenter);
  text_layer_set_font(&dateText, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_22)));
  layer_add_child(&window.layer, &dateText.layer);

  update_date();
}
开发者ID:distantcam,项目名称:pebble,代码行数:28,代码来源:bargraph.c


示例13: handle_init

static void handle_init(AppContextRef ctx) {
  (void) ctx;

  window_init(&s_data.window, "Clock_Window");
  const bool animated = true;
  window_stack_push(&s_data.window, animated);

  window_set_background_color(&s_data.window, GColorBlack);
  resource_init_current_app(&APP_RESOURCES);

  //GFont gotham = fonts_get_system_font(FONT_KEY_DROID_SERIF_28_BOLD);
  GFont fontPlain = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_SANSATION_LIGHT_42));
  GFont fontBold = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_SANSATION_BOLD_42));

  text_layer_init(&s_data.label, GRect(0, 0, s_data.window.layer.frame.size.w, 100));
  text_layer_init(&s_data.label2, GRect(0, 37, s_data.window.layer.frame.size.w, s_data.window.layer.frame.size.h - 37));
  text_layer_set_background_color(&s_data.label, GColorClear);
  text_layer_set_background_color(&s_data.label2, GColorClear);
  text_layer_set_text_color(&s_data.label, GColorWhite);
  text_layer_set_text_color(&s_data.label2, GColorWhite);
  text_layer_set_font(&s_data.label, fontBold);
  text_layer_set_font(&s_data.label2, fontPlain);
  layer_add_child(&s_data.window.layer, &s_data.label.layer);
  layer_add_child(&s_data.window.layer, &s_data.label2.layer);

  PblTm t;
  get_time(&t);
  update_time(&t);
}
开发者ID:kost,项目名称:TextWatch-hr,代码行数:29,代码来源:TextWatch-hr.c


示例14: handle_init

//
// sets up the display
//
void handle_init(AppContextRef ctx) {
  (void)ctx;

    window_init(&window, "Simplicity");
    window_stack_push(&window, true /* Animated */);
    window_set_background_color(&window, GColorBlack);
    resource_init_current_app(&APP_RESOURCES);
    
    //
    // Load the bitmaps
    //
    bmp_init_container( RESOURCE_ID_IMAGE_PIC1, &_pic1 );
    bmp_init_container( RESOURCE_ID_IMAGE_PIC2, &_pic2 );
    bmp_init_container( RESOURCE_ID_IMAGE_PIC3, &_pic3 );

    //
    // create the bitmap layer at the back
    //
    bitmap_layer_init( &_currentPicture, GRect(0,0, 144, 168) );
    layer_add_child( &window.layer, &_currentPicture.layer );
    
    //
    // load the font we are using
    //
    GFont font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ROBOTO_CONDENSED_21));
    
    //
    // create the text layers
    //
    setupTextLayer( &_currentDate, &window, 2, 168-21, 144-4, 21, font );
    setupTextLayer( &_currentTime, &window, 2, 168-42, 144-4, 21, font );
}
开发者ID:netlands,项目名称:pebble.pictureviewer,代码行数:35,代码来源:main.c


示例15: handle_init

void handle_init(AppContextRef ctx) {
    (void)ctx;

    window_init(&window, "Hebrew Text");
    window_stack_push(&window, true /* Animated */);

    window_set_background_color(&window, GColorBlack);

    // If you neglect to call this, all `resource_get_handle()` requests
    // will return NULL.
    resource_init_current_app(&RESOURCES);

    font42 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_SIMPLE_42));
    font36 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_SIMPLE_36));
    font28 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_SIMPLE_28));


    text_layer_init(&timeLayer, GRect(0, 0, window.layer.frame.size.w, window.layer.frame.size.h));
    text_layer_set_text_color(&timeLayer, GColorWhite);
    text_layer_set_text_alignment(&timeLayer, GTextAlignmentRight);
    text_layer_set_background_color(&timeLayer, GColorClear);

    handle_minute_tick(ctx, NULL);

    layer_add_child(&window.layer, &timeLayer.layer);
}
开发者ID:kalugny,项目名称:heb-text-pebble,代码行数:26,代码来源:heb_text.c


示例16: handle_init

static void
handle_init(
	AppContextRef ctx
)
{
	(void) ctx;

	window_init(&window, "Main");
	window_stack_push(&window, true);
	window_set_background_color(&window, GColorBlack);

	resource_init_current_app(&APP_RESOURCES);

	int y = 15;
	int h = 30;

	font_thin_28 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_28));
	font_thick_30 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_BLACK_30));
	font_thin_12 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_12));
	font_thin_18 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_18));
	font_thin_22 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_22));
	font_thin_16 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_16));
	font_thick_18 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_BLACK_18));
	font_thick_24 = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ARIAL_BLACK_24));
	// Stack top to bottom.  Note that the hour can take up
	// two rows at midnight.
	text_layer(&kpi3_word, GRect(4, y + 4.2*h, 144, h+8), font_thin_18);
	text_layer(&kpi2_word, GRect(4, y + 3.5*h, 144, h+8), font_thin_18);
	text_layer(&kpi1_word, GRect(4, y + 2.8*h, 144, h+8), font_thin_18);
	text_layer(&ampm_word, GRect(4, y + 2.1*h, 144, h+8), font_thin_18);
	text_layer(&hour_word, GRect(4, y + 1.4*h, 144, 2*h+8), font_thick_18);
	text_layer(&rel_word, GRect(4, y + 0.7*h, 144, h+8), font_thin_18);
	text_layer(&min_word, GRect(4, y + 0*h, 144, h+8), font_thin_18);

}
开发者ID:zwirbel,项目名称:wieschpaatisches,代码行数:35,代码来源:main.c


示例17: handle_init

void handle_init(AppContextRef ctx) {
  (void) ctx;

  window_init(&window, "Totoro");
  window_stack_push(&window, true);

  resource_init_current_app(&APP_RESOURCES);

  // Set up a layer for the static watch face background
  bmp_init_container(RESOURCE_ID_IMAGE_BACKGROUND, &background_image_container);
  layer_add_child(&window.layer, &background_image_container.layer.layer);


  // Date
  // Initialises the date and sets the text, font and background colour
  text_layer_init(&text_date_layer, window.layer.frame);
  text_layer_set_text_color(&text_date_layer, GColorBlack);
  text_layer_set_background_color(&text_date_layer, GColorClear);
  layer_set_frame(&text_date_layer.layer, GRect(69, 150, 80, 15));

  text_layer_set_font(&text_date_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_GOTHIC_REGULAR_12)));
  layer_add_child(&window.layer, &text_date_layer.layer);

  // Time
  // Initialises the time and sets the text, font and background colour
  text_layer_init(&text_time_layer, window.layer.frame);
  text_layer_set_text_color(&text_time_layer, GColorBlack);
  text_layer_set_background_color(&text_time_layer, GColorClear);
  layer_set_frame(&text_time_layer.layer, GRect(0, 0, 144, 44));

  text_layer_set_font(&text_time_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_GOTHIC_REGULAR_36)));
  text_layer_set_text_alignment(&text_time_layer, GTextAlignmentCenter);
  layer_add_child(&window.layer, &text_time_layer.layer);

}
开发者ID:reverserplus,项目名称:totorowday,代码行数:35,代码来源:totoro.c


示例18: handle_init

void handle_init(AppContextRef ctx) {
  (void)ctx;

  window_init(&window, "Modern Watch");
  window_stack_push(&window, true /* Animated */);
  resource_init_current_app(&APP_RESOURCES);

#if DISPLAY_DATE_ANALOG
  bmp_init_container(RESOURCE_ID_IMAGE_BACKGROUND_DATEBOX, &background_image_container);
#elif INVERTED
  bmp_init_container(RESOURCE_ID_IMAGE_BACKGROUND_INVERTED, &background_image_container);
#else
  bmp_init_container(RESOURCE_ID_IMAGE_BACKGROUND, &background_image_container);
#endif
  layer_add_child(&window.layer, &background_image_container.layer.layer);

#if DISPLAY_DATE_ANALOG
  date_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_ORBITRON_MEDIUM_12));
  text_layer_init(&date_layer, GRect(116, 77, 20, 20));
#else
  date_font = fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_DIGITALDREAM_NARROW_12));
  text_layer_init(&date_layer, GRect(27, 110, 90, 30));
#endif
#if DISPLAY_DATE_ANALOG
  text_layer_set_text_color(&date_layer, GColorBlack);
#elif INVERTED
  text_layer_set_text_color(&date_layer, GColorBlack);
#else
  text_layer_set_text_color(&date_layer, GColorWhite);
#endif
  text_layer_set_text_alignment(&date_layer, GTextAlignmentCenter);
  text_layer_set_background_color(&date_layer, GColorClear);
  text_layer_set_font(&date_layer, date_font);
  layer_add_child(&window.layer, &date_layer.layer);

  draw_date();

  layer_init(&hour_display_layer, window.layer.frame);
  hour_display_layer.update_proc = &hour_display_layer_update_callback;
  layer_add_child(&window.layer, &hour_display_layer);

  gpath_init(&hour_hand_path, &HOUR_HAND_PATH_POINTS);
  gpath_move_to(&hour_hand_path, grect_center_point(&hour_display_layer.frame));

  layer_init(&minute_display_layer, window.layer.frame);
  minute_display_layer.update_proc = &minute_display_layer_update_callback;
  layer_add_child(&window.layer, &minute_display_layer);

  gpath_init(&minute_hand_path, &MINUTE_HAND_PATH_POINTS);
  gpath_move_to(&minute_hand_path, grect_center_point(&minute_display_layer.frame));

  layer_init(&center_display_layer, window.layer.frame);
  center_display_layer.update_proc = &center_display_layer_update_callback;
  layer_add_child(&window.layer, &center_display_layer);
#if DISPLAY_SECONDS
  layer_init(&second_display_layer, window.layer.frame);
  second_display_layer.update_proc = &second_display_layer_update_callback;
  layer_add_child(&window.layer, &second_display_layer);
#endif
}
开发者ID:BUSHA,项目名称:pebble,代码行数:60,代码来源:modern.c


示例19: handle_init

void handle_init(AppContextRef ctx) {
	resource_init_current_app(&HOUSECONTROL);
	
	window_init(&homeWindow, "Group Selection");
	WindowHandlers handlers = {
		.appear = &handle_home_window_appear
	};
	window_set_window_handlers(&homeWindow, handlers);
	window_stack_push(&homeWindow, true /* Animated */);
	
	window_init(&groupWindow, "Device Selection");
	WindowHandlers handlers2 = {
		.appear = &handle_group_window_appear
	};
	window_set_window_handlers(&groupWindow, handlers2);
	
	window_init(&deviceWindow, "Device");
	WindowHandlers handlers3 = {
		.appear = &handle_device_window_appear
	};
	window_set_window_handlers(&deviceWindow, handlers3);
	
	//HOME LAYER
	GRect bounds = homeWindow.layer.bounds;
	menu_layer_init(&homeLayer, bounds);
	
	menu_layer_set_callbacks(&homeLayer, NULL, (MenuLayerCallbacks){
		.get_num_rows		= menu_home_get_num_rows,
		.draw_row 			= menu_home_draw_row,
		.select_click 		= menu_home_select_click
	});
开发者ID:marksachar,项目名称:pebble-housecontrol,代码行数:31,代码来源:pebble-housecontrol.c


示例20: handle_init

void handle_init(AppContextRef ctx) {

  window_init(&window, "Simplicity");
  window_stack_push(&window, true /* Animated */);
  window_set_background_color(&window, GColorBlack);

  resource_init_current_app(&APP_RESOURCES);


  text_layer_init(&text_date_layer, window.layer.frame);
  text_layer_set_text_color(&text_date_layer, GColorWhite);
  text_layer_set_background_color(&text_date_layer, GColorClear);
  layer_set_frame(&text_date_layer.layer, GRect(8, 28, 144-8, 40));
  text_layer_set_font(&text_date_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_TEST_21)));
  layer_add_child(&window.layer, &text_date_layer.layer);


  text_layer_init(&text_time_layer, window.layer.frame);
  text_layer_set_text_color(&text_time_layer, GColorWhite);
  text_layer_set_background_color(&text_time_layer, GColorClear);
  layer_set_frame(&text_time_layer.layer, GRect(1, 62, 144-2, 168-62));
  text_layer_set_font(&text_time_layer, fonts_load_custom_font(resource_get_handle(RESOURCE_ID_FONT_TEST_48)));
  layer_add_child(&window.layer, &text_time_layer.layer);


  layer_init(&line_layer, window.layer.frame);
  line_layer.update_proc = &line_layer_update_callback;
  layer_add_child(&window.layer, &line_layer);


  // TODO: Update display here to avoid blank display on launch?
}
开发者ID:hal1729,项目名称:WinPebble01,代码行数:32,代码来源:WinPebble01.c



注:本文中的resource_init_current_app函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ resource_int_value函数代码示例发布时间:2022-05-30
下一篇:
C++ resource_get_handle函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap