Commit 8fc8cb48 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/gui/Makefile.am removed...

2004-07-07  Michael Natterer  <mitch@gimp.org>

	* app/gui/Makefile.am
	* app/gui/clipboard.[ch]: removed...

	* app/widgets/Makefile.am
	* app/widgets/gimpclipboard.[ch]: ...and added here.

	* app/actions/edit-commands.c
	* app/gui/gui.c: changed accordingly.
parent 525a98f8
2004-07-07 Michael Natterer <mitch@gimp.org>
* app/gui/Makefile.am
* app/gui/clipboard.[ch]: removed...
* app/widgets/Makefile.am
* app/widgets/gimpclipboard.[ch]: ...and added here.
* app/actions/edit-commands.c
* app/gui/gui.c: changed accordingly.
2004-07-07 Michael Natterer <mitch@gimp.org>
Made the undo system robust against the currently pushed undo
......
......@@ -38,11 +38,11 @@
#include "display/gimpdisplayshell.h"
#include "display/gimpdisplayshell-transform.h"
#include "widgets/gimpclipboard.h"
#include "widgets/gimphelp-ids.h"
#include "widgets/gimpdialogfactory.h"
#include "gui/dialogs.h"
#include "gui/clipboard.h"
#include "actions.h"
#include "edit-commands.h"
......@@ -164,7 +164,7 @@ edit_paste_as_new_cmd_callback (GtkAction *action,
GimpBuffer *buffer;
return_if_no_gimp (gimp, data);
buffer = clipboard_get_buffer (gimp);
buffer = gimp_clipboard_get_buffer (gimp);
if (buffer)
{
......@@ -262,7 +262,7 @@ static void
edit_paste (GimpDisplay *gdisp,
gboolean paste_into)
{
GimpBuffer *buffer = clipboard_get_buffer (gdisp->gimage->gimp);
GimpBuffer *buffer = gimp_clipboard_get_buffer (gdisp->gimage->gimp);
if (buffer)
{
......
......@@ -7,8 +7,6 @@ dialogs_sources = \
about-dialog.h \
brush-select.c \
brush-select.h \
clipboard.c \
clipboard.h \
color-notebook.c \
color-notebook.h \
convert-dialog.c \
......
......@@ -45,6 +45,7 @@
#include "tools/gimp-tools.h"
#include "widgets/gimpactiongroup.h"
#include "widgets/gimpclipboard.h"
#include "widgets/gimpcontrollers.h"
#include "widgets/gimpdevices.h"
#include "widgets/gimpdevicestatus.h"
......@@ -62,7 +63,6 @@
#include "menus/menus.h"
#include "clipboard.h"
#include "color-history.h"
#include "dialogs.h"
#include "gui.h"
......@@ -325,11 +325,11 @@ gui_restore_callback (Gimp *gimp,
actions_init (gimp);
menus_init (gimp);
clipboard_init (gimp);
render_init (gimp);
dialogs_init (gimp);
gimp_clipboard_init (gimp);
gimp_devices_init (gimp, gui_device_change_notify);
gimp_controllers_init (gimp);
session_init (gimp);
......@@ -455,7 +455,6 @@ gui_exit_after_callback (Gimp *gimp,
g_object_unref (image_ui_manager);
image_ui_manager = NULL;
clipboard_exit (gimp);
menus_exit (gimp);
actions_exit (gimp);
render_exit (gimp);
......@@ -463,6 +462,7 @@ gui_exit_after_callback (Gimp *gimp,
dialogs_exit (gimp);
gimp_controllers_exit (gimp);
gimp_devices_exit (gimp);
gimp_clipboard_exit (gimp);
themes_exit (gimp);
......
......@@ -37,6 +37,8 @@ libappwidgets_a_sources = \
gimpcellrendererviewable.h \
gimpchanneltreeview.c \
gimpchanneltreeview.h \
gimpclipboard.c \
gimpclipboard.h \
gimpcolorbar.c \
gimpcolorbar.h \
gimpcolordisplayeditor.c \
......
......@@ -20,7 +20,7 @@
#include <gtk/gtk.h>
#include "gui-types.h"
#include "widgets-types.h"
#include "base/pixel-region.h"
#include "base/tile-manager.h"
......@@ -29,10 +29,9 @@
#include "core/gimpbuffer.h"
#include "core/gimpviewable.h"
#include "widgets/gimpdnd.h"
#include "widgets/gimpselectiondata.h"
#include "clipboard.h"
#include "gimpclipboard.h"
#include "gimpdnd.h"
#include "gimpselectiondata.h"
#include "gimp-intl.h"
......@@ -40,43 +39,42 @@
static const GtkTargetEntry target_entry = GIMP_TARGET_PNG;
static void clipboard_buffer_changed (Gimp *gimp);
static void clipboard_set (Gimp *gimp,
GimpBuffer *buffer);
static void gimp_clipboard_buffer_changed (Gimp *gimp);
static void gimp_clipboard_set (Gimp *gimp,
GimpBuffer *buffer);
static void clipboard_get (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
guint info,
Gimp *gimp);
static gboolean clipboard_wait_is_available (void);
static void gimp_clipboard_get (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
guint info,
Gimp *gimp);
static gboolean gimp_clipboard_wait_is_available (void);
void
clipboard_init (Gimp *gimp)
gimp_clipboard_init (Gimp *gimp)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
clipboard_set (gimp, gimp->global_buffer);
gimp_clipboard_set (gimp, gimp->global_buffer);
g_signal_connect_object (gimp, "buffer_changed",
G_CALLBACK (clipboard_buffer_changed),
G_CALLBACK (gimp_clipboard_buffer_changed),
NULL, 0);
}
void
clipboard_exit (Gimp *gimp)
gimp_clipboard_exit (Gimp *gimp)
{
g_return_if_fail (GIMP_IS_GIMP (gimp));
g_signal_handlers_disconnect_by_func (gimp,
G_CALLBACK (clipboard_buffer_changed),
G_CALLBACK (gimp_clipboard_buffer_changed),
NULL);
clipboard_set (gimp, NULL);
gimp_clipboard_set (gimp, NULL);
}
/**
* clipboard_is_available:
* gimp_clipboard_is_available:
* @gimp: pointer to #Gimp
*
* Tests if there's image data in the clipboard. If the global cut
......@@ -88,14 +86,14 @@ clipboard_exit (Gimp *gimp)
* Return value: %TRUE if there's image data in the clipboard, %FALSE otherwise
**/
gboolean
clipboard_is_available (Gimp *gimp)
gimp_clipboard_is_available (Gimp *gimp)
{
g_return_val_if_fail (GIMP_IS_GIMP (gimp), FALSE);
if (gimp->global_buffer)
return TRUE;
return clipboard_wait_is_available ();
return gimp_clipboard_wait_is_available ();
}
......@@ -133,7 +131,7 @@ tile_manager_new_from_pixbuf (GdkPixbuf *pixbuf)
}
/**
* clipboard_get_buffer:
* gimp_clipboard_get_buffer:
* @gimp: pointer to #Gimp
*
* Retrieves either image data from %GDK_SELECTION_CLIPBOARD or from
......@@ -146,7 +144,7 @@ tile_manager_new_from_pixbuf (GdkPixbuf *pixbuf)
* image data
**/
GimpBuffer *
clipboard_get_buffer (Gimp *gimp)
gimp_clipboard_get_buffer (Gimp *gimp)
{
GimpBuffer *buffer = NULL;
GtkClipboard *clipboard;
......@@ -158,7 +156,7 @@ clipboard_get_buffer (Gimp *gimp)
if (clipboard &&
gtk_clipboard_get_owner (clipboard) != G_OBJECT (gimp) &&
clipboard_wait_is_available ())
gimp_clipboard_wait_is_available ())
{
GtkSelectionData *data;
GdkAtom atom = gdk_atom_intern (target_entry.target, FALSE);
......@@ -193,14 +191,14 @@ clipboard_get_buffer (Gimp *gimp)
}
static void
clipboard_buffer_changed (Gimp *gimp)
gimp_clipboard_buffer_changed (Gimp *gimp)
{
clipboard_set (gimp, gimp->global_buffer);
gimp_clipboard_set (gimp, gimp->global_buffer);
}
static void
clipboard_set (Gimp *gimp,
GimpBuffer *buffer)
gimp_clipboard_set (Gimp *gimp,
GimpBuffer *buffer)
{
GtkClipboard *clipboard;
......@@ -213,7 +211,7 @@ clipboard_set (Gimp *gimp,
{
gtk_clipboard_set_with_owner (clipboard,
&target_entry, 1,
(GtkClipboardGetFunc) clipboard_get,
(GtkClipboardGetFunc) gimp_clipboard_get,
(GtkClipboardClearFunc) NULL,
G_OBJECT (gimp));
}
......@@ -224,7 +222,7 @@ clipboard_set (Gimp *gimp,
}
static gboolean
clipboard_wait_is_available (void)
gimp_clipboard_wait_is_available (void)
{
GtkClipboard *clipboard;
gboolean result = FALSE;
......@@ -250,8 +248,12 @@ clipboard_wait_is_available (void)
gint i;
for (i = 0; i < n_targets; i++)
if (targets[i] == atom)
result = TRUE;
{
g_print ("offered type: %s\n", gdk_atom_name (targets[i]));
if (targets[i] == atom)
result = TRUE;
}
g_free (targets);
}
......@@ -264,10 +266,10 @@ clipboard_wait_is_available (void)
}
static void
clipboard_get (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
guint info,
Gimp *gimp)
gimp_clipboard_get (GtkClipboard *clipboard,
GtkSelectionData *selection_data,
guint info,
Gimp *gimp)
{
GimpBuffer *buffer = gimp->global_buffer;
GdkPixbuf *pixbuf;
......
......@@ -16,15 +16,15 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __CLIPBOARD_H__
#define __CLIPBOARD_H__
#ifndef __GIMP_CLIPBOARD_H__
#define __GIMP_CLIPBOARD_H__
void clipboard_init (Gimp *gimp);
void clipboard_exit (Gimp *gimp);
void gimp_clipboard_init (Gimp *gimp);
void gimp_clipboard_exit (Gimp *gimp);
gboolean clipboard_is_available (Gimp *gimp);
GimpBuffer * clipboard_get_buffer (Gimp *gimp);
gboolean gimp_clipboard_is_available (Gimp *gimp);
GimpBuffer * gimp_clipboard_get_buffer (Gimp *gimp);
#endif /* __CLIPBOARD_H__ */
#endif /* __GIMP_CLIPBOARD_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment