2626
2727#include " imgui.h"
2828
29+ // [Bundle] IMGUI_BUNDLE_PYTHON_UNSUPPORTED_API is always defined,
30+ // but is used as a marker to exclude certain sections from the python bindings generation.
31+ #define IMGUI_BUNDLE_PYTHON_UNSUPPORTED_API
2932
3033//
3134// TextEditor
@@ -141,14 +144,18 @@ class TextEditor {
141144 inline bool CurrentCursorHasSelection () const { return cursors.currentCursorHasSelection (); }
142145 inline void ClearCursors () { cursors.clearAll (); }
143146
144- // get cursor positions (the meaning of main and current is explained in README.md)
145147 inline size_t GetNumberOfCursors () const { return cursors.size (); }
148+
149+ #ifdef IMGUI_BUNDLE_PYTHON_UNSUPPORTED_API
150+ // get cursor positions (the meaning of main and current is explained in README.md)
146151 inline void GetCursor (int & line, int & column, size_t cursor) const { return getCursor (line, column, cursor); }
147152 inline void GetCursor (int & startLine, int & startColumn, int & endLine, int & endColumn, size_t cursor) const { return getCursor (startLine, startColumn, endLine, endColumn, cursor); }
148153 inline void GetMainCursor (int & line, int & column) const { return getCursor (line, column, cursors.getMainIndex ()); }
149154 inline void GetCurrentCursor (int & line, int & column) const { return getCursor (line, column, cursors.getCurrentIndex ()); }
155+ #endif // #ifdef IMGUI_BUNDLE_PYTHON_UNSUPPORTED_API
150156
151157 // Alternative API for cursor and selection position using lightweight out struct (line and column are zero-based)
158+ // (the meaning of main and current is explained in README.md)
152159 struct CursorPosition { int line = 0 ; int column = 0 ; };
153160 struct CursorSelection { CursorPosition start; CursorPosition end; };
154161 inline CursorPosition GetMainCursorPosition () const { CursorPosition p; getCursor (p.line , p.column , cursors.getMainIndex ()); return p; }
@@ -248,6 +255,7 @@ class TextEditor {
248255 // passing nullptr deactivates the callback
249256 inline void SetTransactionCallback (std::function<void (std::vector<Change>&)> callback) { transactionCallback = callback; }
250257
258+ #ifdef IMGUI_BUNDLE_PYTHON_UNSUPPORTED_API
251259 // line-based callbacks (line numbers are zero-based)
252260 // insertor callback is called when for each line inserted and the result is used as the new line specific user data
253261 // deletor callback is called for each line deleted (line specific user data is passed to callback)
@@ -265,6 +273,7 @@ class TextEditor {
265273 inline void SetUserData (int line, void * data) { document.setUserData (line, data); }
266274 inline void * GetUserData (int line) const { return document.getUserData (line); }
267275 inline void IterateUserData (std::function<void (int line, void * data)> callback) const { document.iterateUserData (callback); }
276+ #endif // IMGUI_BUNDLE_PYTHON_UNSUPPORTED_API
268277
269278 // line-based decoration
270279 struct Decorator {
@@ -401,6 +410,7 @@ class TextEditor {
401410 // name of the language
402411 std::string name;
403412
413+ #ifdef IMGUI_BUNDLE_PYTHON_UNSUPPORTED_API
404414 // flag to describe if keywords and identifiers are case sensitive (which is the default)
405415 bool caseSensitive = true ;
406416
@@ -451,6 +461,7 @@ class TextEditor {
451461 // function to implement custom tokenizer
452462 // if a token is found, function should return an iterator to the character after the token and set the color
453463 std::function<Iterator(Iterator start, Iterator end, Color& color)> customTokenizer;
464+ #endif // #ifdef IMGUI_BUNDLE_PYTHON_UNSUPPORTED_API
454465
455466 // predefined language definitions
456467 static const Language* C ();
@@ -474,6 +485,7 @@ class TextEditor {
474485 // iterate through identifiers detected by the colorizer (based on current language)
475486 inline void IterateIdentifiers (std::function<void (const std::string& identifier)> callback) const { document.iterateIdentifiers (callback); }
476487
488+ #ifdef IMGUI_BUNDLE_PYTHON_UNSUPPORTED_API
477489 // autocomplete state (acts as API between editor and outer application)
478490 class AutoCompleteState {
479491 public:
@@ -727,6 +739,7 @@ class TextEditor {
727739 int line = 0 ;
728740 int column = 0 ;
729741 };
742+ #endif // #ifdef IMGUI_BUNDLE_PYTHON_UNSUPPORTED_API
730743
731744 // a single cursor
732745 class Cursor {
0 commit comments