int main(void) {
  handle_init();

  app_event_loop();

  handle_deinit();
}
Example #2
0
int main(void) {
  srand(time(NULL));
  init();
  app_event_loop();
  deinit();
  return 0;
}
Example #3
0
int main(void) {
  init();
  app_event_loop();
  deinit();

  return 0;
}
Example #4
0
int main(void)
{
    app_init();
    app_event_loop();
    app_term();

    return 0;
}
Example #5
0
// Start app
int main(void) {
  prv_init();

  APP_LOG(APP_LOG_LEVEL_DEBUG, "Done initializing, pushed window: %p", s_window);

  app_event_loop();
  prv_deinit();
}
Example #6
0
/*
 * Main - or main as it is known
 */
int main(void) {
    init();
    tick_timer_service_subscribe(SECOND_UNIT, &handle_tick);
    bluetooth_connection_service_subscribe(&bt_connection_handler);
    battery_state_service_subscribe	(&battery_state_handler);
    app_event_loop();
    deinit();
}
Example #7
0
File: main.c Project: asyba/UR
static void window_load(Window *window) {

  int num_a_items = 0;

  bus_menu_items[num_a_items++] = (SimpleMenuItem){
    .title = "Media Players",
        .subtitle = "",
    .callback = bus1_select_callback,
  };
  bus_menu_items[num_a_items++] = (SimpleMenuItem){
    .title = "PC",
        .subtitle = "",
    .callback = bus2_select_callback,
  };
  bus_menu_items[num_a_items++] = (SimpleMenuItem){
    .title = "Monitor",
        .subtitle = "",
    .callback = bus3_select_callback,
  };
  
  menu_sections[0] = (SimpleMenuSection){
  .title ="Control Category",
  .num_items = NUM_CLIENT_MENU_ITEMS,
  .items = bus_menu_items,
  };
      
  Layer *window_layer = window_get_root_layer(window);
  GRect bounds = layer_get_frame(window_layer);

  simple_menu_layer = simple_menu_layer_create(bounds, window, menu_sections,NUM_MENU_SECTIONS, NULL);

  layer_add_child(window_layer, simple_menu_layer_get_layer(simple_menu_layer));
}
static void window_unload(Window *window) {
  simple_menu_layer_destroy(simple_menu_layer);
}

