[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Backend notifiers.
From: |
Maciek Gajewski |
Subject: |
[PATCH] Backend notifiers. |
Date: |
Thu, 10 Jul 2008 21:32:47 +0200 |
User-agent: |
KMail/1.9.9 |
Hello
Assigned patch adds backend notifiers to graphics code. The patch is
cumulative, contains previously presented locking facilities.
I ask You for review, and - eventually - inclusion into main source tree.
How does it work:
Graphics backend implements three methods:
virtual void property_changed (const graphics_handle&, const std::string&);
virtual void object_created (const graphics_handle&);
virtual void object_destroyed (const graphics_handle&);
(stubs added to gnuplot and fltk backend)
- property_changed is called from base_property::set
- object_destroyed is called from gh_manager::do_free
- object_created is called from gh_manager::do_make_graphics_handle
and gh_manager::do_make_figure_handle.
I've been using this code for last few days with my Qt backend, and it works
good, events are going back and forth between threads, UI is responsive and
changes are visible immediately. You can event do animations!
For instance, this code:
x = [-pi:0.2:pi];
l = plot( x, sin(x))
for s = [0:0.1:100]; set(l,'ydata',sin(x+s)); usleep(10000);endfor
creates figure window with sine wave moving slowly like signal on oscilloscope
screen. Figure remains responsive, can be moved and resized, while the wave
still moves.
Maciek Gajewski
thread-safe-graphics-notifiers.patch
Description: Text Data
- [PATCH] Backend notifiers.,
Maciek Gajewski <=