Mercurial > octave
comparison libinterp/corefcn/graphics.in.h @ 23449:c763214a8260
maint: Use convention 'int *x' for naming pointers.
* mycell.c, myfeval.c, mypow2.c, myprop.c, myset.c, mystruct.c, Backend.cc,
Backend.h, BaseControl.cc, BaseControl.h, ButtonControl.cc, ButtonControl.h,
ButtonGroup.cc, ButtonGroup.h, Canvas.cc, Canvas.h, CheckBoxControl.cc,
CheckBoxControl.h, Container.cc, Container.h, ContextMenu.cc, ContextMenu.h,
EditControl.cc, EditControl.h, Figure.cc, Figure.h, FigureWindow.cc,
FigureWindow.h, GLCanvas.cc, GLCanvas.h, GenericEventNotify.h,
ListBoxControl.cc, ListBoxControl.h, Logger.cc, Logger.h, Menu.cc, Menu.h,
MenuContainer.h, MouseModeActionGroup.cc, MouseModeActionGroup.h, Object.cc,
Object.h, ObjectFactory.cc, ObjectFactory.h, ObjectProxy.cc, ObjectProxy.h,
Panel.cc, Panel.h, PopupMenuControl.cc, PopupMenuControl.h,
PushButtonControl.cc, PushButtonControl.h, PushTool.cc, PushTool.h,
QtHandlesUtils.cc, QtHandlesUtils.h, RadioButtonControl.cc,
RadioButtonControl.h, SliderControl.cc, SliderControl.h, TextControl.cc,
TextControl.h, TextEdit.cc, TextEdit.h, ToggleButtonControl.cc,
ToggleButtonControl.h, ToggleTool.cc, ToggleTool.h, ToolBar.cc, ToolBar.h,
ToolBarButton.cc, ToolBarButton.h, color-picker.cc, file-editor-tab.cc,
file-editor.cc, file-editor.h, find-dialog.cc, find-dialog.h,
octave-qscintilla.cc, main-window.cc, main-window.h, octave-cmd.cc,
octave-dock-widget.cc, parser.cc, shortcut-manager.cc, workspace-view.cc,
__ichol__.cc, __ilu__.cc, __magick_read__.cc, c-file-ptr-stream.cc,
c-file-ptr-stream.h, cellfun.cc, data.cc, gl2ps-print.cc, graphics.cc,
graphics.in.h, ls-hdf5.cc, ls-hdf5.h, ls-mat5.cc, mex.h, oct-map.cc, oct-map.h,
oct-stream.cc, octave-link.cc, profiler.cc, profiler.h, psi.cc, qz.cc,
sighandlers.cc, symtab.h, txt-eng.h, zfstream.cc, zfstream.h, __init_fltk__.cc,
audiodevinfo.cc, gzip.cc, ov-class.cc, ov-classdef.cc, ov-classdef.h,
ov-dld-fcn.h, ov-fcn-inline.cc, ov-java.cc, ov-java.h, ov.cc, pt-arg-list.cc,
pt-array-list.cc, pt-bp.cc, pt-check.cc, pt-classdef.h, pt-decl.cc, pt-eval.cc,
pt-idx.cc, pt-idx.h, pt-jit.cc, pt-misc.cc, pt-pr-code.cc, pt-select.cc,
pt-stmt.cc, Array.cc, Array.h, CMatrix.cc, MSparse.cc, Sparse.h, dMatrix.cc,
dim-vector.h, fCMatrix.cc, fMatrix.cc, CollocWt.cc, bsxfun-defs.cc,
eigs-base.cc, gsvd.cc, gsvd.h, lo-lapack-proto.h, oct-norm.cc, randmtzig.cc,
svd.cc, svd.h, mx-inlines.cc, oct-binmap.h, oct-sort.cc, oct-sort.h,
oct-string.cc, oct-string.h, sparse-sort.cc, sparse-sort.h:
Use convention 'int *x' for naming pointers.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 27 Apr 2017 15:18:20 -0700 |
parents | db1fdf4384dd |
children | 855122b993da |
comparison
equal
deleted
inserted
replaced
23448:e1c02e7126a9 | 23449:c763214a8260 |
---|---|
80 virtual double unscale (double) const | 80 virtual double unscale (double) const |
81 { | 81 { |
82 error ("invalid axis scale"); | 82 error ("invalid axis scale"); |
83 } | 83 } |
84 | 84 |
85 virtual base_scaler* clone () const | 85 virtual base_scaler * clone () const |
86 { return new base_scaler (); } | 86 { return new base_scaler (); } |
87 | 87 |
88 virtual bool is_linear (void) const | 88 virtual bool is_linear (void) const |
89 { return false; } | 89 { return false; } |
90 }; | 90 }; |
100 | 100 |
101 double scale (double d) const { return d; } | 101 double scale (double d) const { return d; } |
102 | 102 |
103 double unscale (double d) const { return d; } | 103 double unscale (double d) const { return d; } |
104 | 104 |
105 base_scaler* clone (void) const { return new lin_scaler (); } | 105 base_scaler * clone (void) const { return new lin_scaler (); } |
106 | 106 |
107 bool is_linear (void) const { return true; } | 107 bool is_linear (void) const { return true; } |
108 }; | 108 }; |
109 | 109 |
110 class log_scaler : public base_scaler | 110 class log_scaler : public base_scaler |
134 { return log10 (d); } | 134 { return log10 (d); } |
135 | 135 |
136 double unscale (double d) const | 136 double unscale (double d) const |
137 { return pow (10.0, d); } | 137 { return pow (10.0, d); } |
138 | 138 |
139 base_scaler* clone (void) const | 139 base_scaler * clone (void) const |
140 { return new log_scaler (); } | 140 { return new log_scaler (); } |
141 | 141 |
142 private: | 142 private: |
143 void do_scale (const double *src, double *dest, int n) const | 143 void do_scale (const double *src, double *dest, int n) const |
144 { | 144 { |
174 { return -log10 (-d); } | 174 { return -log10 (-d); } |
175 | 175 |
176 double unscale (double d) const | 176 double unscale (double d) const |
177 { return -pow (10.0, -d); } | 177 { return -pow (10.0, -d); } |
178 | 178 |
179 base_scaler* clone (void) const | 179 base_scaler * clone (void) const |
180 { return new neg_log_scaler (); } | 180 { return new neg_log_scaler (); } |
181 | 181 |
182 private: | 182 private: |
183 void do_scale (const double *src, double *dest, int n) const | 183 void do_scale (const double *src, double *dest, int n) const |
184 { | 184 { |
385 | 385 |
386 } | 386 } |
387 | 387 |
388 OCTINTERP_API void run_listeners (listener_mode mode = POSTSET); | 388 OCTINTERP_API void run_listeners (listener_mode mode = POSTSET); |
389 | 389 |
390 virtual base_property* clone (void) const | 390 virtual base_property * clone (void) const |
391 { return new base_property (*this); } | 391 { return new base_property (*this); } |
392 | 392 |
393 protected: | 393 protected: |
394 virtual bool do_set (const octave_value&) | 394 virtual bool do_set (const octave_value&) |
395 { | 395 { |
433 { | 433 { |
434 set (val); | 434 set (val); |
435 return *this; | 435 return *this; |
436 } | 436 } |
437 | 437 |
438 base_property* clone (void) const { return new string_property (*this); } | 438 base_property * clone (void) const { return new string_property (*this); } |
439 | 439 |
440 protected: | 440 protected: |
441 bool do_set (const octave_value& val) | 441 bool do_set (const octave_value& val) |
442 { | 442 { |
443 if (! val.is_string ()) | 443 if (! val.is_string ()) |
539 { | 539 { |
540 set (val); | 540 set (val); |
541 return *this; | 541 return *this; |
542 } | 542 } |
543 | 543 |
544 base_property* clone (void) const | 544 base_property * clone (void) const |
545 { return new string_array_property (*this); } | 545 { return new string_array_property (*this); } |
546 | 546 |
547 protected: | 547 protected: |
548 bool do_set (const octave_value& val) | 548 bool do_set (const octave_value& val) |
549 { | 549 { |
744 { | 744 { |
745 set (val); | 745 set (val); |
746 return *this; | 746 return *this; |
747 } | 747 } |
748 | 748 |
749 base_property* clone (void) const { return new text_label_property (*this); } | 749 base_property * clone (void) const { return new text_label_property (*this); } |
750 | 750 |
751 protected: | 751 protected: |
752 | 752 |
753 bool do_set (const octave_value& val) | 753 bool do_set (const octave_value& val) |
754 { | 754 { |
942 { | 942 { |
943 set (val); | 943 set (val); |
944 return *this; | 944 return *this; |
945 } | 945 } |
946 | 946 |
947 base_property* clone (void) const { return new radio_property (*this); } | 947 base_property * clone (void) const { return new radio_property (*this); } |
948 | 948 |
949 protected: | 949 protected: |
950 bool do_set (const octave_value& newval) | 950 bool do_set (const octave_value& newval) |
951 { | 951 { |
952 if (! newval.is_string ()) | 952 if (! newval.is_string ()) |
1128 return *this; | 1128 return *this; |
1129 } | 1129 } |
1130 | 1130 |
1131 operator octave_value (void) const { return get (); } | 1131 operator octave_value (void) const { return get (); } |
1132 | 1132 |
1133 base_property* clone (void) const { return new color_property (*this); } | 1133 base_property * clone (void) const { return new color_property (*this); } |
1134 | 1134 |
1135 std::string values_as_string (void) const | 1135 std::string values_as_string (void) const |
1136 { return radio_val.values_as_string (); } | 1136 { return radio_val.values_as_string (); } |
1137 | 1137 |
1138 Cell values_as_cell (void) const { return radio_val.values_as_cell (); } | 1138 Cell values_as_cell (void) const { return radio_val.values_as_cell (); } |
1180 { | 1180 { |
1181 set (val); | 1181 set (val); |
1182 return *this; | 1182 return *this; |
1183 } | 1183 } |
1184 | 1184 |
1185 base_property* clone (void) const | 1185 base_property * clone (void) const |
1186 { | 1186 { |
1187 double_property *p = new double_property (*this); | 1187 double_property *p = new double_property (*this); |
1188 | 1188 |
1189 p->finite_constraint = finite_constraint; | 1189 p->finite_constraint = finite_constraint; |
1190 p->minval = minval; | 1190 p->minval = minval; |
1333 return *this; | 1333 return *this; |
1334 } | 1334 } |
1335 | 1335 |
1336 operator octave_value (void) const { return get (); } | 1336 operator octave_value (void) const { return get (); } |
1337 | 1337 |
1338 base_property* clone (void) const | 1338 base_property * clone (void) const |
1339 { return new double_radio_property (*this); } | 1339 { return new double_radio_property (*this); } |
1340 | 1340 |
1341 protected: | 1341 protected: |
1342 OCTINTERP_API bool do_set (const octave_value& v); | 1342 OCTINTERP_API bool do_set (const octave_value& v); |
1343 | 1343 |
1425 { | 1425 { |
1426 set (val); | 1426 set (val); |
1427 return *this; | 1427 return *this; |
1428 } | 1428 } |
1429 | 1429 |
1430 base_property* clone (void) const | 1430 base_property * clone (void) const |
1431 { | 1431 { |
1432 array_property *p = new array_property (*this); | 1432 array_property *p = new array_property (*this); |
1433 | 1433 |
1434 p->type_constraints = type_constraints; | 1434 p->type_constraints = type_constraints; |
1435 p->size_constraints = size_constraints; | 1435 p->size_constraints = size_constraints; |
1535 { | 1535 { |
1536 set (val); | 1536 set (val); |
1537 return *this; | 1537 return *this; |
1538 } | 1538 } |
1539 | 1539 |
1540 base_property* clone (void) const | 1540 base_property * clone (void) const |
1541 { | 1541 { |
1542 row_vector_property *p = new row_vector_property (*this); | 1542 row_vector_property *p = new row_vector_property (*this); |
1543 | 1543 |
1544 p->type_constraints = type_constraints; | 1544 p->type_constraints = type_constraints; |
1545 p->size_constraints = size_constraints; | 1545 p->size_constraints = size_constraints; |
1579 bool val) | 1579 bool val) |
1580 : radio_property (nm, h, radio_values (val ? "{on}|off" : "on|{off}")) | 1580 : radio_property (nm, h, radio_values (val ? "{on}|off" : "on|{off}")) |
1581 { } | 1581 { } |
1582 | 1582 |
1583 bool_property (const std::string& nm, const graphics_handle& h, | 1583 bool_property (const std::string& nm, const graphics_handle& h, |
1584 const char* val) | 1584 const char *val) |
1585 : radio_property (nm, h, radio_values ("on|off"), val) | 1585 : radio_property (nm, h, radio_values ("on|off"), val) |
1586 { } | 1586 { } |
1587 | 1587 |
1588 bool_property (const bool_property& p) | 1588 bool_property (const bool_property& p) |
1589 : radio_property (p) { } | 1589 : radio_property (p) { } |
1594 { | 1594 { |
1595 set (val); | 1595 set (val); |
1596 return *this; | 1596 return *this; |
1597 } | 1597 } |
1598 | 1598 |
1599 base_property* clone (void) const { return new bool_property (*this); } | 1599 base_property * clone (void) const { return new bool_property (*this); } |
1600 | 1600 |
1601 protected: | 1601 protected: |
1602 bool do_set (const octave_value& val) | 1602 bool do_set (const octave_value& val) |
1603 { | 1603 { |
1604 if (val.is_bool_scalar ()) | 1604 if (val.is_bool_scalar ()) |
1638 } | 1638 } |
1639 | 1639 |
1640 void invalidate (void) | 1640 void invalidate (void) |
1641 { current_val = octave::numeric_limits<double>::NaN (); } | 1641 { current_val = octave::numeric_limits<double>::NaN (); } |
1642 | 1642 |
1643 base_property* clone (void) const { return new handle_property (*this); } | 1643 base_property * clone (void) const { return new handle_property (*this); } |
1644 | 1644 |
1645 void add_constraint (const std::string& type) | 1645 void add_constraint (const std::string& type) |
1646 { type_constraints.insert (type); } | 1646 { type_constraints.insert (type); } |
1647 | 1647 |
1648 protected: | 1648 protected: |
1671 { | 1671 { |
1672 set (val); | 1672 set (val); |
1673 return *this; | 1673 return *this; |
1674 } | 1674 } |
1675 | 1675 |
1676 base_property* clone (void) const { return new any_property (*this); } | 1676 base_property * clone (void) const { return new any_property (*this); } |
1677 | 1677 |
1678 protected: | 1678 protected: |
1679 bool do_set (const octave_value& v) | 1679 bool do_set (const octave_value& v) |
1680 { | 1680 { |
1681 data = v; | 1681 data = v; |
1714 { | 1714 { |
1715 set (val); | 1715 set (val); |
1716 return *this; | 1716 return *this; |
1717 } | 1717 } |
1718 | 1718 |
1719 base_property* clone (void) const { return new children_property (*this); } | 1719 base_property * clone (void) const { return new children_property (*this); } |
1720 | 1720 |
1721 bool remove_child (double val) | 1721 bool remove_child (double val) |
1722 { | 1722 { |
1723 return do_remove_child (val); | 1723 return do_remove_child (val); |
1724 } | 1724 } |
1906 { | 1906 { |
1907 set (val); | 1907 set (val); |
1908 return *this; | 1908 return *this; |
1909 } | 1909 } |
1910 | 1910 |
1911 base_property* clone (void) const { return new callback_property (*this); } | 1911 base_property * clone (void) const { return new callback_property (*this); } |
1912 | 1912 |
1913 protected: | 1913 protected: |
1914 bool do_set (const octave_value& v) | 1914 bool do_set (const octave_value& v) |
1915 { | 1915 { |
1916 if (! validate (v)) | 1916 if (! validate (v)) |
2263 : rep (new base_graphics_toolkit ("unknown")) | 2263 : rep (new base_graphics_toolkit ("unknown")) |
2264 { | 2264 { |
2265 rep->count++; | 2265 rep->count++; |
2266 } | 2266 } |
2267 | 2267 |
2268 graphics_toolkit (base_graphics_toolkit* b) | 2268 graphics_toolkit (base_graphics_toolkit *b) |
2269 : rep (b) | 2269 : rep (b) |
2270 { | 2270 { |
2271 rep->count++; | 2271 rep->count++; |
2272 } | 2272 } |
2273 | 2273 |
6523 { | 6523 { |
6524 if (instance_ok ()) | 6524 if (instance_ok ()) |
6525 instance->do_post_callback (h, name, data); | 6525 instance->do_post_callback (h, name, data); |
6526 } | 6526 } |
6527 | 6527 |
6528 static void post_function (graphics_event::event_fcn fcn, void* data = 0) | 6528 static void post_function (graphics_event::event_fcn fcn, void *data = 0) |
6529 { | 6529 { |
6530 if (instance_ok ()) | 6530 if (instance_ok ()) |
6531 instance->do_post_function (fcn, data); | 6531 instance->do_post_function (fcn, data); |
6532 } | 6532 } |
6533 | 6533 |
6722 const octave_value& data); | 6722 const octave_value& data); |
6723 | 6723 |
6724 void do_post_callback (const graphics_handle& h, const std::string& name, | 6724 void do_post_callback (const graphics_handle& h, const std::string& name, |
6725 const octave_value& data); | 6725 const octave_value& data); |
6726 | 6726 |
6727 void do_post_function (graphics_event::event_fcn fcn, void* fcn_data); | 6727 void do_post_function (graphics_event::event_fcn fcn, void *fcn_data); |
6728 | 6728 |
6729 void do_post_set (const graphics_handle& h, const std::string& name, | 6729 void do_post_set (const graphics_handle& h, const std::string& name, |
6730 const octave_value& value, bool notify_toolkit = true); | 6730 const octave_value& value, bool notify_toolkit = true); |
6731 | 6731 |
6732 int do_process_events (bool force = false); | 6732 int do_process_events (bool force = false); |