[CHANGESET] Backend notifiers.

Maciek Gajewski maciej.gajewski0 at gmail.com
Thu Jul 10 15:05:48 CDT 2008


Patch from my previous mail, this time as mercurial changeset.

Maciek Gajewski

> 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


-------------- next part --------------
A non-text attachment was scrubbed...
Name: thread-safe-graphics-notifiers.cset
Type: text/x-diff
Size: 10672 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080710/be54957a/attachment.bin 


More information about the Octave-maintainers mailing list