AGX Dynamics  2.35.0.1
ScriptIDE.h
Go to the documentation of this file.
1 /*
2 Copyright 2007-2022. Algoryx Simulation AB.
3 
4 All AGX source code, intellectual property, documentation, sample code,
5 tutorials, scene files and technical white papers, are copyrighted, proprietary
6 and confidential material of Algoryx Simulation AB. You may not download, read,
7 store, distribute, publish, copy or otherwise disseminate, use or expose this
8 material unless having a written signed agreement with Algoryx Simulation AB, or having been
9 advised so by Algoryx Simulation AB for a time limited evaluation, or having purchased a
10 valid commercial license from Algoryx Simulation AB.
11 
12 Algoryx Simulation AB disclaims all responsibilities for loss or damage caused
13 from using this software, unless otherwise stated in written agreements with
14 Algoryx Simulation AB.
15 */
16 
17 
18 #pragma once
19 #ifndef AGXPYTHON_SCRIPTIDE_H
20 #define AGXPYTHON_SCRIPTIDE_H 1
21 
22 #include <agx/config/AGX_USE_PYTHON.h>
23 
24 #if AGX_USE_PYTHON()
25 
26 #include <agxPython/export.h>
29 
30 #include <agx/Referenced.h>
31 #include <agx/Name.h>
32 
33 namespace agxPython
34 {
35 
36  AGX_DECLARE_POINTER_TYPES(ScriptIDE);
37  class AGXPYTHON_EXPORT ScriptIDE : public agx::Referenced
38  {
39 
40  public:
41 
42  friend class ScriptManager;
43 
44  void updateSourceCode(const agx::String& sourceCode);
45  void queryAutoComplete(const agx::String& sourceCode, int caretLine, int caretColumn, bool readOnly, bool scopeChange);
46 
47  void setAutocomplete(ScriptIDEAutocomplete* autocomplete);
48 
49  ScriptIDEAutocomplete* getAutocomplete() const;
50 
51  void setInterpreter(ScriptIDEInterpreter* interpreter);
52 
53  ScriptIDEInterpreter* getInterpreter() const;
54 
55  const agx::Name& getIdentifyingName() const;
56 
57  const agx::String& getSourceCode() const;
58 
59  int getCaretX() const;
60 
61  int getCaretY() const;
62 
63  protected:
64  ScriptIDE(const agx::Name& identifyingName);
65 
66  virtual ~ScriptIDE();
67 
68  private:
69 
70  agx::Name m_identifyingName;
71 
72  agx::String m_sourceCode;
73 
74  std::pair<int, int> m_caret;
75 
77 
79 
80  };
81 
82 }
83 
84 #endif
85 
86 #endif
#define AGX_DECLARE_POINTER_TYPES(type)
Definition: Referenced.h:248
#define AGXPYTHON_EXPORT
Representation of a name string.
Definition: Name.h:33
Base class providing referencing counted objects.
Definition: Referenced.h:114
Smart pointer for handling referenced counted objects.
Definition: ref_ptr.h:30