~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/actions/windows-commands.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-10-06 13:30:41 UTC
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: james.westby@ubuntu.com-20081006133041-3panbkcanaymfsmp
Tags: upstream-2.6.0
ImportĀ upstreamĀ versionĀ 2.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* GIMP - The GNU Image Manipulation Program
 
2
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License as published by
 
6
 * the Free Software Foundation; either version 2 of the License, or
 
7
 * (at your option) any later version.
 
8
 *
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
 * GNU General Public License for more details.
 
13
 *
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
17
 */
 
18
 
 
19
#include "config.h"
 
20
 
 
21
#include <gtk/gtk.h>
 
22
 
 
23
#include "libgimpwidgets/gimpwidgets.h"
 
24
 
 
25
#include "actions-types.h"
 
26
 
 
27
#include "core/gimpcontainer.h"
 
28
 
 
29
#include "widgets/gimpdialogfactory.h"
 
30
#include "widgets/gimpsessioninfo.h"
 
31
 
 
32
#include "display/gimpdisplay.h"
 
33
 
 
34
#include "dialogs/dialogs.h"
 
35
 
 
36
#include "windows-commands.h"
 
37
 
 
38
 
 
39
/*  public functions  */
 
40
 
 
41
void
 
42
windows_show_toolbox_cmd_callback (GtkAction *action,
 
43
                                   gpointer   data)
 
44
{
 
45
  windows_show_toolbox ();
 
46
}
 
47
 
 
48
void
 
49
windows_show_display_cmd_callback (GtkAction *action,
 
50
                                   gpointer   data)
 
51
{
 
52
  GimpDisplay *display = g_object_get_data (G_OBJECT (action), "display");
 
53
 
 
54
  gtk_window_present (GTK_WINDOW (display->shell));
 
55
}
 
56
 
 
57
void
 
58
windows_show_dock_cmd_callback (GtkAction *action,
 
59
                                gpointer   data)
 
60
{
 
61
  GtkWindow *dock = g_object_get_data (G_OBJECT (action), "dock");
 
62
 
 
63
  gtk_window_present (dock);
 
64
}
 
65
 
 
66
void
 
67
windows_open_recent_cmd_callback (GtkAction *action,
 
68
                                  gpointer   data)
 
69
{
 
70
  GimpSessionInfo *info = g_object_get_data (G_OBJECT (action), "info");
 
71
 
 
72
  g_object_ref (info);
 
73
  gimp_container_remove (global_recent_docks, GIMP_OBJECT (info));
 
74
 
 
75
  global_dock_factory->session_infos =
 
76
    g_list_append (global_dock_factory->session_infos, info);
 
77
 
 
78
  gimp_session_info_restore (info, global_dock_factory);
 
79
  gimp_session_info_clear_info (info);
 
80
}
 
81
 
 
82
void
 
83
windows_show_toolbox (void)
 
84
{
 
85
  if (! global_toolbox_factory->open_dialogs)
 
86
    {
 
87
      GtkWidget *toolbox;
 
88
 
 
89
      toolbox = gimp_dialog_factory_dock_new (global_toolbox_factory,
 
90
                                              gdk_screen_get_default ());
 
91
 
 
92
      gtk_widget_show (toolbox);
 
93
    }
 
94
  else
 
95
    {
 
96
      gimp_dialog_factory_show_toolbox (global_toolbox_factory);
 
97
    }
 
98
}