int main(void) {
  window = window_create();
    appmessage_init();

  window_set_window_handlers(window, (WindowHandlers) {
    .load = window_load,
    .unload = window_unload,
  });

  window_stack_push(window, true /* Animated */);

  APP_LOG(APP_LOG_LEVEL_DEBUG, "Done initializing, pushed window: %p", window);
	

  app_event_loop();

  window_destroy(window);
}
Example #8
0
int main(void)
{
  init();

  init_pebcessing(window, window_get_root_layer(window));

  app_event_loop();

  deinit_pebcessing();

  deinit();

  return 0;
}
int main(void) {
  app_message_register_inbox_received (inbox_received_callback);
  app_message_register_inbox_dropped (inbox_dropped_callback);
  app_message_register_outbox_failed (outbox_failed_callback);
  app_message_register_outbox_sent (outbox_sent_callback);

  app_message_open(app_message_inbox_size_maximum(), app_message_outbox_size_maximum());

  win_main_init ();
  win_main_show ();

  APP_LOG(APP_LOG_LEVEL_DEBUG, "Done initializing");

  app_event_loop();
  win_main_deinit();
}
Example #10
0
void pbl_main(void *params) {
  unsigned char units;
  if (DEBUG) {
    units = SECOND_UNIT;
  } else {
    units = MINUTE_UNIT;
  }
  PebbleAppHandlers handlers = {
    .init_handler = &handle_init,

    .tick_info = {
      .tick_handler = &handle_minute_tick,
      .tick_units = units
    }
  };
  app_event_loop(params, &handlers);
}
int main(void) {
	app_message_register_inbox_received(received_data);
	app_message_register_outbox_sent(data_sent);
	app_message_open(124, 50);

  
	inverter_layer = inverter_layer_create(GRect(0, 0, 144, 168));
	switchWindow(0);

	app_timer_register(300, timerTriggered, NULL);

	app_event_loop();

  inverter_layer_destroy(inverter_layer);
	window_stack_pop_all(false);
	return 0;
}
Example #12
0
int main(void) 
{
	menu_init();
	settings_init();
	pokedex_init();
	  ///game1_init();

	menu_show();
	
	app_event_loop();
	
	menu_deinit();
	settings_deinit();
	pokedex_deinit();
	  ///game1_deinit();
	
	return 0;
}
int main() {
	app_message_register_outbox_sent(data_delivered);
	app_message_register_inbox_received(received_data);
	app_message_open(124, 50);

	DictionaryIterator *iterator;
	app_message_outbox_begin(&iterator);
	dict_write_uint8(iterator, 0, 0);
	dict_write_uint8(iterator, 1, 0);
	dict_write_uint16(iterator, 2, PROTOCOL_VERSION);
	app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED);
	app_message_outbox_send();

	switchWindow(0);
	app_event_loop();
	window_stack_pop_all(false);
	return 0;
}
Example #14
0
int main(void) {
  show_start_window();

  // Set up AppMessage
  app_message_register_inbox_received(inbox_received_handler);
  app_message_register_inbox_dropped(inbox_dropped_handler);
  // - Messages to phone are only ever integers, as the Key is the important instruction
  // - Messages to watch will hopefully fit in 5500. It is maximum 100 caches,
  //     with sizes from geocaching.h, except the average name length will hopefully be less
  //     than 37 characters (incuding terminator). (6+12+37)*100=5500
  
  //I'VE HAD TO UP THIS BY 1000 OTHERWISE SERIALIZED CACHES ARE DROPPED - NOT SURE WHY YET..., and it's down again now
  //halved because api only returns 50
  // AND BACK UP AGAIN by 250!!!
  app_message_open(3000, APP_MESSAGE_OUTBOX_SIZE_MINIMUM);
  
  app_event_loop();
  
  hide_menu_window();

}
int main(void) {
	app_message_register_inbox_received(received_data);
	app_message_register_outbox_sent(data_sent);
	app_message_open(124, 50);

	DictionaryIterator *iterator;
	app_message_outbox_begin(&iterator);
	dict_write_uint8(iterator, 0, 0);
	app_message_outbox_send();
	loadingMode = true;

	config_invertColors = persist_read_bool(0);

	switchWindow(0);

	app_comm_set_sniff_interval(SNIFF_INTERVAL_REDUCED);

	app_event_loop();

	window_stack_pop_all(false);
	return 0;
}
Example #16
0
int main(void) {
  window = window_create();
  window_stack_push(window, true /* Animated */ );
  //accel_data_service_subscribe(0, handle_accel);//subscribe to the accel service
  window_set_click_config_provider(window, click_config_provider);
  psleep(1000);
  
  accel_tap_service_subscribe(&accel_tap_handler);
  
  Layer *window_layer = window_get_root_layer(window);
  GRect bounds = layer_get_frame(window_layer);
  text_layer = text_layer_create(bounds);
  char str[30];
  snprintf(str, 30, "Pebble Butt");
  text_layer_set_text(text_layer, str);
  text_layer_set_font(text_layer, fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD));
  text_layer_set_text_alignment(text_layer, GTextAlignmentCenter);
  layer_add_child(window_layer, text_layer_get_layer(text_layer));
  app_event_loop();  
  //destructor of the main func
  accel_tap_service_unsubscribe();
  text_layer_destroy(text_layer);
  window_destroy(window);
}
Example #17
0
static void window_load(Window *window) {

  int num_a_items = 0;
  int num_a2_items = 0;
  int num_a3_items = 0;
  int num_a4_items = 0;

  math_menu_items[num_a_items++] = (SimpleMenuItem){
    .title = "Algebra",
	.subtitle = "Algebraic Formulas",
    .callback = algebra_select_callback,
  };
  math_menu_items[num_a_items++] = (SimpleMenuItem){
    .title = "Geometry",
	.subtitle = "Geometric Formulas",
    .callback = geometry_select_callback,
  };
  math_menu_items[num_a_items++] = (SimpleMenuItem){
    .title = "Trigonometry",
	.subtitle = "Trig Formulas",
    .callback = trig_select_callback,
  };
  math_menu_items[num_a_items++] = (SimpleMenuItem){
    .title = "Calculus",
	.subtitle = "Calc Formulas",
    .callback = calc_select_callback,
  };
  //TC BEGIN
  trig_calc_menu_items[num_a2_items++] = (SimpleMenuItem){
    .title = "Trig",
	.subtitle = "Normal Trig",
    .callback = trig_deriv_select_callback,
  };
  trig_calc_menu_items[num_a2_items++] = (SimpleMenuItem){
    .title = "Inverse Trig",
  .subtitle = "Inverse Trig",
    .callback = inverse_trig_deriv_select_callback,
  };
  trig_calc_menu_items[num_a2_items++] = (SimpleMenuItem){
    .title = "Hyp. Trig",
  .subtitle = "Hyperbolic Trig",
    .callback = hyp_trig_select_callback,
  };
  trig_calc_menu_items[num_a2_items++] = (SimpleMenuItem){
    .title = "Inv. Hyp. Trig",
  .subtitle = "Inverse Hyp. Trig",
    .callback = inverse_hyp_trig_select_callback,
  };
  trig_calc_menu_items[num_a2_items++] = (SimpleMenuItem){
    .title = "Trig Limits",
  .subtitle = "Limits!",
    .callback = trig_limits_select_callback,
  };
  //TC END
  menu_sections[0] = (SimpleMenuSection){
  .title ="Math Formulas",
  .num_items = NUM_MATH_MENU_ITEMS,
  .items = math_menu_items,
  };
  menu_sections[1] = (SimpleMenuSection){
  .title ="Trig Calc Formulas",
  .num_items = NUM_TRIG_CALC_MENU_ITEMS,
  .items = trig_calc_menu_items,
  };
	
  Layer *window_layer = window_get_root_layer(window);
  GRect bounds = layer_get_frame(window_layer);

  simple_menu_layer = simple_menu_layer_create(bounds, window, menu_sections,NUM_MENU_SECTIONS, NULL);

  layer_add_child(window_layer, simple_menu_layer_get_layer(simple_menu_layer));
}

