1 /* 2 * autocutsel by Michael Witrant <mike @ lepton . fr> 3 * Manipulates the cutbuffer and the selection 4 * Copyright (c) 2001-2006 Michael Witrant. 5 * 6 * This program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program; if not, write to the Free Software 18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 * 20 * This program is distributed under the terms 21 * of the GNU General Public License (read the COPYING file) 22 * 23 */ 24 25 #include "config.h" 26 27 #include <X11/Xmu/Atoms.h> 28 #include <X11/Xmu/StdSel.h> 29 30 #include <X11/Intrinsic.h> 31 #include <X11/StringDefs.h> 32 #include <X11/Xlib.h> 33 #include <X11/Xatom.h> 34 #include <X11/Shell.h> 35 #include <X11/Xlib.h> 36 #include <X11/Xutil.h> 37 #include <X11/Xaw/Box.h> 38 #include <X11/Xaw/Cardinals.h> 39 #include <X11/Xmd.h> 40 #include <stdio.h> 41 #include <stdlib.h> 42 #include <unistd.h> 43 #include <signal.h> 44 #include <errno.h> 45 #include <inttypes.h> 46 47 48 typedef struct { 49 String selection_name; 50 int buffer; 51 String debug_option; 52 String verbose_option; 53 String fork_option; 54 String buttonup_option; 55 String kill; 56 int pause; 57 int debug; 58 int verbose; 59 int fork; 60 Atom selection; 61 char* value; 62 int length; 63 int own_selection; 64 int buttonup; 65 } OptionsRec; 66 67 extern Widget box; 68 extern Display* dpy; 69 extern XtAppContext context; 70 extern Atom selection; 71 extern int buffer; 72 extern OptionsRec options; 73 74 75 void PrintValue(char *value, int length); 76 Boolean ConvertSelection(Widget w, Atom *selection, Atom *target, 77 Atom *type, XtPointer *value, 78 unsigned long *length, int *format); 79