home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / sys / hp / 12998 < prev    next >
Encoding:
Text File  |  1992-11-17  |  3.5 KB  |  66 lines

  1. Newsgroups: comp.sys.hp
  2. Path: sparky!uunet!utcsri!torn!watserv2.uwaterloo.ca!madmax.uwaterloo.ca!gordon
  3. From: gordon@madmax.uwaterloo.ca (Gordon R. Strachan)
  4. Subject: Re: Xv library
  5. Message-ID: <BxvDHC.H69@watserv2.uwaterloo.ca>
  6. Keywords: XvRegisterDragWindow XvRegisterDropCallback Xv
  7. Sender: news@watserv2.uwaterloo.ca
  8. Organization: University of Waterloo
  9. References: <1992Nov16.172433.21589@bnr.ca>
  10. Date: Tue, 17 Nov 1992 16:51:11 GMT
  11. Lines: 53
  12.  
  13. In article <1992Nov16.172433.21589@bnr.ca> iankent@bnr.ca writes:
  14. >  I am using Motif1.1/X11 R4/HP-UX 8.0 with HPVUE and am interested in
  15. >using the following functions in the Xv library. The only documentation
  16. >I have regarding these functions is that in the header file.  Could
  17. >anyone out there send and/or direct me to some documentation/code
  18. >regarding the use of these functions.
  19. >
  20. >/usr/include/Motif1.1/Xv/XvDrag.h
  21. >....
  22. >extern void XvRegisterDragWindow();
  23. >extern void XvRegisterDropCallback();
  24.  
  25. Well, the last time I tried to play with this stuff I was told that it was
  26. undocumented on purpose because HP plans to change it in the future.  So,
  27. you really aren't supposed to play with it.  However, its really not that
  28. had to figure out what you have to do, given the documentation in the
  29. include file.  First you call XvInit to initialize the vue stuff.  Next
  30. you install the handler with the XvRegisterDropCallback.  Then you call
  31. XvRegisterDragWindow to make your window a valid drop window.  Most of the
  32. parameters are pretty self explainatory with the exception of the
  33. secondaryHotspot and primaryHotspot.  The include file tells you the valid
  34. syntax of this string but doesn't tell you what it means.  These guys define
  35. the areas within the window which data can be dropped into.  The difference
  36. between the primary and secondary is that the primary is highlighted when
  37. the drop cursor enters and the secondary isn't.  There may be other
  38. differences but I am not sure.  So, the only thing left to figure out is
  39. the type field for the hotspot.  Well, it is clear that this defines the
  40. type of data that you are willing to accept, similar to the cut and paste
  41. selection.  The question is then what is a valid data type.  It appears that
  42. this can be any string.  But, you have to agree with the drop type that
  43. the client who initialized the drop, at least I think so, it is not clear to
  44. me who decides on what the type of the drop is.  Anyway, suppose we want to
  45. be able to do a drop from the filemanager.  We then have to figure out what
  46. kind of data it will drop on us.  Unfortunately this is undocumented so we
  47. are kind of out of luck.  But, if we take an example of a program which does
  48. accept drops, we can perhaps determine the correct types.  If we do a
  49. "strings" on vuepad we find the line:
  50. =%dx%d+%d+%d-FileEdit
  51.  
  52. so, we can make a good guess at the drop type as FileEdit.  This in fact,
  53. seems to work well.  Further, if we look in the directory 
  54. /usr/lib/X11/vue/types we find a number of files of the form *.drag  These
  55. files seem to contain a mapping of file types to drop types for the
  56. filemanager.  But, at the moment, this is all guessing on my part.  It is not
  57. clear to me who reads the drag files.  I suspect it it read by the filemanager
  58. to determine what kind of files correspond to a user defined drop type.
  59. However, how flexible this is, I can't tell.  For example, could I define a
  60. drop zone which is only defined for files ending in *.c
  61.  
  62. Anyway, I have managed to get something working.  If you like send me mail and
  63. I can send you the code I used.
  64.  
  65. Gordon
  66.