static void window_unload(Window *window) {
  simple_menu_layer_destroy(simple_menu_layer);
}

int main(void) {
  window = window_create();


  window_set_window_handlers(window, (WindowHandlers) {
    .load = window_load,
    .unload = window_unload,
  });

  window_stack_push(window, true /* Animated */);

  app_event_loop();

  window_destroy(window);
}
Example #18
0
int main(void) {
  initWF(layer_update_callback,timerHandler,watchfaceInit,watchfaceDestroy);
  app_event_loop();
  deinitWF();
}
Example #19
0
int main(void) {
  do_init();
  app_event_loop();
  do_deinit();
}
// The main program loop
int main(void) {
    init();
    app_event_loop();
    deinit();
}
Example #21
0
int main() {
  handle_init();
  app_event_loop();
  handle_deinit();
  return 0;
}
Example #22
0
static void main_window_load(Window *window) {
/*  menu icon load
  s_menu_icon_image = gbitmap_create_with_resource(RESOURCE_ID_IMAGE_MENU_ICON_1);
*/
  // Although we already defined NUM_FIRST_MENU_ITEMS, you can define
  // an int as such to easily change the order of menu items later
  int num_a_items = 0;

  s_first_menu_items[num_a_items++] = (SimpleMenuItem) {
    .title = "Weapon 1",
    .subtitle = "Choose This Weapon?",
    .callback = menu_select_callback,
  };
  s_first_menu_items[num_a_items++] = (SimpleMenuItem) {
    .title = "Weapon 2",
    .subtitle = "Choose This Weapon?",
    .callback = menu_select_callback,
  };
  s_first_menu_items[num_a_items++] = (SimpleMenuItem) {
    .title = "Third Item",
    .subtitle = "Choose This Weapon?",
    .callback = menu_select_callback,
    .icon = s_menu_icon_image,
  };

  s_second_menu_items[0] = (SimpleMenuItem) {
    .title = "Special Item",
    .callback = special_select_callback,
  };

  s_menu_sections[0] = (SimpleMenuSection) {
    .num_items = NUM_FIRST_MENU_ITEMS,
    .items = s_first_menu_items,
  };
  s_menu_sections[1] = (SimpleMenuSection) {
    .title = "Yet Another Section",
    .num_items = NUM_SECOND_MENU_ITEMS,
    .items = s_second_menu_items,
  };

  
  Layer *window_layer = window_get_root_layer(window);
  GRect bounds = layer_get_frame(window_layer);

  s_simple_menu_layer = simple_menu_layer_create(bounds, window, s_menu_sections, NUM_MENU_SECTIONS, NULL);

  layer_add_child(window_layer, simple_menu_layer_get_layer(s_simple_menu_layer));
}

void main_window_unload(Window *window) {
  simple_menu_layer_destroy(s_simple_menu_layer);
  gbitmap_destroy(s_menu_icon_image);
}

static void init() {
  s_main_window = window_create();
  window_set_window_handlers(s_main_window, (WindowHandlers) {
    .load = main_window_load,
    .unload = main_window_unload,
  });
  window_stack_push(s_main_window, true);
}

static void deinit() {
  window_destroy(s_main_window);
}

int main(void) {
  init();
  app_event_loop();
  deinit();
}