Exemple #1
0
int main(int argc, char **argv)
{
    struct sigaction act;
    act.sa_handler = signal_handler;
    
    sigaction(SIGWINCH, &act, NULL);

    /* TODO: Check that console is UTF-8 */
    if (setlocale(LC_ALL, "") == NULL) {
        printf("Could not set locale, please check your LC_ALL, LC_CTYPE\n");
        return 1;
    }    

    initscr();
    cbreak();
    noecho();
    keypad(stdscr, TRUE);

    main_window_init();

    while(main_window_event()) {
        /* This is main loop, nothing really usefull here */
    }
    

    endwin();

    return 0;
}
Exemple #2
0
int main (int argc, char *argv[])
{
    gtk_init(&argc, &argv);
    main_window_init();
    trayIcon_init();
    gtk_main();
    return 0;
}
Exemple #3
0
void game_init(game *game) {
    main_window_init(game, &game->main_window);

    game->correct = game->total = 0;
    game->clef = CLEF_TREBLE;
    game->next_clef_swap = 2 + rand() % 5;
    game->current_note = 0;

    srand(time(NULL));
    game_next_bar(game);
}
Exemple #4
0
static void init() {
  APP_LOG(APP_LOG_LEVEL_DEBUG, "start of init");
  autoconfig_init(512, 512);
  app_message_register_inbox_received(in_received_handler);
  main_window_set_config(getMinutes_color(), getMinutes_no_bt_color(), getHours_color(), getHours_no_bt_color(), getText_color(), getText_low_battery_color(), getBg_color(), getBar_radius(), getBar_offset(), getRing_markings(), getLow_bat_threshold());
  BT_VIBE = getBt_vibe();
  main_window_init();
  tick_timer_service_subscribe(MINUTE_UNIT, tick_handler);
  battery_state_service_subscribe(battery_callback);
  battery_callback(battery_state_service_peek());
  bluetooth_connection_service_subscribe(bluetooth_callback);
  bluetooth_callback(bluetooth_connection_service_peek());
  APP_LOG(APP_LOG_LEVEL_DEBUG, "end of init");
}