예제 #1
0
파일: popup.c 프로젝트: MrTraan/mehstation
void meh_screen_popup_render(struct App* app, Screen* screen) {
    PopupData* data = meh_screen_popup_get_data(screen);
    g_assert(data != NULL);

    /* render the background screen */
    gboolean* flip = g_new(gboolean, 1);
    *flip = FALSE;
    meh_message_send(app, data->src_screen, MEH_MSG_RENDER, flip);


    /* render the popup screen */

    meh_widget_rect_render(app->window, data->hover_widget);
    meh_widget_rect_render(app->window, data->background_widget);

    if (data->background_widget->y.ended) {
        /* title */
        meh_widget_rect_render(app->window, data->title_bg_widget);
        meh_widget_text_render(app->window, data->title_widget);

        meh_widget_rect_render(app->window, data->selection_widget);
        meh_widget_text_render(app->window, data->favorite_widget);
    }

    meh_window_render(app->window);
}
예제 #2
0
void meh_simple_popup_render(struct App* app, Screen* screen) {
	SimplePopupData* data = meh_simple_popup_get_data(screen);
	g_assert(data != NULL);

	/* render the background screen */
	gboolean* flip = g_new(gboolean, 1);
	*flip = FALSE;
	meh_message_send(app, data->src_screen, MEH_MSG_RENDER, flip);

	/* render the popup screen */

	meh_widget_rect_render(app->window, data->hover_widget);

	/* title */
	meh_widget_text_render(app->window, data->title_widget);

	meh_widget_rect_render(app->window, data->selection_widget);

	/* render the action */
	for (int i = 0; i < g_queue_get_length(data->actions); i++) {
		SimplePopupAction* action = g_queue_peek_nth(data->actions, i);
		meh_widget_text_render(app->window, action->widget);
	}

	meh_window_render(app->window);
}
예제 #3
0
void meh_exec_selection_render(App* app, Screen* screen) {
	ExecutableListData* data = meh_exec_list_get_data(screen);

	/* selection */
	meh_widget_rect_render(app->window, data->selection_widget);

	/* render all the executables names. */
	for (unsigned int i = 0; i < g_queue_get_length(data->executable_widgets); i++) {
		meh_widget_text_render(app->window, g_queue_peek_nth(data->executable_widgets, i));
	}
}
예제 #4
0
void meh_main_popup_render(struct App* app, Screen* screen) {
	MainPopupData* data = meh_main_popup_get_data(screen);
	g_assert(data != NULL);

	/* render the background screen */
	gboolean* flip = g_new(gboolean, 1);
	*flip = FALSE;
	meh_message_send(app, data->src_screen, MEH_MSG_RENDER, flip);

	/* render the popup screen */

	meh_widget_rect_render(app->window, data->hover_widget);

	/* title */
	meh_widget_text_render(app->window, data->title_widget);

	meh_widget_rect_render(app->window, data->selection_widget);

	meh_widget_text_render(app->window, data->random_widget);
	meh_widget_text_render(app->window, data->close_widget);
	meh_widget_text_render(app->window, data->shutdown_widget);

	meh_window_render(app->window);
}
예제 #5
0
/*
 * meh_screen_mapping_render is the rendering of the starting screen.
 */
void meh_screen_mapping_render(App* app, Screen* screen, gboolean flip) {
	g_assert(screen != NULL);
	g_assert(app != NULL);

	MappingData* data = meh_screen_mapping_get_data(screen);
	g_assert(data != NULL);

	/* clear the screen */
	SDL_Color black = { 0, 0, 0 };
	meh_window_clear(app->window, black);

	meh_widget_text_render(app->window, data->title);

	if (data->device_configuring != NULL) {
		meh_widget_text_render(app->window, data->device_configuring);
	}
	if (data->action != NULL) {
		meh_widget_text_render(app->window, data->action);
	}

	if (flip == TRUE) {
		meh_window_render(app->window);
	}
}