0059fe1d4e4065d61b0c4619dbe0f2af3d9287be.svn-base 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. if (!dojo._hasResource["dojox.gfx"]) { // _hasResource checks added by build.
  2. // Do not use _hasResource directly in
  3. // your code.
  4. dojo._hasResource["dojox.gfx"] = true;
  5. dojo.provide("dojox.gfx");
  6. dojo.require("dojox.gfx.matrix");
  7. dojo.require("dojox.gfx._base");
  8. (function() {
  9. var renderers = (typeof djConfig["gfxRenderer"] == "string"
  10. ? djConfig["gfxRenderer"]
  11. : "svg,vml,silverlight,canvas").split(",");
  12. for (var i = 0; i < renderers.length; ++i) {
  13. switch (renderers[i]) {
  14. case "svg" :
  15. // TODO: need more comprehensive test for SVG
  16. if (!dojo.isIE
  17. && (navigator.userAgent.indexOf("iPhone") < 0)
  18. && (navigator.userAgent.indexOf("iPod") < 0)) {
  19. dojox.gfx.renderer = "svg";
  20. }
  21. break;
  22. case "vml" :
  23. if (dojo.isIE != 0) {
  24. dojox.gfx.renderer = "vml";
  25. }
  26. break;
  27. case "silverlight" :
  28. // TODO: need more comprehensive test for Silverlight
  29. if (window.Silverlight) {
  30. dojox.gfx.renderer = "silverlight";
  31. }
  32. break;
  33. case "canvas" :
  34. // TODO: need more comprehensive test for Canvas
  35. if (dojo.isIE == 0) {
  36. dojox.gfx.renderer = "canvas";
  37. }
  38. break;
  39. }
  40. if (dojox.gfx.renderer) {
  41. break;
  42. }
  43. }
  44. })();
  45. // include a renderer conditionally
  46. dojo.requireIf(dojox.gfx.renderer == "svg", "dojox.gfx.svg");
  47. dojo.requireIf(dojox.gfx.renderer == "vml", "dojox.gfx.vml");
  48. dojo
  49. .requireIf(dojox.gfx.renderer == "silverlight",
  50. "dojox.gfx.silverlight");
  51. dojo.requireIf(dojox.gfx.renderer == "canvas", "dojox.gfx.canvas");
  52. }