* Copyright (C) 2007 The Free Software Foundation
* Copyright (C) 2008 Marco Barisione <marco@barisione.org>
*
- * Based on evince code (shell/ev-sidebar.c) by:
+ * Based on evince code (shell/ev-sidebar.c) by:
* - Jonathan Blandford <jrb@alum.mit.edu>
*
* Base on eog code (src/eog-sidebar.c) by:
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifdef HAVE_CONFIG_H
GtkTreeIter *iter)
{
gchar *title;
- gint index;
+ gint index_;
gtk_tree_model_get (sidebar->priv->page_model, iter,
- PAGE_COLUMN_TITLE, &title,
- PAGE_COLUMN_NOTEBOOK_INDEX, &index,
+ PAGE_COLUMN_TITLE, &title,
+ PAGE_COLUMN_NOTEBOOK_INDEX, &index_,
-1);
- gtk_notebook_set_current_page (GTK_NOTEBOOK (sidebar->priv->notebook), index);
+ gtk_notebook_set_current_page (GTK_NOTEBOOK (sidebar->priv->notebook),
+ index_);
gtk_label_set_text (GTK_LABEL (sidebar->priv->label), title);
g_free (title);
switch (prop_id)
{
case PROP_CURRENT_PAGE:
- empathy_sidebar_set_page (sidebar, g_value_get_object (value));
+ empathy_sidebar_set_page (sidebar, g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
gpointer user_data)
{
GtkWidget *widget;
+ GtkAllocation allocation;
g_return_if_fail (GTK_IS_BUTTON (user_data));
- g_return_if_fail (GTK_WIDGET_NO_WINDOW (user_data));
+ g_return_if_fail (gtk_widget_get_has_window (user_data));
widget = GTK_WIDGET (user_data);
- gdk_window_get_origin (widget->window, x, y);
+ gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
- *x += widget->allocation.x;
- *y += widget->allocation.y + widget->allocation.height;
+ gtk_widget_get_allocation (widget, &allocation);
+ *x += allocation.x;
+ *y += allocation.y + allocation.height;
*push_in = FALSE;
}
{
GtkRequisition requisition;
gint width;
+ GtkAllocation allocation;
- width = widget->allocation.width;
+ gtk_widget_get_allocation (widget, &allocation);
+ width = allocation.width;
gtk_widget_set_size_request (sidebar->priv->menu, -1, -1);
gtk_widget_size_request (sidebar->priv->menu, &requisition);
gtk_widget_show (hbox);
sidebar->priv->select_button = gtk_toggle_button_new ();
- gtk_button_set_relief (GTK_BUTTON (sidebar->priv->select_button),
+ gtk_button_set_relief (GTK_BUTTON (sidebar->priv->select_button),
GTK_RELIEF_NONE);
g_signal_connect (sidebar->priv->select_button, "button_press_event",
GtkTreeIter iter;
GtkWidget *menu_item;
gchar *label_title;
- gint index;
+ gint index_;
g_return_if_fail (EMPATHY_IS_SIDEBAR (sidebar));
g_return_if_fail (GTK_IS_WIDGET (main_widget));
- index = gtk_notebook_append_page (GTK_NOTEBOOK (sidebar->priv->notebook),
+ index_ = gtk_notebook_append_page (GTK_NOTEBOOK (sidebar->priv->notebook),
main_widget, NULL);
menu_item = gtk_image_menu_item_new_with_label (title);
PAGE_COLUMN_TITLE, title,
PAGE_COLUMN_MENU_ITEM, menu_item,
PAGE_COLUMN_MAIN_WIDGET, main_widget,
- PAGE_COLUMN_NOTEBOOK_INDEX, index,
+ PAGE_COLUMN_NOTEBOOK_INDEX, index_,
-1);
gtk_list_store_move_before (GTK_LIST_STORE(sidebar->priv->page_model),
- &iter,
+ &iter,
NULL);
/* Set the first item added as active */
gtk_tree_model_get (sidebar->priv->page_model,
&iter,
PAGE_COLUMN_TITLE, &label_title,
- PAGE_COLUMN_NOTEBOOK_INDEX, &index,
+ PAGE_COLUMN_NOTEBOOK_INDEX, &index_,
-1);
- gtk_menu_set_active (GTK_MENU (sidebar->priv->menu), index);
+ gtk_menu_set_active (GTK_MENU (sidebar->priv->menu), index_);
gtk_label_set_text (GTK_LABEL (sidebar->priv->label), label_title);
gtk_notebook_set_current_page (GTK_NOTEBOOK (sidebar->priv->notebook),
- index);
+ index_);
g_free (label_title);
GtkTreeIter iter;
GtkWidget *widget, *menu_item;
gboolean valid;
- gint index;
+ gint index_;
g_return_if_fail (EMPATHY_IS_SIDEBAR (sidebar));
g_return_if_fail (GTK_IS_WIDGET (main_widget));
while (valid)
{
gtk_tree_model_get (sidebar->priv->page_model, &iter,
- PAGE_COLUMN_NOTEBOOK_INDEX, &index,
+ PAGE_COLUMN_NOTEBOOK_INDEX, &index_,
PAGE_COLUMN_MENU_ITEM, &menu_item,
PAGE_COLUMN_MAIN_WIDGET, &widget,
-1);
if (valid)
{
- gtk_notebook_remove_page (GTK_NOTEBOOK (sidebar->priv->notebook),
- index);
+ gtk_notebook_remove_page (GTK_NOTEBOOK (sidebar->priv->notebook),
+ index_);
gtk_container_remove (GTK_CONTAINER (sidebar->priv->menu), menu_item);
- gtk_list_store_remove (GTK_LIST_STORE (sidebar->priv->page_model),
+ gtk_list_store_remove (GTK_LIST_STORE (sidebar->priv->page_model),
&iter);
- g_signal_emit (G_OBJECT (sidebar),
+ g_signal_emit (G_OBJECT (sidebar),
signals[SIGNAL_PAGE_REMOVED], 0, main_widget);
}
}