Mercurial > octave
changeset 29993:b5fae48ad807
move classes for graphics objects and properties inside octave namespace
* graphics.in.h, graphics.cc: Move all graphics object and properties
classes inside octave namespace. Change all uses. Provide deprecated
typedefs to preserve old names.
* __init_fltk__.cc, __init_gnuplot__.cc: Move all tookit code inside
octave namespace.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 18 Aug 2021 00:25:50 -0400 |
parents | 6ea4a84df9c7 |
children | eb768fc5e6b7 |
files | libinterp/corefcn/graphics-toolkit.h libinterp/corefcn/graphics.cc libinterp/corefcn/graphics.in.h libinterp/corefcn/interpreter-private.h libinterp/corefcn/mex.cc libinterp/dldfcn/__init_fltk__.cc libinterp/dldfcn/__init_gnuplot__.cc |
diffstat | 7 files changed, 187 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/corefcn/graphics-toolkit.h Wed Aug 18 00:21:26 2021 -0400 +++ b/libinterp/corefcn/graphics-toolkit.h Wed Aug 18 00:25:50 2021 -0400 @@ -38,10 +38,9 @@ #include "error.h" #include "graphics-handle.h" -class graphics_object; - namespace octave { + class graphics_object; class graphics_toolkit; class base_graphics_toolkit
--- a/libinterp/corefcn/graphics.cc Wed Aug 18 00:21:26 2021 -0400 +++ b/libinterp/corefcn/graphics.cc Wed Aug 18 00:25:50 2021 -0400 @@ -67,6 +67,8 @@ #include "utils.h" #include "octave-default-image.h" +OCTAVE_NAMESPACE_BEGIN + // forward declarations static octave_value xget (const graphics_handle& h, const caseless_str& name); @@ -3451,7 +3453,7 @@ // Set parent property to new_parent and do adoption m_parent = new_parent.as_octave_value (); - ::adopt (m_parent.handle_value (), m___myhandle__); + octave::adopt (m_parent.handle_value (), m___myhandle__); } /* @@ -5411,7 +5413,7 @@ graphics_object go = gh_mgr.get_object (gh_mgr.lookup (v)); if (go.isa ("text")) - val = ::reparent (v, "set", who, m___myhandle__, false); + val = octave::reparent (v, "set", who, m___myhandle__, false); else { std::string cname = v.class_name (); @@ -7397,13 +7399,13 @@ ColumnVector graphics_xform::xform_vector (double x, double y, double z) { - return ::xform_vector (x, y, z); + return octave::xform_vector (x, y, z); } Matrix graphics_xform::xform_eye (void) { - return ::xform_matrix (); + return octave::xform_matrix (); } ColumnVector @@ -7416,14 +7418,14 @@ z = m_sz.scale (z); } - return ::transform (m_xform, x, y, z); + return octave::transform (m_xform, x, y, z); } ColumnVector graphics_xform::untransform (double x, double y, double z, bool use_scale) const { - ColumnVector v = ::transform (m_xform_inv, x, y, z); + ColumnVector v = octave::transform (m_xform_inv, x, y, z); if (use_scale) { @@ -10624,8 +10626,6 @@ m_vertexnormals = Matrix (); } -OCTAVE_NAMESPACE_BEGIN - DEFMETHOD (__update_normals__, interp, args, , doc: /* -*- texinfo -*- @deftypefn {} {} __update_normals__ (@var{h}) @@ -10693,8 +10693,6 @@ %! end_unwind_protect */ -OCTAVE_NAMESPACE_END - // --------------------------------------------------------------------- void @@ -12638,8 +12636,6 @@ // --------------------------------------------------------------------- -OCTAVE_NAMESPACE_BEGIN - DEFMETHOD (ishghandle, interp, args, , doc: /* -*- texinfo -*- @deftypefn {} {} ishghandle (@var{h}) @@ -13411,8 +13407,6 @@ \ return octave_value (make_graphics_object (#TYPE, false, args)); \ -OCTAVE_NAMESPACE_END - int calc_dimensions (const graphics_object& go) { @@ -13449,8 +13443,6 @@ return nd; } -OCTAVE_NAMESPACE_BEGIN - DEFMETHOD (__calc_dimensions__, interp, args, , doc: /* -*- texinfo -*- @deftypefn {} {} __calc_dimensions__ (@var{axes}) @@ -14253,8 +14245,6 @@ return ovl (); } -OCTAVE_NAMESPACE_END - octave_value get_property_from_handle (double handle, const std::string& property, const std::string& func) @@ -14289,8 +14279,6 @@ return true; } -OCTAVE_NAMESPACE_BEGIN - static bool compare_property_values (const octave_value& ov1, const octave_value& ov2) {
--- a/libinterp/corefcn/graphics.in.h Wed Aug 18 00:21:26 2021 -0400 +++ b/libinterp/corefcn/graphics.in.h Wed Aug 18 00:25:50 2021 -0400 @@ -51,6 +51,8 @@ #include "ov.h" #include "text-renderer.h" +OCTAVE_NAMESPACE_BEGIN + // FIXME: maybe this should be a configure option? // Matlab defaults to "Helvetica", but that causes problems for many // gnuplot users. @@ -6848,4 +6850,166 @@ OCTINTERP_API void close_all_figures (void); +OCTAVE_NAMESPACE_END + +#if defined (OCTAVE_PROVIDE_DEPRECATED_SYMBOLS) + +OCTAVE_DEPRECATED (7, "use 'octave::base_scaler' instead") +typedef octave::base_scaler base_scaler; + +OCTAVE_DEPRECATED (7, "use 'octave::lin_scaler' instead") +typedef octave::lin_scaler lin_scaler; + +OCTAVE_DEPRECATED (7, "use 'octave::log_scaler' instead") +typedef octave::log_scaler log_scaler; + +OCTAVE_DEPRECATED (7, "use 'octave::neg_log_scaler' instead") +typedef octave::neg_log_scaler neg_log_scaler; + +OCTAVE_DEPRECATED (7, "use 'octave::scaler' instead") +typedef octave::scaler scaler; + +OCTAVE_DEPRECATED (7, "use 'octave::base_property' instead") +typedef octave::base_property base_property; + +OCTAVE_DEPRECATED (7, "use 'octave::string_property' instead") +typedef octave::string_property string_property; + +OCTAVE_DEPRECATED (7, "use 'octave::string_array_property' instead") +typedef octave::string_array_property string_array_property; + +OCTAVE_DEPRECATED (7, "use 'octave::text_label_property' instead") +typedef octave::text_label_property text_label_property; + +OCTAVE_DEPRECATED (7, "use 'octave::radio_values' instead") +typedef octave::radio_values radio_values; + +OCTAVE_DEPRECATED (7, "use 'octave::radio_property' instead") +typedef octave::radio_property radio_property; + +OCTAVE_DEPRECATED (7, "use 'octave::color_values' instead") +typedef octave::color_values color_values; + +OCTAVE_DEPRECATED (7, "use 'octave::color_property' instead") +typedef octave::color_property color_property; + +OCTAVE_DEPRECATED (7, "use 'octave::double_property' instead") +typedef octave::double_property double_property; + +OCTAVE_DEPRECATED (7, "use 'octave::double_radio_property' instead") +typedef octave::double_radio_property double_radio_property; + +OCTAVE_DEPRECATED (7, "use 'octave::array_property' instead") +typedef octave::array_property array_property; + +OCTAVE_DEPRECATED (7, "use 'octave::row_vector_property' instead") +typedef octave::row_vector_property row_vector_property; + +OCTAVE_DEPRECATED (7, "use 'octave::bool_property' instead") +typedef octave::bool_property bool_property; + +OCTAVE_DEPRECATED (7, "use 'octave::handle_property' instead") +typedef octave::handle_property handle_property; + +OCTAVE_DEPRECATED (7, "use 'octave::any_property' instead") +typedef octave::any_property any_property; + +OCTAVE_DEPRECATED (7, "use 'octave::children_property' instead") +typedef octave::children_property children_property; + +OCTAVE_DEPRECATED (7, "use 'octave::callback_property' instead") +typedef octave::callback_property callback_property; + +OCTAVE_DEPRECATED (7, "use 'octave::property' instead") +typedef octave::property property; + +OCTAVE_DEPRECATED (7, "use 'octave::pval_vector' instead") +typedef octave::pval_vector pval_vector; + +OCTAVE_DEPRECATED (7, "use 'octave::property_list' instead") +typedef octave::property_list property_list; + +OCTAVE_DEPRECATED (7, "use 'octave::base_properties' instead") +typedef octave::base_properties base_properties; + +OCTAVE_DEPRECATED (7, "use 'octave::base_graphics_object' instead") +typedef octave::base_graphics_object base_graphics_object; + +OCTAVE_DEPRECATED (7, "use 'octave::graphics_object' instead") +typedef octave::graphics_object graphics_object; + +OCTAVE_DEPRECATED (7, "use 'octave::root_figure' instead") +typedef octave::root_figure root_figure; + +OCTAVE_DEPRECATED (7, "use 'octave::figure' instead") +typedef octave::figure figure; + +OCTAVE_DEPRECATED (7, "use 'octave::graphics_xform' instead") +typedef octave::graphics_xform graphics_xform; + +OCTAVE_DEPRECATED (7, "use 'octave::axes' instead") +typedef octave::axes axes; + +OCTAVE_DEPRECATED (7, "use 'octave::line' instead") +typedef octave::line line; + +OCTAVE_DEPRECATED (7, "use 'octave::text' instead") +typedef octave::text text; + +OCTAVE_DEPRECATED (7, "use 'octave::image' instead") +typedef octave::image image; + +OCTAVE_DEPRECATED (7, "use 'octave::light' instead") +typedef octave::light light; + +OCTAVE_DEPRECATED (7, "use 'octave::patch' instead") +typedef octave::patch patch; + +OCTAVE_DEPRECATED (7, "use 'octave::scatter' instead") +typedef octave::scatter scatter; + +OCTAVE_DEPRECATED (7, "use 'octave::surface' instead") +typedef octave::surface surface; + +OCTAVE_DEPRECATED (7, "use 'octave::hggroup' instead") +typedef octave::hggroup hggroup; + +OCTAVE_DEPRECATED (7, "use 'octave::uimenu' instead") +typedef octave::uimenu uimenu; + +OCTAVE_DEPRECATED (7, "use 'octave::uicontextmenu' instead") +typedef octave::uicontextmenu uicontextmenu; + +OCTAVE_DEPRECATED (7, "use 'octave::uicontrol' instead") +typedef octave::uicontrol uicontrol; + +OCTAVE_DEPRECATED (7, "use 'octave::uibuttongroup' instead") +typedef octave::uibuttongroup uibuttongroup; + +OCTAVE_DEPRECATED (7, "use 'octave::uipanel' instead") +typedef octave::uipanel uipanel; + +OCTAVE_DEPRECATED (7, "use 'octave::uitable' instead") +typedef octave::uitable uitable; + +OCTAVE_DEPRECATED (7, "use 'octave::uitoolbar' instead") +typedef octave::uitoolbar uitoolbar; + +OCTAVE_DEPRECATED (7, "use 'octave::uipushtool' instead") +typedef octave::uipushtool uipushtool; + +OCTAVE_DEPRECATED (7, "use 'octave::uitoggletool' instead") +typedef octave::uitoggletool uitoggletool; + +OCTAVE_DEPRECATED (7, "use 'octave::base_graphics_event' instead") +typedef octave::base_graphics_event base_graphics_event; + +OCTAVE_DEPRECATED (7, "use 'octave::graphics_event' instead") +typedef octave::graphics_event graphics_event; + +OCTAVE_DEPRECATED (7, "use 'octave::gh_manager' instead") +typedef octave::gh_manager gh_manager; + #endif + +#endif
--- a/libinterp/corefcn/interpreter-private.h Wed Aug 18 00:21:26 2021 -0400 +++ b/libinterp/corefcn/interpreter-private.h Wed Aug 18 00:25:50 2021 -0400 @@ -33,8 +33,6 @@ #include "symtab.h" -class gh_manager; - namespace octave { class bp_table; @@ -44,6 +42,7 @@ class dynamic_loader; class error_system; class event_manager; + class gh_manager; class gtk_manager; class help_system; class input_system;
--- a/libinterp/corefcn/mex.cc Wed Aug 18 00:21:26 2021 -0400 +++ b/libinterp/corefcn/mex.cc Wed Aug 18 00:25:50 2021 -0400 @@ -4725,7 +4725,8 @@ { mxArray *m = nullptr; - octave_value ret = get_property_from_handle (handle, property, "mexGet"); + octave_value ret + = octave::get_property_from_handle (handle, property, "mexGet"); if (ret.is_defined ()) m = ret.as_mxArray (true); @@ -4738,7 +4739,8 @@ { mxArray *m = nullptr; - octave_value ret = get_property_from_handle (handle, property, "mexGet"); + octave_value ret + = octave::get_property_from_handle (handle, property, "mexGet"); if (ret.is_defined ()) m = ret.as_mxArray (false); @@ -4792,9 +4794,9 @@ int mexSet (double handle, const char *property, mxArray *val) { - bool ret - = set_property_in_handle (handle, property, mxArray::as_octave_value (val), - "mexSet"); + bool ret = octave::set_property_in_handle (handle, property, + mxArray::as_octave_value (val), + "mexSet"); return (ret ? 0 : 1); }
--- a/libinterp/dldfcn/__init_fltk__.cc Wed Aug 18 00:21:26 2021 -0400 +++ b/libinterp/dldfcn/__init_fltk__.cc Wed Aug 18 00:25:50 2021 -0400 @@ -105,6 +105,8 @@ #include "parse.h" #include "variables.h" +OCTAVE_NAMESPACE_BEGIN + #define FLTK_GRAPHICS_TOOLKIT_NAME "fltk" const char *help_text = "\ @@ -2549,3 +2551,5 @@ ## No test needed for internal helper function. %!assert (1) */ + +OCTAVE_NAMESPACE_END
--- a/libinterp/dldfcn/__init_gnuplot__.cc Wed Aug 18 00:21:26 2021 -0400 +++ b/libinterp/dldfcn/__init_gnuplot__.cc Wed Aug 18 00:25:50 2021 -0400 @@ -57,6 +57,8 @@ // PKG_ADD: if (__have_gnuplot__ ()) register_graphics_toolkit ("gnuplot"); endif +OCTAVE_NAMESPACE_BEGIN + class gnuplot_graphics_toolkit : public octave::base_graphics_toolkit { public: @@ -244,8 +246,6 @@ return retval; } -OCTAVE_NAMESPACE_BEGIN - // Initialize the gnuplot graphics toolkit. DEFMETHOD_DLD (__init_gnuplot__, interp, , ,