Re: Clipboard improvements



At 17:37 06.05.04, Matthias Clasen wrote:
I have looked at wrapping the clipboard owner change notification
provided by the XFIXES extension for gdk. Here is the api I'd like to
propose for this:

/**
 * gdk_display_supports_selection_notification:
 * @display: a #GdkDisplay
 *
 * Returns whether #GdkEventOwnerChange events will be
 * sent when the owner of a selection changes.
 *
 * Return value: whether #GdkEventOwnerChange events will
 *               be sent.
 *
 * Since: 2.6
 **/
gboolean
gdk_display_supports_selection_notification (GdkDisplay *display)


typedef enum
{
  GDK_OWNER_CHANGE_NEW_OWNER,
  GDK_OWNER_CHANGE_DESTROY,
  GDK_OWNER_CHANGE_CLOSE
} GdkOwnerChange;


If I understand correctly this function would query the ability to
kind of register 'listeners' for the change of available clipboard
content (given that 'selection' is a very X centric concept and
from all I read about not that well understood, i.e. PRIMAY,
SECONDARY, ...)
It should be possible for gdk/win32 to generate events on
clipboard change with the windows API SetClipboardViewer()
and than map WM_DRAWCLIPBOARD to the event below.

struct _GdkEventOwnerChange
{
  GdkEventType type;
  GdkWindow *window;
  gint8 send_event;
  GdkNativeWindow owner;
  GdkOwnerChange reason;
  GdkAtom selection;
  guint32 time;
  guint32 selection_time;
};

  /**
   * GtkClipboard::owner-change:
   * @clipboard: the clipboard which received the signal
   * @event: the #GtkEventOwnerChange event
   *
   * The ::owner-change signal is emitted if the owner of
   * the clipboard changes. Applications can use this information
   * to e.g. obtain the supported targets from the new owner and
   * update the sensitivity of "Paste" menuitems based on that
   * information.
   *
   * Note that not all displays support owner change notification
   * for selections, see gdk_display_supports_selection_notification().
   *
   * Returns: %TRUE if the event was handled
   *
   * Since: 2.6
   */

I'd like to hear from our win32 hackers whether this kind of API can be
supported on Windows. It would be unfortunate to have
gdk_display_supports_selection_notification() simply return FALSE on
Windows, since that information is definitively available in some form.

There are already some coments in gdkselection-win32.c about maybe
implementation problems, e.g. returning NULL for the owner of the
global clipboard, so the new functionality might finally not get a clear
and/or working implementation.
OTOH maybe it's just necessary to clarify the issues/expectations some
more like required in
http://bugzilla.gnome.org/show_bug.cgi?id=63820
http://bugzilla.gnome.org/show_bug.cgi?id=106507
http://bugzilla.gnome.org/show_bug.cgi?id=107320
http://bugzilla.gnome.org/show_bug.cgi?id=111865
http://bugzilla.gnome.org/show_bug.cgi?id=112404
http://bugzilla.gnome.org/show_bug.cgi?id=119290
http://bugzilla.gnome.org/show_bug.cgi?id=129043

not to mention ;(
http://bugzilla.gnome.org/show_bug.cgi?id=58541


Thanks,
        Hans
-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]