* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
static void atk_selection_interface_init (AtkSelectionIface *iface);
-G_DEFINE_TYPE_WITH_CODE (GtkNotebookAccessible, gtk_notebook_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
+G_DEFINE_TYPE_WITH_CODE (GtkNotebookAccessible, _gtk_notebook_accessible, GTK_TYPE_CONTAINER_ACCESSIBLE,
G_IMPLEMENT_INTERFACE (ATK_TYPE_SELECTION, atk_selection_interface_init))
static gboolean
atk_obj = ATK_OBJECT (data);
accessible = GTK_NOTEBOOK_ACCESSIBLE (atk_obj);
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (atk_obj));
+ if (widget == NULL)
+ return FALSE;
notebook = GTK_NOTEBOOK (widget);
accessible->idle_focus_id = 0;
{
AtkObject *obj;
- obj = gtk_notebook_page_accessible_new (accessible, child);
+ obj = _gtk_notebook_page_accessible_new (accessible, child);
g_hash_table_insert (accessible->pages, child, obj);
atk_object_set_parent (obj, ATK_OBJECT (accessible));
- g_signal_emit_by_name (accessible, "children_changed::add", page_num, obj, NULL);
+ g_signal_emit_by_name (accessible, "children-changed::add", page_num, obj, NULL);
}
static void
obj = g_hash_table_lookup (accessible->pages, widget);
g_return_if_fail (obj);
- g_signal_emit_by_name (accessible, "children_changed::remove",
+ g_signal_emit_by_name (accessible, "children-changed::remove",
page_num, obj, NULL);
- gtk_notebook_page_accessible_invalidate (GTK_NOTEBOOK_PAGE_ACCESSIBLE (obj));
+ _gtk_notebook_page_accessible_invalidate (GTK_NOTEBOOK_PAGE_ACCESSIBLE (obj));
g_hash_table_remove (accessible->pages, widget);
}
-static void
-accessible_destroyed (gpointer data)
-{
- GtkNotebookAccessible *accessible = GTK_NOTEBOOK_ACCESSIBLE (data);
-
- if (accessible->idle_focus_id)
- {
- g_source_remove (accessible->idle_focus_id);
- accessible->idle_focus_id = 0;
- }
-}
static void
gtk_notebook_accessible_initialize (AtkObject *obj,
gpointer data)
GtkNotebook *notebook;
gint i;
- ATK_OBJECT_CLASS (gtk_notebook_accessible_parent_class)->initialize (obj, data);
+ ATK_OBJECT_CLASS (_gtk_notebook_accessible_parent_class)->initialize (obj, data);
accessible = GTK_NOTEBOOK_ACCESSIBLE (obj);
notebook = GTK_NOTEBOOK (data);
g_signal_connect (notebook, "page-removed",
G_CALLBACK (page_removed_cb), NULL);
- g_object_weak_ref (G_OBJECT (notebook), (GWeakNotify)accessible_destroyed, obj);
-
obj->role = ATK_ROLE_PAGE_TAB_LIST;
}
if (accessible->idle_focus_id)
g_source_remove (accessible->idle_focus_id);
- G_OBJECT_CLASS (gtk_notebook_accessible_parent_class)->finalize (object);
+ G_OBJECT_CLASS (_gtk_notebook_accessible_parent_class)->finalize (object);
}
static AtkObject *
if (page_num != old_page_num)
{
- AtkObject *obj;
+ AtkObject *child;
if (old_page_num != -1)
{
- obj = gtk_notebook_accessible_ref_child (atk_obj, old_page_num);
- if (obj)
+ child = gtk_notebook_accessible_ref_child (atk_obj, old_page_num);
+ if (child)
{
- atk_object_notify_state_change (obj, ATK_STATE_SELECTED, FALSE);
- g_object_unref (obj);
+ atk_object_notify_state_change (child, ATK_STATE_SELECTED, FALSE);
+ g_object_unref (child);
}
}
- obj = gtk_notebook_accessible_ref_child (atk_obj, page_num);
- if (obj)
+ child = gtk_notebook_accessible_ref_child (atk_obj, page_num);
+ if (child)
{
- atk_object_notify_state_change (obj, ATK_STATE_SELECTED, TRUE);
- g_object_unref (obj);
+ atk_object_notify_state_change (child, ATK_STATE_SELECTED, TRUE);
+ g_object_unref (child);
/*
* The page which is being displayed has changed but there is
* no need to tell the focus tracker as the focus page will also
* Notebook does not have tabs.
*/
}
- g_signal_emit_by_name (atk_obj, "selection_changed");
- g_signal_emit_by_name (atk_obj, "visible_data_changed");
+ g_signal_emit_by_name (atk_obj, "selection-changed");
+ g_signal_emit_by_name (atk_obj, "visible-data-changed");
}
if (gtk_notebook_get_show_tabs (notebook) &&
(focus_page_num != old_focus_page_num))
}
}
else
- GAIL_WIDGET_CLASS (gtk_notebook_accessible_parent_class)->notify_gtk (obj, pspec);
+ GTK_WIDGET_ACCESSIBLE_CLASS (_gtk_notebook_accessible_parent_class)->notify_gtk (obj, pspec);
}
/*
}
static void
-gtk_notebook_accessible_class_init (GtkNotebookAccessibleClass *klass)
+_gtk_notebook_accessible_class_init (GtkNotebookAccessibleClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
AtkObjectClass *class = ATK_OBJECT_CLASS (klass);
- GailWidgetClass *widget_class = (GailWidgetClass*)klass;
+ GtkWidgetAccessibleClass *widget_class = (GtkWidgetAccessibleClass*)klass;
GtkContainerAccessibleClass *container_class = (GtkContainerAccessibleClass*)klass;
}
static void
-gtk_notebook_accessible_init (GtkNotebookAccessible *notebook)
+_gtk_notebook_accessible_init (GtkNotebookAccessible *notebook)
{
notebook->pages = g_hash_table_new_full (g_direct_hash,
g_direct_equal,