+ if (activated) {
+ /*
+ * If the View is requesting to be activated, then we
+ * check whether or not there is already an active
+ * View.
+ */
+ if (active_view_frame != NULL) {
+ g_warning ("View requested to be activated but there is already "
+ "an active View!\n");
+ return FALSE;
+ }
+
+ /*
+ * Otherwise, uncover it so that it can receive
+ * events, and set it as the active View.
+ */
+ gnome_view_frame_set_covered (view_frame, FALSE);
+ active_view_frame = view_frame;
+ } else {
+ /*
+ * If the View is asking to be deactivated, always
+ * oblige. We may have already deactivated it (see
+ * user_activation_request_cb), but there's no harm in
+ * doing it again. There is always the possibility
+ * that a View will ask to be deactivated when we have
+ * not told it to deactivate itself, and that is
+ * why we cover the view here.
+ */
+ gnome_view_frame_set_covered (view_frame, TRUE);
+
+ if (view_frame == active_view_frame)
+ active_view_frame = NULL;
+ }
+
+ return FALSE;
+}
+
+static GnomeViewFrame *
+add_view (Application *app,
+ GnomeClientSite *client_site, GnomeObjectClient *server)
+{
+ GnomeViewFrame *view_frame;
+ GtkWidget *view_widget;
+
+ view_frame = gnome_client_site_embeddable_new_view (client_site);
+
+ gtk_signal_connect (GTK_OBJECT (view_frame), "user_activate",
+ GTK_SIGNAL_FUNC (user_activation_request_cb), NULL);
+ gtk_signal_connect (GTK_OBJECT (view_frame), "view_activated",
+ GTK_SIGNAL_FUNC (view_activated_cb), NULL);
+
+ gnome_view_frame_set_ui_handler (view_frame, app->uih);
+
+ view_widget = gnome_view_frame_get_wrapper (view_frame);