static UI_CALLBACK(activate_monitor) { int v; resources_get_int("MonitorServer", &v); if (v == 0) { #ifdef HAVE_FULLSCREEN fullscreen_suspend(0); #endif vsync_suspend_speed_eval(); ui_dispatch_events(); /* popdown the menu */ ui_autorepeat_on(); #ifdef HAVE_MOUSE ui_restore_mouse(); #endif if (!ui_emulation_is_paused()) { monitor_startup_trap(); } else { monitor_startup(e_default_space); #ifdef HAVE_FULLSCREEN fullscreen_resume(); #endif } } }
void ui_menu_update_all_GTK(void) { g_list_foreach(checkmark_list, menu_handle_block, (gpointer) 1); g_list_foreach(checkmark_list, menu_update_checkmarks, NULL); ui_dispatch_events(); g_list_foreach(checkmark_list, menu_handle_block, (gpointer) 0); }
console_t *uimon_window_resume(void) { gtk_widget_show_all(fixed.window); gtk_window_present (GTK_WINDOW(fixed.window)); ui_dispatch_events(); gdk_flush(); return &vte_console; }
console_t *uimon_window_resume(void) { gtk_widget_show_all(fixed.window); gtk_window_present(GTK_WINDOW(fixed.window)); screen_resize_window_cb (VTE_TERMINAL(fixed.term), NULL); ui_dispatch_events(); gdk_flush(); return &vte_console; }
static void vidmode_center_canvas(struct video_canvas_s *canvas) { Display *vm_display; if (vm_available == 0) { return; } if (active_canvas != canvas) { return; } vm_display = x11ui_get_display_ptr(); x11ui_move_canvas_window(canvas->emuwindow, 0, 0); ui_dispatch_events(); x11ui_canvas_position(canvas->emuwindow, &x, &y); XF86VidModeSetViewPort(vm_display, screen, x + xoffs, y + yoffs); ui_dispatch_events(); }
/* Report a message to the user, allow different buttons. */ ui_jam_action_t ui_jam_dialog(const char *format, ...) { char str[1024]; va_list ap; static GtkWidget *jam_dialog, *message; gint res; if (console_mode) { va_start(ap, format); vfprintf(stderr, format, ap); va_end(ap); exit(0); } vsync_suspend_speed_eval(); jam_dialog = gtk_dialog_new_with_buttons("", NULL, GTK_DIALOG_DESTROY_WITH_PARENT, _("Reset"), 0, _("Hard Reset"), 1, _("Monitor"), 2, _("Continue"), 3, NULL); g_signal_connect(G_OBJECT(jam_dialog), "destroy", G_CALLBACK(gtk_widget_destroyed), &jam_dialog); va_start(ap, format); vsprintf(str, format, ap); va_end(ap); message = gtk_label_new(str); gtk_box_pack_start(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(jam_dialog))), message, TRUE, TRUE, 0); gtk_widget_show(message); gtk_dialog_set_default_response(GTK_DIALOG(jam_dialog), 0); ui_popup(jam_dialog, "VICE", FALSE); res = gtk_dialog_run(GTK_DIALOG(jam_dialog)); ui_popdown(jam_dialog); if (jam_dialog) { gtk_widget_destroy(jam_dialog); } ui_dispatch_events(); switch (res) { case 3: return UI_JAM_NONE; case 2: ui_restore_mouse(); #ifdef HAVE_FULLSCREEN fullscreen_suspend(0); #endif return UI_JAM_MONITOR; case 1: return UI_JAM_HARD_RESET; case 0: default: return UI_JAM_RESET; } return 0; }
void ui_exit(void) { ui_button_t b; int value1, value2; char *s = util_concat(_("Exit "), (machine_class != VICE_MACHINE_VSID) ? machine_name : "SID", _(" emulator"), NULL); #ifdef HAVE_FULLSCREEN fullscreen_suspend(1); #endif resources_get_int("ConfirmOnExit", &value1); resources_get_int("SaveResourcesOnExit", &value2); b = UI_BUTTON_YES; if ((value1) && (!value2)) { b = ui_ask_yesno(s, _("Do you really want to exit?")); } if (b == UI_BUTTON_YES) { if (value2) { b = UI_BUTTON_YES; if (value1) { b = ui_ask_confirmation(s, _("Save the current settings?")); } if (b == UI_BUTTON_YES) { if (resources_save(NULL) < 0) { ui_error(_("Cannot save settings.")); b = UI_BUTTON_CANCEL; } } } if (b != UI_BUTTON_CANCEL) { /* ui_autorepeat_on(); */ ui_restore_mouse(); #ifdef HAVE_FULLSCREEN fullscreen_suspend(0); #endif ui_dispatch_events(); lib_free(s); #ifdef USE_UI_THREADS dthread_shutdown(); #endif exit(0); }; } lib_free(s); vsync_suspend_speed_eval(); }
static void vidmode_resize_canvas(struct video_canvas_s *canvas, int uienable) { int status_h = 0; int fs_h, fs_w; Display *vm_display; if (vm_available == 0) { return; } vm_display = x11ui_get_display_ptr(); #ifdef HAVE_FULLSCREEN if (uienable) { status_h = canvas->fullscreenconfig->ui_border_top + canvas->fullscreenconfig->ui_border_bottom; } #endif /* fs_w = ((float)vm->hdisplay * get_aspect(canvas)); */ fs_h = vm->vdisplay; fs_w = vm->hdisplay; if (canvas->videoconfig->doublesizex) { xoffs = ((fs_w) - (vm->hdisplay)); fs_w /= 2; } else { xoffs = (fs_w / 2) - (vm->hdisplay / 2); } if (canvas->videoconfig->doublesizey) { yoffs = ((fs_h) - (vm->vdisplay)); fs_h -= status_h; fs_h /= 2; } else { yoffs = (fs_h / 2) - (vm->vdisplay / 2); fs_h -= status_h; } fs_w += (EXTRA_BORDER * 2); fs_h += (EXTRA_BORDER * 2); xoffs += EXTRA_BORDER; yoffs += EXTRA_BORDER; canvas->draw_buffer->canvas_width = fs_w; canvas->draw_buffer->canvas_height = fs_h; video_viewport_resize(canvas); ui_dispatch_events(); }
/* Message Helper */ static void ui_message2(const GtkMessageType type, const char *msg, const char *title) { static GtkWidget* msgdlg; vsync_suspend_speed_eval(); msgdlg = gtk_message_dialog_new(GTK_WINDOW(get_active_toplevel()), GTK_DIALOG_DESTROY_WITH_PARENT, type, GTK_BUTTONS_OK, msg, NULL); ui_popup(msgdlg, title, FALSE); gtk_dialog_run(GTK_DIALOG(msgdlg)); ui_unblock_shells(); /* ui_popdown can't be used in message_boxes */ gtk_widget_destroy(msgdlg); /* still needed ? */ ui_check_mouse_cursor(); ui_dispatch_events(); }
static UI_CALLBACK(activate_monitor) { #ifdef HAVE_FULLSCREEN fullscreen_suspend(0); #endif vsync_suspend_speed_eval(); ui_dispatch_events(); /* popdown the menu */ ui_autorepeat_on(); #ifdef HAVE_MOUSE ui_restore_mouse(); #endif if (!ui_emulation_is_paused()) monitor_startup_trap(); else monitor_startup(); }
void vsyncarch_postsync(void) { /* Dispatch all the pending UI events. */ ui_dispatch_events(); }
void vidmode_resize(struct video_canvas_s *canvas, int uienable) { vidmode_resize_canvas(canvas, uienable); vidmode_center_canvas(canvas); ui_dispatch_events(); }