mirror of https://github.com/GNOME/gimp.git
app/actions/buffers-commands.c app/actions/file-commands.c
2004-09-20 Michael Natterer <mitch@gimp.org> * app/actions/buffers-commands.c * app/actions/file-commands.c * app/actions/layers-commands.c * app/actions/plug-in-actions.c * app/actions/tools-actions.c: removed useless #includes, cleanup.
This commit is contained in:
parent
c448cf9d94
commit
49b9c1d80e
|
@ -1,3 +1,11 @@
|
|||
2004-09-20 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/actions/buffers-commands.c
|
||||
* app/actions/file-commands.c
|
||||
* app/actions/layers-commands.c
|
||||
* app/actions/plug-in-actions.c
|
||||
* app/actions/tools-actions.c: removed useless #includes, cleanup.
|
||||
|
||||
2004-09-20 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/dialogs/dialogs.[ch] (dialogs_init): added GimpMenuFactory
|
||||
|
|
|
@ -39,55 +39,14 @@
|
|||
#include "gimp-intl.h"
|
||||
|
||||
|
||||
/* local function prototypes */
|
||||
|
||||
static void buffers_paste (GimpBufferView *view,
|
||||
gboolean paste_into);
|
||||
|
||||
|
||||
/* public functionss */
|
||||
|
||||
static void
|
||||
buffers_paste (GimpBufferView *view,
|
||||
gboolean paste_into)
|
||||
{
|
||||
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (view);
|
||||
GimpContainer *container;
|
||||
GimpContext *context;
|
||||
GimpBuffer *buffer;
|
||||
|
||||
container = gimp_container_view_get_container (editor->view);
|
||||
context = gimp_container_view_get_context (editor->view);
|
||||
|
||||
buffer = gimp_context_get_buffer (context);
|
||||
|
||||
if (buffer && gimp_container_have (container, GIMP_OBJECT (buffer)))
|
||||
{
|
||||
GimpDisplay *gdisp = gimp_context_get_display (context);
|
||||
GimpImage *gimage = NULL;
|
||||
gint x = -1;
|
||||
gint y = -1;
|
||||
gint width = -1;
|
||||
gint height = -1;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
|
||||
gimp_display_shell_untransform_viewport (shell,
|
||||
&x, &y, &width, &height);
|
||||
|
||||
gimage = gdisp->gimage;
|
||||
}
|
||||
else
|
||||
{
|
||||
gimage = gimp_context_get_image (context);
|
||||
}
|
||||
|
||||
if (gimage)
|
||||
{
|
||||
gimp_edit_paste (gimage, gimp_image_active_drawable (gimage),
|
||||
buffer, paste_into, x, y, width, height);
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
buffers_paste_buffer_cmd_callback (GtkAction *action,
|
||||
gpointer data)
|
||||
|
@ -144,3 +103,53 @@ buffers_delete_buffer_cmd_callback (GtkAction *action,
|
|||
gimp_container_remove (container, GIMP_OBJECT (buffer));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* private functions */
|
||||
|
||||
static void
|
||||
buffers_paste (GimpBufferView *view,
|
||||
gboolean paste_into)
|
||||
{
|
||||
GimpContainerEditor *editor = GIMP_CONTAINER_EDITOR (view);
|
||||
GimpContainer *container;
|
||||
GimpContext *context;
|
||||
GimpBuffer *buffer;
|
||||
|
||||
container = gimp_container_view_get_container (editor->view);
|
||||
context = gimp_container_view_get_context (editor->view);
|
||||
|
||||
buffer = gimp_context_get_buffer (context);
|
||||
|
||||
if (buffer && gimp_container_have (container, GIMP_OBJECT (buffer)))
|
||||
{
|
||||
GimpDisplay *gdisp = gimp_context_get_display (context);
|
||||
GimpImage *gimage = NULL;
|
||||
gint x = -1;
|
||||
gint y = -1;
|
||||
gint width = -1;
|
||||
gint height = -1;
|
||||
|
||||
if (gdisp)
|
||||
{
|
||||
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (gdisp->shell);
|
||||
|
||||
gimp_display_shell_untransform_viewport (shell,
|
||||
&x, &y, &width, &height);
|
||||
|
||||
gimage = gdisp->gimage;
|
||||
}
|
||||
else
|
||||
{
|
||||
gimage = gimp_context_get_image (context);
|
||||
}
|
||||
|
||||
if (gimage)
|
||||
{
|
||||
gimp_edit_paste (gimage, gimp_image_active_drawable (gimage),
|
||||
buffer, paste_into, x, y, width, height);
|
||||
|
||||
gimp_image_flush (gimage);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,8 +46,6 @@
|
|||
#include "display/gimpdisplay.h"
|
||||
#include "display/gimpdisplay-foreach.h"
|
||||
|
||||
#include "menus/menus.h"
|
||||
|
||||
#include "dialogs/dialogs.h"
|
||||
|
||||
#include "actions.h"
|
||||
|
|
|
@ -46,8 +46,6 @@
|
|||
#include "text/gimptext.h"
|
||||
#include "text/gimptextlayer.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "widgets/gimpdock.h"
|
||||
#include "widgets/gimpenumwidgets.h"
|
||||
#include "widgets/gimphelp-ids.h"
|
||||
|
|
|
@ -31,8 +31,6 @@
|
|||
#include "core/gimpdrawable.h"
|
||||
#include "core/gimpimage.h"
|
||||
|
||||
#include "pdb/procedural_db.h"
|
||||
|
||||
#include "plug-in/plug-ins.h"
|
||||
#include "plug-in/plug-in-proc.h"
|
||||
|
||||
|
|
|
@ -35,8 +35,8 @@
|
|||
#include "widgets/gimphelp-ids.h"
|
||||
|
||||
#include "actions.h"
|
||||
#include "actions/tools-actions.h"
|
||||
#include "actions/tools-commands.h"
|
||||
#include "tools-actions.h"
|
||||
#include "tools-commands.h"
|
||||
|
||||
#include "gimp-intl.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue