예제 #1
0
void callscreen_unload(Window* me)
{
    gbitmap_destroy(buttonAnswer);
    gbitmap_destroy(buttonEndCall);
    gbitmap_destroy(buttonMicOff);
    gbitmap_destroy(buttonMicOn);
    gbitmap_destroy(buttonSpeakerOn);
    gbitmap_destroy(buttonSpeakerOff);
}
예제 #2
0
static void main_window_unload(Window *window) {
	// Unload fonts
	fonts_unload_custom_font(s_schedule_font);
	fonts_unload_custom_font(s_time_font);
	
	// Unload text layers
	text_layer_destroy(s_time_layer);
	text_layer_destroy(s_schedule_layer);
	
	// Destroy GBitmap
	gbitmap_destroy(s_background_bitmap);

	// Destroy BitmapLayer
	bitmap_layer_destroy(s_background_layer);
}
예제 #3
0
static void select_click_handler(ClickRecognizerRef recognizer, void *context) {
  if(image){
    gbitmap_destroy(image);
    image = NULL;
    bitmap_layer_set_bitmap(image_layer, image);
  }
  text_layer_set_text(text_layer, "Updating image...");

  DictionaryIterator *iter;
  uint8_t value = 1;
  app_message_outbox_begin(&iter);
  dict_write_int(iter, KEY_IMAGE, &value, 1, true);
  dict_write_end(iter);
  app_message_outbox_send();
}
예제 #4
0
static void main_window_unload(Window *window) {
  //Unload GFont
  fonts_unload_custom_font(s_time_font);
  fonts_unload_custom_font(s_date_font);
  fonts_unload_custom_font(s_battery_font);
  
  //Destroy GBitmap
  gbitmap_destroy(s_frame_1);
  gbitmap_destroy(s_frame_2);
  gbitmap_destroy(s_frame_3);




  //Destroy BitmapLayer
  bitmap_layer_destroy(s_bg_layer);

  // Destroy TextLayer
  text_layer_destroy(s_time_layer);
  text_layer_destroy(s_date_layer);
  //text_layer_destroy(s_battery_layer);
  text_layer_destroy(s_dow_layer);
  
}
예제 #5
0
파일: main.c 프로젝트: palian/Metro8
static void main_window_unload(Window *window) {
    // Destroy TextLayer
    text_layer_destroy(s_time_layer);
    text_layer_destroy(s_time_layer2);
    text_layer_destroy(s_time_layer2a);
    text_layer_destroy(s_time_layer3);

    // Unload GFont
    fonts_unload_custom_font(s_time_font);
    fonts_unload_custom_font(s_time_font2);
    fonts_unload_custom_font(s_time_font3);

  // Unload blocks
    layer_destroy(s_line_layer);
    layer_destroy(s_line_layer2);
    layer_destroy(s_line_layer3);
    layer_destroy(s_line_layer4);
  
  gbitmap_destroy(s_image);
  layer_destroy(s_image_layer);
  
  gbitmap_destroy(s_image2);
  layer_destroy(s_image_layer2);
}
예제 #6
0
inline void UnloadBetweenFight()
{
 	if(bInitialisedBetweenFight == false)
		return;
	
	bInitialisedBetweenFight = false;
	
	// Destroy GBitmaps
  gbitmap_destroy(BackgroundBitmap);

  // Destroy Layers
  bitmap_layer_destroy(BackgroundLayer);
  layer_destroy(StepBarsLayer);
	
	//Destroy Text
	text_layer_destroy(TourneysWonLayer);
	text_layer_destroy(TourneysWonDropLayer);
	text_layer_destroy(CurrentTourneyLayer);
	text_layer_destroy(CurrentTourneyDropLayer);
	text_layer_destroy(WinLossLayer);
	text_layer_destroy(WinLossDropLayer);
	text_layer_destroy(StepsLayer);
	text_layer_destroy(StepsDropLayer);

	//Destroy Faces
	for(int FaceIdx = 0; FaceIdx < C_MAX; ++FaceIdx)
	{
  	gbitmap_destroy(FacesBitmaps[FaceIdx]);
  	gbitmap_destroy(FacesGreyBitmaps[FaceIdx]);
	}
  gbitmap_destroy(QuestionFaceBitmap);
  layer_destroy(FacesLayer);
	
	//Destroy fonts
	fonts_unload_custom_font(MainFont12);
}
예제 #7
0
파일: main.c 프로젝트: svcru/Modern
void deinit(){
	window_destroy(window);
	gbitmap_destroy(background_image_container);
	gbitmap_destroy(icon_battery);
	gbitmap_destroy(icon_battery_charge);
	gbitmap_destroy(icon_bt);
	text_layer_destroy(date_layer);
	layer_destroy(minute_display_layer);
	layer_destroy(hour_display_layer);
	layer_destroy(center_display_layer);
	layer_destroy(second_display_layer);
	layer_destroy(battery_layer);
	layer_destroy(bt_layer);

#ifdef INVERSE
	inverter_layer_destroy(full_inverse_layer);
#endif

	layer_destroy(background_layer);
	layer_destroy(window_layer);

	gpath_destroy(hour_hand_path);
	gpath_destroy(minute_hand_path);
}
static void get_image(){
  if(image){
    gbitmap_destroy(image);
    image = NULL;
    bitmap_layer_set_bitmap(image_layer, image);
  }

  text_layer_set_text(text_layer, "Updating image...");

  DictionaryIterator *iter;
  app_message_outbox_begin(&iter);
  dict_write_cstring(iter, MESSAGE_KEY_url, enamel_get_url());
  dict_write_end(iter);
  app_message_outbox_send();
}
예제 #9
0
static void load_sequence() {
  if(s_sequence) {
    gbitmap_sequence_destroy(s_sequence);
    s_sequence = NULL;
  }
  if(s_bitmap) {
    gbitmap_destroy(s_bitmap);
    s_bitmap = NULL;
  }

  s_sequence = gbitmap_sequence_create_with_resource(RESOURCE_ID_ANIMATION);
  s_bitmap = gbitmap_create_blank(gbitmap_sequence_get_bitmap_size(s_sequence), GBitmapFormat8Bit);

  app_timer_register(1, timer_handler, NULL);
}
예제 #10
0
void draw_weather(WeatherInfo winfo) {
	static char temperature_text[] = "000 %C"; // temperature, 2 spaces for unicode degree sign

	snprintf(temperature_text, sizeof(temperature_text), "%3d\u00B0C", (int) winfo.temp);
	text_layer_set_text(weather_temp_layer, temperature_text);

	// If we didn't get an icon, just leave it unchanged.
	if (winfo.icon > 0) {
		if (weather_cond_bitmap) {
			gbitmap_destroy(weather_cond_bitmap);
		}
		weather_cond_bitmap = gbitmap_create_with_resource(WEATHER_ICONS[winfo.icon]);
		bitmap_layer_set_bitmap(weather_cond_layer, weather_cond_bitmap);
	}
}
예제 #11
0
파일: main.c 프로젝트: Boms/pebble-7-min
//! Destroy layers, window data, and window.
//! @param window A pointer to the window the unload was called from
static void prv_window_unload_handler(Window *window) {
  // window properties
  WindowData *data = (WindowData*)window_get_user_data(window);
  // check user data
  if (data) {
    // unregister callbacks
    app_message_deregister_callbacks();
    // destroy images
    gbitmap_destroy(data->config_bmp);
    gbitmap_destroy(data->grid_1_bmp);
    gbitmap_destroy(data->grid_2_bmp);
    // free data
    stick_figure_destroy(data->stick_figure);
    drawing_button_destroy(data->button);
    layer_destroy(data->draw_layer);
    window_destroy(window);
    free(data);
    return;
  }

  // error handling
  window_destroy(window);
  APP_LOG(APP_LOG_LEVEL_ERROR, "Error: Tried to free NULL WindowData pointer.");
}
예제 #12
0
void handle_deinit(void) {
  text_layer_destroy(hour_layer);
  text_layer_destroy(min_layer);
  text_layer_destroy(am_layer);
  text_layer_destroy(date_layer);
  text_layer_destroy(battery_layer);
  
  bitmap_layer_destroy(bt_white_image_layer);
//  bitmap_layer_destroy(bt_black_image_layer);
  
  gbitmap_destroy(bt_white_image);
//  gbitmap_destroy(bt_black_image);
  
  window_destroy(window);
}
예제 #13
0
static void set_display() {
    time_t temp = time(NULL);
    struct tm *tick_time = localtime(&temp);

    if ( tick_time->tm_min % 10 == 0 && tick_time->tm_sec == 0) {
        scene_seed = choose_scene(max_scenes);
        road_seed = choose_scene(max_roads);
    }

    gbitmap_destroy(scene_bitmap);
    gbitmap_destroy(road_bitmap);
    scene_bitmap = gbitmap_create_with_resource(scenery[scene_seed]);
    //gbitmap_destroy(car_bitmap);

    if ( tick_time->tm_sec % 2 == 0) {
        road_bitmap = gbitmap_create_with_resource(road1[road_seed]);
        //    car_bitmap = gbitmap_create_with_resource(RESOURCE_ID_car1);
    } else {
        road_bitmap = gbitmap_create_with_resource(road2[road_seed]);
        //    car_bitmap = gbitmap_create_with_resource(RESOURCE_ID_car2);
    }
    bitmap_layer_set_bitmap(scene_layer, scene_bitmap);
    bitmap_layer_set_bitmap(road_layer, road_bitmap);
}
예제 #14
0
static void main_window_unload(Window *window) {

    fonts_unload_custom_font(batt_txt_font);
    fonts_unload_custom_font(pct_font);
    fonts_unload_custom_font(clock_font);

    //Destroy GBitmap
    gbitmap_destroy(scene_bitmap);
    gbitmap_destroy(road_bitmap);
    gbitmap_destroy(car_bitmap);
    gbitmap_destroy(batt_bitmap);
//  gbitmap_destroy(right_bitmap);

    //Destroy BitmapLayer
    bitmap_layer_destroy(scene_layer);
    bitmap_layer_destroy(road_layer);
    bitmap_layer_destroy(batt_layer);

    // Destroy TextLayer
    text_layer_destroy(s_time_layer);
    text_layer_destroy(month_layer);
    text_layer_destroy(batt_txt_layer);
    text_layer_destroy(pct_layer);
}
예제 #15
0
static void destroy_bitmaps() {
  gbitmap_destroy(check_icon);
  gbitmap_destroy(x_icon);
  gbitmap_destroy(recent_icon);
  gbitmap_destroy(abc_icon);
  gbitmap_destroy(send_icon);
  #if defined(PBL_MICROPHONE)
  gbitmap_destroy(microphone_icon);
  #endif
}
예제 #16
0
static void handle_window_unload(Window* window) {
  destroy_ui();
  
  gbitmap_destroy(s_res_charging);
  gbitmap_destroy(s_res_battery_20);
  gbitmap_destroy(s_res_battery_40);
  gbitmap_destroy(s_res_battery_60);
  gbitmap_destroy(s_res_battery_80);
  gbitmap_destroy(s_res_battery_100);
}
예제 #17
0
파일: tippy2.c 프로젝트: Med116/tippy
static void window_unload(Window *window) {
  text_layer_destroy(temp_layer);
  text_layer_destroy(plus_layer);
  text_layer_destroy(minus_layer);
  text_layer_destroy(total_layer);
  text_layer_destroy(total_label);
  text_layer_destroy(tip_layer);
  text_layer_destroy(tip_label);
  inverter_layer_destroy(inverter_layer);
  inverter_layer_destroy(results_inverter_layer);
  text_layer_destroy(results_layer);
  layer_destroy(path_layer);
  layer_destroy(results_path_layer);
  gbitmap_destroy(up_down_icon);
  bitmap_layer_destroy(image_layer);
}
static void window_unload(Window *window) {
  // destroy the text layers - this is good
  text_layer_destroy(text_date_layer);
  text_layer_destroy(text_time_layer);
  text_layer_destroy(text_temp_layer);

  // destroy the image layers
  gbitmap_destroy(image);
  layer_remove_from_parent(bitmap_layer_get_layer(image_layer));
  bitmap_layer_destroy(image_layer);

  // unload the fonts
  fonts_unload_custom_font(font49);
  fonts_unload_custom_font(font39);
  fonts_unload_custom_font(font21);
}
예제 #19
0
static void window_unload(Window *window) {
  app_sync_deinit(&sync);

  if (icon_bitmap) {
    gbitmap_destroy(icon_bitmap);
  }

  text_layer_destroy(layer_route);
  text_layer_destroy(layer_eta);
  text_layer_destroy(layer_eta_mins_str);
  text_layer_destroy(layer_gps_str);
  text_layer_destroy(layer_destination);
  text_layer_destroy(layer_station);
  text_layer_destroy(layer_station_str);
  //  bitmap_layer_destroy(icon_layer);
}
예제 #20
0
파일: main.c 프로젝트: kmr/kokona-watch1
static void main_window_unload(Window *window) {
  //Unload GFont
  fonts_unload_custom_font(s_time_font);
  fonts_unload_custom_font(s_date_font);
  
  //Destroy GBitmap
  gbitmap_destroy(s_background_bitmap);

  //Destroy BitmapLayer
  bitmap_layer_destroy(s_background_layer);
  
  // Destroy TextLayer
  text_layer_destroy(s_time_layer);
  // Destroy TextLayer
  text_layer_destroy(s_date_layer);
}
static void main_window_unload(Window *window) {
	// Destroy TextLayer
	text_layer_destroy(s_time_layer);

	// Unload GFont
	fonts_unload_custom_font(s_time_font);

	fonts_unload_custom_font(s_date_font);

	text_layer_destroy(s_date_layer);
	
	layer_destroy(s_wp_views_layer);
	
	gbitmap_destroy(s_bitmap_bluetooth);
	bitmap_layer_destroy(s_bitmap_layer_bluetooth);
}
예제 #22
0
void bluetooth_connection_changed(bool connected) {
  static bool _connected = true;

  // This seemed to get called twice on disconnect
  if (!connected && _connected) {
    vibes_short_pulse();

    if (icon_bitmap) {
      gbitmap_destroy(icon_bitmap);
    }

    icon_bitmap = gbitmap_create_with_resource(RESOURCE_ID_NO_BT);
    bitmap_layer_set_bitmap(icon_layer, icon_bitmap);
  }
  _connected = connected;
}
void weather_layer_destroy(WeatherLayer* weather_layer) {
  WeatherLayerData *wld = layer_get_data(weather_layer);

  text_layer_destroy(wld->temp_layer);
  text_layer_destroy(wld->temp_layer_background);
  bitmap_layer_destroy(wld->icon_layer);

  // Destroy the previous bitmap if we have one
  if (wld->icon != NULL) {
    gbitmap_destroy(wld->icon);
  }
  layer_destroy(weather_layer);

  fonts_unload_custom_font(large_font);
  fonts_unload_custom_font(small_font);
}
예제 #24
0
static void cb_in_received_handler(DictionaryIterator *iter, void *context) {
  autoconfig_in_received_handler(iter, context);

  Tuple *code_tuple = dict_find(iter, WEATHERCODE_KEY);
  if(code_tuple){
    int32_t weather_code = code_tuple->value->int32;
    APP_LOG(APP_LOG_LEVEL_DEBUG, "code:%ld", weather_code);
    
    if(weather_code != 3200){
        Tuple *temp_tuple = dict_find(iter, TEMPERATURE_KEY);
        if (temp_tuple) {
            int32_t temperature = temp_tuple->value->int32;
            // temperature = -99;
            snprintf(temp_text, sizeof(temp_text), "%ld°", temperature);
            layer_mark_dirty(text_layer_get_layer(text_temp_layer));
        }
        Tuple *city_tuple = dict_find(iter, CITYNAME_KEY);
        if (city_tuple) {
            snprintf(city_text, sizeof(city_text), "%s", city_tuple->value->cstring);
            layer_mark_dirty(text_layer_get_layer(text_city_layer));
        }
        // weather_code = 28;
        if(weather_code > 47){
          weather_code = 0;
        }
    }
    else {
      weather_code = 0;
    }
    if(weather_image){
      gbitmap_destroy(weather_image);
    }
    weather_image = gbitmap_create_with_resource(WEATHER_IMAGE_RESOURCE[weather_code]);
    bitmap_layer_set_bitmap(weather_layer,  weather_image);
  }

  if(dict_find(iter, INTERVAL_PKEY)){
    app_timer_cancel(weather_timer);
    weather_timer = app_timer_register(getInterval() * 1000 /* milliseconds */, timer_callback, NULL);
  }

  if(dict_find(iter, LANGUAGE_PKEY)){
    time_t now = time(NULL);
    struct tm *tick_time = localtime(&now);
    handle_minute_tick(tick_time, MINUTE_UNIT);
  }
}
예제 #25
0
// main window unloading (destruction)
static void main_window_unload(Window *window) {
  // Unload font
  fonts_unload_custom_font(s_time_font_dte);

  // Destroy text layer
  text_layer_destroy(s_time_layer_dte);
  
  // Destroy canvas layer
  layer_destroy(s_canvas_layer);
  
  // Remove and destroy bitmap layers and images
  unload_time_images();
  
  layer_remove_from_parent(bitmap_layer_get_layer(s_warning_img_layer));
  bitmap_layer_destroy(s_warning_img_layer);
  gbitmap_destroy(s_warning_bitmap);
}
static void set_container_image(GBitmap **bmp_image, BitmapLayer *bmp_layer, const int resource_id, GPoint origin) {
  GBitmap *old_image = *bmp_image;

  *bmp_image = gbitmap_create_with_resource(resource_id);
#ifdef PBL_PLATFORM_BASALT
  GRect bitmap_bounds = gbitmap_get_bounds((*bmp_image));
#else
  GRect bitmap_bounds = (*bmp_image)->bounds;
#endif
  GRect frame = GRect(origin.x, origin.y, bitmap_bounds.size.w, bitmap_bounds.size.h);
  bitmap_layer_set_bitmap(bmp_layer, *bmp_image);
  layer_set_frame(bitmap_layer_get_layer(bmp_layer), frame);

  if (old_image != NULL) {
  	gbitmap_destroy(old_image);
  }
}
void window_unload(Window *window) {
    text_layer_destroy(number_1);
    text_layer_destroy(number_2);
    text_layer_destroy(number_3);
    text_layer_destroy(number_4);
    text_layer_destroy(number_5);
    text_layer_destroy(number_6);
    text_layer_destroy(number_7);
    text_layer_destroy(number_8);
    text_layer_destroy(number_9);
    text_layer_destroy(number_0);
    text_layer_destroy(status_text_layer);
    bitmap_layer_destroy(line_layer);
    layer_destroy(circle_layer);
    gbitmap_destroy(line);
    inverter_layer_destroy(highlighter);
}
예제 #28
0
파일: main.c 프로젝트: eisea/SimpleTime
static void main_window_unload(Window *window) {
  // Destroy TextLayer
  text_layer_destroy(s_time_layer);
  // Unload GFont
  fonts_unload_custom_font(s_time_font);
  // Destroy weather elements
  text_layer_destroy(s_weather_layer);
  fonts_unload_custom_font(s_weather_font);
  fonts_unload_custom_font(s_date_font);
  text_layer_destroy(s_date_layer);
  layer_destroy(s_battery_layer);
  text_layer_destroy(s_num_label);
  gbitmap_destroy(s_bt_icon_bitmap);
  layer_destroy(s_bt_icon_layer);
  APP_LOG(APP_LOG_LEVEL_INFO, "Main window unloaded");

}
예제 #29
0
static void main_window_unload(Window *window) {
  // Destroy time TextLayer
  text_layer_destroy(s_time_layer);
  // Destroy date TextLayer
  text_layer_destroy(s_date_layer);
  // Destroy time GFont
  fonts_unload_custom_font(s_time_font);
  // Destroy date GFont
  fonts_unload_custom_font(s_date_font);
  // Destroy GBitmap
  gbitmap_destroy(s_background_bitmap);
  // Destroy BitmapLayer
  bitmap_layer_destroy(s_background_layer);
  // Destroy weather elements
  text_layer_destroy(s_weather_layer);
  fonts_unload_custom_font(s_weather_font);
}
예제 #30
0
void deinit(void)
{
	int i;

	for (i = 0; i < 5; i++)
		bitmap_layer_destroy(bl[i]);

	#if (DATE)
		for (i = 5; i < 10; i++)
			bitmap_layer_destroy(bl[i]);
	#endif

	window_destroy(window);

	for (i = 0; i < 12; i++)
		gbitmap_destroy(bs[i]);
}