Add support for copying to clipboard (based on patch by Dana Jansens).
[dana/urxvt.git] / src / rxvttoolkit.h
index 9abfeda..4f91564 100644 (file)
@@ -61,6 +61,7 @@ enum {
   XA_NET_WM_NAME,
   XA_NET_WM_ICON_NAME,
   XA_NET_WM_PING,
+  XA_NET_WM_ICON,
 #endif
 #if USE_XIM
   XA_WM_LOCALE_NAME,
@@ -236,6 +237,7 @@ struct rxvt_display : refcounted
   int       screen;
   Window    root;
   rxvt_term *selection_owner;
+  rxvt_term *clipboard_owner;
   Atom      xa[NUM_XA];
   bool      is_local;
 #ifdef POINTER_BLANK
@@ -254,7 +256,7 @@ struct rxvt_display : refcounted
   }
 
   Atom atom (const char *name);
-  void set_selection_owner (rxvt_term *owner);
+  void set_selection_owner (rxvt_term *owner, bool clipboard);
 
   void reg (xevent_watcher *w);
   void unreg (xevent_watcher *w);
@@ -269,7 +271,8 @@ struct rxvt_display : refcounted
 };
 
 #ifdef USE_XIM
-struct im_watcher : rxvt_watcher, callback<void (void)> {
+struct im_watcher : rxvt_watcher, callback<void (void)>
+{
   void start (rxvt_display *display)
   {
     display->reg (this);
@@ -331,6 +334,15 @@ struct rxvt_color
   bool operator == (const rxvt_color &b) const { return Pixel (*this) == Pixel (b); }
   bool operator != (const rxvt_color &b) const { return Pixel (*this) != Pixel (b); }
 
+  bool is_opaque () const
+  {
+#if XFT
+    return c.color.alpha == rgba::MAX_CC;
+#else
+    return 1;
+#endif
+  }
+
   bool alloc (rxvt_screen *screen, const rgba &color);
   void free (rxvt_screen *screen);