ScriptScope.dox 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*!
  2. \page ScriptScope Scope of Script Development
  3. The QCAD Application Framework offers a very complete and powerful
  4. ECMAScript interface. Almost the entire functionality of
  5. the Qt Application Framework (Qt) and the QCAD Application Framework
  6. is accessible through that scripting interface.
  7. ECMAScript (also known as JavaScript) is a popular script language
  8. that is easy to learn for anyone with previous programming experience.
  9. \section extending_qcad Extending the QCAD Application
  10. Through the ECMAScript interface of, developers can extend QCAD in an easy
  11. and very efficient way. Such extensions can for example be CAD related
  12. interactive construction or modification tools or user interface components
  13. (widgets).
  14. \image html ecmascript_extensions.png
  15. \section creating_applications Creating new Applications
  16. Alternatively, developers can build entirely new applications
  17. based on the QCAD Application Framework. New applications might be
  18. CAD related console tools or desktop applications with graphical user
  19. interfaces that are significantly different to the QCAD application.
  20. \image html ecmascript_applications.png
  21. Since the QCAD Application itself is built using the ECMAScript interface
  22. of the QCAD Application Framework, there is plenty of example code available
  23. which has been thoroughly tested.
  24. \section licensing Licensing
  25. To use the ECMAScript interface to extend QCAD or develop new applications
  26. based on QCAD technology, all you need is a regular QCAD single user
  27. license. Every QCAD user may use the ECMAScript interface and distribute
  28. any modifications and additions to anyone else with a valid QCAD license on
  29. their own terms.
  30. \section qt_qcad_ecma Qt, the QCAD Application Framework and ECMAScript
  31. The figure below shows some of the main functionality that is covered
  32. by Qt and the QCAD Application Framework. Qt covers the generic functionality
  33. that is usually seen in all kinds of desktop applications and is not directly
  34. related to CAD. The QCAD Application Framework offers CAD specific
  35. functionality such as a CAD Core, DXF export and import,
  36. a powerful graphics view, and so on. The ECMAScript files put the available
  37. functionality together into an application.
  38. \image html qt_qcad_functionality.png
  39. The ECMAScript interface of the QCAD Application Framework can be used
  40. to very rapidly build and extend CAD specific applications.
  41. The QCAD user interface itself and all its interactive tools as well as
  42. most widgets and dialogs are implemented through the ECMAScript interface.
  43. The QCAD executable that comes with every QCAD package is essentially
  44. a script interpreter that features standard ECMAScript functionality and
  45. on top of that provides additional classes from the Qt API and the QCAD API.
  46. Running the QCAD executable in an isolated environment would do nothing
  47. as there are no ECMAScripts to be executed. By default, the QCAD executable
  48. looks for a file called "scripts/autostart.js" to execute. In the case of QCAD,
  49. the autostart script initializes all ECMAScript tools and user interface
  50. components and launches the main application loop.
  51. Almost all widgets, menus and tools that are currently available in
  52. QCAD are implemented in ECMAScript.
  53. These scripts are located in the 'scripts' directory of the
  54. downloaded QCAD package. Note that under Mac OS X, the scripts directory is
  55. located inside the application bundle under 'QCAD.app/Contents/Resources/scripts'.
  56. */