void shelm_clock_dialog(const char *window_title, const char *window_text, int window_width, int window_height, const char *window_background, Eina_Bool show_seconds, Eina_Bool show_am_pm, const char *time, Eina_Bool is_editable) { Evas_Object *window, *background, *frame, *box, *clock, *buttonbar, *button_cancel, *button_ok; char buf[PATH_MAX]; if (window_title) window = create_window("shellementary-clockdialog", window_title, cancel_callback); else window = create_window("shellementary-clockdialog", _("Set the time"), cancel_callback); background = create_background(window, window_background, EINA_TRUE); elm_win_resize_object_add(window, background); evas_object_show(background); frame = create_frame(window, EINA_TRUE); elm_win_resize_object_add(window, frame); evas_object_show(frame); box = create_box(window, EINA_FALSE); elm_object_content_set(frame, box); evas_object_show(box); if (window_text) { Evas_Object *label; label = create_label(window, window_text); elm_box_pack_end(box, label); evas_object_show(label); } clock = create_clock(window, show_seconds, show_am_pm, time, is_editable); elm_box_pack_end(box, clock); evas_object_show(clock); buttonbar = create_box(window, EINA_TRUE); elm_box_pack_end(box, buttonbar); evas_object_show(buttonbar); snprintf(buf, sizeof(buf), "%s/icon-cancel.png", PACKAGE_DATA_DIR); button_cancel = create_button(window, buf, _("Cancel")); evas_object_smart_callback_add(button_cancel, "clicked", cancel_callback, NULL); elm_box_pack_start(buttonbar, button_cancel); evas_object_show(button_cancel); snprintf(buf, sizeof(buf), "%s/icon-ok.png", PACKAGE_DATA_DIR); button_ok = create_button(window, buf, _("OK")); evas_object_smart_callback_add(button_ok, "clicked", clock_callback, clock); elm_box_pack_end(buttonbar, button_ok); evas_object_show(button_ok); if (!window_width) evas_object_geometry_get(window, NULL, NULL, &window_width, NULL); if (!window_height) evas_object_geometry_get(window, NULL, NULL, NULL, &window_height); evas_object_resize(window, window_width, window_height); evas_object_show(window); }
/* * intro_init() * Initializes the introduction scene */ void intro_init(void *foo) { elapsed_time = 0.0f; must_fadein = TRUE; music_stop(); bg = create_background(); in = input_create_user(NULL); }
void shelm_simple_dialog(const char *window_title, const char *window_text, int window_width, int window_height, const char *window_background, const char *window_icccm_name, const char *window_default_title, const char *window_default_icon) { Evas_Object *window, *background, *frame, *box, *hbox, *icon, *button_ok; char buf[PATH_MAX]; snprintf(buf, sizeof(buf), "shellementary-%s", window_icccm_name); if (window_title) window = create_window(buf, window_title, destroy); else window = create_window(buf, window_default_title, destroy); background = create_background(window, window_background, EINA_FALSE); elm_win_resize_object_add(window, background); evas_object_show(background); frame = create_frame(window, EINA_FALSE); elm_win_resize_object_add(window, frame); evas_object_show(frame); box = create_box(window, EINA_FALSE); elm_object_content_set(frame, box); evas_object_show(box); hbox = create_box(window, EINA_TRUE); elm_box_pack_end(box, hbox); evas_object_show(hbox); icon = create_icon(window, window_default_icon); elm_box_pack_start(hbox, icon); evas_object_show(icon); if (window_text) { Evas_Object *label; label = create_label(window, window_text); elm_box_pack_end(hbox, label); evas_object_show(label); } snprintf(buf, sizeof(buf), "%s/icon-ok.png", PACKAGE_DATA_DIR); button_ok = create_button(window, buf, _("OK")); evas_object_smart_callback_add(button_ok, "clicked", destroy, NULL); elm_box_pack_end(box, button_ok); evas_object_show(button_ok); if (!window_width) evas_object_geometry_get(window, NULL, NULL, &window_width, NULL); if (!window_height) evas_object_geometry_get(window, NULL, NULL, NULL, &window_height); evas_object_resize(window, window_width, window_height); evas_object_show(window); }
PingusMenu::PingusMenu() : is_init(), hint(), help(), text_scroll_offset(), background(), logo(), start_button(), quit_button(), editor_button(), contrib_button(), options_button() { is_init = false; Size size_(Display::get_width(), Display::get_height()); start_button = gui_manager->create<MenuButton>( this, Vector2i(size_.width/2 - 125, size_.height/2 - 20), _("Story"), _("..:: Start the game ::..")); editor_button = gui_manager->create<MenuButton>( this, Vector2i(size_.width/2 + 125, size_.height/2 - 20), _("Editor"), _("..:: Create your own levels ::..")); options_button = gui_manager->create<MenuButton>( this, Vector2i(size_.width/2 + 125, size_.height/2 + 50), _("Options"), _("..:: Configure the game ::..")); contrib_button = gui_manager->create<MenuButton>( this, Vector2i(size_.width/2 - 125, size_.height/2 + 50), _("Levelsets"), _("..:: Play User Built levels ::..")); quit_button = gui_manager->create<MenuButton>( this, Vector2i(size_.width/2, size_.height/2 + 120), _("Exit"), _("..:: Bye, bye ::..")); logo = Sprite("core/misc/logo"); create_background(Size(Display::get_width(), Display::get_height())); help = _("..:: Ctrl-g: mouse grab :: F10: fps counter :: F11: fullscreen :: F12: screenshot ::.."); Sound::PingusSound::play_music("pingus-1.it"); }
void PingusMenu::resize(const Size& size_) { GUIScreen::resize(size_); create_background(size); start_button->set_pos(size.width/2 - 125, size.height/2 - 20); editor_button->set_pos(size.width/2 + 125, size.height/2 - 20); contrib_button->set_pos(size.width/2 - 125, size.height/2 + 50); options_button->set_pos(size.width/2 + 125, size.height/2 + 50); quit_button->set_pos(size.width/2, size.height/2 + 120); }
void shelm_about_dialog() { Evas_Object *window, *background, *frame, *box, *icon, *label, *sublabel, *scroller, *textinfo, *buttonbar, *button_close; char buf[PATH_MAX]; window = create_window("shellementary-about", _("About Shellementary"), destroy); background = create_background(window, NULL, EINA_TRUE); elm_win_resize_object_add(window, background); evas_object_show(background); frame = create_frame(window, EINA_FALSE); elm_win_resize_object_add(window, frame); evas_object_show(frame); box = create_box(window, EINA_FALSE); elm_object_content_set(frame, box); evas_object_show(box); snprintf(buf, sizeof(buf), "%s/logo.png", PACKAGE_DATA_DIR); icon = create_icon(window, buf); elm_box_pack_start(box, icon); evas_object_show(icon); snprintf(buf, sizeof(buf), "<b>Shellementary %s</>", PACKAGE_VERSION); label = create_label(window, buf); elm_object_scale_set(label, 1.6); elm_box_pack_end(box, label); evas_object_show(label); sublabel = create_label(window, _("<b>Display dialogs from shell scripts</><br>Written as a zenity replacement, supports the same arguments<br><b>http://svn.enlightenment.org/svn/e/trunk/PROTO/shellementary</><br>Based on great Elementary toolkit by <b>raster</> and C programming language.<br><b>License:</> MIT")); elm_box_pack_end(box, sublabel); evas_object_show(sublabel); scroller = create_scroller(window, EINA_TRUE); elm_box_pack_end(box, scroller); evas_object_show(scroller); textinfo = create_entry(window, EINA_TRUE, NULL, EINA_FALSE, EINA_FALSE, EINA_FALSE); elm_entry_entry_set(textinfo, _("<b>Author:</> quaker ([email protected])<br>" "<br>" "<b>Credits:</><br>" "<b>Carsten Haitzler (raster)</> " "for Enlightenment DR17, great Elementary toolkit and help with developenment<br>" "<b>Christopher Michael (devilhorns)</> " "for help with developenment<br>")); elm_object_content_set(scroller, textinfo); evas_object_show(textinfo); buttonbar = create_box(window, EINA_TRUE); elm_box_pack_end(box, buttonbar); evas_object_show(buttonbar); snprintf(buf, sizeof(buf), "%s/icon-cancel.png", PACKAGE_DATA_DIR); button_close = create_button(window, buf, _("Close")); evas_object_smart_callback_add(button_close, "clicked", destroy, NULL); elm_box_pack_end(buttonbar, button_close); evas_object_show(button_close); evas_object_show(window); }
void shelm_entry_dialog(const char *window_title, const char *window_text, int window_width, int window_height, const char *window_background, const char *entry_text, Eina_Bool entry_hide_text) { Evas_Object *window, *background, *frame, *box, *scroller, *entry, *buttonbar, *button_cancel, *button_ok; char buf[PATH_MAX]; if (window_title) window = create_window("shellementary-entrydialog", window_title, cancel_callback); else window = create_window("shellementary-entrydialog", _("Enter something here"), cancel_callback); background = create_background(window, window_background, EINA_TRUE); elm_win_resize_object_add(window, background); evas_object_show(background); frame = create_frame(window, EINA_TRUE); elm_win_resize_object_add(window, frame); evas_object_show(frame); box = create_box(window, EINA_FALSE); elm_object_content_set(frame, box); evas_object_show(box); if (window_text) { Evas_Object *label; label = create_label(window, window_text); elm_box_pack_end(box, label); evas_object_show(label); } scroller = create_scroller(window, EINA_TRUE); elm_box_pack_end(box, scroller); evas_object_show(scroller); entry = create_entry(window, EINA_TRUE, entry_text, entry_hide_text, EINA_FALSE, EINA_TRUE); elm_object_content_set(scroller, entry); evas_object_show(entry); buttonbar = create_box(window, EINA_TRUE); elm_box_pack_end(box, buttonbar); evas_object_show(buttonbar); snprintf(buf, sizeof(buf), "%s/icon-cancel.png", PACKAGE_DATA_DIR); button_cancel = create_button(window, buf, _("Cancel")); evas_object_smart_callback_add(button_cancel, "clicked", cancel_callback, NULL); elm_box_pack_start(buttonbar, button_cancel); evas_object_show(button_cancel); snprintf(buf, sizeof(buf), "%s/icon-ok.png", PACKAGE_DATA_DIR); button_ok = create_button(window, buf, _("OK")); evas_object_smart_callback_add(button_ok, "clicked", entry_callback, entry); elm_box_pack_end(buttonbar, button_ok); evas_object_show(button_ok); if (!window_width) evas_object_geometry_get(window, NULL, NULL, &window_width, NULL); if (!window_height) evas_object_geometry_get(window, NULL, NULL, NULL, &window_height); evas_object_resize(window, window_width, window_height); evas_object_show(window); }