added gimp_button_extended_clicked() which emits the resp. signal.
2001-10-24 Michael Natterer <mitch@gimp.org> * libgimpwidgets/gimpbutton.[ch]: added gimp_button_extended_clicked() which emits the resp. signal. * app/gui/menus.[ch]: added new item factories "<Buffers>" and "<Documents>". * app/gui/Makefile.am * app/gui/buffers-commands.[ch] * app/gui/documents-commands.[ch]: new files for the callbacks. * app/gui/dialogs-constructors.c: use them. * app/gui/file-open-dialog.c: set the title to "Open Image", not "Load Image".
This commit is contained in:

committed by
Michael Natterer

parent
1261ba7bcc
commit
f766956e67
17
ChangeLog
17
ChangeLog
@ -1,3 +1,20 @@
|
||||
2001-10-24 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* libgimpwidgets/gimpbutton.[ch]: added
|
||||
gimp_button_extended_clicked() which emits the resp. signal.
|
||||
|
||||
* app/gui/menus.[ch]: added new item factories "<Buffers>" and
|
||||
"<Documents>".
|
||||
|
||||
* app/gui/Makefile.am
|
||||
* app/gui/buffers-commands.[ch]
|
||||
* app/gui/documents-commands.[ch]: new files for the callbacks.
|
||||
|
||||
* app/gui/dialogs-constructors.c: use them.
|
||||
|
||||
* app/gui/file-open-dialog.c: set the title to "Open Image",
|
||||
not "Load Image".
|
||||
|
||||
2001-10-23 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/app_procs.c: pass a "Gimp" to gui_libs_init(), initialize
|
||||
|
137
app/actions/buffers-commands.c
Normal file
137
app/actions/buffers-commands.c
Normal file
@ -0,0 +1,137 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* 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>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "gui-types.h"
|
||||
|
||||
#include "core/gimpbuffer.h"
|
||||
#include "core/gimpcontainer.h"
|
||||
#include "core/gimpcontext.h"
|
||||
|
||||
#include "widgets/gimpbufferview.h"
|
||||
#include "widgets/gimpcontainerlistview.h"
|
||||
#include "widgets/gimplistitem.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "buffers-commands.h"
|
||||
#include "menus.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void buffers_menu_set_sensitivity (GimpContainerEditor *editor);
|
||||
|
||||
|
||||
/* public functionss */
|
||||
|
||||
void
|
||||
buffers_paste_buffer_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBufferView *view;
|
||||
|
||||
view = (GimpBufferView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->paste_button));
|
||||
}
|
||||
|
||||
void
|
||||
buffers_paste_buffer_into_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBufferView *view;
|
||||
|
||||
view = (GimpBufferView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->paste_into_button));
|
||||
}
|
||||
|
||||
void
|
||||
buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBufferView *view;
|
||||
|
||||
view = (GimpBufferView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->paste_as_new_button));
|
||||
}
|
||||
|
||||
void
|
||||
buffers_delete_buffer_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBufferView *view;
|
||||
|
||||
view = (GimpBufferView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->delete_button));
|
||||
}
|
||||
|
||||
void
|
||||
buffers_show_context_menu (GimpContainerEditor *editor)
|
||||
{
|
||||
GtkItemFactory *item_factory;
|
||||
|
||||
buffers_menu_set_sensitivity (editor);
|
||||
|
||||
item_factory = menus_get_buffers_factory ();
|
||||
|
||||
gimp_item_factory_popup_with_data (item_factory, editor);
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
buffers_menu_set_sensitivity (GimpContainerEditor *editor)
|
||||
{
|
||||
GimpBuffer *buffer;
|
||||
|
||||
buffer = gimp_context_get_buffer (editor->view->context);
|
||||
|
||||
#define SET_SENSITIVE(menu,condition) \
|
||||
menus_set_sensitive ("<Buffers>/" menu, (condition) != 0)
|
||||
|
||||
SET_SENSITIVE ("Paste Buffer", buffer);
|
||||
SET_SENSITIVE ("Paste Buffer Into", buffer);
|
||||
SET_SENSITIVE ("Paste Buffer as New", buffer);
|
||||
SET_SENSITIVE ("Delete Buffer", buffer);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
}
|
36
app/actions/buffers-commands.h
Normal file
36
app/actions/buffers-commands.h
Normal file
@ -0,0 +1,36 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BUFFERS_COMMANDS_H__
|
||||
#define __BUFFERS_COMMANDS_H__
|
||||
|
||||
|
||||
void buffers_paste_buffer_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void buffers_paste_buffer_into_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void buffers_delete_buffer_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
|
||||
void buffers_show_context_menu (GimpContainerEditor *editor);
|
||||
|
||||
|
||||
#endif /* __BUFFERS_COMMANDS_H__ */
|
153
app/actions/documents-commands.c
Normal file
153
app/actions/documents-commands.c
Normal file
@ -0,0 +1,153 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* 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>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "gui-types.h"
|
||||
|
||||
#include "core/gimpcontainer.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpimagefile.h"
|
||||
|
||||
#include "widgets/gimpcontainerlistview.h"
|
||||
#include "widgets/gimpdocumentview.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "documents-commands.h"
|
||||
#include "menus.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void documents_menu_set_sensitivity (GimpContainerEditor *editor);
|
||||
|
||||
|
||||
/* public functionss */
|
||||
|
||||
void
|
||||
documents_open_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDocumentView *view;
|
||||
|
||||
view = (GimpDocumentView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->open_button));
|
||||
}
|
||||
|
||||
void
|
||||
documents_raise_or_open_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDocumentView *view;
|
||||
|
||||
view = (GimpDocumentView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gimp_button_extended_clicked (GIMP_BUTTON (view->open_button),
|
||||
GDK_SHIFT_MASK);
|
||||
}
|
||||
|
||||
void
|
||||
documents_file_open_dialog_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDocumentView *view;
|
||||
|
||||
view = (GimpDocumentView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gimp_button_extended_clicked (GIMP_BUTTON (view->open_button),
|
||||
GDK_CONTROL_MASK);
|
||||
}
|
||||
|
||||
void
|
||||
documents_delete_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDocumentView *view;
|
||||
|
||||
view = (GimpDocumentView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->delete_button));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
documents_refresh_documents_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDocumentView *view;
|
||||
|
||||
view = (GimpDocumentView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->refresh_button));
|
||||
}
|
||||
|
||||
void
|
||||
documents_show_context_menu (GimpContainerEditor *editor)
|
||||
{
|
||||
GtkItemFactory *item_factory;
|
||||
|
||||
documents_menu_set_sensitivity (editor);
|
||||
|
||||
item_factory = menus_get_documents_factory ();
|
||||
|
||||
gimp_item_factory_popup_with_data (item_factory, editor);
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
documents_menu_set_sensitivity (GimpContainerEditor *editor)
|
||||
{
|
||||
GimpImagefile *imagefile;
|
||||
|
||||
imagefile = gimp_context_get_imagefile (editor->view->context);
|
||||
|
||||
#define SET_SENSITIVE(menu,condition) \
|
||||
menus_set_sensitive ("<Documents>/" menu, (condition) != 0)
|
||||
|
||||
SET_SENSITIVE ("Open Image", imagefile);
|
||||
SET_SENSITIVE ("Raise or Open Image", imagefile);
|
||||
SET_SENSITIVE ("File Open Dialog...", TRUE);
|
||||
SET_SENSITIVE ("Remove Entry", imagefile);
|
||||
SET_SENSITIVE ("Refresh History", TRUE);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
}
|
38
app/actions/documents-commands.h
Normal file
38
app/actions/documents-commands.h
Normal file
@ -0,0 +1,38 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __DOCUMENTS_COMMANDS_H__
|
||||
#define __DOCUMENTS_COMMANDS_H__
|
||||
|
||||
|
||||
void documents_open_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void documents_raise_or_open_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void documents_file_open_dialog_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void documents_delete_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void documents_refresh_documents_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
|
||||
void documents_show_context_menu (GimpContainerEditor *editor);
|
||||
|
||||
|
||||
#endif /* __DOCUMENTS_COMMANDS_H__ */
|
@ -24,7 +24,6 @@
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "gui-types.h"
|
||||
#include "tools/tools-types.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpbrushgenerated.h"
|
||||
@ -54,11 +53,13 @@
|
||||
#include "brush-editor.h"
|
||||
#include "brush-select.h"
|
||||
#include "brushes-commands.h"
|
||||
#include "buffers-commands.h"
|
||||
#include "channels-commands.h"
|
||||
#include "color-area.h"
|
||||
#include "colormap-dialog.h"
|
||||
#include "dialogs.h"
|
||||
#include "dialogs-constructors.h"
|
||||
#include "documents-commands.h"
|
||||
#include "error-console-dialog.h"
|
||||
#include "gradient-editor.h"
|
||||
#include "gradient-select.h"
|
||||
@ -462,7 +463,7 @@ dialogs_buffer_list_view_new (GimpDialogFactory *factory,
|
||||
context,
|
||||
32,
|
||||
5, 3,
|
||||
NULL);
|
||||
buffers_show_context_menu);
|
||||
|
||||
return dialogs_dockable_new (view,
|
||||
"Buffer List", "Buffers",
|
||||
@ -601,7 +602,7 @@ dialogs_buffer_grid_view_new (GimpDialogFactory *factory,
|
||||
context,
|
||||
32,
|
||||
5, 3,
|
||||
NULL);
|
||||
buffers_show_context_menu);
|
||||
|
||||
return dialogs_dockable_new (view,
|
||||
"Buffer Grid", "Buffers",
|
||||
@ -749,7 +750,7 @@ dialogs_document_history_new (GimpDialogFactory *factory,
|
||||
context,
|
||||
32,
|
||||
5, 3,
|
||||
NULL);
|
||||
documents_show_context_menu);
|
||||
|
||||
return dialogs_dockable_new (view,
|
||||
"Document History", "History",
|
||||
|
@ -159,7 +159,7 @@ file_open_dialog_show (void)
|
||||
|
||||
gtk_file_selection_set_filename (GTK_FILE_SELECTION (fileload),
|
||||
"." G_DIR_SEPARATOR_S);
|
||||
gtk_window_set_title (GTK_WINDOW (fileload), _("Load Image"));
|
||||
gtk_window_set_title (GTK_WINDOW (fileload), _("Open Image"));
|
||||
|
||||
file_dialog_show (fileload);
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ libappgui_a_SOURCES = @STRIP_BEGIN@ \
|
||||
brush-select.h \
|
||||
brushes-commands.c \
|
||||
brushes-commands.h \
|
||||
buffers-commands.c \
|
||||
buffers-commands.h \
|
||||
channels-commands.c \
|
||||
channels-commands.h \
|
||||
color-area.c \
|
||||
@ -34,6 +36,8 @@ libappgui_a_SOURCES = @STRIP_BEGIN@ \
|
||||
dialogs-commands.h \
|
||||
dialogs-constructors.c \
|
||||
dialogs-constructors.h \
|
||||
documents-commands.c \
|
||||
documents-commands.h \
|
||||
edit-commands.c \
|
||||
edit-commands.h \
|
||||
error-console-dialog.c \
|
||||
|
137
app/gui/buffers-commands.c
Normal file
137
app/gui/buffers-commands.c
Normal file
@ -0,0 +1,137 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* 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>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "gui-types.h"
|
||||
|
||||
#include "core/gimpbuffer.h"
|
||||
#include "core/gimpcontainer.h"
|
||||
#include "core/gimpcontext.h"
|
||||
|
||||
#include "widgets/gimpbufferview.h"
|
||||
#include "widgets/gimpcontainerlistview.h"
|
||||
#include "widgets/gimplistitem.h"
|
||||
#include "widgets/gimppreview.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "buffers-commands.h"
|
||||
#include "menus.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void buffers_menu_set_sensitivity (GimpContainerEditor *editor);
|
||||
|
||||
|
||||
/* public functionss */
|
||||
|
||||
void
|
||||
buffers_paste_buffer_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBufferView *view;
|
||||
|
||||
view = (GimpBufferView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->paste_button));
|
||||
}
|
||||
|
||||
void
|
||||
buffers_paste_buffer_into_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBufferView *view;
|
||||
|
||||
view = (GimpBufferView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->paste_into_button));
|
||||
}
|
||||
|
||||
void
|
||||
buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBufferView *view;
|
||||
|
||||
view = (GimpBufferView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->paste_as_new_button));
|
||||
}
|
||||
|
||||
void
|
||||
buffers_delete_buffer_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpBufferView *view;
|
||||
|
||||
view = (GimpBufferView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->delete_button));
|
||||
}
|
||||
|
||||
void
|
||||
buffers_show_context_menu (GimpContainerEditor *editor)
|
||||
{
|
||||
GtkItemFactory *item_factory;
|
||||
|
||||
buffers_menu_set_sensitivity (editor);
|
||||
|
||||
item_factory = menus_get_buffers_factory ();
|
||||
|
||||
gimp_item_factory_popup_with_data (item_factory, editor);
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
buffers_menu_set_sensitivity (GimpContainerEditor *editor)
|
||||
{
|
||||
GimpBuffer *buffer;
|
||||
|
||||
buffer = gimp_context_get_buffer (editor->view->context);
|
||||
|
||||
#define SET_SENSITIVE(menu,condition) \
|
||||
menus_set_sensitive ("<Buffers>/" menu, (condition) != 0)
|
||||
|
||||
SET_SENSITIVE ("Paste Buffer", buffer);
|
||||
SET_SENSITIVE ("Paste Buffer Into", buffer);
|
||||
SET_SENSITIVE ("Paste Buffer as New", buffer);
|
||||
SET_SENSITIVE ("Delete Buffer", buffer);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
}
|
36
app/gui/buffers-commands.h
Normal file
36
app/gui/buffers-commands.h
Normal file
@ -0,0 +1,36 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __BUFFERS_COMMANDS_H__
|
||||
#define __BUFFERS_COMMANDS_H__
|
||||
|
||||
|
||||
void buffers_paste_buffer_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void buffers_paste_buffer_into_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void buffers_paste_buffer_as_new_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void buffers_delete_buffer_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
|
||||
void buffers_show_context_menu (GimpContainerEditor *editor);
|
||||
|
||||
|
||||
#endif /* __BUFFERS_COMMANDS_H__ */
|
@ -24,7 +24,6 @@
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "gui-types.h"
|
||||
#include "tools/tools-types.h"
|
||||
|
||||
#include "core/gimp.h"
|
||||
#include "core/gimpbrushgenerated.h"
|
||||
@ -54,11 +53,13 @@
|
||||
#include "brush-editor.h"
|
||||
#include "brush-select.h"
|
||||
#include "brushes-commands.h"
|
||||
#include "buffers-commands.h"
|
||||
#include "channels-commands.h"
|
||||
#include "color-area.h"
|
||||
#include "colormap-dialog.h"
|
||||
#include "dialogs.h"
|
||||
#include "dialogs-constructors.h"
|
||||
#include "documents-commands.h"
|
||||
#include "error-console-dialog.h"
|
||||
#include "gradient-editor.h"
|
||||
#include "gradient-select.h"
|
||||
@ -462,7 +463,7 @@ dialogs_buffer_list_view_new (GimpDialogFactory *factory,
|
||||
context,
|
||||
32,
|
||||
5, 3,
|
||||
NULL);
|
||||
buffers_show_context_menu);
|
||||
|
||||
return dialogs_dockable_new (view,
|
||||
"Buffer List", "Buffers",
|
||||
@ -601,7 +602,7 @@ dialogs_buffer_grid_view_new (GimpDialogFactory *factory,
|
||||
context,
|
||||
32,
|
||||
5, 3,
|
||||
NULL);
|
||||
buffers_show_context_menu);
|
||||
|
||||
return dialogs_dockable_new (view,
|
||||
"Buffer Grid", "Buffers",
|
||||
@ -749,7 +750,7 @@ dialogs_document_history_new (GimpDialogFactory *factory,
|
||||
context,
|
||||
32,
|
||||
5, 3,
|
||||
NULL);
|
||||
documents_show_context_menu);
|
||||
|
||||
return dialogs_dockable_new (view,
|
||||
"Document History", "History",
|
||||
|
153
app/gui/documents-commands.c
Normal file
153
app/gui/documents-commands.c
Normal file
@ -0,0 +1,153 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* 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>
|
||||
|
||||
#include "libgimpwidgets/gimpwidgets.h"
|
||||
|
||||
#include "gui-types.h"
|
||||
|
||||
#include "core/gimpcontainer.h"
|
||||
#include "core/gimpcontext.h"
|
||||
#include "core/gimpimagefile.h"
|
||||
|
||||
#include "widgets/gimpcontainerlistview.h"
|
||||
#include "widgets/gimpdocumentview.h"
|
||||
#include "widgets/gimpwidgets-utils.h"
|
||||
|
||||
#include "documents-commands.h"
|
||||
#include "menus.h"
|
||||
|
||||
#include "libgimp/gimpintl.h"
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void documents_menu_set_sensitivity (GimpContainerEditor *editor);
|
||||
|
||||
|
||||
/* public functionss */
|
||||
|
||||
void
|
||||
documents_open_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDocumentView *view;
|
||||
|
||||
view = (GimpDocumentView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->open_button));
|
||||
}
|
||||
|
||||
void
|
||||
documents_raise_or_open_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDocumentView *view;
|
||||
|
||||
view = (GimpDocumentView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gimp_button_extended_clicked (GIMP_BUTTON (view->open_button),
|
||||
GDK_SHIFT_MASK);
|
||||
}
|
||||
|
||||
void
|
||||
documents_file_open_dialog_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDocumentView *view;
|
||||
|
||||
view = (GimpDocumentView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gimp_button_extended_clicked (GIMP_BUTTON (view->open_button),
|
||||
GDK_CONTROL_MASK);
|
||||
}
|
||||
|
||||
void
|
||||
documents_delete_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDocumentView *view;
|
||||
|
||||
view = (GimpDocumentView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->delete_button));
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
documents_refresh_documents_cmd_callback (GtkWidget *widget,
|
||||
gpointer data)
|
||||
{
|
||||
GimpDocumentView *view;
|
||||
|
||||
view = (GimpDocumentView *) gimp_widget_get_callback_context (widget);
|
||||
|
||||
if (! view)
|
||||
return;
|
||||
|
||||
gtk_button_clicked (GTK_BUTTON (view->refresh_button));
|
||||
}
|
||||
|
||||
void
|
||||
documents_show_context_menu (GimpContainerEditor *editor)
|
||||
{
|
||||
GtkItemFactory *item_factory;
|
||||
|
||||
documents_menu_set_sensitivity (editor);
|
||||
|
||||
item_factory = menus_get_documents_factory ();
|
||||
|
||||
gimp_item_factory_popup_with_data (item_factory, editor);
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
documents_menu_set_sensitivity (GimpContainerEditor *editor)
|
||||
{
|
||||
GimpImagefile *imagefile;
|
||||
|
||||
imagefile = gimp_context_get_imagefile (editor->view->context);
|
||||
|
||||
#define SET_SENSITIVE(menu,condition) \
|
||||
menus_set_sensitive ("<Documents>/" menu, (condition) != 0)
|
||||
|
||||
SET_SENSITIVE ("Open Image", imagefile);
|
||||
SET_SENSITIVE ("Raise or Open Image", imagefile);
|
||||
SET_SENSITIVE ("File Open Dialog...", TRUE);
|
||||
SET_SENSITIVE ("Remove Entry", imagefile);
|
||||
SET_SENSITIVE ("Refresh History", TRUE);
|
||||
|
||||
#undef SET_SENSITIVE
|
||||
}
|
38
app/gui/documents-commands.h
Normal file
38
app/gui/documents-commands.h
Normal file
@ -0,0 +1,38 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __DOCUMENTS_COMMANDS_H__
|
||||
#define __DOCUMENTS_COMMANDS_H__
|
||||
|
||||
|
||||
void documents_open_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void documents_raise_or_open_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void documents_file_open_dialog_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void documents_delete_document_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
void documents_refresh_documents_cmd_callback (GtkWidget *widget,
|
||||
gpointer data);
|
||||
|
||||
|
||||
void documents_show_context_menu (GimpContainerEditor *editor);
|
||||
|
||||
|
||||
#endif /* __DOCUMENTS_COMMANDS_H__ */
|
@ -159,7 +159,7 @@ file_open_dialog_show (void)
|
||||
|
||||
gtk_file_selection_set_filename (GTK_FILE_SELECTION (fileload),
|
||||
"." G_DIR_SEPARATOR_S);
|
||||
gtk_window_set_title (GTK_WINDOW (fileload), _("Load Image"));
|
||||
gtk_window_set_title (GTK_WINDOW (fileload), _("Open Image"));
|
||||
|
||||
file_dialog_show (fileload);
|
||||
}
|
||||
|
112
app/gui/menus.c
112
app/gui/menus.c
@ -45,10 +45,12 @@
|
||||
#include "tools/gimpthresholdtool.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "buffers-commands.h"
|
||||
#include "channels-commands.h"
|
||||
#include "commands.h"
|
||||
#include "data-commands.h"
|
||||
#include "dialogs-commands.h"
|
||||
#include "documents-commands.h"
|
||||
#include "edit-commands.h"
|
||||
#include "file-commands.h"
|
||||
#include "gradients-commands.h"
|
||||
@ -1502,6 +1504,68 @@ static GimpItemFactoryEntry palettes_entries[] =
|
||||
};
|
||||
|
||||
|
||||
/***** <Buffers> *****/
|
||||
|
||||
static GimpItemFactoryEntry buffers_entries[] =
|
||||
{
|
||||
{ { N_("/Paste Buffer"), NULL,
|
||||
buffers_paste_buffer_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_PASTE },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Paste Buffer Into"), NULL,
|
||||
buffers_paste_buffer_into_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_PASTE_INTO },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Paste Buffer as New"), NULL,
|
||||
buffers_paste_buffer_as_new_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_PASTE_AS_NEW },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Delete Buffer"), NULL,
|
||||
buffers_delete_buffer_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_DELETE },
|
||||
NULL,
|
||||
NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
/***** <Documents> *****/
|
||||
|
||||
static GimpItemFactoryEntry documents_entries[] =
|
||||
{
|
||||
{ { N_("/Open Image"), NULL,
|
||||
documents_open_document_cmd_callback, 0,
|
||||
"<StockItem>", GTK_STOCK_OPEN },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Raise or Open Image"), NULL,
|
||||
documents_raise_or_open_document_cmd_callback, 0,
|
||||
"<StockItem>", GTK_STOCK_OPEN },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/File Open Dialog..."), NULL,
|
||||
documents_file_open_dialog_cmd_callback, 0,
|
||||
"<StockItem>", GTK_STOCK_OPEN },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Remove Entry"), NULL,
|
||||
documents_delete_document_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_DELETE },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
|
||||
SEPARATOR ("/---"),
|
||||
|
||||
{ { N_("/Refresh History"), NULL,
|
||||
documents_refresh_documents_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_REFRESH },
|
||||
NULL,
|
||||
NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
static gboolean menus_initialized = FALSE;
|
||||
|
||||
|
||||
@ -1517,6 +1581,8 @@ static GtkItemFactory *brushes_factory = NULL;
|
||||
static GtkItemFactory *patterns_factory = NULL;
|
||||
static GtkItemFactory *gradients_factory = NULL;
|
||||
static GtkItemFactory *palettes_factory = NULL;
|
||||
static GtkItemFactory *buffers_factory = NULL;
|
||||
static GtkItemFactory *documents_factory = NULL;
|
||||
|
||||
|
||||
/* public functions */
|
||||
@ -1546,6 +1612,8 @@ menus_init (Gimp *gimp)
|
||||
patterns_factory = menus_get_patterns_factory ();
|
||||
gradients_factory = menus_get_gradients_factory ();
|
||||
palettes_factory = menus_get_palettes_factory ();
|
||||
buffers_factory = menus_get_buffers_factory ();
|
||||
documents_factory = menus_get_documents_factory ();
|
||||
|
||||
for (list = GIMP_LIST (gimp->tool_info_list)->list;
|
||||
list;
|
||||
@ -1701,6 +1769,18 @@ menus_exit (Gimp *gimp)
|
||||
g_object_unref (G_OBJECT (palettes_factory));
|
||||
palettes_factory = NULL;
|
||||
}
|
||||
|
||||
if (buffers_factory)
|
||||
{
|
||||
g_object_unref (G_OBJECT (buffers_factory));
|
||||
buffers_factory = NULL;
|
||||
}
|
||||
|
||||
if (documents_factory)
|
||||
{
|
||||
g_object_unref (G_OBJECT (documents_factory));
|
||||
documents_factory = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -2139,6 +2219,38 @@ menus_get_palettes_factory (void)
|
||||
return palettes_factory;
|
||||
}
|
||||
|
||||
GtkItemFactory *
|
||||
menus_get_buffers_factory (void)
|
||||
{
|
||||
if (! buffers_factory)
|
||||
{
|
||||
buffers_factory = menus_item_factory_new (GTK_TYPE_MENU,
|
||||
"<Buffers>", "buffers",
|
||||
G_N_ELEMENTS (buffers_entries),
|
||||
buffers_entries,
|
||||
NULL,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
return buffers_factory;
|
||||
}
|
||||
|
||||
GtkItemFactory *
|
||||
menus_get_documents_factory (void)
|
||||
{
|
||||
if (! documents_factory)
|
||||
{
|
||||
documents_factory = menus_item_factory_new (GTK_TYPE_MENU,
|
||||
"<Documents>", "documents",
|
||||
G_N_ELEMENTS (documents_entries),
|
||||
documents_entries,
|
||||
NULL,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
return documents_factory;
|
||||
}
|
||||
|
||||
void
|
||||
menus_create_item_from_full_path (GimpItemFactoryEntry *entry,
|
||||
gchar *domain_name,
|
||||
|
@ -49,6 +49,8 @@ GtkItemFactory * menus_get_brushes_factory (void);
|
||||
GtkItemFactory * menus_get_patterns_factory (void);
|
||||
GtkItemFactory * menus_get_gradients_factory (void);
|
||||
GtkItemFactory * menus_get_palettes_factory (void);
|
||||
GtkItemFactory * menus_get_buffers_factory (void);
|
||||
GtkItemFactory * menus_get_documents_factory (void);
|
||||
|
||||
|
||||
void menus_create_item_from_full_path (GimpItemFactoryEntry *entry,
|
||||
|
@ -45,10 +45,12 @@
|
||||
#include "tools/gimpthresholdtool.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "buffers-commands.h"
|
||||
#include "channels-commands.h"
|
||||
#include "commands.h"
|
||||
#include "data-commands.h"
|
||||
#include "dialogs-commands.h"
|
||||
#include "documents-commands.h"
|
||||
#include "edit-commands.h"
|
||||
#include "file-commands.h"
|
||||
#include "gradients-commands.h"
|
||||
@ -1502,6 +1504,68 @@ static GimpItemFactoryEntry palettes_entries[] =
|
||||
};
|
||||
|
||||
|
||||
/***** <Buffers> *****/
|
||||
|
||||
static GimpItemFactoryEntry buffers_entries[] =
|
||||
{
|
||||
{ { N_("/Paste Buffer"), NULL,
|
||||
buffers_paste_buffer_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_PASTE },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Paste Buffer Into"), NULL,
|
||||
buffers_paste_buffer_into_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_PASTE_INTO },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Paste Buffer as New"), NULL,
|
||||
buffers_paste_buffer_as_new_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_PASTE_AS_NEW },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Delete Buffer"), NULL,
|
||||
buffers_delete_buffer_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_DELETE },
|
||||
NULL,
|
||||
NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
/***** <Documents> *****/
|
||||
|
||||
static GimpItemFactoryEntry documents_entries[] =
|
||||
{
|
||||
{ { N_("/Open Image"), NULL,
|
||||
documents_open_document_cmd_callback, 0,
|
||||
"<StockItem>", GTK_STOCK_OPEN },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Raise or Open Image"), NULL,
|
||||
documents_raise_or_open_document_cmd_callback, 0,
|
||||
"<StockItem>", GTK_STOCK_OPEN },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/File Open Dialog..."), NULL,
|
||||
documents_file_open_dialog_cmd_callback, 0,
|
||||
"<StockItem>", GTK_STOCK_OPEN },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Remove Entry"), NULL,
|
||||
documents_delete_document_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_DELETE },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
|
||||
SEPARATOR ("/---"),
|
||||
|
||||
{ { N_("/Refresh History"), NULL,
|
||||
documents_refresh_documents_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_REFRESH },
|
||||
NULL,
|
||||
NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
static gboolean menus_initialized = FALSE;
|
||||
|
||||
|
||||
@ -1517,6 +1581,8 @@ static GtkItemFactory *brushes_factory = NULL;
|
||||
static GtkItemFactory *patterns_factory = NULL;
|
||||
static GtkItemFactory *gradients_factory = NULL;
|
||||
static GtkItemFactory *palettes_factory = NULL;
|
||||
static GtkItemFactory *buffers_factory = NULL;
|
||||
static GtkItemFactory *documents_factory = NULL;
|
||||
|
||||
|
||||
/* public functions */
|
||||
@ -1546,6 +1612,8 @@ menus_init (Gimp *gimp)
|
||||
patterns_factory = menus_get_patterns_factory ();
|
||||
gradients_factory = menus_get_gradients_factory ();
|
||||
palettes_factory = menus_get_palettes_factory ();
|
||||
buffers_factory = menus_get_buffers_factory ();
|
||||
documents_factory = menus_get_documents_factory ();
|
||||
|
||||
for (list = GIMP_LIST (gimp->tool_info_list)->list;
|
||||
list;
|
||||
@ -1701,6 +1769,18 @@ menus_exit (Gimp *gimp)
|
||||
g_object_unref (G_OBJECT (palettes_factory));
|
||||
palettes_factory = NULL;
|
||||
}
|
||||
|
||||
if (buffers_factory)
|
||||
{
|
||||
g_object_unref (G_OBJECT (buffers_factory));
|
||||
buffers_factory = NULL;
|
||||
}
|
||||
|
||||
if (documents_factory)
|
||||
{
|
||||
g_object_unref (G_OBJECT (documents_factory));
|
||||
documents_factory = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -2139,6 +2219,38 @@ menus_get_palettes_factory (void)
|
||||
return palettes_factory;
|
||||
}
|
||||
|
||||
GtkItemFactory *
|
||||
menus_get_buffers_factory (void)
|
||||
{
|
||||
if (! buffers_factory)
|
||||
{
|
||||
buffers_factory = menus_item_factory_new (GTK_TYPE_MENU,
|
||||
"<Buffers>", "buffers",
|
||||
G_N_ELEMENTS (buffers_entries),
|
||||
buffers_entries,
|
||||
NULL,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
return buffers_factory;
|
||||
}
|
||||
|
||||
GtkItemFactory *
|
||||
menus_get_documents_factory (void)
|
||||
{
|
||||
if (! documents_factory)
|
||||
{
|
||||
documents_factory = menus_item_factory_new (GTK_TYPE_MENU,
|
||||
"<Documents>", "documents",
|
||||
G_N_ELEMENTS (documents_entries),
|
||||
documents_entries,
|
||||
NULL,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
return documents_factory;
|
||||
}
|
||||
|
||||
void
|
||||
menus_create_item_from_full_path (GimpItemFactoryEntry *entry,
|
||||
gchar *domain_name,
|
||||
|
@ -49,6 +49,8 @@ GtkItemFactory * menus_get_brushes_factory (void);
|
||||
GtkItemFactory * menus_get_patterns_factory (void);
|
||||
GtkItemFactory * menus_get_gradients_factory (void);
|
||||
GtkItemFactory * menus_get_palettes_factory (void);
|
||||
GtkItemFactory * menus_get_buffers_factory (void);
|
||||
GtkItemFactory * menus_get_documents_factory (void);
|
||||
|
||||
|
||||
void menus_create_item_from_full_path (GimpItemFactoryEntry *entry,
|
||||
|
@ -45,10 +45,12 @@
|
||||
#include "tools/gimpthresholdtool.h"
|
||||
#include "tools/tool_manager.h"
|
||||
|
||||
#include "buffers-commands.h"
|
||||
#include "channels-commands.h"
|
||||
#include "commands.h"
|
||||
#include "data-commands.h"
|
||||
#include "dialogs-commands.h"
|
||||
#include "documents-commands.h"
|
||||
#include "edit-commands.h"
|
||||
#include "file-commands.h"
|
||||
#include "gradients-commands.h"
|
||||
@ -1502,6 +1504,68 @@ static GimpItemFactoryEntry palettes_entries[] =
|
||||
};
|
||||
|
||||
|
||||
/***** <Buffers> *****/
|
||||
|
||||
static GimpItemFactoryEntry buffers_entries[] =
|
||||
{
|
||||
{ { N_("/Paste Buffer"), NULL,
|
||||
buffers_paste_buffer_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_PASTE },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Paste Buffer Into"), NULL,
|
||||
buffers_paste_buffer_into_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_PASTE_INTO },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Paste Buffer as New"), NULL,
|
||||
buffers_paste_buffer_as_new_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_PASTE_AS_NEW },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Delete Buffer"), NULL,
|
||||
buffers_delete_buffer_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_DELETE },
|
||||
NULL,
|
||||
NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
/***** <Documents> *****/
|
||||
|
||||
static GimpItemFactoryEntry documents_entries[] =
|
||||
{
|
||||
{ { N_("/Open Image"), NULL,
|
||||
documents_open_document_cmd_callback, 0,
|
||||
"<StockItem>", GTK_STOCK_OPEN },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Raise or Open Image"), NULL,
|
||||
documents_raise_or_open_document_cmd_callback, 0,
|
||||
"<StockItem>", GTK_STOCK_OPEN },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/File Open Dialog..."), NULL,
|
||||
documents_file_open_dialog_cmd_callback, 0,
|
||||
"<StockItem>", GTK_STOCK_OPEN },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
{ { N_("/Remove Entry"), NULL,
|
||||
documents_delete_document_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_DELETE },
|
||||
NULL,
|
||||
NULL, NULL },
|
||||
|
||||
SEPARATOR ("/---"),
|
||||
|
||||
{ { N_("/Refresh History"), NULL,
|
||||
documents_refresh_documents_cmd_callback, 0,
|
||||
"<StockItem>", GIMP_STOCK_REFRESH },
|
||||
NULL,
|
||||
NULL, NULL }
|
||||
};
|
||||
|
||||
|
||||
static gboolean menus_initialized = FALSE;
|
||||
|
||||
|
||||
@ -1517,6 +1581,8 @@ static GtkItemFactory *brushes_factory = NULL;
|
||||
static GtkItemFactory *patterns_factory = NULL;
|
||||
static GtkItemFactory *gradients_factory = NULL;
|
||||
static GtkItemFactory *palettes_factory = NULL;
|
||||
static GtkItemFactory *buffers_factory = NULL;
|
||||
static GtkItemFactory *documents_factory = NULL;
|
||||
|
||||
|
||||
/* public functions */
|
||||
@ -1546,6 +1612,8 @@ menus_init (Gimp *gimp)
|
||||
patterns_factory = menus_get_patterns_factory ();
|
||||
gradients_factory = menus_get_gradients_factory ();
|
||||
palettes_factory = menus_get_palettes_factory ();
|
||||
buffers_factory = menus_get_buffers_factory ();
|
||||
documents_factory = menus_get_documents_factory ();
|
||||
|
||||
for (list = GIMP_LIST (gimp->tool_info_list)->list;
|
||||
list;
|
||||
@ -1701,6 +1769,18 @@ menus_exit (Gimp *gimp)
|
||||
g_object_unref (G_OBJECT (palettes_factory));
|
||||
palettes_factory = NULL;
|
||||
}
|
||||
|
||||
if (buffers_factory)
|
||||
{
|
||||
g_object_unref (G_OBJECT (buffers_factory));
|
||||
buffers_factory = NULL;
|
||||
}
|
||||
|
||||
if (documents_factory)
|
||||
{
|
||||
g_object_unref (G_OBJECT (documents_factory));
|
||||
documents_factory = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -2139,6 +2219,38 @@ menus_get_palettes_factory (void)
|
||||
return palettes_factory;
|
||||
}
|
||||
|
||||
GtkItemFactory *
|
||||
menus_get_buffers_factory (void)
|
||||
{
|
||||
if (! buffers_factory)
|
||||
{
|
||||
buffers_factory = menus_item_factory_new (GTK_TYPE_MENU,
|
||||
"<Buffers>", "buffers",
|
||||
G_N_ELEMENTS (buffers_entries),
|
||||
buffers_entries,
|
||||
NULL,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
return buffers_factory;
|
||||
}
|
||||
|
||||
GtkItemFactory *
|
||||
menus_get_documents_factory (void)
|
||||
{
|
||||
if (! documents_factory)
|
||||
{
|
||||
documents_factory = menus_item_factory_new (GTK_TYPE_MENU,
|
||||
"<Documents>", "documents",
|
||||
G_N_ELEMENTS (documents_entries),
|
||||
documents_entries,
|
||||
NULL,
|
||||
FALSE);
|
||||
}
|
||||
|
||||
return documents_factory;
|
||||
}
|
||||
|
||||
void
|
||||
menus_create_item_from_full_path (GimpItemFactoryEntry *entry,
|
||||
gchar *domain_name,
|
||||
|
@ -49,6 +49,8 @@ GtkItemFactory * menus_get_brushes_factory (void);
|
||||
GtkItemFactory * menus_get_patterns_factory (void);
|
||||
GtkItemFactory * menus_get_gradients_factory (void);
|
||||
GtkItemFactory * menus_get_palettes_factory (void);
|
||||
GtkItemFactory * menus_get_buffers_factory (void);
|
||||
GtkItemFactory * menus_get_documents_factory (void);
|
||||
|
||||
|
||||
void menus_create_item_from_full_path (GimpItemFactoryEntry *entry,
|
||||
|
@ -126,6 +126,23 @@ gimp_button_new (void)
|
||||
return GTK_WIDGET (button);
|
||||
}
|
||||
|
||||
/**
|
||||
* gimp_button_extended_clicked:
|
||||
* @button: a #GimpButton.
|
||||
* @state: a state as found in #GdkEventButton->state, e.g. #GDK_SHIFT_MASK.
|
||||
*
|
||||
* Emits the button's "extended_clicked" signal.
|
||||
**/
|
||||
void
|
||||
gimp_button_extended_clicked (GimpButton *button,
|
||||
guint state)
|
||||
{
|
||||
g_return_if_fail (GIMP_IS_BUTTON (button));
|
||||
|
||||
g_signal_emit (G_OBJECT (button), button_signals[EXTENDED_CLICKED], 0,
|
||||
state);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gimp_button_button_press (GtkWidget *widget,
|
||||
GdkEventButton *bevent)
|
||||
@ -170,8 +187,7 @@ gimp_button_button_release (GtkWidget *widget,
|
||||
(GIMP_BUTTON (button)->press_state &
|
||||
(GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK)))
|
||||
{
|
||||
g_signal_emit (G_OBJECT (widget),
|
||||
button_signals[EXTENDED_CLICKED], 0,
|
||||
gimp_button_extended_clicked (GIMP_BUTTON (button),
|
||||
GIMP_BUTTON (button)->press_state);
|
||||
|
||||
extended_clicked = TRUE;
|
||||
|
@ -65,6 +65,9 @@ GType gimp_button_get_type (void);
|
||||
|
||||
GtkWidget * gimp_button_new (void);
|
||||
|
||||
void gimp_button_extended_clicked (GimpButton *button,
|
||||
guint state);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
Reference in New Issue
Block a user