Commit 3d11bfbd authored by Adrien Plazas's avatar Adrien Plazas
Browse files

Rename HdyPaginator into HdyCarousel

Fixes Librem5/libhandy#161.
parent d48ef455
......@@ -30,6 +30,30 @@ libhandy-1.so.0 libhandy-1-0 #MINVER#
hdy_carousel_box_set_position@LIBHANDY_1_0 0.9.90
hdy_carousel_box_set_spacing@LIBHANDY_1_0 0.9.90
hdy_carousel_box_stop_animation@LIBHANDY_1_0 0.9.90
hdy_carousel_get_allow_mouse_drag@LIBHANDY_1_0 0.9.90
hdy_carousel_get_animation_duration@LIBHANDY_1_0 0.9.90
hdy_carousel_get_center_content@LIBHANDY_1_0 0.9.90
hdy_carousel_get_indicator_spacing@LIBHANDY_1_0 0.9.90
hdy_carousel_get_indicator_style@LIBHANDY_1_0 0.9.90
hdy_carousel_get_interactive@LIBHANDY_1_0 0.9.90
hdy_carousel_get_n_pages@LIBHANDY_1_0 0.9.90
hdy_carousel_get_position@LIBHANDY_1_0 0.9.90
hdy_carousel_get_spacing@LIBHANDY_1_0 0.9.90
hdy_carousel_get_type@LIBHANDY_1_0 0.9.90
hdy_carousel_indicator_style_get_type@LIBHANDY_1_0 0.9.90
hdy_carousel_insert@LIBHANDY_1_0 0.9.90
hdy_carousel_new@LIBHANDY_1_0 0.9.90
hdy_carousel_prepend@LIBHANDY_1_0 0.9.90
hdy_carousel_reorder@LIBHANDY_1_0 0.9.90
hdy_carousel_scroll_to@LIBHANDY_1_0 0.9.90
hdy_carousel_scroll_to_full@LIBHANDY_1_0 0.9.90
hdy_carousel_set_allow_mouse_drag@LIBHANDY_1_0 0.9.90
hdy_carousel_set_animation_duration@LIBHANDY_1_0 0.9.90
hdy_carousel_set_center_content@LIBHANDY_1_0 0.9.90
hdy_carousel_set_indicator_spacing@LIBHANDY_1_0 0.9.90
hdy_carousel_set_indicator_style@LIBHANDY_1_0 0.9.90
hdy_carousel_set_interactive@LIBHANDY_1_0 0.9.90
hdy_carousel_set_spacing@LIBHANDY_1_0 0.9.90
hdy_centering_policy_get_type@LIBHANDY_1_0 0.0.10
hdy_column_get_linear_growth_width@LIBHANDY_1_0 0.0.3
hdy_column_get_maximum_width@LIBHANDY_1_0 0.0.1
......@@ -138,30 +162,6 @@ libhandy-1.so.0 libhandy-1-0 #MINVER#
hdy_leaflet_transition_type_get_type@LIBHANDY_1_0 0.0.12
hdy_lerp@LIBHANDY_1_0 0.0.11
hdy_list_box_separator_header@LIBHANDY_1_0 0.0.6
hdy_paginator_get_allow_mouse_drag@LIBHANDY_1_0 0.0.12
hdy_paginator_get_animation_duration@LIBHANDY_1_0 0.0.11
hdy_paginator_get_center_content@LIBHANDY_1_0 0.0.11
hdy_paginator_get_indicator_spacing@LIBHANDY_1_0 0.0.11
hdy_paginator_get_indicator_style@LIBHANDY_1_0 0.0.11
hdy_paginator_get_interactive@LIBHANDY_1_0 0.0.11
hdy_paginator_get_n_pages@LIBHANDY_1_0 0.0.11
hdy_paginator_get_position@LIBHANDY_1_0 0.0.11
hdy_paginator_get_spacing@LIBHANDY_1_0 0.0.11
hdy_paginator_get_type@LIBHANDY_1_0 0.0.11
hdy_paginator_indicator_style_get_type@LIBHANDY_1_0 0.0.11
hdy_paginator_insert@LIBHANDY_1_0 0.0.11
hdy_paginator_new@LIBHANDY_1_0 0.0.11
hdy_paginator_prepend@LIBHANDY_1_0 0.0.11
hdy_paginator_reorder@LIBHANDY_1_0 0.0.11
hdy_paginator_scroll_to@LIBHANDY_1_0 0.0.11
hdy_paginator_scroll_to_full@LIBHANDY_1_0 0.0.11
hdy_paginator_set_allow_mouse_drag@LIBHANDY_1_0 0.0.12
hdy_paginator_set_animation_duration@LIBHANDY_1_0 0.0.11
hdy_paginator_set_center_content@LIBHANDY_1_0 0.0.11
hdy_paginator_set_indicator_spacing@LIBHANDY_1_0 0.0.11
hdy_paginator_set_indicator_style@LIBHANDY_1_0 0.0.11
hdy_paginator_set_interactive@LIBHANDY_1_0 0.0.11
hdy_paginator_set_spacing@LIBHANDY_1_0 0.0.11
hdy_preferences_group_add_preferences_to_model@LIBHANDY_1_0 0.0.10
hdy_preferences_group_get_description@LIBHANDY_1_0 0.0.10
hdy_preferences_group_get_title@LIBHANDY_1_0 0.0.10
......
......@@ -37,6 +37,7 @@
<title>Widgets and Objects</title>
<xi:include href="xml/hdy-action-row.xml"/>
<xi:include href="xml/hdy-animation.xml"/>
<xi:include href="xml/hdy-carousel.xml"/>
<xi:include href="xml/hdy-column.xml"/>
<xi:include href="xml/hdy-combo-row.xml"/>
<xi:include href="xml/hdy-dialog.xml"/>
......@@ -46,7 +47,6 @@
<xi:include href="xml/hdy-header-group.xml"/>
<xi:include href="xml/hdy-keypad.xml"/>
<xi:include href="xml/hdy-leaflet.xml"/>
<xi:include href="xml/hdy-paginator.xml"/>
<xi:include href="xml/hdy-preferences-group.xml"/>
<xi:include href="xml/hdy-preferences-page.xml"/>
<xi:include href="xml/hdy-preferences-row.xml"/>
......
......@@ -26,10 +26,10 @@ struct _HdyDemoWindow
HdyComboRow *combo_row;
HdyComboRow *enum_combo_row;
HdyHeaderGroup *header_group;
HdyPaginator *paginator;
GtkListBox *paginator_listbox;
HdyComboRow *paginator_orientation_row;
HdyComboRow *paginator_indicator_style_row;
HdyCarousel *carousel;
GtkListBox *carousel_listbox;
HdyComboRow *carousel_orientation_row;
HdyComboRow *carousel_indicator_style_row;
};
G_DEFINE_TYPE (HdyDemoWindow, hdy_demo_window, GTK_TYPE_APPLICATION_WINDOW)
......@@ -96,12 +96,12 @@ hdy_demo_window_notify_fold_cb (GObject *sender,
static void
update_leaflet_swipe (HdyDemoWindow *self)
{
gboolean first_page = (hdy_paginator_get_position (self->paginator) <= 0);
gboolean paginator_visible =
(gtk_stack_get_visible_child (self->stack) == GTK_WIDGET (self->paginator));
gboolean first_page = (hdy_carousel_get_position (self->carousel) <= 0);
gboolean carousel_visible =
(gtk_stack_get_visible_child (self->stack) == GTK_WIDGET (self->carousel));
hdy_leaflet_set_can_swipe_back (self->content_box,
!paginator_visible || first_page);
!carousel_visible || first_page);
}
static void
......@@ -249,8 +249,8 @@ view_switcher_demo_clicked_cb (GtkButton *btn,
}
static gchar *
paginator_orientation_name (HdyEnumValueObject *value,
gpointer user_data)
carousel_orientation_name (HdyEnumValueObject *value,
gpointer user_data)
{
g_return_val_if_fail (HDY_IS_ENUM_VALUE_OBJECT (value), NULL);
......@@ -265,17 +265,17 @@ paginator_orientation_name (HdyEnumValueObject *value,
}
static void
notify_paginator_position_cb (GObject *sender,
GParamSpec *pspec,
HdyDemoWindow *self)
notify_carousel_position_cb (GObject *sender,
GParamSpec *pspec,
HdyDemoWindow *self)
{
update_leaflet_swipe (self);
}
static void
notify_paginator_orientation_cb (GObject *sender,
GParamSpec *pspec,
HdyDemoWindow *self)
notify_carousel_orientation_cb (GObject *sender,
GParamSpec *pspec,
HdyDemoWindow *self)
{
HdyComboRow *row = HDY_COMBO_ROW (sender);
gboolean horizontal;
......@@ -284,7 +284,7 @@ notify_paginator_orientation_cb (GObject *sender,
g_assert (HDY_IS_DEMO_WINDOW (self));
horizontal = (hdy_combo_row_get_selected_index (row) == GTK_ORIENTATION_HORIZONTAL);
g_object_set (self->paginator,
g_object_set (self->carousel,
"orientation", hdy_combo_row_get_selected_index (row),
"margin-top", horizontal ? 6 : 0,
"margin-bottom", horizontal ? 6 : 0,
......@@ -294,17 +294,17 @@ notify_paginator_orientation_cb (GObject *sender,
}
static gchar *
paginator_indicator_style_name (HdyEnumValueObject *value,
gpointer user_data)
carousel_indicator_style_name (HdyEnumValueObject *value,
gpointer user_data)
{
g_return_val_if_fail (HDY_IS_ENUM_VALUE_OBJECT (value), NULL);
switch (hdy_enum_value_object_get_value (value)) {
case HDY_PAGINATOR_INDICATOR_STYLE_NONE:
case HDY_CAROUSEL_INDICATOR_STYLE_NONE:
return g_strdup (_("None"));
case HDY_PAGINATOR_INDICATOR_STYLE_DOTS:
case HDY_CAROUSEL_INDICATOR_STYLE_DOTS:
return g_strdup (_("Dots"));
case HDY_PAGINATOR_INDICATOR_STYLE_LINES:
case HDY_CAROUSEL_INDICATOR_STYLE_LINES:
return g_strdup (_("Lines"));
default:
return NULL;
......@@ -312,26 +312,26 @@ paginator_indicator_style_name (HdyEnumValueObject *value,
}
static void
notify_paginator_indicator_style_cb (GObject *sender,
GParamSpec *pspec,
HdyDemoWindow *self)
notify_carousel_indicator_style_cb (GObject *sender,
GParamSpec *pspec,
HdyDemoWindow *self)
{
HdyComboRow *row = HDY_COMBO_ROW (sender);
g_assert (HDY_IS_COMBO_ROW (row));
g_assert (HDY_IS_DEMO_WINDOW (self));
hdy_paginator_set_indicator_style (self->paginator, hdy_combo_row_get_selected_index (row));
hdy_carousel_set_indicator_style (self->carousel, hdy_combo_row_get_selected_index (row));
}
static void
paginator_return_clicked_cb (GtkButton *btn,
HdyDemoWindow *self)
carousel_return_clicked_cb (GtkButton *btn,
HdyDemoWindow *self)
{
g_autoptr (GList) children;
children = gtk_container_get_children (GTK_CONTAINER (self->paginator));
hdy_paginator_scroll_to (self->paginator, GTK_WIDGET (children->data));
children = gtk_container_get_children (GTK_CONTAINER (self->carousel));
hdy_carousel_scroll_to (self->carousel, GTK_WIDGET (children->data));
}
HdyDemoWindow *
......@@ -378,10 +378,10 @@ hdy_demo_window_class_init (HdyDemoWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, combo_row);
gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, enum_combo_row);
gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, header_group);
gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, paginator);
gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, paginator_listbox);
gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, paginator_orientation_row);
gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, paginator_indicator_style_row);
gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, carousel);
gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, carousel_listbox);
gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, carousel_orientation_row);
gtk_widget_class_bind_template_child (widget_class, HdyDemoWindow, carousel_indicator_style_row);
gtk_widget_class_bind_template_callback_full (widget_class, "key_pressed_cb", G_CALLBACK(hdy_demo_window_key_pressed_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "notify_header_visible_child_cb", G_CALLBACK(hdy_demo_window_notify_header_visible_child_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "notify_fold_cb", G_CALLBACK(hdy_demo_window_notify_fold_cb));
......@@ -392,10 +392,10 @@ hdy_demo_window_class_init (HdyDemoWindowClass *klass)
gtk_widget_class_bind_template_callback_full (widget_class, "dialog_action_clicked_cb", G_CALLBACK(dialog_action_clicked_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "dialog_complex_clicked_cb", G_CALLBACK(dialog_complex_clicked_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "view_switcher_demo_clicked_cb", G_CALLBACK(view_switcher_demo_clicked_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "notify_paginator_position_cb", G_CALLBACK(notify_paginator_position_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "notify_paginator_orientation_cb", G_CALLBACK(notify_paginator_orientation_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "notify_paginator_indicator_style_cb", G_CALLBACK(notify_paginator_indicator_style_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "paginator_return_clicked_cb", G_CALLBACK(paginator_return_clicked_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "notify_carousel_position_cb", G_CALLBACK(notify_carousel_position_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "notify_carousel_orientation_cb", G_CALLBACK(notify_carousel_orientation_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "notify_carousel_indicator_style_cb", G_CALLBACK(notify_carousel_indicator_style_cb));
gtk_widget_class_bind_template_callback_full (widget_class, "carousel_return_clicked_cb", G_CALLBACK(carousel_return_clicked_cb));
}
static void
......@@ -438,10 +438,10 @@ hdy_demo_window_init (HdyDemoWindow *self)
lists_page_init (self);
gtk_list_box_set_header_func (self->paginator_listbox, hdy_list_box_separator_header, NULL, NULL);
hdy_combo_row_set_for_enum (self->paginator_orientation_row, GTK_TYPE_ORIENTATION, paginator_orientation_name, NULL, NULL);
hdy_combo_row_set_for_enum (self->paginator_indicator_style_row, HDY_TYPE_PAGINATOR_INDICATOR_STYLE, paginator_indicator_style_name, NULL, NULL);
hdy_combo_row_set_selected_index (self->paginator_indicator_style_row, HDY_PAGINATOR_INDICATOR_STYLE_DOTS);
gtk_list_box_set_header_func (self->carousel_listbox, hdy_list_box_separator_header, NULL, NULL);
hdy_combo_row_set_for_enum (self->carousel_orientation_row, GTK_TYPE_ORIENTATION, carousel_orientation_name, NULL, NULL);
hdy_combo_row_set_for_enum (self->carousel_indicator_style_row, HDY_TYPE_CAROUSEL_INDICATOR_STYLE, carousel_indicator_style_name, NULL, NULL);
hdy_combo_row_set_selected_index (self->carousel_indicator_style_row, HDY_CAROUSEL_INDICATOR_STYLE_DOTS);
hdy_leaflet_set_visible_child_name (self->content_box, "content");
update_header_bar (self);
......
......@@ -1321,11 +1321,11 @@
</packing>
</child>
<child>
<object class="HdyPaginator" id="paginator">
<object class="HdyCarousel" id="carousel">
<property name="visible">True</property>
<property name="center_content">True</property>
<property name="indicator_spacing">6</property>
<signal name="notify::position" handler="notify_paginator_position_cb"/>
<signal name="notify::position" handler="notify_carousel_position_cb"/>
<child>
<object class="GtkBox">
<property name="visible">True</property>
......@@ -1346,7 +1346,7 @@
<property name="margin-bottom">18</property>
<style>
<class name="dim-label"/>
<class name="paginator-icon"/>
<class name="carousel-icon"/>
</style>
</object>
</child>
......@@ -1359,7 +1359,7 @@
<property name="visible">True</property>
<property name="opacity">0.5</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Paginator</property>
<property name="label" translatable="yes">Carousel</property>
<property name="halign">center</property>
<property name="xalign">0</property>
<property name="margin-bottom">12</property>
......@@ -1397,7 +1397,7 @@
<property name="maximum-width">400</property>
<property name="linear-growth-width">300</property>
<child>
<object class="GtkListBox" id="paginator_listbox">
<object class="GtkListBox" id="carousel_listbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">center</property>
......@@ -1406,17 +1406,17 @@
<class name="frame"/>
</style>
<child>
<object class="HdyComboRow" id="paginator_orientation_row">
<object class="HdyComboRow" id="carousel_orientation_row">
<property name="title" translatable="yes">Orientation</property>
<property name="visible">True</property>
<signal name="notify::selected-index" handler="notify_paginator_orientation_cb" swapped="no"/>
<signal name="notify::selected-index" handler="notify_carousel_orientation_cb" swapped="no"/>
</object>
</child>
<child>
<object class="HdyComboRow" id="paginator_indicator_style_row">
<object class="HdyComboRow" id="carousel_indicator_style_row">
<property name="title" translatable="yes">Page Indicators</property>
<property name="visible">True</property>
<signal name="notify::selected-index" handler="notify_paginator_indicator_style_cb" swapped="no"/>
<signal name="notify::selected-index" handler="notify_carousel_indicator_style_cb" swapped="no"/>
</object>
</child>
</object>
......@@ -1453,7 +1453,7 @@
<property name="can_focus">False</property>
<property name="label" translatable="yes">_Return to the first page</property>
<property name="use-underline">True</property>
<signal name="clicked" handler="paginator_return_clicked_cb" swapped="no"/>
<signal name="clicked" handler="carousel_return_clicked_cb" swapped="no"/>
<style>
<class name="suggested-action"/>
</style>
......@@ -1463,8 +1463,8 @@
</child>
</object>
<packing>
<property name="name">paginator</property>
<property name="title">Paginator</property>
<property name="name">carousel</property>
<property name="title">Carousel</property>
</packing>
</child>
</object>
......
......@@ -3,6 +3,6 @@ stacksidebar list {
border-right-width: 0px;
}
hdypaginator.horizontal .paginator-icon {
hdycarousel.horizontal .carousel-icon {
-gtk-icon-transform: rotate(90deg);
}
......@@ -19,15 +19,15 @@
#define CENTER_CONTENT_INSENSITIVE_MSG _("This property does not apply unless Show Indicators is set.")
static gint
hdy_paginator_get_page (HdyPaginator *paginator)
hdy_carousel_get_page (HdyCarousel *carousel)
{
return round (hdy_paginator_get_position (paginator));
return round (hdy_carousel_get_position (carousel));
}
static gboolean
hdy_paginator_is_transient (HdyPaginator *paginator)
hdy_carousel_is_transient (HdyCarousel *carousel)
{
return fmod (hdy_paginator_get_position (paginator), 1.0) > 0.00001;
return fmod (hdy_carousel_get_position (carousel), 1.0) > 0.00001;
}
static gint
......@@ -103,7 +103,7 @@ selection_changed_cb (GladeProject *project,
for (l = children; l; l = l->next) {
page = l->data;
if (sel_widget == page || gtk_widget_is_ancestor (sel_widget, page)) {
hdy_paginator_scroll_to (HDY_PAGINATOR (container), page);
hdy_carousel_scroll_to (HDY_CAROUSEL (container), page);
index = get_page_index (container, page);
glade_widget_property_set (gwidget, "page", index);
break;
......@@ -120,7 +120,7 @@ project_changed_cb (GladeWidget *gwidget,
GladeProject *project, *old_project;
project = glade_widget_get_project (gwidget);
old_project = g_object_get_data (G_OBJECT (gwidget), "paginator-project-ptr");
old_project = g_object_get_data (G_OBJECT (gwidget), "carousel-project-ptr");
if (old_project)
g_signal_handlers_disconnect_by_func (G_OBJECT (old_project),
......@@ -131,29 +131,29 @@ project_changed_cb (GladeWidget *gwidget,
g_signal_connect (G_OBJECT (project), "selection-changed",
G_CALLBACK (selection_changed_cb), gwidget);
g_object_set_data (G_OBJECT (gwidget), "paginator-project-ptr", project);
g_object_set_data (G_OBJECT (gwidget), "carousel-project-ptr", project);
}
static void
position_changed_cb (HdyPaginator *paginator,
GParamSpec *pspec,
GladeWidget *gwidget)
position_changed_cb (HdyCarousel *carousel,
GParamSpec *pspec,
GladeWidget *gwidget)
{
gint old_page, new_page;
glade_widget_property_get (gwidget, "page", &old_page);
new_page = hdy_paginator_get_page (paginator);
new_page = hdy_carousel_get_page (carousel);
if (old_page == new_page || hdy_paginator_is_transient (paginator))
if (old_page == new_page || hdy_carousel_is_transient (carousel))
return;
glade_widget_property_set (gwidget, "page", new_page);
}
void
glade_hdy_paginator_post_create (GladeWidgetAdaptor *adaptor,
GObject *container,
GladeCreateReason reason)
glade_hdy_carousel_post_create (GladeWidgetAdaptor *adaptor,
GObject *container,
GladeCreateReason reason)
{
GladeWidget *gwidget = glade_widget_get_from_gobject (container);
......@@ -175,10 +175,10 @@ glade_hdy_paginator_post_create (GladeWidgetAdaptor *adaptor,
}
void
glade_hdy_paginator_child_action_activate (GladeWidgetAdaptor *adaptor,
GObject *container,
GObject *object,
const gchar *action_path)
glade_hdy_carousel_child_action_activate (GladeWidgetAdaptor *adaptor,
GObject *container,
GObject *object,
const gchar *action_path)
{
if (!strcmp (action_path, "insert_page_after") ||
!strcmp (action_path, "insert_page_before")) {
......@@ -199,8 +199,8 @@ glade_hdy_paginator_child_action_activate (GladeWidgetAdaptor *adaptor,
placeholder = glade_placeholder_new ();
hdy_paginator_insert (HDY_PAGINATOR (container), placeholder, index);
hdy_paginator_scroll_to (HDY_PAGINATOR (container), placeholder);
hdy_carousel_insert (HDY_CAROUSEL (container), placeholder, index);
hdy_carousel_scroll_to (HDY_CAROUSEL (container), placeholder);
property = glade_widget_get_property (parent, "pages");
glade_command_set_property (property, pages + 1);
......@@ -246,7 +246,7 @@ set_n_pages (GObject *container,
gint old_size, new_size, i, page;
new_size = g_value_get_int (value);
old_size = hdy_paginator_get_n_pages (HDY_PAGINATOR (container));
old_size = hdy_carousel_get_n_pages (HDY_CAROUSEL (container));
if (old_size == new_size)
return;
......@@ -280,7 +280,7 @@ set_page (GObject *object,
child = get_nth_page (GTK_CONTAINER (object), new_page);
if (child)
hdy_paginator_scroll_to (HDY_PAGINATOR (object), child);
hdy_carousel_scroll_to (HDY_CAROUSEL (object), child);
}
static void
......@@ -288,24 +288,24 @@ set_indicator_style (GObject *container,
const GValue *value)
{
GladeWidget *gwidget;
HdyPaginatorIndicatorStyle style;
HdyCarouselIndicatorStyle style;
gwidget = glade_widget_get_from_gobject (container);
style = g_value_get_enum (value);
glade_widget_property_set_sensitive (gwidget, "indicator-spacing",
style != HDY_PAGINATOR_INDICATOR_STYLE_NONE,
style != HDY_CAROUSEL_INDICATOR_STYLE_NONE,
CENTER_CONTENT_INSENSITIVE_MSG);
glade_widget_property_set_sensitive (gwidget, "center-content",
style != HDY_PAGINATOR_INDICATOR_STYLE_NONE,
style != HDY_CAROUSEL_INDICATOR_STYLE_NONE,
CENTER_CONTENT_INSENSITIVE_MSG);
}
void
glade_hdy_paginator_set_property (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *id,
const GValue *value)
glade_hdy_carousel_set_property (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *id,
const GValue *value)
{
if (!strcmp (id, "pages"))
set_n_pages (object, value);
......@@ -320,25 +320,25 @@ glade_hdy_paginator_set_property (GladeWidgetAdaptor *adaptor,
}
void
glade_hdy_paginator_get_property (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *id,
GValue *value)
glade_hdy_carousel_get_property (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *id,
GValue *value)
{
if (!strcmp (id, "pages")) {
g_value_reset (value);
g_value_set_int (value, hdy_paginator_get_n_pages (HDY_PAGINATOR (object)));
g_value_set_int (value, hdy_carousel_get_n_pages (HDY_CAROUSEL (object)));
} else if (!strcmp (id, "page")) {
g_value_reset (value);
g_value_set_int (value, hdy_paginator_get_page (HDY_PAGINATOR (object)));
g_value_set_int (value, hdy_carousel_get_page (HDY_CAROUSEL (object)));
} else {
GWA_GET_CLASS (GTK_TYPE_CONTAINER)->get_property (adaptor, object, id, value);
}
}
static gboolean
glade_hdy_paginator_verify_n_pages (GObject *object,
const GValue *value)
glade_hdy_carousel_verify_n_pages (GObject *object,
const GValue *value)
{
gint new_size, old_size;
......@@ -349,27 +349,27 @@ glade_hdy_paginator_verify_n_pages (GObject *object,
}
static gboolean
glade_hdy_paginator_verify_page (GObject *object,
const GValue *value)
glade_hdy_carousel_verify_page (GObject *object,
const GValue *value)
{
gint page, pages;
page = g_value_get_int (value);
pages = hdy_paginator_get_n_pages (HDY_PAGINATOR (object));
pages = hdy_carousel_get_n_pages (HDY_CAROUSEL (object));
return 0 <= page && page < pages;
}
gboolean
glade_hdy_paginator_verify_property (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *id,
const GValue *value)
glade_hdy_carousel_verify_property (GladeWidgetAdaptor *adaptor,
GObject *object,
const gchar *id,
const GValue *value)
{
if (!strcmp (id, "pages"))
return glade_hdy_paginator_verify_n_pages (object, value);
return glade_hdy_carousel_verify_n_pages (object, value);
else if (!strcmp (id, "page"))
return glade_hdy_paginator_verify_page (object, value);
return glade_hdy_carousel_verify_page (object, value);
else if (GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property)
return GWA_GET_CLASS (GTK_TYPE_CONTAINER)->verify_property (adaptor, object,
id, value);
......@@ -378,9 +378,9 @@ glade_hdy_paginator_verify_property (GladeWidgetAdaptor *adaptor,
}
void
glade_hdy_paginator_add_child (GladeWidgetAdaptor *adaptor,
GObject *container,
GObject *child)
glade_hdy_carousel_add_child (GladeWidgetAdaptor *adaptor,
GObject *container,
GObject *child)
{
GladeWidget *gbox, *gchild;
gint pages, page;
......@@ -416,9 +416,9 @@ glade_hdy_paginator_add_child (GladeWidgetAdaptor *adaptor,
}
void
glade_hdy_paginator_remove_child (GladeWidgetAdaptor *adaptor,
GObject *container,
GObject *child)
glade_hdy_carousel_remove_child (GladeWidgetAdaptor *adaptor,
GObject *container,
GObject *child)
{
GladeWidget *gbox;
gint pages, page;
......@@ -433,20 +433,20 @@ glade_hdy_paginator_remove_child (GladeWidgetAdaptor *adaptor,
}
void
glade_hdy_paginator_replace_child (GladeWidgetAdaptor *adaptor,
GObject *container,
GObject *current,
GObject *new_widget)
glade_hdy_carousel_replace_child (GladeWidgetAdaptor *adaptor,
GObject *container,
GObject *current,
GObject *new_widget)
{
GladeWidget *gbox, *gchild;
gint pages, page, index;
index = get_page_index (GTK_CONTAINER (container), GTK_WIDGET (current));
gtk_container_remove (GTK_CONTAINER (container), GTK_WIDGET (current));
hdy_paginator_insert (HDY_PAGINATOR (container), GTK_WIDGET (new_widget),
index);
hdy_paginator_scroll_to_full (HDY_PAGINATOR (container),
GTK_WIDGET (new_widget), 0);
hdy_carousel_insert (HDY_CAROUSEL (container), GTK_WIDGET (new_widget),
index);
hdy_carousel_scroll_to_full (HDY_CAROUSEL (container),