dock-commands.c 1.92 KB
Newer Older
1
/* GIMP - The GNU Image Manipulation Program
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * 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.
 */

#include "config.h"

#include <gtk/gtk.h>

23 24
#include "libgimpwidgets/gimpwidgets.h"

25 26
#include "actions-types.h"

27
#include "widgets/gimpmenudock.h"
28

29 30 31 32 33 34
#include "actions.h"
#include "dock-commands.h"


/*  public functions  */

35 36 37 38 39 40 41 42
void
dock_toggle_image_menu_cmd_callback (GtkAction *action,
                                     gpointer   data)
{
  GtkWidget *widget;
  gboolean   active;
  return_if_no_widget (widget, data);

43 44
  if (! GTK_WIDGET_TOPLEVEL (widget))
    widget = gtk_widget_get_toplevel (widget);
45 46 47

  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

48 49
  if (GIMP_IS_MENU_DOCK (widget))
    gimp_menu_dock_set_show_image_menu (GIMP_MENU_DOCK (widget), active);
50 51 52 53 54 55 56 57 58 59
}

void
dock_toggle_auto_cmd_callback (GtkAction *action,
                               gpointer   data)
{
  GtkWidget *widget;
  gboolean   active;
  return_if_no_widget (widget, data);

60 61
  if (! GTK_WIDGET_TOPLEVEL (widget))
    widget = gtk_widget_get_toplevel (widget);
62 63 64

  active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action));

65 66
  if (GIMP_IS_MENU_DOCK (widget))
    gimp_menu_dock_set_auto_follow_active (GIMP_MENU_DOCK (widget), active);
67
}