SPtr<App> App::create(Ingen::World* world) { // Add RC file for embedded GUI Gtk style const std::string rc_path = Ingen::data_file_path("ingen_style.rc"); Gtk::RC::add_default_file(rc_path); _main = Gtk::Main::instance(); if (!_main) { Glib::set_application_name("Ingen"); gtk_window_set_default_icon_name("ingen"); _main = new Gtk::Main(&world->argc(), &world->argv()); } App* app = new App(world); // Load configuration settings app->style()->load_settings(); app->style()->apply_settings(); // Set default window icon app->_about_dialog->property_program_name() = "Ingen"; app->_about_dialog->property_logo_icon_name() = "ingen"; gtk_window_set_default_icon_name("ingen"); return SPtr<App>(app); }
void mate_about_run(void) { mate_about_dialog = (MateAboutDialog*) mate_about_dialog_new(); GtkIconTheme* icon_theme = gtk_icon_theme_get_default(); if (gtk_icon_theme_has_icon(icon_theme, icon)) { gtk_window_set_default_icon_name(icon); mate_about_dialog_set_logo_icon_name(mate_about_dialog, icon); } else { gtk_window_set_default_icon_name(desktop_icon); mate_about_dialog_set_logo_icon_name(mate_about_dialog, desktop_icon); } // name mate_about_dialog_set_program_name(mate_about_dialog, gettext(program_name)); // version mate_about_dialog_set_version(mate_about_dialog, version); // credits and website mate_about_dialog_set_copyright(mate_about_dialog, copyright); mate_about_dialog_set_website(mate_about_dialog, website); /** * This generate a random message. * The comments index must not be more than comments_count - 1 */ mate_about_dialog_set_comments(mate_about_dialog, gettext(comments_array[g_random_int_range(0, comments_count - 1)])); mate_about_dialog_set_authors(mate_about_dialog, authors); mate_about_dialog_set_artists(mate_about_dialog, artists); mate_about_dialog_set_documenters(mate_about_dialog, documenters); /* Translators should localize the following string which will be * displayed in the about box to give credit to the translator(s). */ mate_about_dialog_set_translator_credits(mate_about_dialog, _("translator-credits")); #if GTK_CHECK_VERSION(3, 0, 0) gtk_window_set_application(GTK_WINDOW(mate_about_dialog), mate_about_application); #endif // start and destroy gtk_dialog_run((GtkDialog*) mate_about_dialog); gtk_widget_destroy((GtkWidget*) mate_about_dialog); }
int ui_gtk_initialize(int argc, char *argv[]) { GtkWidget *vbox; /* Create the main window */ ui_main_data.window = gtk_window_new (GTK_WINDOW_TOPLEVEL); ui_init_filters (TRUE, FALSE); // gtk_window_set_default_icon_from_file ("../analyzer.png", NULL); gtk_window_set_default_icon_name (GTK_STOCK_FIND); gtk_window_set_position (GTK_WINDOW(ui_main_data.window), GTK_WIN_POS_CENTER); gtk_window_set_default_size (GTK_WINDOW(ui_main_data.window), 1024, 800); ui_set_title(""); gtk_window_set_resizable (GTK_WINDOW(ui_main_data.window), TRUE); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); CHECK_FCT(ui_menu_bar_create(vbox)); CHECK_FCT(ui_toolbar_create(vbox)); CHECK_FCT(ui_notebook_create(vbox)); gtk_container_add (GTK_CONTAINER(ui_main_data.window), vbox); /* Assign the destroy event */ g_signal_connect(ui_main_data.window, "destroy", ui_main_window_destroy, NULL); /* Show the application window */ gtk_widget_show_all (ui_main_data.window); g_idle_add (ui_idle_callback, NULL); return RC_OK; }
int main(int argc, char **argv) { GtkApplication *app; int status; setlocale(LC_ALL, ""); bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); /* Seed random number generator. */ srand48((long) time((time_t *) 0)); g_type_init(); get_options(argc, argv); gtk_init(&argc, &argv); gtk_window_set_default_icon_name("accessories-calculator"); app = gtk_application_new("org.gnome.gcalctool", G_APPLICATION_FLAGS_NONE); g_signal_connect(app, "startup", G_CALLBACK(startup_cb), NULL); g_signal_connect(app, "activate", G_CALLBACK(activate_cb), NULL); status = g_application_run(G_APPLICATION(app), argc, argv); return status; }
int main (int argc, char **argv) { /* init i18n */ setlocale (LC_ALL, ""); bindtextdomain(GETTEXT_PACKAGE, SEAFILE_LOCALE_DIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); if (count_process("seafile-applet") > 1) { fprintf(stderr, _("Seafile is already running\n")); exit(1); } gtk_init (&argc, &argv); gtk_icon_theme_append_search_path (gtk_icon_theme_get_default(), PKGDATADIR); gtk_window_set_default_icon_name ("seafile"); signal (SIGINT, sigint_handler); applet = g_new0 (SeafileApplet, 1); seafile_applet_init (applet); seafile_applet_start (argc, argv); applet_message ("seafile started\n"); trayicon_set_tip ("Seafile"); gtk_main (); return 0; }
static gboolean applet_factory(MatePanelApplet* applet, const gchar* iid, gpointer user_data) { AtkObject* atko; if (!(strcmp (iid, "NotificationArea") == 0 || strcmp (iid, "SystemTrayApplet") == 0)) { return FALSE; } /* Defer loading until applet is added to panel so * gtk_widget_get_screen returns correct information */ g_signal_connect(GTK_WIDGET(applet), "realize", G_CALLBACK(on_applet_realized), NULL); atko = gtk_widget_get_accessible (GTK_WIDGET (applet)); atk_object_set_name (atko, _("Panel Notification Area")); mate_panel_applet_set_flags(applet, MATE_PANEL_APPLET_HAS_HANDLE | MATE_PANEL_APPLET_EXPAND_MINOR); mate_panel_applet_set_background_widget(applet, GTK_WIDGET(applet)); force_no_focus_padding(GTK_WIDGET(applet)); #ifndef NOTIFICATION_AREA_INPROCESS gtk_window_set_default_icon_name(NOTIFICATION_AREA_ICON); #endif gtk_widget_show_all(GTK_WIDGET(applet)); return TRUE; }
static void terminal_app_init (TerminalApp *app) { gs_unref_object GSettings *settings; gtk_window_set_default_icon_name (GNOME_TERMINAL_ICON_NAME); /* Desktop proxy settings */ app->system_proxy_settings = g_settings_new (SYSTEM_PROXY_SETTINGS_SCHEMA); /* Desktop Interface settings */ app->desktop_interface_settings = g_settings_new (DESKTOP_INTERFACE_SETTINGS_SCHEMA); /* Terminal global settings */ app->global_settings = g_settings_new (TERMINAL_SETTING_SCHEMA); /* Check if we need to migrate from gconf to dconf */ maybe_migrate_settings (app); /* Get the profiles */ app->profiles_list = terminal_profiles_list_new (); /* Get the encodings */ app->encodings = terminal_encodings_get_builtins (); terminal_app_encoding_list_notify_cb (app->global_settings, "encodings", app); g_signal_connect (app->global_settings, "changed::encodings", G_CALLBACK (terminal_app_encoding_list_notify_cb), app); app->screen_map = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); settings = g_settings_get_child (app->global_settings, "keybindings"); terminal_accels_init (G_APPLICATION (app), settings); }
int main(int argc, char **argv) { int r; r = fp_init(); if (r < 0) return r; gtk_init(&argc, &argv); gtk_window_set_default_icon_name("fprint_demo"); r = setup_pollfds(); if (r < 0) return r; mwin_create(); mwin_populate_devs(); mwin_select_first_dev(); gtk_main(); if (fpdev) fp_dev_close(fpdev); fp_exit(); return 0; }
int main (int argc, char *argv[]) { GtkApplication *app; GObjectClass *app_class; gint retval; g_type_init (); #ifdef HAVE_CHEESE /* Used by the avatar chooser */ g_return_val_if_fail (cheese_gtk_init (&argc, &argv), 1); #endif empathy_init (); g_set_application_name (_("Empathy Accounts")); /* Make empathy and empathy-accounts appear as the same app in gnome-shell */ gdk_set_program_class ("Empathy"); gtk_window_set_default_icon_name ("empathy"); app = gtk_application_new (EMPATHY_ACCOUNTS_DBUS_NAME, G_APPLICATION_FLAGS_NONE); app_class = G_OBJECT_GET_CLASS (app); G_APPLICATION_CLASS (app_class)->local_command_line = local_cmdline; G_APPLICATION_CLASS (app_class)->activate = app_activate; retval = g_application_run (G_APPLICATION (app), argc, argv); g_object_unref (app); return retval; }
int main(int argc, char *argv[]) { GtkWidget *window; gtk_init(&argc, &argv); g_set_application_name("This is a test"); gtk_window_set_default_icon_name("foobar"); g_setenv("PULSE_PROP_media.role", "phone", TRUE); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW (window), g_get_application_name()); gtk_widget_show_all(window); m = pa_glib_mainloop_new(NULL); g_assert(m); connect(); gtk_main(); pa_context_unref(ctxt); pa_glib_mainloop_free(m); return 0; }
/* static void cb_scroll_event(GtkAdjustment *adj, GtkWidget *view) { gtk_text_view_place_cursor_onscreen(GTK_TEXT_VIEW(view)); } */ MainWin *create_main_window(void) { GtkWidget *window; GtkWidget *vbox; GtkWidget *menubar; GtkWidget *sw; GtkWidget *view; GtkWidget *statusBar; guint statusBarContext; MainWin *mw = g_malloc(sizeof(MainWin)); window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_widget_set_name(window, PACKAGE_NAME); #if GTK_CHECK_VERSION(2, 6, 0) gtk_window_set_default_icon_name(PACKAGE); #else GdkPixbuf *icon = gdk_pixbuf_new_from_file( ICONDIR G_DIR_SEPARATOR_S PACKAGE ".png", NULL); gtk_window_set_icon(GTK_WINDOW(window), icon); if (icon) g_object_unref(icon); #endif g_signal_connect(G_OBJECT(window), "delete-event", G_CALLBACK(on_file_quit), NULL); g_signal_connect_after(G_OBJECT(window), "delete-event", G_CALLBACK(gtk_widget_hide_on_delete), NULL); vbox = gtk_vbox_new(FALSE, 0); gtk_container_add(GTK_CONTAINER(window), vbox); menubar = create_menu_bar(window); gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0); sw = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); view = create_text_view(); gtk_container_add(GTK_CONTAINER(sw), view); statusBar = gtk_statusbar_new(); statusBarContext = gtk_statusbar_get_context_id( (GtkStatusbar *) statusBar, "status" ); gtk_statusbar_push( (GtkStatusbar *) statusBar, statusBarContext, " " ); gtk_box_pack_start(GTK_BOX(vbox), statusBar, FALSE, FALSE, 0); mw->window = window; mw->menubar = menubar; mw->view = view; mw->statusBar = (GtkStatusbar *) statusBar; mw->statusBarContext = statusBarContext; mw->buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view)); return mw; }
void GnomeMeeting::BuildGUI (Ekiga::ServiceCore& services) { /* Init the stock icons */ gnomemeeting_stock_icons_init (); /* Build the GUI */ gtk_window_set_default_icon_name (GM_ICON_LOGO); assistant_window = ekiga_assistant_new (services); main_window = gm_main_window_new (services); // FIXME should be moved in ekiga_assistant_new gtk_window_set_transient_for (GTK_WINDOW (assistant_window), GTK_WINDOW (main_window)); /* GM is started */ PTRACE (1, "Ekiga version " << MAJOR_VERSION << "." << MINOR_VERSION << "." << BUILD_NUMBER); PTRACE (1, "OPAL version " << OPAL_VERSION); PTRACE (1, "PTLIB version " << PTLIB_VERSION); #if defined HAVE_XV || defined HAVE_DX PTRACE (1, "Accelerated rendering support enabled"); #else PTRACE (1, "Accelerated rendering support disabled"); #endif #ifdef HAVE_DBUS PTRACE (1, "DBUS support enabled"); #else PTRACE (1, "DBUS support disabled"); #endif #ifdef HAVE_GCONF PTRACE (1, "GConf support enabled"); #else PTRACE (1, "GConf support disabled"); #endif }
static void egg_set_desktop_file_internal (const char *desktop_file_path, gboolean set_defaults) { GError *error = NULL; G_LOCK (egg_desktop_file); if (egg_desktop_file) egg_desktop_file_free (egg_desktop_file); egg_desktop_file = egg_desktop_file_new (desktop_file_path, &error); if (error) { g_warning ("Could not load desktop file '%s': %s", desktop_file_path, error->message); g_error_free (error); } if (set_defaults && egg_desktop_file != NULL) { /* Set localized application name and default window icon */ if (egg_desktop_file->name) g_set_application_name (egg_desktop_file->name); if (egg_desktop_file->icon) { if (g_path_is_absolute (egg_desktop_file->icon)) gtk_window_set_default_icon_from_file (egg_desktop_file->icon, NULL); else gtk_window_set_default_icon_name (egg_desktop_file->icon); } } G_UNLOCK (egg_desktop_file); }
void gimp_widgets_init (GimpHelpFunc standard_help_func, GimpGetColorFunc get_foreground_func, GimpGetColorFunc get_background_func, GimpEnsureModulesFunc ensure_modules_func) { static gboolean gimp_widgets_initialized = FALSE; g_return_if_fail (standard_help_func != NULL); if (gimp_widgets_initialized) g_error ("gimp_widgets_init() must only be called once!"); _gimp_standard_help_func = standard_help_func; _gimp_get_foreground_func = get_foreground_func; _gimp_get_background_func = get_background_func; _gimp_ensure_modules_func = ensure_modules_func; gimp_stock_init (); gtk_window_set_default_icon_name (GIMP_STOCK_WILBER); gimp_widgets_init_foreign_enums (); gimp_widgets_initialized = TRUE; }
int main (int argc, char **argv) { GtkApplication *app; gint retval; g_thread_init (NULL); gtk_init (&argc, &argv); empathy_gtk_init (); app = gtk_application_new (EMPATHY_DEBUGGER_DBUS_NAME, G_APPLICATION_FLAGS_NONE); g_signal_connect (app, "activate", G_CALLBACK (activate_cb), NULL); g_set_application_name (_("Empathy Debugger")); /* Make empathy and empathy-debugger appear as the same app in gnome-shell */ gdk_set_program_class ("Empathy"); gtk_window_set_default_icon_name ("empathy"); textdomain (GETTEXT_PACKAGE); retval = g_application_run (G_APPLICATION (app), argc, argv); g_object_unref (app); return retval; }
static void screenshot_application_startup (GApplication *app) { ScreenshotApplication *self = SCREENSHOT_APPLICATION (app); GtkBuilder *builder; GMenuModel *menu; G_APPLICATION_CLASS (screenshot_application_parent_class)->startup (app); gtk_window_set_default_icon_name (SCREENSHOOTER_ICON); screenshooter_init_stock_icons (); g_action_map_add_action_entries (G_ACTION_MAP (self), action_entries, G_N_ELEMENTS (action_entries), self); builder = gtk_builder_new (); gtk_builder_add_from_resource (builder, "/org/gnome/screenshot/screenshot-app-menu.ui", NULL); menu = G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")); gtk_application_set_app_menu (GTK_APPLICATION (self), menu); g_object_unref (builder); g_object_unref (menu); /* interactive mode: trigger the dialog and wait for the response */ if (screenshot_config->interactive) screenshot_show_interactive_dialog (self); else screenshot_start (self); }
static void shell_show_overview_page (GnomeControlCenter *center) { GnomeControlCenterPrivate *priv = center->priv; notebook_select_page (priv->notebook, priv->scrolled_window); if (priv->current_panel) notebook_remove_page (priv->notebook, priv->current_panel); priv->current_panel = NULL; /* clear the search text */ g_free (priv->filter_string); priv->filter_string = g_strdup (""); gtk_entry_set_text (GTK_ENTRY (priv->search_entry), ""); gtk_widget_grab_focus (priv->search_entry); gtk_lock_button_set_permission (GTK_LOCK_BUTTON (priv->lock_button), NULL); /* reset window title and icon */ gtk_window_set_role (GTK_WINDOW (priv->window), NULL); gtk_window_set_title (GTK_WINDOW (priv->window), priv->default_window_title); gtk_window_set_default_icon_name (priv->default_window_icon); gtk_window_set_icon_name (GTK_WINDOW (priv->window), priv->default_window_icon); cc_shell_set_active_panel (CC_SHELL (center), NULL); /* clear any custom widgets */ _shell_remove_all_custom_widgets (priv); }
int main (int argc, char *argv[]) { GtkWidget *dialog; GtkWidget *browse_button; GtkWidget *help_button; GtkWidget *face_image; char *greeter; int max_size; bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); gtk_init(&argc, &argv); photofile = g_build_filename (g_get_home_dir (), ".face", NULL); /* Read config data in bulk */ mdmcomm_comm_bulk_start (); max_size = mdm_config_get_int (MDM_KEY_USER_MAX_FILE); max_width = mdm_config_get_int (MDM_KEY_MAX_ICON_WIDTH); max_height = mdm_config_get_int (MDM_KEY_MAX_ICON_HEIGHT); greeter = mdm_config_get_string (MDM_KEY_GREETER); facedir = mdm_config_get_string (MDM_KEY_GLOBAL_FACE_DIR); /* At this point we are done using the socket, so close it */ mdmcomm_comm_bulk_stop (); imagename = NULL; gtk_window_set_default_icon_name ("stock_person"); xml = glade_xml_new (MDM_GLADE_DIR "/mdmphotosetup.glade", NULL, NULL); dialog = glade_xml_get_widget (xml, "face_dialog"); face_image = glade_xml_get_widget (xml, "face_image"); browse_button = glade_xml_get_widget (xml, "browse_button"); help_button = glade_xml_get_widget (xml, "helpbutton1"); gtk_widget_set_size_request (browse_button, MAX (max_width, 230), MAX (max_height, 130)); if (g_access (photofile, R_OK) == 0) { gtk_image_set_from_file (GTK_IMAGE (face_image), photofile); } else { gtk_image_set_from_icon_name (GTK_IMAGE (face_image), "stock_person", GTK_ICON_SIZE_DIALOG); } g_signal_connect (browse_button, "clicked", G_CALLBACK (browse_button_cb), dialog); g_signal_connect (help_button, "clicked", G_CALLBACK (help_button_cb), dialog); g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), NULL); gtk_widget_show_all (dialog); gtk_main (); return 0; }
int main(int argc, char *argv[]) { UniqueApp *app; GtkWidget *window; GtkWidget *notebook; GError *error = NULL; bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); if (gtk_init_with_args(&argc, &argv, NULL, options, GETTEXT_PACKAGE, &error) == FALSE) { if (error) { g_print("%s\n", error->message); g_error_free(error); } else g_print("An unknown error occurred\n"); return 1; } if (option_dump != FALSE) { dump_devices (); return 0; } app = unique_app_new ("org.mate.Bluetooth.properties", NULL); if (unique_app_is_running (app)) { gdk_notify_startup_complete (); unique_app_send_message (app, UNIQUE_ACTIVATE, NULL); return 0; } g_set_application_name(_("Bluetooth Properties")); gtk_window_set_default_icon_name("bluetooth"); bluetooth_plugin_manager_init (); notebook = gtk_notebook_new(); gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE); setup_adapter(GTK_NOTEBOOK(notebook)); window = create_window(notebook); g_signal_connect (app, "message-received", G_CALLBACK (message_received_cb), window); gtk_main(); bluetooth_plugin_manager_cleanup (); cleanup_adapter(); g_object_unref(app); return 0; }
static int setup_interface( void ) { GtkWidget *window, *treeview, *select_entry, *spawn_dialog, *spawn_label; GtkCellRenderer *renderer; gtk_window_set_default_icon_name( "gnome-dev-keyboard" ); wl = window_list_new(); xml = glade_xml_new( PREFIX "/share/keyboardcast/keyboardcast.glade", NULL, NULL ); if( xml == NULL ) return 1; select_entry = glade_xml_get_widget( xml, "select-entry" ); treeview = glade_xml_get_widget( xml, "treeview" ); window = glade_xml_get_widget( xml, "window" ); spawn_dialog = glade_xml_get_widget( xml, "spawn-dialog" ); spawn_label = glade_xml_get_widget( xml, "spawn-label" ); if( select_entry == NULL || treeview == NULL || window == NULL || spawn_dialog == NULL || spawn_label == NULL ) return 1; gtk_tree_view_set_model( GTK_TREE_VIEW( treeview ), GTK_TREE_MODEL( wl ) ); renderer = window_list_toggle_renderer( wl ); gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( treeview ), -1, "✓", renderer, // ☑☒✓✔ "active", 1, NULL ); renderer = gtk_cell_renderer_text_new(); gtk_tree_view_insert_column_with_attributes( GTK_TREE_VIEW( treeview ), -1, "Window Title", renderer, "text", 2, NULL ); glade_xml_signal_connect( xml, "key_event", G_CALLBACK( key_event ) ); glade_xml_signal_connect( xml, "gtk_exit", G_CALLBACK( gtk_exit ) ); glade_xml_signal_connect_data( xml, "expanded", G_CALLBACK( expanded ), window ); glade_xml_signal_connect_data( xml, "button_clicked", G_CALLBACK( button_clicked ), select_entry ); glade_xml_signal_connect_data( xml, "spawn_clicked", G_CALLBACK( spawn_clicked ), spawn_dialog ); glade_xml_signal_connect( xml, "terminal_toggled", G_CALLBACK( terminal_toggled ) ); glade_xml_signal_connect_data( xml, "update_label", G_CALLBACK( update_label ), spawn_label ); update_label( NULL, GTK_LABEL( spawn_label ) ); window_list_filter_by_process( wl, "gnome-terminal" ); gtk_widget_show_all( window ); return 0; }
static gboolean geyes_applet_fill (MatePanelApplet *applet) { EyesApplet *eyes_applet; GtkActionGroup *action_group; gchar *ui_path; g_set_application_name (_("Eyes")); gtk_window_set_default_icon_name ("mate-eyes-applet"); mate_panel_applet_set_flags (applet, MATE_PANEL_APPLET_EXPAND_MINOR); mate_panel_applet_set_background_widget (applet, GTK_WIDGET (applet)); eyes_applet = create_eyes (applet); eyes_applet->timeout_id = g_timeout_add ( UPDATE_TIMEOUT, (GSourceFunc) timer_cb, eyes_applet); action_group = gtk_action_group_new ("Geyes Applet Actions"); gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions (action_group, geyes_applet_menu_actions, G_N_ELEMENTS (geyes_applet_menu_actions), eyes_applet); ui_path = g_build_filename (GEYES_MENU_UI_DIR, "geyes-applet-menu.xml", NULL); mate_panel_applet_setup_menu_from_file (eyes_applet->applet, ui_path, action_group); g_free (ui_path); if (mate_panel_applet_get_locked_down (eyes_applet->applet)) { GtkAction *action; action = gtk_action_group_get_action (action_group, "Props"); gtk_action_set_visible (action, FALSE); } g_object_unref (action_group); gtk_widget_set_tooltip_text (GTK_WIDGET (eyes_applet->applet), _("Eyes")); set_atk_name_description (GTK_WIDGET (eyes_applet->applet), _("Eyes"), _("The eyes look in the direction of the mouse pointer")); g_signal_connect (eyes_applet->vbox, "dispose", G_CALLBACK (dispose_cb), eyes_applet); gtk_widget_show_all (GTK_WIDGET (eyes_applet->applet)); /* setup here and not in create eyes so the destroy signal is set so * that when there is an error within loading the theme * we can emit this signal */ if (properties_load (eyes_applet) == FALSE) return FALSE; setup_eyes (eyes_applet); return TRUE; }
static gboolean screenshot_app_init (void) { gtk_window_set_default_icon_name (SCREENSHOOTER_ICON); screenshooter_init_stock_icons (); return init_dbus_session (); }
gint main (gint argc, gchar **argv) { GOptionContext *context; GtkWidget *window; GError *error = NULL; static gchar **remaining_args = NULL; gchar *initial_key = NULL; const GOptionEntry entries[] = { { G_OPTION_REMAINING, '\0', 0, G_OPTION_ARG_STRING_ARRAY, &remaining_args, NULL, N_("[KEY]") }, { NULL } }; bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); textdomain (GETTEXT_PACKAGE); context = g_option_context_new (N_("- Directly edit your entire configuration database")); g_option_context_set_translation_domain (context, GETTEXT_PACKAGE); g_option_context_add_main_entries (context, entries, GETTEXT_PACKAGE); g_option_context_add_group (context, gtk_get_option_group (TRUE)); if (!g_option_context_parse (context, &argc, &argv, &error)) { g_critical ("Failed to parse arguments: %s", error->message); g_error_free (error); g_option_context_free (context); exit (1); } g_option_context_free (context); /* Register our stock icons */ gtk_icon_theme_append_search_path (gtk_icon_theme_get_default (), ICONDIR); mateconf_stock_icons_register (); load_accel_map (); gtk_window_set_default_icon_name ("mateconf-editor"); window = mateconf_editor_application_create_editor_window (MATECONF_EDITOR_WINDOW_TYPE_NORMAL); gtk_widget_show_now (window); /* get the key specified on the command line if any. Ignore the rest */ initial_key = remaining_args != NULL ? remaining_args[0] : NULL; if (initial_key != NULL) mateconf_editor_window_go_to (MATECONF_EDITOR_WINDOW (window),initial_key); gtk_main (); save_accel_map (); g_strfreev (remaining_args); return 0; }
static gboolean applet_factory (PanelApplet *applet, const gchar *iid, gpointer user_data) { NaTray *tray; AppletData *data; AtkObject *atko; if (!(strcmp (iid, "OAFIID:GNOME_NotificationAreaApplet") == 0 || strcmp (iid, "OAFIID:GNOME_SystemTrayApplet") == 0)) return FALSE; tray = na_tray_new_for_screen (gtk_widget_get_screen (GTK_WIDGET (applet)), get_orientation_from_applet (applet)); data = g_slice_new (AppletData); data->applet = applet; data->tray = tray; data->about_dialog = NULL; g_object_set_data_full (G_OBJECT (applet), "system-tray-data", data, (GDestroyNotify) free_applet_data); atko = gtk_widget_get_accessible (GTK_WIDGET (applet)); atk_object_set_name (atko, _("Panel Notification Area")); panel_applet_set_flags (applet, PANEL_APPLET_HAS_HANDLE|PANEL_APPLET_EXPAND_MINOR); g_signal_connect (applet, "change_orient", G_CALLBACK (applet_change_orientation), data); g_signal_connect (applet, "change_background", G_CALLBACK (applet_change_background), data); g_signal_connect (applet, "destroy", G_CALLBACK (applet_destroy), data); panel_applet_set_background_widget (applet, GTK_WIDGET (applet)); gtk_container_add (GTK_CONTAINER (applet), GTK_WIDGET (tray)); #ifndef NOTIFICATION_AREA_INPROCESS gtk_window_set_default_icon_name (NOTIFICATION_AREA_ICON); #endif gtk_widget_show_all (GTK_WIDGET (applet)); panel_applet_setup_menu_from_file (applet, NULL, "GNOME_NotificationAreaApplet.xml", NULL, menu_verbs, data); return TRUE; }
static void dss_app_init (DssApp * app) { const gchar *name = "Dual stream switcher"; g_set_prgname (name); g_set_application_name (name); gtk_window_set_default_icon_name (name); g_application_add_main_option_entries (G_APPLICATION (app), app_options); }
static void gt_win_init(GtWin* self) { GtWinPrivate* priv = gt_win_get_instance_private(self); GPropertyAction* action; GT_TYPE_PLAYER; // Hack to load GtPlayer into the symbols table GT_TYPE_PLAYER_HEADER_BAR; GT_TYPE_BROWSE_HEADER_BAR; GT_TYPE_CHANNELS_VIEW; GT_TYPE_GAMES_VIEW; GT_TYPE_FOLLOWS_VIEW; GT_TYPE_CHAT; gtk_window_set_application(GTK_WINDOW(self), GTK_APPLICATION(main_app)); gtk_widget_init_template(GTK_WIDGET(self)); gtk_widget_realize(priv->player_header_bar); priv->cur_info_data = NULL; priv->info_queue = g_queue_new(); gtk_window_set_default_size(GTK_WINDOW(self), g_settings_get_int(main_app->settings, "window-width"), g_settings_get_int(main_app->settings, "window-height")); gtk_window_set_default_icon_name("gnome-twitch"); g_object_bind_property(priv->browse_stack, "visible-child", self, "visible-view", G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE); GdkScreen* screen = gdk_screen_get_default(); GtkCssProvider* css = gtk_css_provider_new(); gtk_css_provider_load_from_resource(css, "/com/vinszent/GnomeTwitch/com.vinszent.GnomeTwitch.style.css"); gtk_style_context_add_provider_for_screen(screen, GTK_STYLE_PROVIDER(css), GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); g_signal_connect_after(self, "key-press-event", G_CALLBACK(key_press_cb), self); g_signal_connect(self, "delete-event", G_CALLBACK(delete_cb), self); g_signal_connect_after(priv->info_bar, "response", G_CALLBACK(close_info_bar_cb), self); g_action_map_add_action_entries(G_ACTION_MAP(self), win_actions, G_N_ELEMENTS(win_actions), self); action = g_property_action_new("toggle_fullscreen", self, "fullscreen"); g_action_map_add_action(G_ACTION_MAP(self), G_ACTION(action)); g_object_unref(action); GtkWindowGroup* window_group = gtk_window_group_new(); gtk_window_group_add_window(window_group, GTK_WINDOW(self)); g_object_unref(window_group); }
static void gth_application_init (GthApplication *app) { #ifdef GDK_WINDOWING_X11 GDesktopAppInfo *app_info; app_info = g_desktop_app_info_new ("gthumb.desktop"); if (app_info == NULL) return; if (g_desktop_app_info_has_key (app_info, "Name")) { char *app_name; app_name = g_desktop_app_info_get_string (app_info, "Name"); g_set_application_name (app_name); g_free (app_name); } if (g_desktop_app_info_has_key (app_info, "Icon")) { char *icon; icon = g_desktop_app_info_get_string (app_info, "Icon"); if (g_path_is_absolute (icon)) gtk_window_set_default_icon_from_file (icon, NULL); else gtk_window_set_default_icon_name (icon); g_free (icon); } g_object_unref (app_info); #else /* manually set name and icon */ g_set_application_name (_("gThumb")); gtk_window_set_default_icon_name ("gthumb"); #endif }
static void goo_application_startup (GApplication *application) { G_APPLICATION_CLASS (goo_application_parent_class)->startup (application); g_set_application_name (_("CD Player")); gtk_window_set_default_icon_name ("goobox"); initialize_app_menu (application); }
int main(int argc, char *argv[]) { GtkStatusIcon *statusicon; DBusGConnection *conn; DBusGProxy *adapter, *device; GError *error = NULL; bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); textdomain(GETTEXT_PACKAGE); gtk_init(&argc, &argv); gtk_window_set_default_icon_name("bluetooth"); conn = dbus_g_bus_get(DBUS_BUS_SYSTEM, &error); if (error != NULL) { g_printerr("Connecting to system bus failed: %s\n", error->message); g_error_free(error); return 1; } set_icon (TRUE); statusicon = init_notification(); g_signal_connect(statusicon, "activate", G_CALLBACK(activate_callback), NULL); setup_agents(); adapter = dbus_g_proxy_new_for_name(conn, "org.bluez", "/hci0", "org.bluez.Adapter"); device = dbus_g_proxy_new_from_proxy(adapter, "/hci0/dev_11_22_33_44_55_66", "org.bluez.Device"); //display_dialog(adapter, device, "Test (00:11:22:33:44:55)", "123456", 0, NULL); pin_dialog(adapter, device, "Test", "'Test' (00:11:22:33:44:55)", FALSE, NULL); confirm_dialog(adapter, device, "Test", "'Test' (00:11:22:33:44:55)", "123456", NULL); auth_dialog(adapter, device, "Test", "'Test' (00:11:22:33:44:55)", "UUID", NULL); gtk_main(); g_object_unref(device); g_object_unref(adapter); cleanup_notification(); cleanup_agents(); dbus_g_connection_unref(conn); return 0; }
static gboolean applet_factory (MatePanelApplet *applet, const char *iid, gpointer user_data) { gboolean ret = FALSE; GtkWidget *drive_list; AtkObject *ao; GtkActionGroup *action_group; gchar *ui_path; if (!strcmp (iid, drivemount_iid)) { g_set_application_name (_("Disk Mounter")); gtk_window_set_default_icon_name ("media-floppy"); mate_panel_applet_set_flags (applet, MATE_PANEL_APPLET_EXPAND_MINOR); mate_panel_applet_set_background_widget (applet, GTK_WIDGET (applet)); drive_list = drive_list_new (); gtk_container_add (GTK_CONTAINER (applet), drive_list); g_signal_connect_object (applet, "change_orient", G_CALLBACK (change_orient), drive_list, 0); g_signal_connect_object (applet, "size_allocate", G_CALLBACK (size_allocate), drive_list, 0); g_signal_connect (applet, "change_background", G_CALLBACK (change_background), drive_list); /* set initial state */ change_orient (applet, mate_panel_applet_get_orient (applet), DRIVE_LIST (drive_list)); action_group = gtk_action_group_new ("DriveMount Applet Actions"); gtk_action_group_set_translation_domain (action_group, GETTEXT_PACKAGE); gtk_action_group_add_actions (action_group, applet_menu_actions, G_N_ELEMENTS (applet_menu_actions), drive_list); ui_path = g_build_filename (DRIVEMOUNT_MENU_UI_DIR, "drivemount-applet-menu.xml", NULL); mate_panel_applet_setup_menu_from_file (applet, ui_path, action_group); g_free (ui_path); g_object_unref (action_group); ao = gtk_widget_get_accessible (GTK_WIDGET (applet)); atk_object_set_name (ao, _("Disk Mounter")); gtk_widget_show_all (GTK_WIDGET (applet)); ret = TRUE; } return ret; }