Exemple #1
0
int main() {
	int ret = 0;

	picframe_init();


	arrow_setup();
//	clock_setup();

	weather_today_setup();
	weather_tomorrow_setup();
	weather_dayAfterTomorrow_setup();
	weather_dayAfterTomorrowPlus1_setup();

	curr_window = picframe_get_window(START_WINDOW);

	picframe_set_backlight(500);

	while (1) {

		picframe_clear_screen();

		switch (curr_window_idx) {
		/*
		case 1:
			ret = clock_loop();
			break;
		*/
		case 1:
			ret = weather_today_loop();
			break;
		case 2:
			ret = weather_tomorrow_loop();
			break;
		case 3:
			ret = weather_dayAfterTomorrow_loop();
			break;
		case 4:
			ret = weather_dayAfterTomorrowPlus1_loop();
			break;
		default:
			break;
		}
		if (ret == 1)
			goto cleanup;

	}

	// Try a friendly shotdown to prevent memory leaks...
	cleanup: picframe_cleanup();

	app_free();

	return 0;
}
int main() {
	int ret=0;

	picframe_init();

	first_window_setup();
	second_window_setup();
	third_window_setup();
	fourth_window_setup();
	fifth_window_setup();
	
	curr_window = picframe_get_window(START_WINDOW);

	picframe_set_backlight(500);

	while (1) {
		picframe_clear_screen();
		switch(curr_window_idx) {
			case 1:
				ret = first_window_loop();
				break;
			case 2:
				ret = second_window_loop();
				break;
			case 3:
				ret = third_window_loop();
				break;
			case 4:
				ret = fourth_window_loop();
				break;
			case 5:
				ret = fifth_window_loop();
				break;
			default:
				break;
		}	
		if (ret == 1) goto cleanup;

		picframe_update(curr_window);
		SDL_Delay(1);
	}

cleanup:
	picframe_cleanup();

	return 0;
}
int main() {

	int ret = 0;

	app_create();

	picframe_set_backlight(500);

	while (1) {

		picframe_clear_screen();

		if ((ret = window[curr_window_idx]->wndProc()) == 1)
			break;

	}

	app_free();

	return 0;
}
Exemple #4
0
int picframe_init() {
	_font = NULL;
	/* SDL Setup */
	if ( SDL_Init(SDL_INIT_VIDEO) < 0 )
	{
		fprintf(stderr, "Could not initialize SDL: %s\n", SDL_GetError());
	exit(1);
	}
	atexit(OnExit);
	/* Initialize our screen */
	_screen = SDL_SetVideoMode(WIDTH, HEIGHT, 32,
                               SDL_HWSURFACE );
	if ( _screen == NULL )
	{
		fprintf(stderr, "Could not setup screen to resolution %dx%d : %s\n",
		WIDTH, HEIGHT, SDL_GetError());
		exit(1);
	}
	/* Hide the mouse */
	SDL_ShowCursor(0); 
	/* Solid white background */
	picframe_clear_screen();
	/* Initialize the fonts */
	if ( TTF_Init() == -1 ) {
		fprintf(stderr, "Could not initalize SDL_ttf!\n");
		exit(1);
	}
	/* Load a default font */
//	picframe_load_font("/usr/share/fonts/Ubuntu-L.ttf", 20);

	/* Aight, lets make our first default window */
	_num_windows = 0;
//	struct LList_t *node = picframe_add_window();

	picframe_gpio_init();

	return 0;
}