\begindata{text,539756272}
\textdsversion{12}
\template{default}
\define{overbar
}
\define{footnote
}
\formatnote{\formatnote{.ds CT

.ds CB - IV-\\\\n(PN -}}

\chapter{\overbar{
}Drag & Drop

Extensions for the

Andrew Toolkit

\underline{                                               }

}
\flushright{Todd A. Inglett

IBM Rochester

tinglett@rchland.vnet.ibm.com

}\section{





}\center{\bold{\italic{ABSTRACT

}}}\indent{\indent{The ability to drag and drop files represented by icons is 
relatively new to 
Unix\footnote{\
\begindata{fnote,539676936}
\textdsversion{12}
Unix is a registered trademark of UNIX System Laboratories, Inc.\
\enddata{fnote,539676936}
\view{fnotev,539676936,84,0,0}} with the advent of desktop managers such as 
\italic{X.desktop}\footnote{\
\begindata{fnote,539677192}
\textdsversion{12}
X.desktop is a product from IXI Limited, Cambridge, England.\
\enddata{fnote,539677192}
\view{fnotev,539677192,85,0,0}} and \italic{Looking 
Glass}\footnote{\
\begindata{fnote,539677448}
\textdsversion{12}
Looking Glass is a product from Visix Software, Inc.\
\enddata{fnote,539677448}
\view{fnotev,539677448,86,0,0}}.  This paper outlines how the simple protocol 
used by X.desktop may be used to extend the Andrew Toolkit (ATK) to allow drag 
and drop between X.desktop and an ATK application.  The protocol does not 
require X.desktop.

}}\section{
\begindata{bp,539707208}
\enddata{bp,539707208}
\view{bpv,539707208,95,0,0}

Drag & Drop Defined

}
The definition of \italic{drag and drop} used in this paper is the ability to 
``grab'' some user interface object or icon and move it to some new location. 
 Normally, this movement is performed by some mouse action.  The movement 
itself is called a \italic{drag} operation.  For example, using \italic{IXI's 
X.Desktop} (see figure below) is a desktop manager application where one sees 
files represented by icons on the desktop.  If the user presses and holds the 
first mouse button over an icon, the icon is ``grabbed.''  Visually, the mouse 
cursor changes to a hand that appears to be holding a piece of paper.  With 
the button held, the user can move the cursor to a new location and release 
the mouse button.  The movement is the \italic{drag} operation and the release 
is the \italic{drop} operation.

\center{\
\begindata{raster,539763720}
2 0 65536 65536 0 0 391 328
bits 539763720 391 328
zzo |
zzo |
i80zzg04h04 |
0a/aa/aa+aaac	!aaac |
15!5595/55/55+55	5c |
0a/aa/aa+aaac	!aaac |
15!5595/55/55+55	5c |
0bHbfZZGfdHac |
15zzm5c |
0b2a/aa/aa*aa	ac!aaac |
15!5595/55555f	Id5/555559"55	565c |
0b2a/aa"aaafI	ea/aa"aaac!aa	ac |
15!5595/55555f	Id5/555559!55	40165c |
0b2a/aa"aaafI	ea/aa"aaac8aaa	ac |
15500595/5555	5fId5/55555941	!55765c |
0b22/aa"aaafe3	0c38ea/aa"aaac	8aaaac |
15555d95/5555	5ffd75d7/55!55	5947!55765c |
0b27fa/aa!aaaf	e175d9ea/aa!aa	aeac8aaaac |
15!5595/55555f	dd75ded5/5555	59"55765c |
0b2a/aa"aaafdd	0c376a/aa"aaac	8aaaac |
15!5595/55555f	e17df8d5/5555	59!555ff65c |
0b2a/aa"aaafG	7dGea/aa"aaac	!aaac |
15!5595/55555f	G7dGd5/555559	"55565c |
0b7fGbfZYfbGfd	Gfeac |
3fZZLfefc |
g/aa/aa-aaa804 |
15d5/55/55,55	545c |
0ba0zzk0cac |
15c0zzk0c5c |
0ba0zzk0cac |
15c0zzk0c5c |
0ba0zzk0cac |
15c0zzk0c5c |
0ba0zzk0cac |
15c0zzk0c5c |
0ba0zzk0cac |
15c0zzk0c5c |
0ba0zzk0cac |
15c01fe103c0i	G070402h07b840	zi77800fi0c5c |
0ba00c6380c0i	63030e02h0318	e0zi33g03i0cac |
15c00c21gc0i61	030406h031040	zi33g03i0c5c |
0ba00chc0i6003	g06h0390zj33g	03i0cac |
15c00c8780c0f0	h641f1e1fc0g01	b1e078c3zg330f	030dc0g0c5c |
0ba00f8180c198	h7c37!06h01a0	60ccc3zg3f1983	0760g0cac |
15c00c8180c318	h6463!06h01a0	618cdbzg333183	0630g0c5c |
0ba00c0180c3f8	h6063!06ie061	fcdbzg333f8306	30g0cac |
15c00c0180c3i	6063!06ie06180	dbzg3330030630	g0c5c |
0ba00c0180c3i	6163!06ic06180	6ezg3330030630	g0cac |
15c00c0180c188	h6337!0640h40	60c466zg331883	0660g0c5c |
0ba01e07e3!f0	hG1d9f8380h41	f87842zg778f0f	c7c0g0cac |
15c0zzh06h0c5c |
0ba0zzh06h0cac |
15c0zzh0fh0c5c |
0ba0zzk0cac |
15c03ff0j01G80	j0ffczjGc0j0c	5c |
0ba0zzk0cac |
15c0zzk0c5c |
0ba0zzk0cac |
15c0zzk0c5c |
0ba0zzk0cac |
15c0zzk0c5c |
0bbfZZKfcac |
15ZZLfc5c |
0bZZLfcac |
1580zzi3fGfc5c |
0b80zzi3fGf8ac |
1580zzi3ff7f0	5c |
0b80zzi3fe7f0	ac |
1580zzi3fe7f0	5c |
0b80zzi3fc7f0	ac |
1580z07f8zg3f	c7f05c |
0b80z3848zg3f	83f0ac |
1580zc008zg3f	83f05c |
0b80y03g08zg3f	01f0ac |
1580iIf8r0cg04	o07Ic0m3f01f0	5c |
0b80i80h06r30	g04o04i30m3eg	f0ac |
1580i80h03Ge0	pc18006o04i1f	Gl3egf05c |
0b80i80h018020	p86g02o04i0c01	l3cg70ac |
1580i80h018038	p98c302o04i0c	01c0k3cg705c |
0b80i80h01c02c	p831803o04i0e	0160k39Gf0ac |
1580i80h01402c	pc06181o04i0a	0160k3bGf05c |
0b80i80h02a02c	p400c01o04i15	0160k3fGf0ac |
1580i80h0d602c	p40300180n04i	6b0160k3fGf05c |
0b80i80h06b02c	p40h80n04i3581	60k3fGf0ac |
1580i80h03582c	p60c0g80n04i1a	c160k3fGf05c |
0b80i80h01a82c	p2018gc0n04i0d	4160k3fGf0ac |
1580i80id42cp	2060g40n04i06	a160k3fGf05c |
0b80i80i6c2cp	3180g60n04i03	6160k3fGf0ac |
1580i80i362cp	10h20n04i01b1	60k3fGf05c |
0b80i80i1a2cp	1060g30n04jd1	60k3fGf0ac |
1580i80i0d2cp	19803010n04j69	60k3fGf05c |
0b80i80i072cp	0830c030n04j39	60k3fGf0ac |
1580i80i032cp	08c3gf0n04j19	60k3fGf05c |
0b80i80i01acp	!0c0360n04j0d	60k3fGf0ac |
1580i80i01acp	04gccc0n04j0d	60k3fGf05c |
0b80i80jacp04	033180n04j0560	k3fGf0ac |
1580i80jacp06	gc3o04j0560k3f	Gf05c |
0b80i80jacp02	0306o04j0560k	3fGf0ac |
1580i80jacp03	!0co04j0560k3f	Gf05c |
0b80i80jacp01	3018o04j0560k	3fGf0ac |
1580i80jacp01	c030o04j0560k	3fGf05c |
0b80i80jacp01	8060f8n04j0560	k3fGf0ac |
1580i80jacp01	gc18cn04j0560	k3fGf05c |
0b80i80jacp!01	818cn04j0560k	3fGf0ac |
1580i80jacq07	0180n04j0560k	3fGf05c |
0b80i80jacp!1c	0180n04j0560k	3fGf0ac |
1580i80jacp72	78018cn04j0560	k3fGf05c |
0b80i80jaco01	c2980d8cn04j05	60k3fGf0ac |
1580i80jaco07	02070cf8n04j05	60k3fGf05c |
0b80i80j2cofe	02ge3i7580j04	j0160k3fGf0ac |
1580i80g60g03	2cn018304g8e80	g018e78j04g03	h1960k3fGf05c |
0b80i80gd8g06	8cn0301c1fc38	80g02a1ccj04g	06c0g3460k3fG
 f0ac |
1580i800198g0c	ccn06gf307e0f0	g0ff006j04g0c	c0g6660k3fGf0
 5c |
0b80i800308g18	4cn04gfe03808e	g180f23j04g18	40gc260k3fGf0
 ac |
1580i800618g30	ccn04gfc1180b2	g30g1180i04g30	c0018660k3fGf0
 5c |
0b80i800c18g60	ccn0422c80181	0eg60g88c0i04	g60c0030660k3f
 Gf0ac |
1580i801f201e	c1acn0409c822	c032g45404460	i04gf9gf60d60
 k3fGf05c |
0b80i80108021	c12cn0402c814	ccceg82a02220	i04g84010e0960
 k3fGf0ac |
1580i80604e40	c02cn0655a80b	d332018fd011j	04030272060160
 k3fGf05c |
0b80i80403b80	60acn02ab9655	8cce01186828j	040201dc030560
 k3fGf0ac |
1580i80c03180	60acn01d746ab	333c0fGf410j04	06018c030560k
 3fGf05c |
0b80i!8019g30	aco7c3bd6ccf0	08g38k!04gc801	8560k3fGf0ac |
1580i818419g30	acn0383c0fd33	c008fc74k040c	20c8018560k3f
 Gf05c |
0b80i818859gb0	acn03fc3cgcfg	098eb8k040c42	c8058560k3fGf0
 ac |
1580i81823901	70aco3f!c33cg	0907f450j040c	11c80b8560k3f
 Gf05c |
0b80i8084592a	b0aco03fc3cf0	g09f1d028j!04	22c9558560k3f
 Gf0ac |
1580i80eab895	70acp3fc3c0g08	700554j040755	c4ab8560k3fGf0
 5c |
0b80iGd57faaG	acp03Gh081a02	aaj07feabfd57	fd60k3fGf0ac |
1580ie06ae055	c02cq3ch080d!55	40i07035702ae	0160k38h5c |
0b80i3ff5GebG	ect08072aaaa0	i01GafG5fG60k	38g10ac |
1580i381f801f	g0ct0801Gfd40	i01c0fcgf8g60	k38g305c |
0b80i0fJfct08	g7fGa0j7fJe0k	38g30ac |
1580i0fJfct08	g30Gc0j7fJe0k	38g305c |
0b80zi08g3003	e0u38g30ac |
1580zi18g38ge0	u38g305c |
0b80zi10g18g20	u38g30ac |
1580zi10g18w38	g305c |
0b80zi1fGf8w38	g30ac |
1580g1f80g07h	3c103cs0fGf8q	07k38g305c |
0b80g06h03h66	380czm03k38g30	ac |
1580g06h03h66	100czm03k38g30	5c |
0b80g06h03h60	g0czm03k38g30	ac |
1580g0616c7c3	38f060780c0fk	6f3b9b87c6e370	g3cj379dcdc3e3
 71b8g1f0f0780	h38g305c |
0b80g061b6c63	3198f8180c1980	j39998ccc63b1	d8g66j1cccc666
 31d8ecg37198c	c0h38g30ac |
1580g061b6c!63	1860180c3180j	31998ccc63198c	gc6j18ccc66631
 8cc6g6330d8c0	h38g305c |
0b80g061b61e3	c3f860180c3f80	j30198cc1e319	8cgc0j180cc660
 f18cc6g6330d8	i38g30ac |
1580g061b6663	c3g60180c30k30	198cc663198cg	c0g20h180cc663
 318cc6g6330d8	i38g305c |
0b80g061b6c!63	g60180c30k3019	8ccc63198cgc2	g20h180cc66631
 8cc6g6330d840	h38g30ac |
1580g061b6ce3	318860180c1880	j301b8ccce331	982066g30h180d
 c6667198cc1037	198cc0h38g305c |
0b80g1f9b6737	b8!f07e3f0fk7c	0edde733e1f070	3cg30h3e076ef3
 99f0f8381d8f07	80h38g30ac |
1580z03018020	h38l0180c010l	38g305c |
0b80z030180i3c	l0180c0m38g30	ac |
1580z0783c0i3c	l03c1e0m38g30	5c |
0b80zl3ev38g30	ac |
1580zl3fv38g30	5c |
0b80zl3fv38g30	ac |
1580zl7f80u38	g305c |
0b80zl7f80u38	g30ac |
1580zl7fc0u38	g305c |
0b80zl7fe0u38	g30ac |
1580z07f8j7fe0	u38g305c |
0b80z3848j7ff0	u38g30ac |
1580zc008j7ff0	u38g305c |
0b80y03g08j7f	f0u38g30ac |
1580iIf8r0cg04	j7f80i07Ic0m38	g305c |
0b80i80h06r30	g04j7b80i04i30	m38g30ac |
1580i80h03Ge0	pc18006j0380i	04i1fGl38g305c |
0b80i80h018020	p86g02j03c0i04	i0c01l38g30ac |
1580i80h018038	p98c302j01c0i	04i0c01c0k38g	305c |
0b80i80h01c02c	p831803j01c0i	04i0e0160k38g	30ac |
1580i80h01402c	pc06181j01c0i	04i0a0160k38g	305c |
0b80i80h02a02c	p400c01j01e0i	04i150160k38g	30ac |
1580i80h0d602c	p40300180je0i	04i6b0160k38g	305c |
0b80i80h06b02c	p40h80je0i04i	358160k38g30ac |
1580i80h03582c	p60c0g80je0i04	i1ac160k38g30	5c |
0b80i80h01a82c	p2018gc0jf0i04	i0d4160k38g30	ac |
1580i80id42cp	2060g40j70i04	i06a160k38g30	5c |
0b80i80i6c2cp	3180g60j70i04	i036160k38g30	ac |
1580i80i362cp	10h20j70i04i01	b160k38g305c |
0b80i80i1a2cp	1060g30j70i04	jd160k38g30ac |
1580i80i0d2cp	19803010j78i04	j6960k38g305c |
0b80i80i072cp	0830c030j38i04	j3960k38g30ac |
1580i80i032cp	08c3gf0j38i04	j1960k38g305c |
0b80i80i01acp	!0c0360j38i04	j0d60k38g30ac |
1580i80i01acp	04gccc0j3ci04	j0d60k38g305c |
0b80i80jacp04	033180j1ci04j	0560k38g30ac |
1580i80jacp06	gc3k1ci04j0560	k38g305c |
0b80i80jacp02	0306k1ci04j05	60k38g30ac |
1580i80jacp03	!0ck1ei04j0560	k38g305c |
0b80i80jacp01	3018k0ei04j05	60k38g30ac |
1580i80jacp01	c030k0ei04j05	60k38g305c |
0b80i80jacp01	8060f8j0ei04j	0560k38g30ac |
1580i80jacp01	gc18cj0ei04j05	60k38g305c |
0b80i80jacp!01	818cj0fi04j05	60k38g30ac |
1580i80jacq07	0180j07i04j05	60k38g305c |
0b80i80jacp!1c	0180j07i04j05	60k38g30ac |
1580i80jacp72	78018cj07i04j	0560k38g305c |
0b80i80jaco01	c2980d8cj0780	h04j0560k38g30	ac |
1580i80jaco07	02070cf8j0380	h04j0560k38g30	5c |
0b80i80j2cofe	02ge3k0380h04	j0160k38g30ac |
1580i80g60g03	2cn018304g8e80	j0380h04g03h19	60k38g305c |
0b80i80gd8g06	8cn0301c1fc38	80j03c0h04g06	c0g3460k38g30
 ac |
1580i800198g0c	ccn06gf307e0f0	j01c0h04g0cc0	g6660k38g305c |
0b80i800308g18	4cn04gfe03808e	j01c0h04g1840	gc260k38g30ac |
1580i800618g30	ccn04gfc1180b2	j01c0h04g30c0	018660k38g305c |
0b80i800c18g60	ccn0422c80181	0ej01c0h04g60	c0030660k38g30
 ac |
1580i801f201e	c1acn0409c822	c032j01e0h04g	f9gf60d60k38g
 305c |
0b80i80108021	c12cn0402c814	ccceke0h04g84	010e0960k38g30
 ac |
1580i80604e40	c02cn0655a80b	d332ke0h040302	72060160k38g30
 5c |
0b80i80403b80	60acn02ab9655	8cceke0h040201	dc030560k38g30
 ac |
1580i80c03180	60acn01d746ab	333ckf0h040601	8c030560k38g30
 5c |
0b80i!8019g30	aco7c3bd6ccf0	k70h!04gc80185	60k38g30ac |
1580i818419g30	acn0383c0fd33	c0k70h040c20c8	018560k38g305c |
0b80i818859gb0	acn03fc3cgcfl	70h040c42c805	8560k38g30ac |
1580i81823901	70aco3f!c33cl	78h040c11c80b	8560k38g305c |
0b80i8084592a	b0aco03fc3cf0	l38h!0422c955	8560k38g30ac |
1580i80eab895	70acp3fc3c0l38	h040755c4ab85	60k38g305c |
0b80iGd57faaG	acp03Gm38h07fe	abfd57fd60k38	g30ac |
1580ie06ae055	c02cq3cm38h07	035702ae0160k	38g305c |
0b80i3ff5GebG	ecy3ch01GafG5f	G60k38g30ac |
1580i381f801f	g0cy1ch01c0fc	gf8g60k38g305c |
0b80i0fJfcy1c	i7fJe0k38g30ac |
1580i0fJfcy1c	i7fJe0k39Gf05c |
0b80zn1et3bGf0	ac |
1580zn0et3fGf0	5c |
0b80zn0et3fGf0	ac |
1580zn0et38h5c |
0b80i04zj0ft38	g30ac |
1580i04je0g1e	k08g020780h1c	j0704g0103c0h	0eg0380i3cg70
 5c |
0b80i0cj60g06	k08g020180h0c	j0704g01gc0h06	g0180i3cg70ac |
1580i1cj60g06	k18g060180h0c	j070cg03gc0h06	g0180i3egf05c |
0b80i3cj60g06	k18g060180h0c	j070cg03gc0h06	g0180i3egf0ac |
15806f3b9bbfc6	e370g7c1e061b	80h7a7f!1fc181	e1f07cg1eh3fbf
 !8fe0c0f0f83e	g0f8783c0g3f01	f05c |
0b8039998cfc63	b1d8g7633060e	c0hc618318601	833318dcg33h63
 8c18c3gc1998c	6eg1b8cc660g3f	01f0ac |
158031998cfc63	198cg6663060c	60hc218318601	861b198cg63h63
 8c18c3gc30d8c	c6g31986c60g3f	83f05c |
0b8030198cfde3	198cg667f060c	60h7018078601	8618798cg60h3b
 8c03c3gc30c3c	c6g31986ch3f83	f0ac |
158030198dfe63	198cg6660060c	60h1c18598601	8619998cg60h0f
 cc0cc3gc30ccc	c6g31986ch3fc7	f05c |
0b8030198ffc63	198cg6660060c	60h8618f18601	861b198cg61h43
 cc18c3gc30d8c	c6g31986c20g3f	c7f0ac |
1580301b8ffce3	3198206631060c	c0hc619b38641	833338dc1033h
 63cc99c320c199	9c6e081b8cc660	g3feff05c |
0b807c0edfG33	e1f070ef1e1f8f	80hbc0f9cc387	!e1cc76381eh5f
 c70e61c3!f0e6	3b1c0ec783c0g	3feff0ac |
1580h0ff80301	8020i0cj0780l	10i01e0m08k3f	Gf05c |
0b80h1ff80301	80j0cj0f80qe0	s38hac |
1580h1ff80783	c0j1ej1f80qe0	s30h5c |
0bZZLfcac |
1580h07f8r3fr	f0v5c |
0b80h02f8r7fr	70vac |
1580h0398rGr70	v5c |
0b80h0780q01G	r70vac |
1580h07r03Gr70	p3fJc05c |
0b80h0fr07fer	78p3fJc0ac |
1580h0er0ffer	38p3fJc05c |
0b80h0er03fer	38p3870!0f87c0	ac |
1580g181eh0180	l03hfeg30h1cj	60g83b806nf038	70070f87c05c |
0b80g101ch01m	02hfeg20h0cj40	g81bc04m01983c	f9e3870fc0ac |
1580g301ch03m	06g01fcg60h0c	jc001819c0cm01	8c3cf9e3870fc0
 5c |
3f80g203ch02m	04g01e4g40h0c	j8001819c08m01	8c3cf9e3870fc0
 fc |
g80g63b8f4de06	0f078b65b0f1b8	0c3d37c780c3e3	707cde1e30c187
 c7f19c187c6e37	0f40g80018c3c	f807824fc004 |
0b80g41f98c73	04198ccdb6d998	cc08631fccc086	3198dc733330c1
 0c61819e10c63b	1d98c001c0gcc	3cf807924fc0ac |
1580gc1f98463	0c31986db6db0c	cc18611fd8c186	31998c!6336c3
 0c6181be30c631	98d840g80g7c3c	f9e390cfc05c |
0b80g81f8e060	0830186db6db0c	cc10381f9801g	f1998c607f36c2
 01e181ee201e31	98cej1c3cf9e3	90cfc0ac |
15800181f83860	1830186db6db0c	cc300e1f18!03	31998c!6036c6
 066181ee606631	98c380i183cf9	e399cfc05c |
0b80!01f90c60	1030986db6db0c	cc20431f184206	31998c!601b84
 0c6181be40c631	98d0c0i183870	0719c7c0ac |
15800301f98c60	30198ccdb6d998	cc60631e0cc606	7198dc6031198c
 0ce1919fc0ce33	1998c0g80g3038	700f1dc7c05c |
0b800201ed78f8	200f078db6d8f1	de405e3e078403	9bbc76f81e1088
 0730e3df80733e	1f178001c0g60	3fJc0ac |
15800601c0h60	mc0g3cg0cm18i	0780g3018i80g	c03fJc05c |
0b80g03c0r3cs	07h3018j01g3f	Jc0ac |
1580g0380r78s	0780g783cl3fJ	c05c |
0b80g0380r78s	0380o3fJc0ac |
1580g0780rf0s	0380u5c |
0b80g07sf0s03	80uac |
1580g07r01e0s	03c0u5c |
0b80g0fr01e0s	01c0uac |
1580g0er03c0s	01c0u5c |
0bh1er03c0s01	c0uac |
15!559d+5557d5	-55d5.555c |
0a!aabe+aaaf-aa	abea+aaac!aaac |
15!55bd+555f.55	f5.555c |
0a!aaba+aaaf.aa	ea+aaac!aaac |
1fHbfZZGfdHfc |
3fZZMfc |
i70r3cu70v |
if0r3cu70v |
ie0r78u70v |
ie0r78u78v |
h01e0rf0u38v |
h01c0rf0u38v |
h01c0q01e0u38	v |
h03c0q01e0u38	v |
h0380q03c0u3c	v |
h0780q03c0u1c	v |
h07r0780u1cv |
h07r0780u1cv |
h0fr0fv1ev |
h0er0fv0ev |
h0er1ev0ev |
h1er1ev0ev |
h1cr3cv0fv |
h3cr3cv07v |
h38r78v07v |
h38r78v06v |
uf0zs |
uf0zs |
t01e0zs |
t01e0zs |
t03c0zs |
3fk01fcb0k03c0	zs |
1180k8410k0780	zs |
1080j208010k07	80s180ch01f804	s |
10461b6b619678	8993k07t0c18i	8ct |
10492524924920	f89480y0c18i84	g04r |
1049212493c920	889780y0a28cd	8e608ccecf3580	p |
10892124920920	8094z0a292492	90f925244bq |
11892524932920	809640y094924	98f08125247aq |
3f0618ded9dd99	e1fb80y094924	868081252442q |
t60gc00740p08	892492c8812524	66q |
t20g400cc0p1c	9cc35c71c0cfb3	3fq |
t20g400840zp |
q02cc30e32c59	9001c66d6660zl |
q019249249249	10024924c990zl |
q011e3924924b	1003092488f0zl |
q01104924924a	0840c9248880zl |
q011949249246	0cc2492489c8zl |
q038e34d33be4	0783861bc670zl |
v04zr |
v08zr |
v18zr |
zzo |
zzo |
\enddata{raster, 539763720}
\view{rasterview,539763720,88,0,0}}

The real action that occurs normally happens when the icon is dropped.  If the 
icon is a file, dropping the icon may move or copy the file to a new 
directory.  Or if the file icon is dropped on another file icon, the other 
icon may be assumed to be a program to run with the file as input.  The exact 
action depends upon the icon being dropped and the location where it is 
dropped.  IXI's X.desktop offers a script language very similar to the Unix 
shell to define these actions.


Drag and drop operations are not limited to a single window.  For example, the 
\typewriter{runapp.c} icon above can be dragged into another directory window. 
 The physical file will be moved and the icon will move to reflect that fact. 
 The same icon can also be dragged to a \italic{desktop} window.  A desktop is 
not a directory, but simply a holding place for ``working'' files.  But these 
examples are all specific to IXI's X.desktop.  Drag and drop operations are 
not limited to a single application either (such as X.desktop).  An icon can 
be dropped on a different application's window.



\section{Drag & Drop and the Andrew Toolkit

}
Andrew applications can easily exploit the drag and drop paradigm.  For 
example, one could drag a filename out from bush and drop it on ez.  Ez could 
then visit the dropped file.  Or a buffer could be dragged out of ez and 
dropped on bush.  Bush could then view the directory containing that file.  A 
file could be dropped onto a typescript, and typescript could enter the file's 
full pathname onto the command line.  As these examples show, the ``objects'' 
manipulated with drag and drop need not be represented as 
icons.\footnote{\
\begindata{fnote,539677704}
\textdsversion{12}
Although one could argue that the presence of an icon makes the operation more 
intuitive.\
\enddata{fnote,539677704}
\view{fnotev,539677704,89,0,0}}


Drag and drop in ATK can also be used \italic{within} applications.  For 
example, zip could be implemented such that the drawing object icons are 
dragged into the drawing area, then edited to suit the drawing.  A circle 
could be dragged and dropped into the drawing, then stretched into shape.


The idea becomes very powerful when it is compatible with other non-ATK 
applications and toolkits.  The effectiveness of cut and paste would be 
seriously impaired if every application or toolkit supported its own 
incompatible implementation.  Likewise, drag and drop would be much less 
effective if it was confined only to ATK based applications.


When ATK honors IXI's drag and drop protocol, X.desktop file icons can be 
dragged from the desktop and dropped on any ATK application.  Bush can be used 
to find a file which can then be dragged out of bush and dropped on the 
desktop.  These files can be dragged from the desktop onto ez which can either 
switch to the file or open new windows.  The desktop becomes a ``working 
area'' for frequently used files and directories.



\section{IXI's Drag and Drop Protocol

}
IXI's protocol is based upon creating X \italic{properties} and sending client 
messages.  The protocol ``drops'' a file by creating a property on the window 
of the destination application followed by sending a client message to the 
application indicating the name of the property.  The client is responsible 
for reading and deleting the property.  No sockets, message queues, streams or 
other forms of IPC are necessary.  The protocol can be monitored and reverse 
engineered quite readily with the \italic{xprop -spy} command.


For readers unfamiliar with X properties, a \italic{property} is logically a 
variable with a name, type and value that is attached to an X window.  It is a 
programming entity only so it is not visible in any way to a user viewing the 
window.  A \italic{client message} is a short message that can be sent from 
one X application to another.  These messages are delivered in the same manner 
as any other X protocol event (such as \italic{expose}, \italic{keypress}, 
\italic{mouse motion}, etc).  Because a client message must be short (5 
integers plus some window ID information), the protocol uses a property to 
store the information about the file drop (names, etc), and the client message 
refers to the property by name and window id.


For sake of discussion, call the application performing the drop as ``the 
sender'' and the application being dropped upon as ``the receiver.''  The 
protocol works as follows:


\description{1.	The receiver attaches a property called 
\italic{IXI_DROP_PROTOCOL} to its own window at startup time.  The following 
table describes this property in detail.  The presence of this propery 
indicates the willingness of the application to receive file drops, and its 
content describes what window should receive the drop client message.

	\
\begindata{table,539763976}
\cols 96 191 99
-	-
| ^Protocol Property Definition	= 	=|
-	-
| prop name	| IXI_DROP_PROTOCOL	=|
| type	| WINDOW	=|
| length	| '# of formats	=|
| data[0]	| Window ID	=|
| data[1]...	| Supported data types	=|
-	-
\enddata{table,539763976}
\view{spread,539763976,90,0,0}\center{

}
	The \italic{data[0]} field indicates the window id which the recipient 
application wishes to receive the client message.  This is normally the same 
window, but a multi-window application may choose to direct all messages to a 
single window without requiring the user to only drop objects on that window.


	The data[1]...data[length] fields indicate the names of data formats that the 
recipient can interpret.  The type \italic{STRING} may be used to indicate a 
single filename.  Normally a full pathname is used.  The type 
\italic{HOST_AND_FILE_NAME} may be used to indicate a list of filenames 
defined as follows:


\example{	hostname\\0pathname1\\0pathname2\\0...\\0pathnameN\\0\\0


}	 Other data types can be used provided that application's can agree on their 
usage.


2.	The user wants to drop a file.  He performs some action in the sender 
application to initiate a file drop.  This is perhaps just a mouse press, but 
may be a menu selection or key press of some sort.  The sender application 
normally grabs the mouse cursor, changes its shape to indicate a ``drag'' 
operation, and allows the user to pick a target window.


3.	The sender application gets the window id of the receiver application by 
computing which window was selected in step #2.  The sender now traverses the 
X window tree up from the selected window through parent windows to the root 
window, looking for a window with an attached \italic{IXI_DROP_PROTOCOL} 
property.  ATK applications normally have only one X window, but other 
toolkits use subwindows.


4.	If the sender cannot find such a window, it aborts the drop.  The receiver 
application does not support drag and drop.


5.	If the sender does find such a window, it reads the value of the 
\italic{IXI_DROP_PROTOCOL} property mentioned in step #1--which contains a 
window id and data type.  Normally this is the same window where the property 
was found, but it need not be.


	The sender examines the data types supported by the receiver and converts the 
data if necessary.  The sender then computes a unique property name and 
creates it on the receiver's window.  A unique property name may be generated 
by using the following template for a name:


\example{	IXI_DROP_PROTOCOL_\italic{w}_\italic{x}

}
	Where \italic{w} is the window ID (decimal) of the sender's window, and 
\italic{x} is some generation number (decimal) used within the sender.  If all 
applications follow this convention, the name should be unique and should not 
exist on the recipient's 
window.\footnote{\
\begindata{fnote,539677960}
\textdsversion{12}
\define{italic
menu:[Font~1,Italic~11]
attr:[FontFace Italic Int Set]}
Ideally, the sender will reuse the generation numbers when the property is 
deleted by the recipient.  This avoids core leaks in the X server because 
\italic{atoms} must be created for these names.\
\enddata{fnote,539677960}
\view{fnotev,539677960,91,0,0}}


6.	Assuming the data type indicates a ``file drop'', the sender places the 
names of the dropped files into the property it has just created.  The 
receiver is not yet aware of the events that have taken place thus far.


7.	The sender finally forms a client message to send to the receiver.  The 
following table describes this message which is sent as a client message to 
the receiver:

	\
\begindata{table,539764232}
-	-
| ^Client Message Format	= 	=|
-	-
| event type	| ClientMessage	=|
| window	| Receiver's window id	=|
| message type	| IXI_DROP_PROTOCOL	=|
| format	| '32	=|
| data[0]	| time stamp	=|
| data[1]	| coordinates	=|
| data[2]	| mouse state	=|
| data[3]	| data format	=|
| data[4]	| property name	=|
-	-
\enddata{table,539764232}
\view{spread,539764232,92,0,0}


	The \italic{coordinates} is a 32 bit integer formed as follows:

	\
\begindata{table,539764104}
\cols 200 199 99
'31	"0	 
-	-
| x coordinate	| y coordinate	=|
-	-
\enddata{table,539764104}
\view{spread,539764104,93,0,0}


	The \italic{mouse state} is a 32 bit integer formed as follows:

	\
\begindata{table,539764488}
\cols 99 127 60 99 99
'32	"13	"8	"0	 
-	-	-	-
| reserved (0's)	= 	| buttons	| modifiers	=|
-	-	-	-
\enddata{table,539764488}
\view{spread,539764488,94,0,0}


	The \italic{buttons} field is 5 bits and contains one bit for mouse buttons 1 
through 5.  For example, bits 8 and 9 set indicates that buttons 1 and 2 were 
pressed when the ``object'' was dragged (although they may have been released 
to drop the file).  The \italic{modifiers} field is 8 bits and contains one 
bit for each of the modifier keys \italic{shift}, \italic{lock}, 
\italic{control}, and \italic{mod1} through \italic{mod5}.


	The \italic{data format} field of the client message specifies the data type 
of the property that was stored on the recipient's window.  This is usually 
\italic{HOST_AND_FILE_NAME} and must match one of the data types supported by 
the recipient application.


	The \italic{property name} field of the client message indicates the name of 
the property so the recipient can find it.


8.	The receiver gets the client message as an X event.  It locates the 
property by name, reads its value, and deletes the property.  The receiver may 
do what it wishes with the file names (visit a file, etc).  The receiver can 
use the mouse button state and x,y coordinates to perform different operations 
depending upon which buttons were used to drop the file and where the file was 
dropped.

}

\section{The ATK Interface

}
The sample implementation was done by adding three new methods to the 
\italic{interaction manager}.  The interaction manager was chosen because it 
best represents an instance of an ATK window.  The three methods are:


\typewriter{im_DropFiles(char **pathnames, struct cursor *cursor)

im_DropFile(char *pathname, struct cursor *cursor)

}\leftindent{These methods allow an application to drag ``out'' of the 
application.  Currently only file drags are implemented and the second method 
is simply a convenience function for the first.  The im_DropFiles method takes 
a null terminated list of file names and a cursor.  The file names are those 
that will be dropped.  This method grabs the cursor and changes it to the 
given cursor and allows the user to select a point to drop the files.  The 
application is blocked until the drop occurs at which time the method returns.

}
\typewriter{char **im_GetDroppedFiles()

}\leftindent{This method is used to get files dropped on a view.  It returns a 
null terminated list of filenames that where dropped, or NULL if there are no 
dropped files.  Currently, only file drops are implemented.  The protocol by 
which a view ``sees'' that files have been dropped is described below.

}
The application is informed of a file ``drop'' exactly as it is informed of a 
mouse ``hit.''  In fact, the list of mouse actions has been extended to 
include file drops in the view interface:


\example{enum view_MouseAction \{ view_NoMouseEvent,

   view_LeftDown, view_LeftUp, view_LeftMovement,

   view_RightDown, view_RightUp, view_RightMovement,

   \bold{view_LeftFileDrop}, \bold{view_MiddleFileDrop}, 
\bold{view_RightFileDrop} \};

}
When a file is dropped on an ATK application, the drop is indicated as a mouse 
hit.  The hit filters down the view tree as any ordinary mouse hit.  In order 
to allow insets to interpret file drops, a view should always pass a file drop 
hit down to a child view first, after which it should attempt to get the files 
that were dropped with im_GetDroppedFiles.  If the child view called 
im_GetDroppedFiles, there will be no files to get, i.e. im_GetDroppedFiles may 
only be called once.  This allows the child view to ``take'' the files.  If 
the child view does not handle file drops, it's hit method simply returns and 
the parent view gets the files.  This protocol gives the child view precedence 
so that files may be dropped on individual insets.


One problem with the protocol is that it is assumed that each view's hit 
method passes unknown hits down to their child views.  Unfortunately, this is 
not always the case.  Already, the scrollview class has been modified to pass 
unknown hits to its child view.


The dropped file names are discarded if no view accepts the dropped files.



\section{ATK Examples

}
So far only ez and typescript have been modified to use the above drag and 
drop interface.  For both, a new proctable call is available that may be bound 
to a menu or key which will initiate a file drop.  In ez the filename 
associated with the current buffer is the file that is dragged and dropped. 
 In typescript the current working directory is dragged...which is only useful 
if the shell's prompt prints the \typewriter{^A<pwd>^B} title hack string.


Dropping a collection of files on ez will perform a visit file operation.  If 
the files are dropped with the left button, new windows appear for each file 
dropped.  If the files are dropped with the right button several visit files 
are performed within the same window leaving the last file visible.  Dropping 
a collection of files on typescript will enter the full pathnames of the files 
onto the command line at the current insertion point.



\section{Future Work

}
Currently, the interfaces concentrate on \italic{file} drag and drop even 
though the protocol should support any type of drag and drop.  The interface 
should be extended to allow for arbitrary typed drag and drop.   Perhaps the 
im_GetDroppedFiles() method could be replaced by im_GetDroppedObject(struct 
atom *type) and could return a vector of ``objects.''


The im_DropFiles method blocks the application while the user drops files. 
 This is not always acceptible and should be worked into the im main 
application loop.  Perhaps a worthy goal would be to enhance im enough that 
the drag and drop could be separated into a class of its own.  This would 
require externalizing X window properties and client messages...both of which 
could be useful for implementing a form of IPC between ATK applications.


The OSF has recently announced Motif 1.2 which also includes the concept of 
drag and drop.  Before ATK interfaces are set in stone, these interfaces and 
protocols should be examined so that ATK might interoperate with newer 
versions of Motif.

\enddata{text,539756272}
