gtk-Clipboards             package:RGtk2             R Documentation

_C_l_i_p_b_o_a_r_d_s

_D_e_s_c_r_i_p_t_i_o_n:

     Storing data on clipboards

_M_e_t_h_o_d_s _a_n_d _F_u_n_c_t_i_o_n_s:

     'gtkClipboardGet(selection = "GDK_SELECTION_CLIPBOARD")'
      'gtkClipboardGetForDisplay(display, selection =
     "GDK_SELECTION_CLIPBOARD")'
      'gtkClipboardGetDisplay(object)'
      'gtkClipboardSetWithData(object, targets, get.func, user.data =
     NULL)'
      'gtkClipboardSetWithOwner(object, targets, get.func, owner =
     NULL)'
      'gtkClipboardGetOwner(object)'
      'gtkClipboardClear(object)'
      'gtkClipboardSetText(object, text, len = -1)'
      'gtkClipboardSetImage(object, pixbuf)'
      'gtkClipboardRequestContents(object, target, callback, user.data
     = NULL)'
      'gtkClipboardRequestText(object, callback, user.data = NULL)'
      'gtkClipboardRequestImage(object, callback, user.data = NULL)'
      'gtkClipboardRequestTargets(object, callback, user.data = NULL)'
      'gtkClipboardRequestRichText(object, buffer, callback,
     user.data)'
      'gtkClipboardWaitForContents(object, target)'
      'gtkClipboardWaitForText(object)'
      'gtkClipboardWaitForImage(object)'
      'gtkClipboardWaitForRichText(object, buffer)'
      'gtkClipboardWaitIsTextAvailable(object)'
      'gtkClipboardWaitIsImageAvailable(object)'
      'gtkClipboardWaitIsRichTextAvailable(object, buffer)'
      'gtkClipboardWaitForTargets(object)'
      'gtkClipboardWaitIsTargetAvailable(object, target)'
      'gtkClipboardSetCanStore(object, targets)'
      'gtkClipboardStore(object)'
      'gtkClipboard(display, selection = "GDK_SELECTION_CLIPBOARD")'

_H_i_e_r_a_r_c_h_y:

     GObject
        +----GtkClipboard 

_D_e_t_a_i_l_e_d _D_e_s_c_r_i_p_t_i_o_n:

     The 'GtkClipboard' object represents a clipboard of data shared
     between different processes or between different widgets in the
     same process. Each clipboard is identified by a name encoded as a
     'GdkAtom'. (Conversion to and from strings can be done with
     'gdkAtomIntern' and 'gdkAtomName'.) The default clipboard
     corresponds to the "CLIPBOARD" atom; another commonly used
     clipboard is the "PRIMARY" clipboard, which, in X, traditionally
     contains the currently selected text.

     To support having a number of different formats on the clipboard
     at the same time, the clipboard mechanism allows providing
     callbacks instead of the actual data.  When you set the contents
     of the clipboard, you can either supply the data directly (via
     functions like 'gtkClipboardSetText'), or you can supply a
     callback to be called at a later time when the data is needed (via
     'gtkClipboardSetWithData' or 'gtkClipboardSetWithOwner'.)
     Providing a callback also avoids having to make copies of the data
     when it is not needed. 'gtkClipboardSetWithData' and
     'gtkClipboardSetWithOwner' are quite similar; the choice between
     the two depends mostly on which is more convenient in a particular
     situation. The former is most useful when you want to have a blob
     of data with callbacks to convert it into the various data types
     that you advertise. When the 'clear.func' you provided is called,
     you simply free the data blob. The latter is more useful when the
     contents of clipboard reflect the internal state of a 'GObject'
     (As an example, for the PRIMARY clipboard, when an entry widget
     provides the clipboard's contents the contents are simply the text
     within the selected region.) If the contents change, the entry
     widget can call 'gtkClipboardSetWithOwner' to update the timestamp
     for clipboard ownership, without having to worry about
     'clear.func' being called.

     Requesting the data from the clipboard is essentially
     asynchronous. If the contents of the clipboard are provided within
     the same process, then a direct function call will be made to
     retrieve the data, but if they are provided by another process,
     then the data needs to be retrieved from the other process, which
     may take some time. To avoid blocking the user interface, the call
     to request the selection, 'gtkClipboardRequestContents' takes a
     callback that will be called when the contents are received (or
     when the request fails.) If you don't want to deal with providing
     a separate callback, you can also use
     'gtkClipboardWaitForContents'. What this does is run the GLib main
     loop recursively waiting for the contents. This can simplify the
     code flow, but you still have to be aware that other callbacks in
     your program can be called while this recursive mainloop is
     running.

     Along with the functions to get the clipboard contents as an
     arbitrary data chunk, there are also functions to retrieve it as
     text, 'gtkClipboardRequestText' and 'gtkClipboardWaitForText'.
     These functions take care of determining which formats are
     advertised by the clipboard provider, asking for the clipboard in
     the best available format and converting the results into the
     UTF-8 encoding. (The standard form for representing strings in
     GTK+.)

