*
* 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 Street, Fifth Floor, Boston, MA 02110-1301, USA.
*
* $Id$
*/
#include "egg-toolbars-model.h"
#include "egg-toolbar-editor.h"
-#include <gtk/gtkvseparator.h>
-#include <gtk/gtkiconfactory.h>
-#include <gtk/gtkwindow.h>
-#include <gtk/gtkmain.h>
-#include <gtk/gtkdnd.h>
-#include <gtk/gtkhbox.h>
-#include <gtk/gtkimage.h>
-#include <gtk/gtktoggleaction.h>
-#include <gtk/gtkcheckmenuitem.h>
-#include <gtk/gtkimagemenuitem.h>
-#include <gtk/gtkseparatormenuitem.h>
-#include <gtk/gtkmenu.h>
-#include <gtk/gtkstock.h>
-#include <gtk/gtklabel.h>
-#include <gtk/gtkbutton.h>
-#include <gtk/gtktoolbar.h>
-#include <gtk/gtktoolitem.h>
-#include <gtk/gtktoolbutton.h>
-#include <gtk/gtkseparatortoolitem.h>
-#include <gtk/gtkicontheme.h>
+#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <string.h>
gtk_widget_hide (widget);
- action = g_object_get_data (G_OBJECT (widget), "gtk-action");
+#if GTK_CHECK_VERSION (2, 16, 0)
+ action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (widget));
+#else
+action = gtk_widget_get_action (widget);
+#endif
+
if (action == NULL) return;
flags = egg_toolbars_model_get_name_flags (etoolbar->priv->model,
{
gtk_widget_show (widget);
- action = g_object_get_data (G_OBJECT (widget), "gtk-action");
+#if GTK_CHECK_VERSION (2, 16, 0)
+ action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (widget));
+#else
+ action = gtk_widget_get_action (widget);
+#endif
+
if (action == NULL) return;
flags = egg_toolbars_model_get_name_flags (etoolbar->priv->model,
if (priv->edit_mode > 0)
{
GdkCursor *cursor;
+ GdkScreen *screen;
GdkPixbuf *pixbuf = NULL;
-
- cursor = gdk_cursor_new (GDK_HAND2);
+
+ screen = gtk_widget_get_screen (GTK_WIDGET (etoolbar));
+
+ cursor = gdk_cursor_new_for_display (gdk_screen_get_display (screen),
+ GDK_HAND2);
gdk_window_set_cursor (widget->window, cursor);
gdk_cursor_unref (cursor);
static void
configure_item_tooltip (GtkToolItem *item)
{
- GtkAction *action = g_object_get_data (G_OBJECT (item),
- "gtk-action");
-
+ GtkAction *action;
+
+#if GTK_CHECK_VERSION (2, 16, 0)
+ action = gtk_activatable_get_related_action (GTK_ACTIVATABLE (item));
+#else
+ action = gtk_widget_get_action (GTK_WIDGET (item));
+#endif
+
if (action != NULL)
{
g_object_notify (G_OBJECT (action), "tooltip");
priv->visibility_id = gtk_ui_manager_new_merge_id (priv->manager);
- showing = GTK_WIDGET_VISIBLE (etoolbar);
+ showing = gtk_widget_get_visible (GTK_WIDGET (etoolbar));
n_toolbars = egg_toolbars_model_n_toolbars (priv->model);
for (i = 0; i < n_toolbars; i++)
gtk_action_set_visible (GTK_ACTION (action), (egg_toolbars_model_get_flags (priv->model, i)
& EGG_TB_MODEL_NOT_REMOVABLE) == 0);
gtk_action_set_sensitive (GTK_ACTION (action), showing);
- gtk_toggle_action_set_active (action, GTK_WIDGET_VISIBLE
+ gtk_toggle_action_set_active (action, gtk_widget_get_visible
(get_dock_nth (etoolbar, i)));
for (list = priv->visibility_paths; list != NULL; list = g_list_next (list))
priv->visibility_paths = NULL;
}
+ g_free (priv->popup_path);
+ priv->popup_path = NULL;
+
if (priv->manager != NULL)
{
if (priv->visibility_id)
GdkVisual *visual;
gint icon_width;
gint icon_height;
+ GdkScreen *screen;
icon_width = DEFAULT_ICON_WIDTH;
- if (!gtk_icon_size_lookup_for_settings (gtk_settings_get_default (),
+ screen = gtk_widget_get_screen (widget);
+
+ if (!gtk_icon_size_lookup_for_settings (gtk_settings_get_for_screen (screen),
GTK_ICON_SIZE_LARGE_TOOLBAR,
NULL,
&icon_height))
}
static GdkPixbuf *
-new_separator_pixbuf ()
+new_separator_pixbuf (void)
{
GtkWidget *separator;
GdkPixbuf *pixbuf;