/[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 459 by astrand, Tue Sep 2 09:37:17 2003 UTC revision 542 by astrand, Mon Nov 3 13:22:09 2003 UTC
# Line 56  xclip_provide_selection(XSelectionReques Line 56  xclip_provide_selection(XSelectionReques
56          XSendEvent(g_display, req->requestor, False, NoEventMask, &xev);          XSendEvent(g_display, req->requestor, False, NoEventMask, &xev);
57  }  }
58    
59  static void  void
60  xclip_handle_SelectionNotify(XSelectionEvent * event)  xclip_handle_SelectionNotify(XSelectionEvent * event)
61  {  {
62          unsigned long nitems, bytes_left;          unsigned long nitems, bytes_left;
# Line 129  xclip_handle_SelectionNotify(XSelectionE Line 129  xclip_handle_SelectionNotify(XSelectionE
129          cliprdr_send_data(NULL, 0);          cliprdr_send_data(NULL, 0);
130  }  }
131    
132  static void  void
133  xclip_handle_SelectionRequest(XSelectionRequestEvent * event)  xclip_handle_SelectionRequest(XSelectionRequestEvent * event)
134  {  {
135          unsigned long nitems, bytes_left;          unsigned long nitems, bytes_left;
136            unsigned char *prop_return;
137          uint32 *wanted_format;          uint32 *wanted_format;
138          int format, res;          int format, res;
139          Atom type;          Atom type;
# Line 156  xclip_handle_SelectionRequest(XSelection Line 157  xclip_handle_SelectionRequest(XSelection
157          {          {
158                  res = XGetWindowProperty(g_display, event->requestor,                  res = XGetWindowProperty(g_display, event->requestor,
159                                           rdesktop_clipboard_target_atom, 0, 1, True, XA_INTEGER,                                           rdesktop_clipboard_target_atom, 0, 1, True, XA_INTEGER,
160                                           &type, &format, &nitems, &bytes_left,                                           &type, &format, &nitems, &bytes_left, &prop_return);
161                                           (unsigned char **) &wanted_format);                  wanted_format = (uint32 *) prop_return;
162                  format = (res == Success) ? *wanted_format : CF_TEXT;                  format = (res == Success) ? *wanted_format : CF_TEXT;
163                    /* FIXME: Need to free returned data? */
164          }          }
165          else          else
166          {          {
# Line 170  xclip_handle_SelectionRequest(XSelection Line 172  xclip_handle_SelectionRequest(XSelection
172          /* wait for data */          /* wait for data */
173  }  }
174    
175  static void  void
176  xclip_handle_SelectionClear(void)  xclip_handle_SelectionClear(void)
177  {  {
178          DEBUG_CLIPBOARD(("xclip_handle_SelectionClear\n"));          DEBUG_CLIPBOARD(("xclip_handle_SelectionClear\n"));
# Line 179  xclip_handle_SelectionClear(void) Line 181  xclip_handle_SelectionClear(void)
181          cliprdr_send_text_format_announce();          cliprdr_send_text_format_announce();
182  }  }
183    
184  static void  void
185  xclip_handle_PropertyNotify(XPropertyEvent * event)  xclip_handle_PropertyNotify(XPropertyEvent * event)
186  {  {
187          unsigned long nitems, bytes_left;          unsigned long nitems, bytes_left;
# Line 215  xclip_handle_PropertyNotify(XPropertyEve Line 217  xclip_handle_PropertyNotify(XPropertyEve
217    
218    
219  void  void
220  ui_clip_format_announce(char *data, uint32 length)  ui_clip_format_announce(uint8 * data, uint32 length)
221  {  {
222          XSetSelectionOwner(g_display, primary_atom, g_wnd, g_last_gesturetime);          XSetSelectionOwner(g_display, primary_atom, g_wnd, g_last_gesturetime);
223          if (XGetSelectionOwner(g_display, primary_atom) != g_wnd)          if (XGetSelectionOwner(g_display, primary_atom) != g_wnd)
# Line 236  ui_clip_format_announce(char *data, uint Line 238  ui_clip_format_announce(char *data, uint
238    
239    
240  void  void
241  ui_clip_handle_data(char *data, uint32 length)  ui_clip_handle_data(uint8 * data, uint32 length)
242  {  {
243          xclip_provide_selection(&selection_request, XA_STRING, 8, data, length - 1);          xclip_provide_selection(&selection_request, XA_STRING, 8, data, length - 1);
244  }  }

Legend:
Removed from v.459  
changed lines
  Added in v.542

  ViewVC Help
Powered by ViewVC 1.1.26