_S_t_r_u_c_t_u_r_e_s:


     '_G_t_k_C_l_i_p_b_o_a_r_d' _undocumented _


_C_o_n_v_e_n_i_e_n_t _C_o_n_s_t_r_u_c_t_i_o_n:

     'gtkClipboard' is the equivalent of 'gtkClipboardGetForDisplay'.

_U_s_e_r _F_u_n_c_t_i_o_n_s:


     '_G_t_k_C_l_i_p_b_o_a_r_d_R_e_c_e_i_v_e_d_F_u_n_c(_c_l_i_p_b_o_a_r_d, _s_e_l_e_c_t_i_o_n._d_a_t_a, _d_a_t_a)' A
          function to be called when the results of
          'gtkClipboardRequestContents' are received, or when the
          request fails.

          '_c_l_i_p_b_o_a_r_d' ['GtkClipboard'] the 'GtkClipboard'

          '_s_e_l_e_c_t_i_o_n._d_a_t_a' ['GtkSelectionData'] a 'GtkSelectionData'
               containing the data was received. If retrieving the data
               failed, then then length field of 'selection.data' will
               be negative.

          '_d_a_t_a' [R object] the 'user.data' supplied to
               'gtkClipboardRequestContents'.


     '_G_t_k_C_l_i_p_b_o_a_r_d_T_e_x_t_R_e_c_e_i_v_e_d_F_u_n_c(_c_l_i_p_b_o_a_r_d, _t_e_x_t, _d_a_t_a)' A function
          to be called when the results of 'gtkClipboardRequestText'
          are received, or when the request fails.

          '_c_l_i_p_b_o_a_r_d' ['GtkClipboard'] the 'GtkClipboard'

          '_t_e_x_t' [character] the text received, as a UTF-8 encoded
               string, or 'NULL' if retrieving the data failed.

          '_d_a_t_a' [R object] the 'user.data' supplied to
               'gtkClipboardRequestText'.


     '_G_t_k_C_l_i_p_b_o_a_r_d_I_m_a_g_e_R_e_c_e_i_v_e_d_F_u_n_c(_c_l_i_p_b_o_a_r_d, _p_i_x_b_u_f, _d_a_t_a)' A
          function to be called when the results of
          'gtkClipboardRequestImage' are received, or when the request
          fails. Since 2.6

          '_c_l_i_p_b_o_a_r_d' ['GtkClipboard'] the 'GtkClipboard'

          '_p_i_x_b_u_f' ['GdkPixbuf'] the received image

          '_d_a_t_a' [R object] the 'user.data' supplied to
               'gtkClipboardRequestImage'.


     '_G_t_k_C_l_i_p_b_o_a_r_d_T_a_r_g_e_t_s_R_e_c_e_i_v_e_d_F_u_n_c(_c_l_i_p_b_o_a_r_d, _a_t_o_m_s, _n._a_t_o_m_s, _d_a_t_a)' 
          A function to be called when the results of
          'gtkClipboardRequestTargets' are received, or when the
          request fails. Since 2.4

          '_c_l_i_p_b_o_a_r_d' ['GtkClipboard'] the 'GtkClipboard'

          '_a_t_o_m_s' ['GdkAtom'] the supported targets, as list of
               'GdkAtom', or 'NULL'  if retrieving the data failed.

          '_n._a_t_o_m_s' [integer] the length of the 'atoms' list.

          '_d_a_t_a' [R object] the 'user.data' supplied to
               'gtkClipboardRequestTargets'.


     '_G_t_k_C_l_i_p_b_o_a_r_d_R_i_c_h_T_e_x_t_R_e_c_e_i_v_e_d_F_u_n_c(_c_l_i_p_b_o_a_r_d, _f_o_r_m_a_t, _t_e_x_t, _l_e_n_g_t_h, _d_a_t_a)' 
          _undocumented _

          '_c_l_i_p_b_o_a_r_d' ['GtkClipboard'] 

          '_f_o_r_m_a_t' ['GdkAtom'] 

          '_t_e_x_t' [raw] 

          '_l_e_n_g_t_h' [numeric] 

          '_d_a_t_a' [R object] 


     '_G_t_k_C_l_i_p_b_o_a_r_d_G_e_t_F_u_n_c(_c_l_i_p_b_o_a_r_d, _s_e_l_e_c_t_i_o_n._d_a_t_a, _i_n_f_o, _u_s_e_r._d_a_t_a._o_r._o_w_n_e_r)' 
          A function that will be called to provide the contents of the
          selection. If multiple types of data were advertised, the
          requested type can be determined from the 'info' parameter or
          by checking the target field of 'selection.data'. If the data
          could successfully be converted into then it should be stored
          into the 'selection.data' object by calling
          'gtkSelectionDataSet' (or related functions such as
          'gtkSelectionDataSetText'). If no data is set, the requestor
          will be informed that the attempt to get the data failed.    

          '_c_l_i_p_b_o_a_r_d' ['GtkClipboard'] the 'GtkClipboard'

          '_s_e_l_e_c_t_i_o_n._d_a_t_a' ['GtkSelectionData'] a 'GtkSelectionData'
               argument in which the requested data should be stored.

          '_i_n_f_o' [numeric] the info field corresponding to the
               requested target from the 'GtkTargetEntry' list passed
               to 'gtkClipboardSetWithData' or
               'gtkClipboardSetWithOwner'.

          '_u_s_e_r._d_a_t_a._o_r._o_w_n_e_r' [R object] the 'user.data' argument
               passed to 'gtkClipboardSetWithData', or the 'owner'
               argument passed to 'gtkClipboardSetWithOwner'


     '_G_t_k_C_l_i_p_b_o_a_r_d_C_l_e_a_r_F_u_n_c(_c_l_i_p_b_o_a_r_d, _u_s_e_r._d_a_t_a._o_r._o_w_n_e_r)' A function
          that will be called when the contents of the clipboard are
          changed or cleared. Once this has called, the
          'user.data.or.owner' argument will not be used again.

          '_c_l_i_p_b_o_a_r_d' ['GtkClipboard'] the 'GtkClipboard'

          '_u_s_e_r._d_a_t_a._o_r._o_w_n_e_r' [R object] the 'user.data' argument
               passed to 'gtkClipboardSetWithData', or the 'owner'
               argument passed to 'gtkClipboardSetWithOwner'


_S_i_g_n_a_l_s:


     '_o_w_n_e_r-_c_h_a_n_g_e(_c_l_i_p_b_o_a_r_d, _e_v_e_n_t, _u_s_e_r._d_a_t_a)' The ::owner-change
          signal is emitted when GTK+ receives an event that indicates
          that the ownership of the selection  associated with
          'clipboard' has changed.  

          Since  2.6

          '_c_l_i_p_b_o_a_r_d' ['GtkClipboard']  the 'GtkClipboard' on which the
               signal is emitted

          '_e_v_e_n_t' ['GdkEvent']  the 'GdkEventOwnerChange' event 

          '_u_s_e_r._d_a_t_a' [R object] user data set when the signal handler
               was connected.


_A_u_t_h_o_r(_s):

     Derived by RGtkGen from GTK+ documentation

_R_e_f_e_r_e_n_c_e_s:

     <URL:
     http://developer.gnome.org/doc/API/2.0/gtk/gtk-Clipboards.html>

