xsel

Program for manipulating the X clipboard
git clone https://git.sinitax.com/kfish/xsel
Log | Files | Refs | README | LICENSE | sfeed.txt

commit d77c4ec0c31134901328e1fd523c2907c7978c6d
parent 918143578306477d547e8d19e7b29e6e2a1927d5
Author: conrad <conrad@9c49b5d1-7df3-0310-bce2-b7278e68f44c>
Date:   Thu, 17 Jan 2008 04:28:12 +0000

Add basic handling of COMPOUND_TEXT.
We do not currently serve COMPOUND_TEXT; we can retrieve it but do not
perform charset conversion.


git-svn-id: http://svn.kfish.org/xsel/trunk@205 9c49b5d1-7df3-0310-bce2-b7278e68f44c

Diffstat:
Mxsel.c | 13++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/xsel.c b/xsel.c @@ -61,9 +61,13 @@ static Atom incr_atom; /* The INCR atom */ static Atom null_atom; /* The NULL atom */ static Atom text_atom; /* The TEXT atom */ static Atom utf8_atom; /* The UTF8 atom */ +static Atom compound_text_atom; /* The COMPOUND_TEXT atom */ /* Number of selection targets served by this. - * (MULTIPLE, INCR, TARGETS, TIMESTAMP, DELETE, TEXT, UTF8_STRING and STRING) */ + * (MULTIPLE, INCR, TARGETS, TIMESTAMP, DELETE, TEXT, UTF8_STRING and STRING) + * NB. We do not currently serve COMPOUND_TEXT; we can retrieve it but do not + * perform charset conversion. + */ #define MAX_NUM_TARGETS 8 static int NUM_TARGETS; static Atom supported_targets[MAX_NUM_TARGETS]; @@ -626,6 +630,7 @@ wait_selection (Atom selection, Atom request_target) *(int *)value); keep_waiting = False; } else if (target != utf8_atom && target != XA_STRING && + target != compound_text_atom && request_target != delete_atom) { /* Report non-TEXT atoms */ print_debug (D_WARN, "Selection (type %s) is not a string.", @@ -2011,6 +2016,12 @@ main(int argc, char *argv[]) supported_targets[s++] = XA_STRING; NUM_TARGETS++; + /* Get the COMPOUND_TEXT atom. + * NB. We do not currently serve COMPOUND_TEXT; we can retrieve it but + * do not perform charset conversion. + */ + compound_text_atom = XInternAtom (display, "COMPOUND_TEXT", False); + /* handle selection keeping and exit if so */ if (do_keep) { keep_selections ();