Posted to tcl by emiliano at Sat Jan 22 17:32:47 GMT 2011view raw

  1. emiliano@merlot:~/src/tk$ cvs diff -u unix/tkUnixCursor.c
  2. Index: unix/tkUnixCursor.c
  3. ===================================================================
  4. RCS file: /cvsroot/tktoolkit/tk/unix/tkUnixCursor.c,v
  5. retrieving revision 1.15
  6. diff -u -r1.15 tkUnixCursor.c
  7. --- unix/tkUnixCursor.c 5 Nov 2008 22:48:58 -0000 1.15
  8. +++ unix/tkUnixCursor.c 22 Jan 2011 17:23:51 -0000
  9. @@ -12,6 +12,9 @@
  10. */
  11.  
  12. #include "tkInt.h"
  13. +#ifdef HAVE_XCURSOR
  14. +#include <X11/Xcursor/Xcursor.h>
  15. +#endif
  16.  
  17. /*
  18. * The following data structure is a superset of the TkCursor structure
  19. @@ -325,9 +328,15 @@
  20. goto badString;
  21. }
  22.  
  23. +#ifdef HAVE_XCURSOR
  24. + if (!inTkTable && (argc != 1) && (argc != 2) && (argc != 4)) {
  25. + goto badString;
  26. + }
  27. +#else
  28. if (!inTkTable && (argc != 2) && (argc != 4)) {
  29. goto badString;
  30. }
  31. +#endif /* HAVE_XCURSOR */
  32.  
  33. cursor = CreateCursorFromTableOrFile(interp, tkwin, argc, argv,
  34. tkCursorPtr);
  35. @@ -429,6 +438,11 @@
  36. source = XCreateBitmapFromData(display, drawable, data, width,height);
  37. ckfree(data);
  38. } else {
  39. +#ifdef HAVE_XCURSOR
  40. + cursor = XcursorFilenameLoadCursor(display, &argv[0][1]);
  41. + if (cursor != None)
  42. + goto cleanup;
  43. +#endif /* HAVE_XCURSOR */
  44. if (TkReadBitmapFile(display, drawable, &argv[0][1],
  45. (unsigned *) &width, (unsigned *) &height,
  46. &source, &xHot, &yHot) != BitmapSuccess) {
  47.