/[rdesktop]/sourceforge.net/trunk/rdesktop/xclip.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/xclip.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1371 by jsorg71, Thu Jan 4 05:39:39 2007 UTC revision 1372 by jsorg71, Mon Jan 8 04:47:06 2007 UTC
# Line 53  Line 53 
53  extern Display *g_display;  extern Display *g_display;
54  extern Window g_wnd;  extern Window g_wnd;
55  extern Time g_last_gesturetime;  extern Time g_last_gesturetime;
56  extern BOOL g_rdpclip;  extern RD_BOOL g_rdpclip;
57    
58  /* Mode of operation.  /* Mode of operation.
59     - Auto: Look at both PRIMARY and CLIPBOARD and use the most recent.     - Auto: Look at both PRIMARY and CLIPBOARD and use the most recent.
60     - Non-auto: Look at just CLIPBOARD. */     - Non-auto: Look at just CLIPBOARD. */
61  static BOOL auto_mode = True;  static RD_BOOL auto_mode = True;
62  /* Atoms of the two X selections we're dealing with: CLIPBOARD (explicit-copy) and PRIMARY (selection-copy) */  /* Atoms of the two X selections we're dealing with: CLIPBOARD (explicit-copy) and PRIMARY (selection-copy) */
63  static Atom clipboard_atom, primary_atom;  static Atom clipboard_atom, primary_atom;
64  /* Atom of the TARGETS clipboard target */  /* Atom of the TARGETS clipboard target */
# Line 92  static Atom rdesktop_selection_notify_at Line 92  static Atom rdesktop_selection_notify_at
92  /* State variables that indicate if we're currently probing the targets of the  /* State variables that indicate if we're currently probing the targets of the
93     selection owner. reprobe_selections indicate that the ownership changed in     selection owner. reprobe_selections indicate that the ownership changed in
94     the middle of the current probe so it should be restarted. */     the middle of the current probe so it should be restarted. */
95  static BOOL probing_selections, reprobe_selections;  static RD_BOOL probing_selections, reprobe_selections;
96  /* Atoms _RDESKTOP_PRIMARY_OWNER and _RDESKTOP_CLIPBOARD_OWNER. Used as properties  /* Atoms _RDESKTOP_PRIMARY_OWNER and _RDESKTOP_CLIPBOARD_OWNER. Used as properties
97     on the root window to indicate which selections that are owned by rdesktop. */     on the root window to indicate which selections that are owned by rdesktop. */
98  static Atom rdesktop_primary_owner_atom, rdesktop_clipboard_owner_atom;  static Atom rdesktop_primary_owner_atom, rdesktop_clipboard_owner_atom;
# Line 105  static Atom incr_atom; Line 105  static Atom incr_atom;
105     the context to proceed. */     the context to proceed. */
106  static XSelectionRequestEvent selection_request;  static XSelectionRequestEvent selection_request;
107  /* Denotes we have a pending selection request. */  /* Denotes we have a pending selection request. */
108  static Bool has_selection_request;  static RD_BOOL has_selection_request;
109  /* Stores the clipboard format (CF_TEXT, CF_UNICODETEXT etc.) requested in the last  /* Stores the clipboard format (CF_TEXT, CF_UNICODETEXT etc.) requested in the last
110     CLIPDR_DATA_REQUEST (= the RDP server requesting clipboard data from us).     CLIPDR_DATA_REQUEST (= the RDP server requesting clipboard data from us).
111     When we receive this data from whatever X client offering it, this variable gives us     When we receive this data from whatever X client offering it, this variable gives us
# Line 117  static Atom targets[MAX_TARGETS]; Line 117  static Atom targets[MAX_TARGETS];
117  static int num_targets;  static int num_targets;
118  /* Denotes that an rdesktop (not this rdesktop) is owning the selection,  /* Denotes that an rdesktop (not this rdesktop) is owning the selection,
119     allowing us to interchange Windows native clipboard data directly. */     allowing us to interchange Windows native clipboard data directly. */
120  static BOOL rdesktop_is_selection_owner = False;  static RD_BOOL rdesktop_is_selection_owner = False;
121  /* Time when we acquired the selection. */  /* Time when we acquired the selection. */
122  static Time acquire_time = 0;  static Time acquire_time = 0;
123    
# Line 157  utf16_lf2crlf(uint8 * data, uint32 * siz Line 157  utf16_lf2crlf(uint8 * data, uint32 * siz
157  {  {
158          uint8 *result;          uint8 *result;
159          uint16 *inptr, *outptr;          uint16 *inptr, *outptr;
160          Bool swap_endianess;          RD_BOOL swap_endianess;
161    
162          /* Worst case: Every char is LF */          /* Worst case: Every char is LF */
163          result = xmalloc((*size * 2) + 2);          result = xmalloc((*size * 2) + 2);
# Line 283  helper_cliprdr_send_empty_response() Line 283  helper_cliprdr_send_empty_response()
283  /* Replies with clipboard data to RDP, converting it from the target format  /* Replies with clipboard data to RDP, converting it from the target format
284     to the expected RDP format as necessary. Returns true if data was sent.     to the expected RDP format as necessary. Returns true if data was sent.
285   */   */
286  static Bool  static RD_BOOL
287  xclip_send_data_with_convert(uint8 * source, size_t source_size, Atom target)  xclip_send_data_with_convert(uint8 * source, size_t source_size, Atom target)
288  {  {
289          DEBUG_CLIPBOARD(("xclip_send_data_with_convert: target=%s, size=%u\n",          DEBUG_CLIPBOARD(("xclip_send_data_with_convert: target=%s, size=%u\n",
# Line 958  ui_clip_format_announce(uint8 * data, ui Line 958  ui_clip_format_announce(uint8 * data, ui
958  void  void
959  ui_clip_handle_data(uint8 * data, uint32 length)  ui_clip_handle_data(uint8 * data, uint32 length)
960  {  {
961          BOOL free_data = False;          RD_BOOL free_data = False;
962    
963          if (length == 0)          if (length == 0)
964          {          {

Legend:
Removed from v.1371  
changed lines
  Added in v.1372

  ViewVC Help
Powered by ViewVC 1.1.26