void gnome_calendar_a11y_init (void) { /* we only add focus watcher when accessibility is enabled */ if (atk_get_root ()) { EA_SET_FACTORY (gnome_calendar_get_type(), ea_gnome_calendar); /* force loading some types */ e_text_type = g_type_class_ref (E_TYPE_TEXT); pixbuf_type = g_type_class_ref (GNOME_TYPE_CANVAS_PIXBUF); e_day_view_type = g_type_class_ref (e_day_view_get_type ()); e_week_view_type = g_type_class_ref (e_week_view_get_type ()); e_day_view_main_item_type = g_type_class_ref (e_day_view_main_item_get_type ()); e_week_view_main_item_type = g_type_class_ref (e_week_view_main_item_get_type ()); g_signal_add_emission_hook (g_signal_lookup ("event", E_TYPE_TEXT), 0, ea_calendar_focus_watcher, NULL, (GDestroyNotify) NULL); g_signal_add_emission_hook (g_signal_lookup ("event", GNOME_TYPE_CANVAS_PIXBUF), 0, ea_calendar_focus_watcher, NULL, (GDestroyNotify) NULL); g_signal_add_emission_hook (g_signal_lookup ("event-after", e_day_view_get_type()), 0, ea_calendar_focus_watcher, NULL, (GDestroyNotify) NULL); g_signal_add_emission_hook (g_signal_lookup ("event", e_day_view_main_item_get_type()), 0, ea_calendar_focus_watcher, NULL, (GDestroyNotify) NULL); g_signal_add_emission_hook (g_signal_lookup ("event-after", e_week_view_get_type()), 0, ea_calendar_focus_watcher, NULL, (GDestroyNotify) NULL); g_signal_add_emission_hook (g_signal_lookup ("event", e_week_view_main_item_get_type()), 0, ea_calendar_focus_watcher, NULL, (GDestroyNotify) NULL); } }
bool wxGLCanvas::Create( wxWindow *parent, const wxGLContext *shared, const wxGLCanvas *shared_context_of, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name, int *attribList, const wxPalette& palette) { m_sharedContext = (wxGLContext*)shared; // const_cast m_sharedContextOf = (wxGLCanvas*)shared_context_of; // const_cast m_glContext = (wxGLContext*) NULL; m_exposed = false; m_noExpose = true; m_nativeSizeEvent = true; m_fbc = NULL; m_vi = NULL; // to be sure the glx version is known wxGLCanvas::QueryGLXVersion(); if (wxGLCanvas::GetGLXVersion() >= 13) { // GLX >= 1.3 uses a GLXFBConfig GLXFBConfig * fbc = NULL; if (wxTheApp->m_glFBCInfo != NULL) { fbc = (GLXFBConfig *) wxTheApp->m_glFBCInfo; m_canFreeFBC = false; // owned by wxTheApp - don't free upon destruction } else { fbc = (GLXFBConfig *) wxGLCanvas::ChooseGLFBC(attribList); m_canFreeFBC = true; } m_fbc = fbc; // save for later use wxCHECK_MSG( m_fbc, false, _T("required FBConfig couldn't be found") ); } XVisualInfo *vi = NULL; if (wxTheApp->m_glVisualInfo != NULL) { vi = (XVisualInfo *)wxTheApp->m_glVisualInfo; m_canFreeVi = false; // owned by wxTheApp - don't free upon destruction } else { if (wxGLCanvas::GetGLXVersion() >= 13) // GLX >= 1.3 vi = glXGetVisualFromFBConfig(GDK_DISPLAY(), m_fbc[0]); else // GLX <= 1.2 vi = (XVisualInfo *) ChooseGLVisual(attribList); m_canFreeVi = true; } m_vi = vi; // save for later use wxCHECK_MSG( m_vi, false, _T("required visual couldn't be found") ); // watch for the "parent-set" signal on m_wxwindow so we can set colormap // before m_wxwindow is realized (which will occur before // wxWindow::Create() returns if parent is already visible) unsigned sig_id = g_signal_lookup("parent-set", GTK_TYPE_WIDGET); g_signal_add_emission_hook(sig_id, 0, parent_set_hook, this, NULL); wxWindow::Create(parent, id, pos, size, style, name); m_glWidget = m_wxwindow; gtk_widget_set_double_buffered( m_glWidget, FALSE ); g_signal_connect(m_wxwindow, "realize", G_CALLBACK(gtk_glwindow_realized_callback), this); g_signal_connect(m_wxwindow, "map", G_CALLBACK(gtk_glwindow_map_callback), this); g_signal_connect(m_wxwindow, "expose_event", G_CALLBACK(gtk_glwindow_expose_callback), this); g_signal_connect(m_widget, "size_allocate", G_CALLBACK(gtk_glcanvas_size_callback), this); // if our parent window is already visible, we had been realized before we // connected to the "realize" signal and hence our m_glContext hasn't been // initialized yet and we have to do it now if (GTK_WIDGET_REALIZED(m_wxwindow)) gtk_glwindow_realized_callback( m_wxwindow, this ); if (GTK_WIDGET_MAPPED(m_wxwindow)) gtk_glwindow_map_callback( m_wxwindow, this ); return true; }
bool wxGLCanvas::Create(wxWindow *parent, const wxGLAttributes& dispAttrs, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name, const wxPalette& palette) { #if wxUSE_PALETTE wxASSERT_MSG( !palette.IsOk(), wxT("palettes not supported") ); #endif // wxUSE_PALETTE wxUnusedVar(palette); // Unused when wxDEBUG_LEVEL==0 m_exposed = false; m_noExpose = true; m_nativeSizeEvent = true; #ifdef __WXGTK3__ m_cairoPaintContext = NULL; m_backgroundStyle = wxBG_STYLE_PAINT; #endif if ( !InitVisual(dispAttrs) ) return false; // watch for the "parent-set" signal on m_wxwindow so we can set colormap // before m_wxwindow is realized (which will occur before // wxWindow::Create() returns if parent is already visible) unsigned sig_id = g_signal_lookup("parent-set", GTK_TYPE_WIDGET); g_signal_add_emission_hook(sig_id, 0, parent_set_hook, this, NULL); wxWindow::Create( parent, id, pos, size, style, name ); gtk_widget_set_double_buffered(m_wxwindow, false); #if WXWIN_COMPATIBILITY_2_8 g_signal_connect(m_wxwindow, "realize", G_CALLBACK(gtk_glwindow_realized_callback), this); #endif // WXWIN_COMPATIBILITY_2_8 #ifdef __WXGTK3__ g_signal_connect(m_wxwindow, "draw", G_CALLBACK(draw), this); #else g_signal_connect(m_wxwindow, "map", G_CALLBACK(gtk_glwindow_map_callback), this); g_signal_connect(m_wxwindow, "expose_event", G_CALLBACK(gtk_glwindow_expose_callback), this); #endif g_signal_connect(m_widget, "size_allocate", G_CALLBACK(gtk_glcanvas_size_callback), this); #if WXWIN_COMPATIBILITY_2_8 // if our parent window is already visible, we had been realized before we // connected to the "realize" signal and hence our m_glContext hasn't been // initialized yet and we have to do it now if (gtk_widget_get_realized(m_wxwindow)) gtk_glwindow_realized_callback( m_wxwindow, this ); #endif // WXWIN_COMPATIBILITY_2_8 #ifndef __WXGTK3__ if (gtk_widget_get_mapped(m_wxwindow)) gtk_glwindow_map_callback( m_wxwindow, this ); #endif return true; }
static void parasite_actionlist_init(ParasiteActionList *actionlist, ParasiteActionListClass *klass) { GtkCellRenderer *renderer; GtkTreeViewColumn *column; GTypeClass *uimanager_type; guint uimanager_signal; actionlist->priv = PARASITE_ACTIONLIST_GET_PRIVATE(actionlist); actionlist->priv->uimanagers = NULL; actionlist->priv->model = gtk_tree_store_new(NUM_COLUMNS, G_TYPE_STRING, // ACTION_LABEL G_TYPE_STRING, // ACTION_NAME G_TYPE_STRING, // ACTION_ICON G_TYPE_STRING, // ROW_COLOR, G_TYPE_STRING, // SORT_NAME G_TYPE_POINTER); // ADDRESS gtk_tree_view_set_model(GTK_TREE_VIEW(actionlist), GTK_TREE_MODEL(actionlist->priv->model)); column = gtk_tree_view_column_new(); gtk_tree_view_append_column(GTK_TREE_VIEW(actionlist), column); gtk_tree_view_column_set_title(column, "Label"); renderer = gtk_cell_renderer_pixbuf_new(); gtk_tree_view_column_pack_start(column, renderer, FALSE); gtk_tree_view_column_set_attributes(column, renderer, "stock-id", ACTION_ICON, NULL); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_column_pack_start(column, renderer, FALSE); gtk_tree_view_column_set_attributes(column, renderer, "text", ACTION_LABEL, "foreground", ROW_COLOR, NULL); renderer = gtk_cell_renderer_text_new(); column = gtk_tree_view_column_new_with_attributes("Action", renderer, "text", ACTION_NAME, "foreground", ROW_COLOR, NULL); gtk_tree_view_append_column(GTK_TREE_VIEW(actionlist), column); gtk_tree_sortable_set_sort_column_id( GTK_TREE_SORTABLE(actionlist->priv->model), SORT_NAME, GTK_SORT_ASCENDING); // Listen to all "actions-changed" signal emissions uimanager_type = g_type_class_ref(GTK_TYPE_UI_MANAGER); uimanager_signal = g_signal_lookup("actions-changed", GTK_TYPE_UI_MANAGER); g_signal_add_emission_hook(uimanager_signal, 0, actions_changed_cb, actionlist, NULL); g_type_class_unref(uimanager_type); }
/* A browser window was added */ static void _interface_tweaks_on_add_browser(InterfaceTweaks *self, MidoriBrowser *inBrowser, gpointer inUserData) { g_return_if_fail(IS_INTERFACE_TWEAKS(self)); g_return_if_fail(MIDORI_IS_BROWSER(inBrowser)); InterfaceTweaksPrivate *priv=self->priv; GtkNotebook *notebook; GList *tabs, *iter; InterfaceTweaksLocationbarLookup locationbar; GtkEntryCompletion *completion; guint keyPressSignalID; gulong hookID; /* Set up all current available tabs in browser */ tabs=midori_browser_get_tabs(inBrowser); for(iter=tabs; iter; iter=g_list_next(iter)) { _interface_tweaks_on_add_tab(self, iter->data, inBrowser); } g_list_free(tabs); /* Listen to new tabs opened in browser */ g_signal_connect_swapped(inBrowser, "add-tab", G_CALLBACK(_interface_tweaks_on_add_tab), self); notebook=NULL; g_object_get(inBrowser, "notebook", ¬ebook, NULL); if(notebook) { g_signal_connect_swapped(notebook, "page-added", G_CALLBACK(_interface_tweaks_on_tab_reordered), self); g_signal_connect_swapped(notebook, "page-reordered", G_CALLBACK(_interface_tweaks_on_tab_reordered), self); g_object_unref(notebook); } /* Listen to locationbar signals */ _interface_tweaks_find_browser_locationbar(inBrowser, &locationbar); if(locationbar.widget) { /* Add completion to location entry and setup signals */ completion=gtk_entry_completion_new(); gtk_entry_completion_set_inline_completion(completion, TRUE); gtk_entry_completion_set_inline_selection(completion, FALSE); gtk_entry_completion_set_popup_completion(completion, FALSE); gtk_entry_completion_set_model(completion, GTK_TREE_MODEL(priv->completionModel)); gtk_entry_completion_set_text_column(completion, 0); gtk_entry_set_completion(GTK_ENTRY(locationbar.widget), completion); g_signal_connect_swapped(completion, "insert-prefix", G_CALLBACK(_interface_tweaks_on_insert_prefix), self); g_object_unref(completion); /* Add emission handler to entry if it does not exist to ensure that * our "key-press-event" handler gets called first */ hookID=GPOINTER_TO_SIZE(g_object_get_data(G_OBJECT(locationbar.widget), "interface-tweaks-hook-id")); if(hookID==0) { keyPressSignalID=g_signal_lookup("key-press-event", GTK_TYPE_ENTRY); hookID=g_signal_add_emission_hook(keyPressSignalID, 0, _interface_tweaks_on_key_press_event, locationbar.widget, NULL); g_object_set_data(G_OBJECT(locationbar.widget), "interface-tweaks-hook-id", GSIZE_TO_POINTER(hookID)) ; } /* Add signal to recognize widget destruction to release emission hook */ g_signal_connect_swapped(locationbar.widget, "destroy", G_CALLBACK(_interface_tweaks_on_destroyed), self); } }
int main (int argc, char **argv) { gint i; GTest *test1, *test2; GArray *test_threads; const gint n_threads = 1; #ifdef SYMBIAN g_log_set_handler (NULL, G_LOG_FLAG_FATAL| G_LOG_FLAG_RECURSION | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING | G_LOG_LEVEL_MESSAGE | G_LOG_LEVEL_INFO | G_LOG_LEVEL_DEBUG, &mrtLogHandler, NULL); g_set_print_handler(mrtPrintHandler); #endif /*SYMBIAN*/ g_thread_init (NULL); #ifndef SYMBIAN g_print ("START: %s\n", argv[0]); #else #ifdef VERBOSE g_print ("START: %s\n", argv[0]); #endif #endif /*SYMBIAN*/ g_log_set_always_fatal (G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | g_log_set_always_fatal (G_LOG_FATAL_MASK)); g_type_init (); test1 = g_object_new (G_TYPE_TEST, NULL); test2 = g_object_new (G_TYPE_TEST, NULL); g_signal_connect (test1, "notify::test-prop", G_CALLBACK (notify), NULL); g_signal_connect (test1, "test-signal1", G_CALLBACK (notify), NULL); g_signal_connect (test1, "test-signal2", G_CALLBACK (notify), NULL); #ifndef SYMBIAN test_threads = g_array_new (FALSE, FALSE, sizeof (GThread *)); stopping = FALSE; for (i = 0; i < n_threads; i++) { GThread *thread; thread = g_thread_create ((GThreadFunc) run_thread, test1, TRUE, NULL); g_array_append_val (test_threads, thread); thread = g_thread_create ((GThreadFunc) run_thread, test2, TRUE, NULL); g_array_append_val (test_threads, thread); } g_usleep (500000); stopping = TRUE; g_print ("\nstopping\n"); /* join all threads */ for (i = 0; i < 2 * n_threads; i++) { GThread *thread; thread = g_array_index (test_threads, GThread *, i); g_thread_join (thread); } g_print ("stopped:%d\n",TESTNUM); #else #ifdef MULTITHREAD test_threads = g_array_new (FALSE, FALSE, sizeof (GThread *)); stopping = FALSE; TESTNUM=1; notifynum=0; handlernum=0; for (i = 0; i < n_threads; i++) { GThread *thread; thread = g_thread_create ((GThreadFunc) run_thread, test1, TRUE, NULL); g_array_append_val (test_threads, thread); thread = g_thread_create ((GThreadFunc) run_thread, test2, TRUE, NULL); g_array_append_val (test_threads, thread); } g_usleep (500000); stopping = TRUE; #ifdef VERBOSE g_print ("\nstopping\n"); #endif /* join all threads */ for (i = 0; i < 2 * n_threads; i++) { GThread *thread; thread = g_array_index (test_threads, GThread *, i); g_thread_join (thread); } g_assert(notifynum != 0); g_assert(handlernum == 0); g_array_free (test_threads, TRUE); #ifdef VERBOSE g_print ("Signals.c: completed for TESTNUM = %d\n",TESTNUM); #endif test_threads = g_array_new (FALSE, FALSE, sizeof (GThread *)); stopping = FALSE; TESTNUM=2; notifynum=0; handlernum=0; for (i = 0; i < n_threads; i++) { GThread *thread; thread = g_thread_create ((GThreadFunc) run_thread, test1, TRUE, NULL); g_array_append_val (test_threads, thread); thread = g_thread_create ((GThreadFunc) run_thread, test2, TRUE, NULL); g_array_append_val (test_threads, thread); } g_usleep (500000); stopping = TRUE; #ifdef VERBOSE g_print ("\nstopping\n"); #endif /* join all threads */ for (i = 0; i < 2 * n_threads; i++) { GThread *thread; thread = g_array_index (test_threads, GThread *, i); g_thread_join (thread); } g_assert(notifynum != 0); g_assert(handlernum != 0); g_array_free (test_threads, TRUE); #ifdef VERBOSE g_print ("Signals.c: completed for TESTNUM = %d\n",TESTNUM); #endif test_threads = g_array_new (FALSE, FALSE, sizeof (GThread *)); stopping = FALSE; TESTNUM=3; notifynum=0; handlernum=0; for (i = 0; i < n_threads; i++) { GThread *thread; thread = g_thread_create ((GThreadFunc) run_thread, test1, TRUE, NULL); g_array_append_val (test_threads, thread); thread = g_thread_create ((GThreadFunc) run_thread, test2, TRUE, NULL); g_array_append_val (test_threads, thread); } g_usleep (5000000); stopping = TRUE; #ifdef VERBOSE g_print ("\nstopping\n"); #endif /* join all threads */ for (i = 0; i < 2 * n_threads; i++) { GThread *thread; thread = g_array_index (test_threads, GThread *, i); g_thread_join (thread); } g_assert(notifynum != 0); g_assert(handlernum == 0); g_array_free (test_threads, TRUE); #ifdef VERBOSE g_print ("Signals.c: completed for TESTNUM = %d\n",TESTNUM); #endif #else /* ! MULTITHREAD*/ TESTNUM=1; #ifdef VERBOSE g_print ("\nStarting with TESTNUM=%d\n",TESTNUM); #endif notifynum=0; handlernum=0; run_thread(test1); g_assert(notifynum == LOOP +1); g_assert(handlernum ==0); notifynum=0; handlernum=0; run_thread(test2); g_assert(notifynum == 0); g_assert(handlernum == 0); TESTNUM=2; #ifdef VERBOSE g_print ("\nStarting with TESTNUM=%d\n",TESTNUM); #endif notifynum=0; handlernum=0; run_thread(test1); g_assert(notifynum == LOOP+1); g_assert(handlernum == LOOP+1); notifynum=0; handlernum=0; run_thread(test2); g_assert(notifynum == 0); g_assert(handlernum == LOOP+1); TESTNUM=3; #ifdef VERBOSE g_print ("\nStarting with TESTNUM=%d\n",TESTNUM); #endif notifynum=0; handlernum=0; run_thread(test1); g_assert(notifynum == LOOP +1); g_assert(handlernum ==0); notifynum=0; handlernum=0; run_thread(test2); g_assert(notifynum == 0); g_assert(handlernum == 0); g_assert(g_signal_has_handler_pending(G_OBJECT(test1),g_signal_lookup("test-signal2",G_TYPE_TEST),NULL,TRUE)==TRUE); g_assert(g_signal_has_handler_pending(G_OBJECT(test2),g_signal_lookup("test-signal2",G_TYPE_TEST),NULL,TRUE)==FALSE); g_assert(g_signal_handler_is_connected(G_OBJECT(test1),g_signal_lookup("test-signal1",G_TYPE_TEST))==TRUE); g_assert(g_signal_handler_is_connected(G_OBJECT(test2),g_signal_lookup("test-signal2",G_TYPE_TEST))==FALSE); handlernum=g_signal_lookup("test-signal1",G_TYPE_TEST); #ifdef VERBOSE g_print("Signal id: %d\n",handlernum); #endif g_signal_connect (test2, "test-signal1", G_CALLBACK (notify), NULL); hookid=g_signal_add_emission_hook(handlernum,NULL,(GSignalEmissionHook) hook_function,NULL,NULL); #ifdef VERBOSE g_print("Hookid: %d\n",hookid); #endif /********************/ #ifdef TEST_STOP_EMISSION /* notifynum=0; handlernum=0; g_print("The following call stops signal emission\n"); g_signal_stop_emission(G_OBJECT(test1),g_signal_lookup("test-signal1",G_TYPE_TEST),0); g_print("The following call should abort and it is normal\n"); run_thread(test1); printf("Notifynum: %d and Handlernum: %d\n",notifynum,handlernum); */ notifynum=0; handlernum=0; g_signal_stop_emission_by_name(G_OBJECT(test1),"test-signal1"); //run_thread(test1); g_print("Notifynum: %d and Handlernum: %d\n",notifynum,handlernum); #endif /*TEST_STOP_EMISSION*/ /*******************/ handlernum=0; g_signal_emit(G_OBJECT (test1), g_test_signals[TEST_SIGNAL1], 0, 0); g_signal_emit(G_OBJECT (test2), g_test_signals[TEST_SIGNAL1], 0, 0); g_assert(handlernum==2); g_signal_remove_emission_hook(g_signal_lookup("test-signal1",G_TYPE_TEST),hookid); #ifdef VERBOSE g_print("Emitting signal again after removing emission hook\n"); #endif handlernum=0; g_signal_emit (G_OBJECT (test1), g_test_signals[TEST_SIGNAL1], 0, 0); g_signal_emit (G_OBJECT (test2), g_test_signals[TEST_SIGNAL1], 0, 0); g_assert(handlernum==0); g_assert (strcmp ("test-signal1", g_signal_name (g_signal_lookup("test-signal1",G_TYPE_TEST))) == 0); g_assert (strcmp ("test-signal2", g_signal_name (g_signal_lookup("test-signal2",G_TYPE_TEST))) == 0); memset(&gv,0,sizeof(gv)); g_value_init(&gv,G_TYPE_OBJECT); g_value_set_object(&gv,test1); gi=0; g_signal_list_ids(G_OBJECT_TYPE(test1),&gi); g_assert(g_signal_lookup("test-signal1",G_TYPE_TEST)==gi); notifynum=0; g_signal_emitv (&gv, g_test_signals[TEST_SIGNAL1], 0, &gv); g_assert(notifynum==1); g_signal_query(g_signal_lookup("test-signal1",G_TYPE_TEST),&gq); g_assert(strcmp("test-signal1",gq.signal_name)==0); g_assert(g_signal_lookup("test-signal1",G_TYPE_TEST)==gq.signal_id); g_assert(g_signal_handler_find(G_OBJECT(test1), G_SIGNAL_RUN_LAST,g_signal_lookup("test-signal2",G_TYPE_TEST),NULL,NULL,NULL,NULL)==2); notifynum=g_signal_handlers_block_matched(G_OBJECT(test1),G_SIGNAL_MATCH_FUNC,g_signal_lookup("test-signal2",G_TYPE_TEST),NULL,NULL,(gpointer)G_CALLBACK(notify),NULL); handlernum=g_signal_handlers_unblock_matched(G_OBJECT(test1),G_SIGNAL_MATCH_FUNC,g_signal_lookup("test-signal2",G_TYPE_TEST),NULL,NULL,(gpointer)G_CALLBACK(notify),NULL); g_assert(notifynum==handlernum); #endif /*MULTITHREAD*/ #ifdef VERBOSE g_printf ("\nsignals-multithread.c: Completed all tests\n"); #endif #endif /*SYMBIAN*/ #if SYMBIAN testResultXml("signals-singlethread"); #endif /* EMULATOR */ return 0; }
static void oregano_application (GApplication *app, GFile *file) { Schematic *schematic = NULL ; SchematicView *schematic_view = NULL; gchar *msg; Splash *splash = NULL; GError *error = NULL; // Keep non localized input for ngspice setlocale (LC_NUMERIC, "C"); if (oregano.show_splash) { splash = oregano_splash_new (&error); if (error) { msg = g_strdup_printf (_("Failed to spawn splash-screen \'%s\''. Code %i - %s"), OREGANO_UIDIR "splash.ui", error->code, error->message); oregano_error (msg); g_free (msg); g_error_free (error); //non fatal issue } } //splash == NULL if showing splash is disabled oregano_lookup_libraries (splash); if (oregano.libraries == NULL) { oregano_error ( _("Could not find a parts library.\n\n" "Supposed to be in " OREGANO_LIBRARYDIR )); return; } oregano.clipboard = NULL; schematic = NULL; if (file) { GError *error = NULL; char *fname = g_file_get_parse_name (file); schematic = schematic_read (fname, &error); if (schematic) { schematic_view = schematic_view_new (schematic); gtk_widget_show_all (schematic_view_get_toplevel (schematic_view)); schematic_set_filename (schematic, fname); schematic_set_title (schematic, g_path_get_basename (fname)); } } else { schematic = schematic_new (); schematic_view = schematic_view_new (schematic); gtk_widget_show_all (schematic_view_get_toplevel (schematic_view)); } g_signal_add_emission_hook ( g_signal_lookup ("last_schematic_destroyed", TYPE_SCHEMATIC), 0, quit_hook, NULL, NULL); if (oregano.show_splash && splash) oregano_splash_done (splash, _("Welcome to Oregano")); }
int wxDialog::ShowModal() { WX_TESTING_SHOW_MODAL_HOOK(); wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" ); // release the mouse if it's currently captured as the window having it // will be disabled when this dialog is shown -- but will still keep the // capture making it impossible to do anything in the modal dialog itself wxWindow * const win = wxWindow::GetCapture(); if ( win ) win->GTKReleaseMouseAndNotify(); wxWindow * const parent = GetParentForModalDialog(); if ( parent ) { gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(parent->m_widget) ); } wxBusyCursorSuspender cs; // temporarily suppress the busy cursor #if GTK_CHECK_VERSION(2,10,0) unsigned sigId = 0; gulong hookId = 0; #ifndef __WXGTK3__ // Ubuntu overlay scrollbar uses at least GTK 2.24 if (gtk_check_version(2,24,0) == NULL) #endif { sigId = g_signal_lookup("realize", GTK_TYPE_WIDGET); hookId = g_signal_add_emission_hook(sigId, 0, realize_hook, NULL, NULL); } #endif Show( true ); m_modalShowing = true; wxOpenModalDialogsCount++; // NOTE: gtk_window_set_modal internally calls gtk_grab_add() ! gtk_window_set_modal(GTK_WINDOW(m_widget), TRUE); // Run modal dialog event loop. { wxGUIEventLoopTiedPtr modal(&m_modalLoop, new wxGUIEventLoop()); m_modalLoop->Run(); } #if GTK_CHECK_VERSION(2,10,0) if (sigId) g_signal_remove_emission_hook(sigId, hookId); #endif gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE); wxOpenModalDialogsCount--; return GetReturnCode(); }
int wxDialog::ShowModal() { WX_HOOK_MODAL_DIALOG(); wxASSERT_MSG( !IsModal(), "ShowModal() can't be called twice" ); // release the mouse if it's currently captured as the window having it // will be disabled when this dialog is shown -- but will still keep the // capture making it impossible to do anything in the modal dialog itself wxWindow * const win = wxWindow::GetCapture(); if ( win ) win->GTKReleaseMouseAndNotify(); wxWindow * const parent = GetParentForModalDialog(); if ( parent ) { gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(parent->m_widget) ); } #if GTK_CHECK_VERSION(2,10,0) unsigned sigId = 0; gulong hookId = 0; #ifndef __WXGTK3__ // Ubuntu overlay scrollbar uses at least GTK 2.24 if (gtk_check_version(2,24,0) == NULL) #endif { sigId = g_signal_lookup("realize", GTK_TYPE_WIDGET); hookId = g_signal_add_emission_hook(sigId, 0, realize_hook, NULL, NULL); } #endif // NOTE: this will cause a gtk_grab_add() during Show() gtk_window_set_modal(GTK_WINDOW(m_widget), true); Show( true ); m_modalShowing = true; wxOpenModalDialogLocker modalLock; // Prevent the widget from being destroyed if the user closes the window. // Needed for derived classes which bypass wxTLW::Create(), and therefore // the wxTLW "delete-event" handler is not connected gulong handler_id = g_signal_connect( m_widget, "delete-event", G_CALLBACK(gtk_true), this); // Run modal dialog event loop. { wxGUIEventLoopTiedPtr modal(&m_modalLoop, new wxGUIEventLoop()); m_modalLoop->Run(); } g_signal_handler_disconnect(m_widget, handler_id); #if GTK_CHECK_VERSION(2,10,0) if (sigId) g_signal_remove_emission_hook(sigId, hookId); #endif gtk_window_set_modal(GTK_WINDOW(m_widget), FALSE); return GetReturnCode(); }