42 OCTINTERP_API
gh_manager (octave::interpreter& interp);
56 const_iterator p = (octave::math::isnan (val)
57 ? m_handle_map.end () : m_handle_map.find (val));
70 return get_object (
lookup (val));
75 const_iterator p = (h.
ok () ? m_handle_map.find (h) : m_handle_map.end ());
77 return (p != m_handle_map.end ()) ? p->second : graphics_object ();
81 make_graphics_handle (
const std::string& go_name,
83 bool integer_figure_handle =
false,
84 bool call_createfcn =
true,
85 bool notify_toolkit =
true);
88 make_figure_handle (
double val,
bool notify_toolkit =
true);
98 for (
const auto& hfig : m_figure_list)
100 if (is_handle_visible (hfig))
109 Matrix retval (1, m_handle_map.size ());
112 for (
const auto& h_iter : m_handle_map)
116 if (show_hidden || is_handle_visible (h))
117 retval(i++) = h.
value ();
125 void lock () { m_graphics_lock.lock (); }
127 bool try_lock () {
return m_graphics_lock.try_lock (); }
129 void unlock () { m_graphics_lock.unlock (); }
133 Matrix retval (1, m_figure_list.size ());
136 for (
const auto& hfig : m_figure_list)
138 if (show_hidden || is_handle_visible (hfig))
139 retval(i++) = hfig.value ();
151 const std::string& name,
158 octave::autolock guard (graphics_lock ());
160 graphics_object go = get_object (h);
162 if (go.valid_object ())
166 execute_callback (h, cb, data);
178 post_function (graphics_event::event_fcn fcn,
void *fcn_data =
nullptr);
183 bool redraw_figure =
false);
185 OCTINTERP_API
int process_events (
bool force =
false);
187 OCTINTERP_API
void enable_event_processing (
bool enable =
true);
193 graphics_object go = get_object (h);
195 if (go.valid_object ())
196 retval = go.is_handle_visible ();
201 OCTINTERP_API
void close_all_figures ();
203 OCTINTERP_API
void restore_gcbo ();
205 OCTINTERP_API
void post_event (
const graphics_event& e);
209 return m_graphics_lock;
216 const auto it = m_latex_cache.find (key);
218 if (it != m_latex_cache.end ())
227 if (m_latex_keys.size () >= 500)
229 auto it = m_latex_cache.find (m_latex_keys.front ());
231 if (it != m_latex_cache.end ())
232 m_latex_cache.erase (it);
234 m_latex_keys.pop_front ();
237 m_latex_cache[key] = val;
238 m_latex_keys.push_back (key);
243 typedef std::map<graphics_handle, graphics_object>::iterator iterator;
244 typedef std::map<graphics_handle, graphics_object>::const_iterator
247 typedef std::set<graphics_handle>::iterator free_list_iterator;
248 typedef std::set<graphics_handle>::const_iterator const_free_list_iterator;
250 typedef std::list<graphics_handle>::iterator figure_list_iterator;
251 typedef std::list<graphics_handle>::const_iterator const_figure_list_iterator;
253 octave::interpreter& m_interpreter;
256 std::map<graphics_handle, graphics_object> m_handle_map;
259 std::set<graphics_handle> m_handle_free_list;
262 double m_next_handle;
266 std::list<graphics_handle> m_figure_list;
269 octave::mutex m_graphics_lock;
272 std::list<graphics_event> m_event_queue;
275 std::list<graphics_object> m_callback_objects;
278 int m_event_processing;
282 std::unordered_map<std::string, latex_data> m_latex_cache;
283 std::list<std::string> m_latex_keys;