static void ephy_session_dispose (GObject *object) { EphySession *session = EPHY_SESSION (object); LOG ("EphySession disposing"); session_command_queue_clear (session); G_OBJECT_CLASS (ephy_session_parent_class)->dispose (object); }
static void ephy_session_dispose (GObject *object) { EphySession *session = EPHY_SESSION (object); LOG ("EphySession disposing"); g_queue_free_full (session->priv->closed_tabs, (GDestroyNotify)closed_tab_free); G_OBJECT_CLASS (ephy_session_parent_class)->dispose (object); }
static void ephy_session_finalize (GObject *object) { EphySession *session = EPHY_SESSION (object); LOG ("EphySession finalising"); /* FIXME: those should be NULL already!? */ g_list_free (session->priv->windows); g_list_free (session->priv->tool_windows); G_OBJECT_CLASS (ephy_session_parent_class)->finalize (object); }
static void impl_detach_window (EphyExtension *extension, EphyWindow *window) { EphySession *session = EPHY_SESSION (extension); LOG ("impl_detach_window"); session->priv->windows = g_list_remove (session->priv->windows, window); ephy_session_save (session, SESSION_STATE); /* NOTE: since the window will be destroyed anyway, we don't need to * disconnect our signal handlers from its components. */ }
static void ephy_session_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { EphySession *session = EPHY_SESSION (object); switch (prop_id) { case PROP_ACTIVE_WINDOW: g_value_set_object (value, ephy_session_get_active_window (session)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); } }
static void ephy_session_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) { EphySession *session = EPHY_SESSION (object); switch (property_id) { case PROP_CAN_UNDO_TAB_CLOSED: g_value_set_boolean (value, ephy_session_get_can_undo_tab_closed (session)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } }
static void impl_attach_window (EphyExtension *extension, EphyWindow *window) { EphySession *session = EPHY_SESSION (extension); GtkWidget *notebook; LOG ("impl_attach_window"); session->priv->windows = g_list_append (session->priv->windows, window); ephy_session_save (session, SESSION_STATE); g_signal_connect (window, "focus-in-event", G_CALLBACK (window_focus_in_event_cb), session); notebook = ephy_window_get_notebook (window); g_signal_connect (notebook, "page-added", G_CALLBACK (notebook_page_added_cb), session); g_signal_connect (notebook, "page-removed", G_CALLBACK (notebook_page_removed_cb), session); g_signal_connect (notebook, "page-reordered", G_CALLBACK (notebook_page_reordered_cb), session); /* Set unique identifier as role, so that on restore, the WM can * place the window on the right workspace */ if (gtk_window_get_role (GTK_WINDOW (window)) == NULL) { /* I guess rand() is unique enough, otherwise we could use * time + pid or something */ char *role; role = g_strdup_printf ("epiphany-window-%x", rand()); gtk_window_set_role (GTK_WINDOW (window), role); g_free (role); } }