Very first version of graphics/gui in scilab 6 77/9577/7
Antoine ELIAS [Fri, 2 Nov 2012 14:42:26 +0000 (15:42 +0100)]
Change-Id: Ib5d1b50497bba1f102ad89cebdbd83422f7ed71a

285 files changed:
scilab/etc/modules.xml.in
scilab/etc/modules.xml.vc
scilab/modules/api_scilab/Makefile.am
scilab/modules/api_scilab/Makefile.in
scilab/modules/api_scilab/api_scilab.vcxproj
scilab/modules/api_scilab/api_scilab.vcxproj.filters
scilab/modules/api_scilab/includes/api_optional.h
scilab/modules/api_scilab/includes/overload.hxx
scilab/modules/api_scilab/includes/returnProperty.h [moved from scilab/modules/core/includes/returnProperty.h with 78% similarity]
scilab/modules/api_scilab/includes/returnPropertyList.h [moved from scilab/modules/core/includes/returnPropertyList.h with 66% similarity]
scilab/modules/api_scilab/src/cpp/api_common.cpp
scilab/modules/api_scilab/src/cpp/api_handle.cpp
scilab/modules/api_scilab/src/cpp/api_list.cpp
scilab/modules/api_scilab/src/cpp/api_optional.cpp
scilab/modules/api_scilab/src/cpp/overload.cpp
scilab/modules/api_scilab/src/cpp/returnProperty.cpp [new file with mode: 0644]
scilab/modules/api_scilab/src/cpp/returnPropertyList.cpp [new file with mode: 0644]
scilab/modules/ast/ast.vcxproj
scilab/modules/ast/includes/run_AssignExp.hxx
scilab/modules/ast/includes/run_CallExp.hxx
scilab/modules/ast/includes/runvisitor.hxx
scilab/modules/ast/includes/visitor_common.hxx
scilab/modules/ast/src/cpp/visitor_common.cpp
scilab/modules/core/Makefile.am
scilab/modules/core/Makefile.in
scilab/modules/core/src/c/core.vcxproj
scilab/modules/core/src/c/core.vcxproj.filters
scilab/modules/core/src/c/returnProperty.c [deleted file]
scilab/modules/core/src/c/returnPropertyList.c [deleted file]
scilab/modules/data_structures/macros/lstsize.sci [new file with mode: 0644]
scilab/modules/demo_tools/macros/demo_gui.sci
scilab/modules/differential_equations/src/cpp/differentialequationfunctions.cpp
scilab/modules/functions/sci_gateway/cpp/sci_exec.cpp
scilab/modules/functions/sci_gateway/cpp/sci_execstr.cpp
scilab/modules/graphics/Makefile.am
scilab/modules/graphics/Makefile.in
scilab/modules/graphics/core_Import.def
scilab/modules/graphics/graphics.vcxproj
scilab/modules/graphics/graphics.vcxproj.filters
scilab/modules/graphics/includes/graphics_gw.hxx
scilab/modules/graphics/includes/gw_graphics.h
scilab/modules/graphics/macros/%h_p.sci
scilab/modules/graphics/sci_gateway/c/sci_champ.c
scilab/modules/graphics/sci_gateway/c/sci_drawaxis.c
scilab/modules/graphics/sci_gateway/c/sci_fec.c
scilab/modules/graphics/sci_gateway/c/sci_get.c
scilab/modules/graphics/sci_gateway/c/sci_grayplot.c
scilab/modules/graphics/sci_gateway/c/sci_matplot.c
scilab/modules/graphics/sci_gateway/c/sci_param3d.c
scilab/modules/graphics/sci_gateway/c/sci_param3d1.c
scilab/modules/graphics/sci_gateway/c/sci_plot2d.c
scilab/modules/graphics/sci_gateway/c/sci_plot2d1.c
scilab/modules/graphics/sci_gateway/c/sci_plot3d.c
scilab/modules/graphics/sci_gateway/c/sci_winsid.c [deleted file]
scilab/modules/graphics/sci_gateway/c/sci_xlfont.c
scilab/modules/graphics/sci_gateway/cpp/graphics_gw.cpp
scilab/modules/graphics/sci_gateway/cpp/graphics_gw.vcxproj
scilab/modules/graphics/sci_gateway/cpp/graphics_gw.vcxproj.filters
scilab/modules/graphics/sci_gateway/cpp/sci_get.cpp [new file with mode: 0644]
scilab/modules/graphics/sci_gateway/cpp/sci_winsid.cpp [new file with mode: 0644]
scilab/modules/graphics/src/c/GetCommandArg.c
scilab/modules/graphics/src/c/getHandleProperty/GetHashTable.c
scilab/modules/graphics/src/c/getHandleProperty/GetHashTable.h
scilab/modules/graphics/src/c/getHandleProperty/getHandleProperty.h
scilab/modules/graphics/src/c/getHandleProperty/get_alignment_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_anti_aliasing_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_arc_drawing_method_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_arrow_size_factor_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_arrow_size_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_auto_clear_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_auto_dimensionning_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_auto_position_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_auto_resize_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_auto_rotation_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_auto_scale_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_auto_ticks_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_axes_bounds_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_axes_reverse_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_axes_size_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_axes_visible_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_background_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_bar_layout_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_bar_width_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_box_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_callback_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_callback_type_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_cdata_mapping_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_children_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_clip_box_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_clip_state_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_closed_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_color_flag_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_color_map_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_color_mode_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_color_range_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_colored_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_cube_scaling_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_current_axes_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_current_entity_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_current_figure_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_data_bounds_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_data_mapping_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_data_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_data_property.h
scilab/modules/graphics/src/c/getHandleProperty/get_default_axes_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_default_figure_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_event_handler_enable_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_event_handler_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_figure_closerequestfcn_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_figure_id_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_figure_name_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_figure_position_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_figure_resizefcn_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_figure_size_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_figure_style_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_figures_id_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_fill_mode_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_filled_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_font_angle_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_font_color_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_font_foreground_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_font_size_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_font_style_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_foreground_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_format_n_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_fractional_font_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_grid_position_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_grid_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_handle_visible_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_hidden_axis_color_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_hidden_color_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_immediate_drawing_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_info_message_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_interp_color_mode.c
scilab/modules/graphics/src/c/getHandleProperty/get_interp_color_vector.c
scilab/modules/graphics/src/c/getHandleProperty/get_isoview_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_labels_font_color_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_labels_font_size_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_labels_font_style_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_legend_location_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_line_mode_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_line_style_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_links_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_log_flags_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_margins_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_mark_background_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_mark_foreground_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_mark_mode_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_mark_size_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_mark_size_unit_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_mark_style_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_old_style_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_outside_colors_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_parent_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_pixel_drawing_mode_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_pixmap_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_polyline_style_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_position_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_rotation_angles_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_rotation_style_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_screen_position_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_segs_color_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_sub_tics_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_surface_color_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_surface_mode_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_tag_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_text_box_mode_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_text_box_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_text_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_thickness_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_tics_color_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_tics_direction_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_tics_label_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_tics_segment_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_tics_style_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_tight_limits_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_title_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_triangles_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_type_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_user_data_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_view_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_viewport_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_visible_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_x_label_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_x_location_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_x_shift_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_x_ticks_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_xtics_coord_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_y_label_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_y_location_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_y_shift_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_y_ticks_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_ytics_coord_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_z_bounds_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_z_label_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_z_shift_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_z_ticks_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_zoom_box_property.c
scilab/modules/graphics/src/c/getHandleProperty/get_zoom_state_property.c
scilab/modules/graphics/src/c/getHandleProperty/setGetHashTable.h
scilab/modules/graphics/src/c/getHandleProperty/set_cdata_mapping_property.c
scilab/modules/graphics/src/c/getHandleProperty/set_data_property.c
scilab/modules/graphics/src/c/getHandleProperty/set_user_data_property.c
scilab/modules/graphics/src/c/get_ticks_utils.c
scilab/modules/graphics/src/c/get_ticks_utils.h
scilab/modules/gui/demos/gui.dem.gateway.sce
scilab/modules/gui/includes/GetConsoleShowHiddenHandles.h
scilab/modules/gui/includes/GetScreenProperty.h
scilab/modules/gui/includes/GetUicontrolBackgroundColor.h
scilab/modules/gui/includes/GetUicontrolFontAngle.h
scilab/modules/gui/includes/GetUicontrolFontName.h
scilab/modules/gui/includes/GetUicontrolFontSize.h
scilab/modules/gui/includes/GetUicontrolFontUnits.h
scilab/modules/gui/includes/GetUicontrolFontWeight.h
scilab/modules/gui/includes/GetUicontrolHorizontalAlignment.h
scilab/modules/gui/includes/GetUicontrolListboxTop.h
scilab/modules/gui/includes/GetUicontrolMax.h
scilab/modules/gui/includes/GetUicontrolMin.h
scilab/modules/gui/includes/GetUicontrolPosition.h
scilab/modules/gui/includes/GetUicontrolRelief.h
scilab/modules/gui/includes/GetUicontrolSliderStep.h
scilab/modules/gui/includes/GetUicontrolString.h
scilab/modules/gui/includes/GetUicontrolStyle.h
scilab/modules/gui/includes/GetUicontrolTooltipString.h
scilab/modules/gui/includes/GetUicontrolUnits.h
scilab/modules/gui/includes/GetUicontrolValue.h
scilab/modules/gui/includes/GetUicontrolVerticalAlignment.h
scilab/modules/gui/includes/GetUimenuChecked.h
scilab/modules/gui/includes/GetUimenuLabel.h
scilab/modules/gui/includes/GetUiobjectEnable.h
scilab/modules/gui/includes/GetUiobjectForegroundColor.h
scilab/modules/gui/includes/gui_gw.hxx
scilab/modules/gui/sci_gateway/cpp/gui_gw.cpp
scilab/modules/gui/src/c/core_Import.def
scilab/modules/gui/src/cpp/GetConsoleShowHiddenHandles.cpp
scilab/modules/gui/src/cpp/GetScreenProperty.cpp
scilab/modules/gui/src/cpp/GetUicontrolBackgroundColor.cpp
scilab/modules/gui/src/cpp/GetUicontrolFontAngle.cpp
scilab/modules/gui/src/cpp/GetUicontrolFontName.cpp
scilab/modules/gui/src/cpp/GetUicontrolFontSize.cpp
scilab/modules/gui/src/cpp/GetUicontrolFontUnits.cpp
scilab/modules/gui/src/cpp/GetUicontrolFontWeight.cpp
scilab/modules/gui/src/cpp/GetUicontrolHorizontalAlignment.cpp
scilab/modules/gui/src/cpp/GetUicontrolListboxTop.cpp
scilab/modules/gui/src/cpp/GetUicontrolMax.cpp
scilab/modules/gui/src/cpp/GetUicontrolMin.cpp
scilab/modules/gui/src/cpp/GetUicontrolPosition.cpp
scilab/modules/gui/src/cpp/GetUicontrolRelief.cpp
scilab/modules/gui/src/cpp/GetUicontrolSliderStep.cpp
scilab/modules/gui/src/cpp/GetUicontrolString.cpp
scilab/modules/gui/src/cpp/GetUicontrolStyle.cpp
scilab/modules/gui/src/cpp/GetUicontrolTooltipString.cpp
scilab/modules/gui/src/cpp/GetUicontrolUnits.cpp
scilab/modules/gui/src/cpp/GetUicontrolValue.cpp
scilab/modules/gui/src/cpp/GetUicontrolVerticalAlignment.cpp
scilab/modules/gui/src/cpp/GetUimenuChecked.cpp
scilab/modules/gui/src/cpp/GetUimenuLabel.cpp
scilab/modules/gui/src/cpp/GetUiobjectEnable.cpp
scilab/modules/gui/src/cpp/GetUiobjectForegroundColor.cpp
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/label/SwingScilabLabel.java
scilab/modules/linear_algebra/src/cpp/scischur.cpp
scilab/modules/mexlib/src/cpp/mexlib.cpp
scilab/modules/overloading/macros/%s_i_h.sci
scilab/modules/overloading/macros/%st_i_h.sci
scilab/modules/overloading/macros/generic_i_h.sci
scilab/modules/spreadsheet/spreadsheet.vcxproj
scilab/modules/system_env/includes/context_get.h [new file with mode: 0644]
scilab/modules/system_env/src/cpp/context_get.cpp [new file with mode: 0644]
scilab/modules/system_env/system_env.vcxproj
scilab/modules/system_env/system_env.vcxproj.filters
scilab/modules/types/includes/alltypes.hxx
scilab/modules/types/includes/callable.hxx
scilab/modules/types/includes/function.hxx
scilab/modules/types/includes/graphichandle.hxx
scilab/modules/types/includes/internal.hxx
scilab/modules/types/includes/macro.hxx
scilab/modules/types/includes/macrofile.hxx
scilab/modules/types/src/cpp/double.cpp
scilab/modules/types/src/cpp/function.cpp
scilab/modules/types/src/cpp/graphichandle.cpp
scilab/modules/types/src/cpp/macro.cpp
scilab/modules/types/src/cpp/macrofile.cpp
scilab/modules/types/system_env_Import.def
scilab/modules/types/types.vcxproj
scilab/modules/types/types.vcxproj.filters

index 18ce18e..cb18e3b 100644 (file)
@@ -54,4 +54,5 @@
     <module name="optimization" activate="yes"/>
     <module name="special_functions" activate="yes"/>
     <module name="graphics" activate="@GUI_ENABLE@"/>
+    <module name="demo_tools" activate="@GUI_ENABLE@"/>
 </modules>
index 0d607ff..06368db 100644 (file)
@@ -55,4 +55,5 @@
     <module name="optimization" activate="yes"/>
     <module name="special_functions" activate="yes"/>
     <module name="graphics" activate="yes"/>
+    <module name="demo_tools" activate="yes"/>
 </modules>
index da4fb53..37030ef 100644 (file)
@@ -19,6 +19,8 @@ src/cpp/api_pointer.cpp \
 src/cpp/api_handle.cpp \
 src/cpp/api_error.cpp \
 src/cpp/overload.cpp \
+src/cpp/returnProperty.cpp \
+src/cpp/returnPropertyList.cpp \
 src/cpp/api_optional.cpp
 
 libsciapi_scilab_la_CPPFLAGS= \
index 6982a03..35d6211 100644 (file)
@@ -149,6 +149,8 @@ am__objects_1 = libsciapi_scilab_la-api_boolean.lo \
        libsciapi_scilab_la-api_handle.lo \
        libsciapi_scilab_la-api_error.lo \
        libsciapi_scilab_la-overload.lo \
+       libsciapi_scilab_la-returnProperty.lo \
+       libsciapi_scilab_la-returnPropertyList.lo \
        libsciapi_scilab_la-api_optional.lo
 am_libsciapi_scilab_la_OBJECTS = $(am__objects_1)
 libsciapi_scilab_la_OBJECTS = $(am_libsciapi_scilab_la_OBJECTS)
@@ -457,6 +459,8 @@ src/cpp/api_pointer.cpp \
 src/cpp/api_handle.cpp \
 src/cpp/api_error.cpp \
 src/cpp/overload.cpp \
+src/cpp/returnProperty.cpp \
+src/cpp/returnPropertyList.cpp \
 src/cpp/api_optional.cpp
 
 libsciapi_scilab_la_CPPFLAGS = \
@@ -689,6 +693,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciapi_scilab_la-api_sparse.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciapi_scilab_la-api_string.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciapi_scilab_la-overload.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciapi_scilab_la-returnProperty.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciapi_scilab_la-returnPropertyList.Plo@am__quote@
 
 .cpp.o:
 @am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@@ -802,6 +808,20 @@ libsciapi_scilab_la-overload.lo: src/cpp/overload.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciapi_scilab_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsciapi_scilab_la-overload.lo `test -f 'src/cpp/overload.cpp' || echo '$(srcdir)/'`src/cpp/overload.cpp
 
+libsciapi_scilab_la-returnProperty.lo: src/cpp/returnProperty.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciapi_scilab_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsciapi_scilab_la-returnProperty.lo -MD -MP -MF $(DEPDIR)/libsciapi_scilab_la-returnProperty.Tpo -c -o libsciapi_scilab_la-returnProperty.lo `test -f 'src/cpp/returnProperty.cpp' || echo '$(srcdir)/'`src/cpp/returnProperty.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libsciapi_scilab_la-returnProperty.Tpo $(DEPDIR)/libsciapi_scilab_la-returnProperty.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/returnProperty.cpp' object='libsciapi_scilab_la-returnProperty.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciapi_scilab_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsciapi_scilab_la-returnProperty.lo `test -f 'src/cpp/returnProperty.cpp' || echo '$(srcdir)/'`src/cpp/returnProperty.cpp
+
+libsciapi_scilab_la-returnPropertyList.lo: src/cpp/returnPropertyList.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciapi_scilab_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsciapi_scilab_la-returnPropertyList.lo -MD -MP -MF $(DEPDIR)/libsciapi_scilab_la-returnPropertyList.Tpo -c -o libsciapi_scilab_la-returnPropertyList.lo `test -f 'src/cpp/returnPropertyList.cpp' || echo '$(srcdir)/'`src/cpp/returnPropertyList.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libsciapi_scilab_la-returnPropertyList.Tpo $(DEPDIR)/libsciapi_scilab_la-returnPropertyList.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/returnPropertyList.cpp' object='libsciapi_scilab_la-returnPropertyList.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciapi_scilab_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libsciapi_scilab_la-returnPropertyList.lo `test -f 'src/cpp/returnPropertyList.cpp' || echo '$(srcdir)/'`src/cpp/returnPropertyList.cpp
+
 libsciapi_scilab_la-api_optional.lo: src/cpp/api_optional.cpp
 @am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciapi_scilab_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libsciapi_scilab_la-api_optional.lo -MD -MP -MF $(DEPDIR)/libsciapi_scilab_la-api_optional.Tpo -c -o libsciapi_scilab_la-api_optional.lo `test -f 'src/cpp/api_optional.cpp' || echo '$(srcdir)/'`src/cpp/api_optional.cpp
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libsciapi_scilab_la-api_optional.Tpo $(DEPDIR)/libsciapi_scilab_la-api_optional.Plo
index 32d9275..90f73f7 100644 (file)
@@ -77,7 +77,7 @@
     <ClCompile>
       <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;src/c;../core/includes;../call_scilab/includes;../string/includes;../../libs/MALLOC/includes;../operations/includes;../output_stream/includes;../localization/includes;../../libs/intl;../types/includes;../symbol/includes;../ast/includes;../elementary_functions/includes;../../libs/dynamiclibrary/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../core/includes;../call_scilab/includes;../string/includes;../../libs/MALLOC/includes;../operations/includes;../output_stream/includes;../localization/includes;../../libs/intl;../types/includes;../symbol/includes;../ast/includes;../elementary_functions/includes;../../libs/dynamiclibrary/includes;../system_env/includes;../Threads/includes;../console/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;API_SCILAB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
@@ -120,7 +120,7 @@ cd .. &gt;nul
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;src/c;../core/includes;../call_scilab/includes;../string/includes;../../libs/MALLOC/includes;../operations/includes;../output_stream/includes;../localization/includes;../../libs/intl;../types/includes;../symbol/includes;../ast/includes;../elementary_functions/includes;../../libs/dynamiclibrary/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../core/includes;../call_scilab/includes;../string/includes;../../libs/MALLOC/includes;../operations/includes;../output_stream/includes;../localization/includes;../../libs/intl;../types/includes;../symbol/includes;../ast/includes;../elementary_functions/includes;../../libs/dynamiclibrary/includes;../system_env/includes;../Threads/includes;../console/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;API_SCILAB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
@@ -164,7 +164,7 @@ cd .. &gt;nul
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>includes;src/c;../core/includes;../call_scilab/includes;../string/includes;../../libs/MALLOC/includes;../operations/includes;../output_stream/includes;../localization/includes;../../libs/intl;../types/includes;../symbol/includes;../ast/includes;../elementary_functions/includes;../../libs/dynamiclibrary/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../core/includes;../call_scilab/includes;../string/includes;../../libs/MALLOC/includes;../operations/includes;../output_stream/includes;../localization/includes;../../libs/intl;../types/includes;../symbol/includes;../ast/includes;../elementary_functions/includes;../../libs/dynamiclibrary/includes;../system_env/includes;../Threads/includes;../console/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;API_SCILAB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -217,7 +217,7 @@ cd .. &gt;nul
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>includes;src/c;../core/includes;../call_scilab/includes;../string/includes;../../libs/MALLOC/includes;../operations/includes;../output_stream/includes;../localization/includes;../../libs/intl;../types/includes;../symbol/includes;../ast/includes;../elementary_functions/includes;../../libs/dynamiclibrary/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;src/c;../core/includes;../call_scilab/includes;../string/includes;../../libs/MALLOC/includes;../operations/includes;../output_stream/includes;../localization/includes;../../libs/intl;../types/includes;../symbol/includes;../ast/includes;../elementary_functions/includes;../../libs/dynamiclibrary/includes;../system_env/includes;../Threads/includes;../console/includes;../../libs/Eigen/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;API_SCILAB_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -275,6 +275,8 @@ cd .. &gt;nul
     <ClCompile Include="src\cpp\api_poly.cpp" />
     <ClCompile Include="src\cpp\api_sparse.cpp" />
     <ClCompile Include="src\cpp\api_string.cpp" />
+    <ClCompile Include="src\cpp\returnProperty.cpp" />
+    <ClCompile Include="src\cpp\returnPropertyList.cpp" />
     <ClCompile Include="src\c\DllmainApi_scilab.c" />
     <ClCompile Include="src\cpp\overload.cpp" />
   </ItemGroup>
@@ -288,6 +290,8 @@ cd .. &gt;nul
     <ClInclude Include="includes\api_int.h" />
     <ClInclude Include="includes\api_internal_handle.h" />
     <ClInclude Include="includes\api_optional.h" />
+    <ClInclude Include="includes\returnProperty.h" />
+    <ClInclude Include="includes\returnPropertyList.h" />
     <ClInclude Include="src\cpp\api_internal_boolean.h" />
     <ClInclude Include="src\cpp\api_internal_boolean_sparse.h" />
     <ClInclude Include="src\cpp\api_internal_common.h" />
index fb49d6f..a8545cb 100644 (file)
     <ClCompile Include="src\cpp\api_optional.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="src\cpp\returnProperty.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="src\cpp\returnPropertyList.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="includes\api_boolean.h">
     <ClInclude Include="includes\api_optional.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="includes\returnProperty.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="includes\returnPropertyList.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="src\c\api_scilab.rc">
       <Filter>localization</Filter>
     </None>
   </ItemGroup>
-</Project>
+</Project>
\ No newline at end of file
index 14474c2..794c011 100644 (file)
@@ -37,9 +37,9 @@ extern "C" {
      * @return if the operation succeeded ( 0 ) or not ( !0 )
      */
     int getOptionals(void* _pvCtx, char* fname, rhs_opts opts[]);
-    int FirstOpt();
-    int NumOpt();
-    int FindOpt(char* pstProperty, rhs_opts opts[]);
+    int FirstOpt(void* _pvCtx);
+    int NumOpt(void* _pvCtx);
+    int FindOpt(void* _pvCtx, char* pstProperty, rhs_opts opts[]);
 #ifdef __cplusplus
 }
 #endif
index 28d69da..cc8b6fb 100644 (file)
@@ -35,11 +35,12 @@ public:
     /**
      */
     static types::Function::ReturnValue generateNameAndCall(std::wstring _stFunctionName, types::typed_list &in, int _iRetCount,
-                                             types::typed_list &out, ast::ConstVisitor *_execMe);
+        types::typed_list &out, ast::ConstVisitor *_execMe);
+
     /**
      */
     static types::Function::ReturnValue call(std::wstring _stFunctionName, types::typed_list &in, int _iRetCount,
-                                             types::typed_list &out, ast::ConstVisitor *_execMe);
+        types::typed_list &out, ast::ConstVisitor *_execMe);
 
     static std::wstring getNameFromOper(ast::OpExp::Oper);
 
 #ifndef _RETURN_PROPERTY_H_
 #define _RETURN_PROPERTY_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "dynlib_api_scilab.h"
+
+
 /**
  * create an empty matrix in the scilab stack in order to see it in the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnEmptyMatrix(void* _pvCtx) ;
+void* sciReturnEmptyMatrix();
 
 /**
  * copy the string value in the scilab stack in order to see it the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnString(void* _pvCtx, const char * value ) ;
+void* sciReturnString(const char * value ) ;
 
 /**
  * copy a char value into a scilab string in order to see it the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnChar(void* _pvCtx, char value ) ;
+void* sciReturnChar(char value ) ;
 
 /**
  * copy a single double in the scilab stack in order to see it the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnDouble(void* _pvCtx, double value ) ;
+void* sciReturnDouble(double value ) ;
 
 /**
  * copy a single int in the scilab stack in order to see it the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnInt(void* _pvCtx, int value ) ;
+void* sciReturnInt(int value ) ;
 
 /**
  * copy a double array into a row vector in the scilab stack in order to see it the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnRowVector(void* _pvCtx, const double values[], int nbValues ) ;
+void* sciReturnRowVector(const double values[], int nbValues ) ;
 
 /**
 * copy a int array into a row vector (of double) in the scilab stack
 * in order to see it the console.
 * @return 0 if the function was executed correctly, -1 if an error occurred.
 */
-int sciReturnRowVectorFromInt(void* _pvCtx, const int values[], int nbValues ) ;
+void* sciReturnRowVectorFromInt(const int values[], int nbValues ) ;
 
 /**
  * copy an int array into an int row vector in the scilab stack
  * in order to see it the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnRowIntVector(void* _pvCtx, const int values[], int nbValues ) ;
+void* sciReturnRowIntVector(const int values[], int nbValues ) ;
 
 /**
  * copy a char * array into an string row vector in the scilab stack
  * in order to see it the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnRowStringVector(void* _pvCtx, char * values[], int nbValues ) ;
+void* sciReturnRowStringVector(char * values[], int nbValues ) ;
 
 /**
  * copy a handle in the scilab stack in order to see it the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnHandle(void* _pvCtx, long handle ) ;
+void* sciReturnHandle(long handle ) ;
 
 /**
  * copy an handle array into a row vector in the scilab stack in order to see it the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnRowHandleVector(void* _pvCtx, const long handles[], int nbValues ) ;
+void* sciReturnRowHandleVector(const long handles[], int nbValues ) ;
 
 /**
 * copy an handle array into a col vector in the scilab stack in order to see it the console.
 * @return 0 if the function was executed correctly, -1 if an error occurred.
 */
-int sciReturnColHandleVector(void* _pvCtx, const long handles[], int nbValues ) ;
+void* sciReturnColHandleVector(const long handles[], int nbValues ) ;
 
 /**
  * copy a matrix stored has a double array
  * into a Scilab matrix in the stack in order to see it the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnMatrix(void* _pvCtx, double values[], int nbRow, int nbCol ) ;
+void* sciReturnMatrix(double values[], int nbRow, int nbCol ) ;
 
 /**
  * copy a matrix stored has a char * array
  * into a Scilab string matrix in the stack in order to see it the console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnStringMatrix(void* _pvCtx, char * values[], int nbRow, int nbCol ) ;
+void* sciReturnStringMatrix(char * values[], int nbRow, int nbCol ) ;
 
 /**
  * return user data in the scilab console.
  * @return 0 if the function was executed correctly, -1 if an error occurred.
  */
-int sciReturnUserData(void* _pvCtx, const int * userData, int userDataSize ) ;
+void* sciReturnUserData(const int * userData, int userDataSize ) ;
 
+#ifdef __cplusplus
+}
+#endif
 #endif /* _RETURN_PROPERTY_H_ */
@@ -1,5 +1,5 @@
 /*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Scilab (http://www.scilab.org/) - This file is part of Scilab
  * Copyright (C) 2006 - INRIA - Jean-Baptiste Silvy
  * 
  * This file must be used under the terms of the CeCILL.
  *
  */
 
-
 #ifndef _RETURN_PROPERTY_LIST_H_
 #define _RETURN_PROPERTY_LIST_H_
 
-typedef struct
-{
-  int curElement ; /**< the number of the current element in the stack the first one is the name.
-                        vary from 1 to nbElements */
-  int nbElements ; /**< the number of element which will be inserted in the list. */
-  int stackPointer ; /**< use to differentiate returned list. Not useful for now. */
-} returnedList ;
+#ifdef __cplusplus
+extern "C" {
+#endif
 
+#include "dynlib_api_scilab.h"
 /**
  * Construct a new tlist and allocate scilab stack for return in the console.
  * Only one tlist should be used at the same time.
@@ -30,7 +26,7 @@ typedef struct
  *                  and its properties. Its size is nbElement + 1.
  * @return a pointer to the newly created list or NULL if an error occurred.
  */
-returnedList * createReturnedList( int nbElements, char * elementName[] ) ;
+void* createReturnedList(int nbElements, char* elementName[]);
 
 /**
  * free the list. Must be done after using the list.
@@ -38,46 +34,49 @@ returnedList * createReturnedList( int nbElements, char * elementName[] ) ;
  *          1 if the list has not been totally filled
  *         -1 if an other error happened
  */
-int destroyReturnedList( returnedList * list ) ;
+int destroyReturnedList(void* list);
 
 /**
  * add a new row vector in the list.
- * @param[in/out] returnedList the returned tList
+ * @param[in/out] void the returned tList
  * @param[in]     vector       values to be inserted of size nbValues
  * @return        0  if the call was successful
  *                1  if the list is full so the item can not be inserted
  *                -1 if an other error occurred
  */
-int addRowVectorToReturnedList( returnedList * list, const double vector[], int nbValues ) ;
+int addRowVectorToReturnedList(void* list, const double vector[], int nbValues);
 
 /**
  * add a new column vector in the list.
- * @param[in/out] returnedList the returned tList
+ * @param[in/out] void the returned tList
  * @param[in]     vector       values to be inserted of size nbValues
  * @return        0  if the call was successful
  *                1  if the list is full so the item can not be inserted
  *                -1 if an other error occurred
  */
-int addColVectorToReturnedList( returnedList * list, const double vector[], int nbValues ) ;
+int addColVectorToReturnedList(void* list, const double vector[], int nbValues);
 
 /**
  * add a new column vector in the list.
- * @param[in/out] returnedList the returned tList
+ * @param[in/out] void the returned tList
  * @param[in]     matrix   values to be inserted of size nbRow x nbCol
  * @return        0  if the call was successful
  *                1  if the list is full so the item can not be inserted
  *                -1 if an other error occurred
  */
-int addMatrixToReturnedList( returnedList * list, const double matrix[], int nbRow, int nbCol ) ;
+int addMatrixToReturnedList(void* list, const double matrix[], int nbRow, int nbCol);
 
 /**
  * add a new string column vector in the list.
- * @param[in/out] returnedList the returned tList
+ * @param[in/out] void the returned tList
  * @param[in]     vector   values to be inserted of size nbValues
  * @return        0  if the call was successful
  *                1  if the list is full so the item can not be inserted
  *                -1 if an other error occurred
  */
-int addStringColVectorToReturnedList( returnedList * list, char * vector[], int nbValues ) ;
+int addStringColVectorToReturnedList(void* list, char* vector[], int nbValues);
 
+#ifdef __cplusplus
+}
+#endif
 #endif /* _RETURN_PROPERTY_LIST_H_ */
index 811b39b..adf79e1 100644 (file)
@@ -424,9 +424,9 @@ SciErr getVarType(void *_pvCtx, int *_piAddress, int *_piType)
     case GenericType::RealUInt64 :
         *_piType = sci_ints;
         break;
-        //case GenericType::RealHandle :
-        //    *_piType = sci_handles;
-        //    break;
+    case GenericType::RealHandle :
+        *_piType = sci_handles;
+        break;
     case GenericType::RealString :
         *_piType = sci_strings;
         break;
index 3df7f3b..9cbca01 100644 (file)
@@ -13,6 +13,9 @@
  * still available and supported in Scilab 6.
  */
 
+#include "graphichandle.hxx"
+#include "function.hxx"
+
 extern "C"
 {
 #include "api_scilab.h"
@@ -24,37 +27,102 @@ extern "C"
 #include "call_scilab.h"
 }
 
+using namespace std;
+using namespace types;
+
+
 SciErr getMatrixOfHandle(void* _pvCtx, int* _piAddress, int* _piRows, int* _piCols, long long** _pllHandle)
 {
-    SciErr sciErr;
-    sciErr.iErr = 0;
-    sciErr.iMsgCount = 0;
+       SciErr sciErr; sciErr.iErr = 0; sciErr.iMsgCount = 0;
+       int iType = 0;
 
-    //FIX ME
+       if(     _piAddress == NULL)
+       {
+               addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getMatrixOfHandle");
+               return sciErr;
+       }
 
-    return sciErr;
+       sciErr = getVarType(_pvCtx, _piAddress, &iType);
+       if(sciErr.iErr || iType != sci_handles)
+       {
+               addErrorMessage(&sciErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s excepted"), "getMatrixOfHandle", _("boolean matrix"));
+               return sciErr;
+       }
+
+       sciErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols);
+       if(sciErr.iErr)
+       {
+               addErrorMessage(&sciErr, API_ERROR_GET_HANDLE, _("%s: Unable to get argument #%d"), "getMatrixOfHandle", getRhsFromAddress(_pvCtx, _piAddress));
+               return sciErr;
+       }
+
+       if(_pllHandle)
+       {
+        *_pllHandle = ((InternalType*)_piAddress)->getAs<types::GraphicHandle>()->get();
+       }
+       return sciErr;
 }
 /*--------------------------------------------------------------------------*/
 SciErr allocMatrixOfHandle(void* _pvCtx, int _iVar, int _iRows, int _iCols, long long** _pllHandle)
 {
-    SciErr sciErr;
-    sciErr.iErr = 0;
-    sciErr.iMsgCount = 0;
+    SciErr sciErr; sciErr.iErr = 0; sciErr.iMsgCount = 0;
 
-    //FIX ME
+    if(_pvCtx == NULL)
+    {
+        addErrorMessage(&sciErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "allocMatrixOfHandle");
+        return sciErr;
+    }
+
+    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
+    typed_list in = *pStr->m_pIn;
+    InternalType** out = pStr->m_pOut;
+    int*       piRetCount = pStr->m_piRetCount;
+    wchar_t* pstName = pStr->m_pstName;
+
+    GraphicHandle *pHandle = new GraphicHandle(_iRows, _iCols);
+    if(pHandle == NULL)
+    {
+        addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: No more memory to allocated variable"), "allocMatrixOfHandle");
+        return sciErr;
+    }
+
+    int rhs = _iVar - *getNbInputArgument(_pvCtx);
+    out[rhs - 1] = pHandle;
+    *_pllHandle = pHandle->get();
+    if(*_pllHandle == NULL)
+    {
+        addErrorMessage(&sciErr, API_ERROR_NO_MORE_MEMORY, _("%s: No more memory to allocated variable"), "allocMatrixOfHandle");
+        return sciErr;
+    }
 
     return sciErr;
 }
 /*--------------------------------------------------------------------------*/
 SciErr createMatrixOfHandle(void* _pvCtx, int _iVar, int _iRows, int _iCols, long long* _pllHandle)
 {
-    SciErr sciErr;
-    sciErr.iErr = 0;
-    sciErr.iMsgCount = 0;
+       SciErr sciErr; sciErr.iErr = 0; sciErr.iMsgCount = 0;
+       long long* pllHandle = NULL;
 
-    //FIX ME
+    if(_iRows == 0 && _iCols == 0)
+    {
+        double dblReal = 0;
+        sciErr = createMatrixOfDouble(_pvCtx, _iVar, 0, 0, &dblReal);
+        if (sciErr.iErr)
+        {
+            addErrorMessage(&sciErr, API_ERROR_CREATE_EMPTY_MATRIX, _("%s: Unable to create variable in Scilab memory"), "createEmptyMatrix");
+        }
+        return sciErr;
+    }
 
-    return sciErr;
+    sciErr = allocMatrixOfHandle(_pvCtx, _iVar, _iRows, _iCols, &pllHandle);
+       if(sciErr.iErr)
+       {
+               addErrorMessage(&sciErr, API_ERROR_CREATE_BOOLEAN, _("%s: Unable to create variable in Scilab memory"), "createMatrixOfBoolean");
+               return sciErr;
+       }
+
+       memcpy(pllHandle, _pllHandle, sizeof(long long) * _iRows * _iCols);
+       return sciErr;
 }
 /*--------------------------------------------------------------------------*/
 SciErr fillMatrixOfHandle(void* _pvCtx, int* _piAddress, int _iRows, int _iCols, long long** _pllHandle)
@@ -62,9 +130,6 @@ SciErr fillMatrixOfHandle(void* _pvCtx, int* _piAddress, int _iRows, int _iCols,
     SciErr sciErr;
     sciErr.iErr = 0;
     sciErr.iMsgCount = 0;
-
-    //FIX ME
-
     return sciErr;
 }
 /*--------------------------------------------------------------------------*/
@@ -75,22 +140,48 @@ int isHandleType(void* _pvCtx, int* _piAddress)
 /*--------------------------------------------------------------------------*/
 int getScalarHandle(void* _pvCtx, int* _piAddress, long long* _pllHandle)
 {
-    SciErr sciErr;
-    sciErr.iErr = 0;
-    sciErr.iMsgCount = 0;
+       SciErr sciErr; sciErr.iErr = 0; sciErr.iMsgCount = 0;
+       int iRows       = 0;
+       int iCols       = 0;
+
+       long long* pllHandle = NULL;
+
+       sciErr = getMatrixOfHandle(_pvCtx, _piAddress, &iRows, &iCols, &pllHandle);
+       if(sciErr.iErr)
+       {
+               addErrorMessage(&sciErr, API_ERROR_GET_SCALAR_HANDLE, _("%s: Unable to get argument #%d"), "getScalarHandle", getRhsFromAddress(_pvCtx, _piAddress));
+               printError(&sciErr, 0);
+               return sciErr.iErr;
+       }
+
+       if(isScalar(_pvCtx, _piAddress) == 0)
+       {
+               addErrorMessage(&sciErr, API_ERROR_GET_SCALAR_HANDLE, _("%s: Wrong type for input argument #%d: A scalar expected.\n"), "getScalarHandle", getRhsFromAddress(_pvCtx, _piAddress));
+               printError(&sciErr, 0);
+               return sciErr.iErr;
+       }
 
-    //FIX ME
+       if(_pllHandle != NULL)
+       {
+               *_pllHandle = pllHandle[0];
+       }
 
-    return 0;
+       return 0;
 }
 /*--------------------------------------------------------------------------*/
 int createScalarHandle(void* _pvCtx, int _iVar, long long _llHandle)
 {
-    SciErr sciErr;
-    sciErr.iErr = 0;
-    sciErr.iMsgCount = 0;
+       SciErr sciErr; sciErr.iErr = 0; sciErr.iMsgCount = 0;
+       long long* pllHandle = NULL;
 
-    //FIX ME
+       sciErr = allocMatrixOfHandle(_pvCtx, _iVar, 1, 1, &pllHandle);
+       if(sciErr.iErr)
+       {
+               addErrorMessage(&sciErr, API_ERROR_CREATE_SCALAR_HANDLE, _("%s: Unable to create variable in Scilab memory"), "createScalarHandle");
+               printError(&sciErr, 0);
+               return sciErr.iErr;
+       }
 
-    return 0;
+       pllHandle[0] = _llHandle;
+       return 0;
 }
index eb6b9ad..424e906 100644 (file)
@@ -16,6 +16,7 @@
 #include <vector>
 #include <map>
 #include <string>
+#include "list.hxx"
 
 extern "C"
 {
@@ -257,12 +258,14 @@ SciErr getListItemNumber(void* _pvCtx, int* _piAddress, int* _piNbItem)
         addErrorMessage(&sciErr, API_ERROR_LIST_ITEM_NUMBER, _("%s: Unable to get item number of list"), "getListItemNumber");
         return sciErr;
     }
+
+    types::List* pL = (types::List*)_piAddress;
     switch (iType)
     {
         case sci_list :
         case sci_mlist :
         case sci_tlist :
-            *_piNbItem = _piAddress[1];
+            *_piNbItem = pL->getSize();
             break;
         default :
             addErrorMessage(&sciErr, API_ERROR_INVALID_LIST_TYPE, _("%s: Invalid argument type, %s excepted"), "getListItemNumber", _("list"));
@@ -292,16 +295,16 @@ SciErr getListItemAddress(void* _pvCtx, int* _piAddress, int _iItemNum, int** _p
         return sciErr;
     }
 
+    types::List* pL = (types::List*)_piAddress;
     //get offset of item array
-    piOffset    =  _piAddress + 2;
-    if (piOffset[_iItemNum] == piOffset[_iItemNum - 1])
+    types::InternalType* pIT = pL->get(_iItemNum - 1);
+    if (pIT->isListUndefined())
     {
         *_piItemAddress = NULL;
     }
     else
     {
-        piItemAddress = piOffset + iItem  + 1 + !(iItem % 2);
-        *_piItemAddress = piItemAddress + (piOffset[_iItemNum - 1] - 1) * (sizeof(double) / sizeof(int));
+        *_piItemAddress = (int*)pIT;
     }
     return sciErr;
 }
index 5a1117c..adc7497 100644 (file)
@@ -9,12 +9,21 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  */
 
+#include "function.hxx"
+
+extern "C"
+{
 #include <string.h>
 #include "api_scilab.h"
 #include "localization.h"
 #include "Scierror.h"
 #include "call_scilab.h"
 #include "sciprint.h"
+#include "MALLOC.h"
+}
+
+
+using namespace types;
 
 static int findOptional(void* _pvCtx, char *fname, rhs_opts opts[]);
 static void printOptionalNames(void* _pvCtx, rhs_opts opts[]);
@@ -22,73 +31,75 @@ static void printOptionalNames(void* _pvCtx, rhs_opts opts[]);
 /**************************/
 /*   optional functions   */
 /**************************/
+int getOptionals(void* _pvCtx, char* pstFuncName, rhs_opts opts[])
+{
+    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
+    types::optional_list opt = *pStr->m_pOpt;
+    for (int i = 0 ; i < opt.size() ; i++)
+    {
+        char* pstOpts = wide_string_to_UTF8(opt[i].first.c_str());
+        int index = findOptional(_pvCtx, pstOpts, opts);
+        FREE(pstOpts);
+
+        if (index < 0)
+        {
+            sciprintW(_W("%ls: Unrecognized optional arguments %ls.\n"), pStr->m_pstName, opt[i].first.c_str());
+            printOptionalNames(_pvCtx, opts);
+            return 0;
+        }
 
+        opts[index].iPos = i + 1;
+        GenericType* pGT = (GenericType*)opt[i].second;
+
+        opts[index].iRows = pGT->getRows();
+        opts[index].iCols = pGT->getCols();
+        getVarType(_pvCtx, (int*)pGT, &opts[index].iType);
+        opts[index].piAddr = (int*)pGT;
+    }
+    //   int index = -1;
+    //GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
+
+    //   wchar_t* pwstProperty = to_wide_string(pstProperty);
+
+    //   for(int i = 0 ; i < pStr->m_pOpt->size() ; i++)
+    //   {
+    //       std::pair<std::wstring, InternalType*> current = (*pStr->m_pOpt)[i];
+    //       if(wcscmp(current.first.c_str(), pwstProperty) == 0)
+    //       {
+    //           index = i;
+    //           break;
+    //       }
+    //   }
+
+    //   FREE(pwstProperty);
 
-int getOptionals(void* _pvCtx, char* fname, rhs_opts opts[])
-{
-    //int k, i = 0;
-    //char name[nlgh + 1];
-    //int nopt = NumOpt();        /* optional arguments on the stack */
-
-    ///* reset first field since opts is declared static in calling function */
-    ///* this could be avoided with ansi compilers by removing static in the
-    // * opts declaration */
-
-    //while (opts[i].pstName != NULL)
-    //{
-    //    opts[i].iPos = -1;
-    //    i++;
-    //}
-
-    ///* Walking through last arguments */
-
-    //for (k = Rhs - nopt + 1; k <= Rhs; k++)
-    //{
-    //    if (IsOpt(k, name) == 0)
-    //    {
-    //        Scierror(999, _("%s: Optional arguments name=val must be at the end.\n"), fname);
-    //        return 0;
-    //    }
-    //    else
-    //    {
-    //        int isopt = findOptional(_pvCtx, name, opts);
-
-    //        if (isopt >= 0)
-    //        {
-    //            rhs_opts *ro = &opts[isopt];
-    //            ro->iPos = k;
-    //            getVarAddressFromPosition(_pvCtx, k, &ro->piAddr);
-    //            getVarType(_pvCtx, ro->piAddr, &ro->iType);
-    //            getVarDimension(_pvCtx, ro->piAddr, &ro->iRows, &ro->iCols);
-    //        }
-    //        else
-    //        {
-    //            sciprint(_("%s: Unrecognized optional arguments %s.\n"), fname, name);
-    //            printOptionalNames(_pvCtx, opts);
-    //            SciError(999);
-    //            return 0;
-    //        }
-    //    }
-    //}
     return 1;
 }
 
-int FirstOpt()
+int FirstOpt(void* _pvCtx)
 {
-    return 1;
+    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
+    return (int)pStr->m_pIn->size() + 1;
 }
 
-int NumOpt()
+int NumOpt(void* _pvCtx)
 {
-    return 1;
+    GatewayStruct* pStr = (GatewayStruct*)_pvCtx;
+    return (int)pStr->m_pOpt->size();
 }
 
-int FindOpt(char* pstProperty, rhs_opts opts[])
+int FindOpt(void* _pvCtx, char* pstProperty, rhs_opts opts[])
 {
-    return 1;
+    int i = findOptional(_pvCtx, pstProperty, opts);
+    if (i > 0 && opts[i].iPos > 0)
+    {
+        return i;
+    }
+
+    return 0;
 }
 
-static int findOptional(void* _pvCtx, char *fname, rhs_opts opts[])
+static int findOptional(void* _pvCtx, char *pstProperty, rhs_opts opts[])
 {
     int rep = -1, i = 0;
 
@@ -97,7 +108,7 @@ static int findOptional(void* _pvCtx, char *fname, rhs_opts opts[])
         int cmp;
 
         /* name is terminated by white space and we want to ignore them */
-        if ((cmp = strcmp(fname, opts[i].pstName)) == 0)
+        if ((cmp = strcmp(pstProperty, opts[i].pstName)) == 0)
         {
             rep = i;
             break;
@@ -125,6 +136,7 @@ void printOptionalNames(void* _pvCtx, rhs_opts opts[])
         sciprint(_("Optional argument list is empty.\n"));
         return;
     }
+
     sciprint(_("Optional arguments list: \n"));
     while (opts[i + 1].pstName != NULL)
     {
index 976e596..cda6f3a 100644 (file)
@@ -9,6 +9,9 @@
  *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
+
+#pragma comment(lib,"../../bin/typesmacro.lib")
+
 extern "C"
 {
 #include "stdarg.h"
@@ -53,7 +56,8 @@ types::Function::ReturnValue Overload::call(std::wstring _stOverloadingFunctionN
     types::Callable *pCall = pIT->getAs<types::Callable>();
     try
     {
-        return pCall->call(in, _iRetCount, out, _execMe);
+        types::optional_list opt;
+        return pCall->call(in, opt, _iRetCount, out, _execMe);
     }
     catch (ScilabMessage sm)
     {
@@ -135,14 +139,3 @@ std::wstring Overload::getNameFromOper(ast::OpExp::Oper _oper)
         return std::wstring(L"???");
     }
 }
-
-wstring formatString(const wstring& wstFormat, ...)
-{
-    wchar_t pwstTemp[1024];
-    va_list arglist;
-    va_start(arglist, wstFormat);
-    int iLen = os_swprintf(pwstTemp, 1024, wstFormat.c_str(), arglist);
-    va_end(arglist);
-
-    return wstring(pwstTemp, iLen);
-}
diff --git a/scilab/modules/api_scilab/src/cpp/returnProperty.cpp b/scilab/modules/api_scilab/src/cpp/returnProperty.cpp
new file mode 100644 (file)
index 0000000..f538259
--- /dev/null
@@ -0,0 +1,209 @@
+/*
+ * Scilab (http://www.scilab.org/) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Jean-Baptiste SILVY
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+/*------------------------------------------------------------------------*/
+/* file: returnProperty.c                                                 */
+/* desc : a set of functions used to return values in Scilab              */
+/*------------------------------------------------------------------------*/
+
+//#include "api_scilab.h"
+#include "returnProperty.h"
+#include <string.h>
+#include "MALLOC.h"
+#include "double.hxx"
+#include "string.hxx"
+#include "graphichandle.hxx"
+
+/*--------------------------------------------------------------------------*/
+void* sciReturnEmptyMatrix()
+{
+    //createEmptyMatrix(_pvCtx, nbInputArgument(_pvCtx) + 1);
+    return types::Double::Empty();
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnString(const char * value)
+{
+    //createSingleString(_pvCtx, nbInputArgument(_pvCtx) + 1, value)
+    return new types::String(value);
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnChar(char value)
+{
+    //createSingleString(_pvCtx, nbInputArgument(_pvCtx) + 1, pstValue)
+    char pstValue[2] = {value, 0};//createSingleString needs null terminated characters string
+    return new types::String(pstValue);
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnDouble(double value)
+{
+    //createScalarDouble(_pvCtx, nbInputArgument(_pvCtx) + 1, value)
+    return new types::Double(value);
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnInt(int value)
+{
+    return sciReturnDouble((double)value);
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnRowVector(const double values[], int nbValues)
+{
+    //SciErr sciErr = createMatrixOfDouble(_pvCtx, nbInputArgument(_pvCtx) + 1, 1, nbValues, values);
+    //if (sciErr.iErr)
+    //{
+    //    printError(&sciErr, 0);
+    //    return 1;
+    //}
+
+    //return 0;
+
+    double* pdbl = NULL;
+    types::Double* pD = new types::Double(1, nbValues, &pdbl);
+    for (int i = 0 ; i < nbValues ; i++)
+    {
+        pdbl[i] = values[i];
+    }
+    return pD;
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnRowVectorFromInt(const int values[], int nbValues)
+{
+    //SciErr sciErr = createMatrixOfDoubleAsInteger(_pvCtx, nbInputArgument(_pvCtx) + 1, 1, nbValues, values);
+    //if (sciErr.iErr)
+    //{
+    //    printError(&sciErr, 0);
+    //    return 1;
+    //}
+
+    //return 0;
+
+    double* pdbl = NULL;
+    types::Double* pD = new types::Double(1, nbValues, &pdbl);
+    for (int i = 0 ; i < nbValues ; i++)
+    {
+        pdbl[i] = (double)values[i];
+    }
+    return pD;
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnRowIntVector(const int values[], int nbValues)
+{
+    return sciReturnRowVectorFromInt(values, nbValues);
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnRowStringVector(char * values[], int nbValues)
+{
+    return sciReturnStringMatrix(values, 1, nbValues);
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnHandle(long handle)
+{
+    //createScalarHandle(_pvCtx, nbInputArgument(_pvCtx) + 1, handle)
+    return new types::GraphicHandle(handle);
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnRowHandleVector(const long handles[], int nbValues)
+{
+    //int i = 0;
+    //long long* pH = NULL;
+    //SciErr sciErr = allocMatrixOfHandle(_pvCtx, nbInputArgument(_pvCtx) + 1, 1, nbValues, &pH);
+    //if (sciErr.iErr)
+    //{
+    //    printError(&sciErr, 0);
+    //    return 1;
+    //}
+
+    //for (i = 0 ; i < nbValues ; i++)
+    //{
+    //    pH[i] = handles[i];
+    //}
+
+    //return 0;
+
+    types::GraphicHandle* pH = new types::GraphicHandle(1, nbValues);
+    long long* pHandle = pH->get();
+    for (int i = 0 ; i < nbValues ; i++)
+    {
+        pHandle[i] = (long long)handles[i];
+    }
+    return pH;
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnColHandleVector(const long handles[], int nbValues)
+{
+    //int i = 0;
+    //long long* pH = NULL;
+    //SciErr sciErr = allocMatrixOfHandle(_pvCtx, nbInputArgument(_pvCtx) + 1, nbValues, 1, &pH);
+    //if (sciErr.iErr)
+    //{
+    //    printError(&sciErr, 0);
+    //    return 1;
+    //}
+
+    //for (i = 0 ; i < nbValues ; i++)
+    //{
+    //    pH[i] = handles[i];
+    //}
+
+    //return 0;
+    types::GraphicHandle* pH = new types::GraphicHandle(nbValues, 1);
+    long long* pHandle = pH->get();
+    for (int i = 0 ; i < nbValues ; i++)
+    {
+        pHandle[i] = (long long)handles[i];
+    }
+    return pH;
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnMatrix(double values[], int nbRow, int nbCol)
+{
+    //SciErr sciErr = createMatrixOfDouble(_pvCtx, nbInputArgument(_pvCtx) + 1, nbRow, nbCol, values);
+    //if (sciErr.iErr)
+    //{
+    //    printError(&sciErr, 0);
+    //    return 1;
+    //}
+
+    //return 0;
+    double* pdbl = NULL;
+    types::Double* pD = new types::Double(nbRow, nbCol, &pdbl);
+    for (int i = 0 ; i < nbRow * nbCol ; i++)
+    {
+        pdbl[i] = values[i];
+    }
+    return pD;
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnStringMatrix(char * values[], int nbRow, int nbCol)
+{
+    //SciErr sciErr = createMatrixOfString(_pvCtx, nbInputArgument(_pvCtx) + 1, nbRow, nbCol, values);
+    //if (sciErr.iErr)
+    //{
+    //    printError(&sciErr, 0);
+    //    return 1;
+    //}
+
+    //return 0;
+
+    types::String* pS = new types::String(nbRow, nbCol);
+    for (int i = 0 ; i < nbRow * nbCol ; i++)
+    {
+        wchar_t* pwstValue = to_wide_string(values[i]);
+        pS->set(i, pwstValue);
+        FREE(pwstValue);
+    }
+    return pS;
+}
+/*--------------------------------------------------------------------------*/
+void* sciReturnUserData(const int * userData, int userDataSize)
+{
+    return ((types::InternalType*) * userData);
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/api_scilab/src/cpp/returnPropertyList.cpp b/scilab/modules/api_scilab/src/cpp/returnPropertyList.cpp
new file mode 100644 (file)
index 0000000..06172b3
--- /dev/null
@@ -0,0 +1,158 @@
+/*
+ * Scilab (http://www.scilab.org/) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Jean-Baptiste SILVY
+ * 
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at    
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+/*------------------------------------------------------------------------*/
+/* file: returnProperty.c                                                 */
+/* desc : a set of functions used to return a tList in Scilab             */
+/*------------------------------------------------------------------------*/
+
+#include "returnPropertyList.h"
+#include "returnProperty.h"
+#include "MALLOC.h"
+#include "sciprint.h"
+#include "localization.h"
+#include "tlist.hxx"
+#include "double.hxx"
+#include "string.hxx"
+/*------------------------------------------------------------------------*/
+void* createReturnedList(int nbElements, char * elementName[])
+{
+  //returnedList * newList = NULL ;
+  //int nbRow = 1 ;
+
+  //newList = (returnedList*)MALLOC(sizeof(returnedList)) ;
+  //if (newList == NULL)
+  //{
+  //  sciprint(_("Error returning tlist, memory full.\n")) ;
+  //  return NULL ;
+  //}
+
+  //newList->nbElements = nbElements + 1 ;
+
+  ///* create the tlist in the stack and get the stack pointer in newList->stackPointer */
+  //CreateVar(Rhs+1,TYPED_LIST_DATATYPE, &(newList->nbElements), &nbRow, &(newList->stackPointer));
+
+  ///* create the first element : names of properties */
+  //CreateListVarFromPtr(Rhs+1, 1,MATRIX_OF_STRING_DATATYPE, &nbRow, &(newList->nbElements), elementName);
+  //
+  //newList->curElement = 1 ;
+
+  //return newList ;
+
+    //create fieldname list
+    types::String* pField = (types::String*)sciReturnStringMatrix(elementName, 1, nbElements + 1);
+    //create TList
+    types::TList* pL = new types::TList();
+    //add field list in list
+    pL->append(pField);
+    return pL;
+
+}
+/*------------------------------------------------------------------------*/
+int destroyReturnedList(void* list)
+{
+  /* safe test to know if the list has been correctly filled */
+  //if (list->curElement != list->nbElements)
+  //{
+  //  sciprint(_("tlist not completely filled.\n")) ;
+  //  FREE(list) ;
+  //  return 1 ;
+  //}
+
+  //FREE(list) ;
+  //return 0 ;
+
+    delete (types::TList*)list;
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int addRowVectorToReturnedList(void* list, const double vector[], int nbValues)
+{
+  //int nbRow = 1 ;
+  ///* check we are not using all the allocated space for the list */
+  //if (list->curElement >= list->nbElements)
+  //{
+  //  sciprint(_("List full.\n")) ;
+  //  return 1 ;
+  //}
+
+  ///* add a new element */
+  //list->curElement++ ;
+  //CreateListVarFromPtr(Rhs+1, list->curElement,MATRIX_OF_DOUBLE_DATATYPE, &nbRow, &nbValues, &vector);
+  //return 0 ;
+
+    types::TList* pL = (types::TList*)list;
+    pL->append((types::InternalType*)sciReturnMatrix((double*)vector, nbValues, 1));
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int addColVectorToReturnedList(void* list, const double vector[], int nbValues)
+{
+  //int nbCol = 1 ;
+  ///* check we are not using all the allocated space for the list */
+  //if (list->curElement >= list->nbElements)
+  //{
+  //  sciprint(_("List full.\n")) ;
+  //  return 1 ;
+  //}
+
+  ///* add a new element */
+  //list->curElement++ ;
+  //CreateListVarFromPtr(Rhs+1, list->curElement,MATRIX_OF_DOUBLE_DATATYPE, &nbValues, &nbCol, &vector);
+
+  //return 0 ;
+
+    types::TList* pL = (types::TList*)list;
+    pL->append((types::InternalType*)sciReturnMatrix((double*)vector, nbValues, 1));
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int addMatrixToReturnedList(void* list, const double matrix[], int nbRow, int nbCol)
+{
+  ///* check we are not using all the allocated space for the list */
+  //if (list->curElement >= list->nbElements)
+  //{
+  //  sciprint(_("List full.\n")) ;
+  //  return 1 ;
+  //}
+
+  ///* add a new element */
+  //list->curElement++ ;
+  //CreateListVarFromPtr(Rhs+1, list->curElement,MATRIX_OF_DOUBLE_DATATYPE, &nbRow, &nbCol, &matrix);
+
+  //return 0 ;
+
+    types::TList* pL = (types::TList*)list;
+    pL->append((types::InternalType*)sciReturnMatrix((double*)matrix, nbRow, nbCol));
+    return 0;
+}
+/*------------------------------------------------------------------------*/
+int addStringColVectorToReturnedList(void* list, char * vector[], int nbValues)
+{
+  //int nbCol = 1 ;
+  ///* check we are not using all the allocated space for the list */
+  //if (list->curElement >= list->nbElements)
+  //{
+  //  sciprint(_("List full.\n")) ;
+  //  return 1 ;
+  //}
+
+  ///* add a new element */
+  //list->curElement++ ;
+  //CreateListVarFromPtr(Rhs+1, list->curElement,MATRIX_OF_STRING_DATATYPE, &nbValues, &nbCol, vector);
+
+  //return 0 ;
+
+    types::TList* pL = (types::TList*)list;
+    pL->append((types::InternalType*)sciReturnStringMatrix(vector, nbValues, 1));
+    return 0;
+}
+/*------------------------------------------------------------------------*/
index d73369a..460676d 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;AST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;AST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;AST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>includes;..\symbol\includes;..\types\includes;..\functions_manager\includes;../core/includes;..\elementary_functions\includes;../operations/includes;../localization/includes;../../libs/intl;../output_stream/includes;../system_env/includes;../string/includes;../api_scilab/includes;../threads/includes;../../libs/dynamiclibrary/includes;../../libs/Eigen/includes;../console/includes;../graphic_objects/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;AST_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
index c3d540c..375ccad 100644 (file)
@@ -27,25 +27,21 @@ void visitprivate(const AssignExp  &e)
         {
             // x = ?
             /*getting what to assign*/
-            InternalType *pIT = e.right_val_get();
-            if (pIT == NULL)
-            {
-                expected_size_set(1);
-                e.right_exp_get().accept(*this);
-
-                if (result_getSize() != 1)
-                {
-                    std::wostringstream os;
-                    os << L"Can not assign multiple value in a single variable" << std::endl;;
-                    //os << ((Location)e.right_exp_get().location_get()).location_getString() << std::endl;
-                    throw ScilabError(os.str(), 999, e.right_exp_get().location_get());
-                }
+            expected_size_set(1);
+            e.right_exp_get().accept(*this);
 
-                pIT = result_get();
-                //reset result
-                result_set(NULL);
+            if (result_getSize() != 1)
+            {
+                std::wostringstream os;
+                os << L"Can not assign multiple value in a single variable" << std::endl;;
+                //os << ((Location)e.right_exp_get().location_get()).location_getString() << std::endl;
+                throw ScilabError(os.str(), 999, e.right_exp_get().location_get());
             }
 
+            InternalType *pIT = result_get();
+
+            //reset result
+            result_set(NULL);
             if (pIT->isImplicitList())
             {
                 if (pIT->getAs<ImplicitList>()->isComputable())
@@ -113,14 +109,8 @@ void visitprivate(const AssignExp  &e)
             }
 
             /*getting what to assign*/
-            InternalType* pITR = e.right_val_get();
-            if (pITR == NULL)
-            {
-                e.right_exp_get().accept(*this);
-                pITR = result_get();
-                //reset result
-                result_set(NULL);
-            }
+            e.right_exp_get().accept(*this);
+            InternalType* pITR = result_get();
 
             if (pITR == NULL)
             {
@@ -130,6 +120,9 @@ void visitprivate(const AssignExp  &e)
                 throw ScilabError(os.str(), 999, e.left_exp_get().location_get());
             }
 
+            //reset result
+            result_set(NULL);
+
             if (pIT == NULL)
             {
                 //Var doesn't exist, create it with good dimensions
@@ -264,14 +257,8 @@ void visitprivate(const AssignExp  &e)
             }
 
             /*getting what to assign*/
-            InternalType* pITR = e.right_val_get();
-            if (pITR == NULL)
-            {
-                e.right_exp_get().accept(*this);
-                pITR = result_get();
-                //reset result
-                result_set(NULL);
-            }
+            e.right_exp_get().accept(*this);
+            InternalType* pITR = result_get();
 
             if (pITR == NULL)
             {
@@ -281,6 +268,9 @@ void visitprivate(const AssignExp  &e)
                 throw ScilabError(os.str(), 999, e.left_exp_get().location_get());
             }
 
+            //reset result
+            result_set(NULL);
+
             if (pIT == NULL)
             {
                 //Var doesn't exist, create it with good dimensions
@@ -300,7 +290,14 @@ void visitprivate(const AssignExp  &e)
             InternalType *pOut = NULL;
 
             //fisrt extract implicit list
-            if (pITR->isImplicitList())
+            if(pITR->isColon())
+            {
+                //double* pdbl = NULL;
+                //pITR = new Double(-1, -1, &pdbl);
+                //pdbl[0] = 1;
+                pITR = Double::Identity(-1, -1);
+            }
+            else if (pITR->isImplicitList())
             {
                 InternalType *pIL = pITR->getAs<ImplicitList>()->extractFullMatrix();
                 pITR = pIL;
@@ -508,18 +505,18 @@ void visitprivate(const AssignExp  &e)
                 {
                     pRet = pIT->getAs<Sparse>()->insert(pArgs, pInsert);
                 }
-                else if (pIT->isPoly() && pInsert->isDouble())
+                else if(pIT->isPoly() && pInsert->isDouble())
                 {
                     Polynom* pDest = pIT->getAs<Polynom>();
                     Double* pIns = pInsert->getAs<Double>();
                     Polynom* pP = new Polynom(pDest->getVariableName(), pIns->getDims(), pIns->getDimsArray());
                     pP->setComplex(pIns->isComplex());
 
-                    for (int idx = 0 ; idx < pP->getSize() ; idx++)
+                    for(int idx = 0 ; idx < pP->getSize() ; idx++)
                     {
                         double* pR = NULL;
                         double* pI = NULL;
-                        if (pP->isComplex())
+                        if(pP->isComplex())
                         {
                             SinglePoly* pS = new SinglePoly(&pR, &pI, 1);
                             double dblR = pIns->get(idx);
@@ -540,7 +537,7 @@ void visitprivate(const AssignExp  &e)
                     pRet = pIT->getAs<Polynom>()->insert(pArgs, pP);
                     delete pP;
                 }
-                else if (pIT->isPoly() && pInsert->isPoly())
+                else if(pIT->isPoly() && pInsert->isPoly())
                 {
                     pRet = pIT->getAs<Polynom>()->insert(pArgs, pInsert);
                 }
@@ -629,6 +626,32 @@ void visitprivate(const AssignExp  &e)
                 {
                     pRet = pIT->getAs<List>()->insert(pArgs, pInsert);
                 }
+                else if(pIT->isHandle())
+                {
+                    if(pArgs->size() == 1 && (*pArgs)[0]->isString())
+                    {//s(["x"])
+                        types::GraphicHandle* pH = pIT->getAs<types::GraphicHandle>();
+                        types::String *pS = (*pArgs)[0]->getAs<types::String>();
+                        typed_list in;
+                        typed_list out;
+                        optional_list opt;
+
+                        in.push_back(pH);
+                        in.push_back(pS);
+                        in.push_back(pInsert);
+
+                        Function* pCall = (Function*)symbol::Context::getInstance()->get(symbol::Symbol(L"set"));
+                        Callable::ReturnValue ret =  pCall->call(in, opt, 1, out, this);
+                        if(ret == Callable::OK)
+                        {
+                            pRet = pIT;
+                        }
+                    }
+                    else
+                    {
+                        pRet = pIT->getAs<types::GraphicHandle>()->extract(pArgs);
+                    }
+                }
                 else
                 {
                     //overloading
@@ -690,13 +713,13 @@ void visitprivate(const AssignExp  &e)
             {
                 if (bNew)
                 {
-                    if (pVar == NULL)
+                    if (pVar == NULL && pIT->isHandle() == false)
                     {
                         //is not a(x) = y but something like a.b(x) = y
                         //so we have to retrieve struct and children to assign new value
-                        InternalType *pHead = NULL;
-                        Struct* pMain       = NULL;
-                        Struct* pCurrent    = NULL;
+                        InternalType *pHead     = NULL;
+                        InternalType* pMain     = NULL;
+                        InternalType* pCurrent  = NULL;
                         bool bOK = getStructFromExp(&pCall->name_get(), &pMain, &pCurrent, NULL, pOut);
                         //change pOut only to toString call
                         pOut = pMain;
@@ -753,31 +776,36 @@ void visitprivate(const AssignExp  &e)
             int iLhsCount = (int)pList->exps_get().size();
 
             /*getting what to assign*/
-            T exec;
-            exec.expected_size_set(iLhsCount);
-            e.right_exp_get().accept(exec);
+            expected_size_set(iLhsCount);
+            e.right_exp_get().accept(*this);
 
-            if (exec.result_getSize() != iLhsCount)
+            if (result_getSize() != iLhsCount)
             {
                 std::wostringstream os;
-                os << L"Incompatible assignation: trying to assign " << exec.result_getSize();
+                os << L"Incompatible assignation: trying to assign " << result_getSize();
                 os << " values in " << iLhsCount << " variables." << std::endl;
                 throw ScilabError(os.str(), 999, e.right_exp_get().location_get());
             }
 
+
             std::list<Exp *>::const_reverse_iterator it;
             int i = (int)iLhsCount - 1;
             for (it = pList->exps_get().rbegin() ; it != pList->exps_get().rend() ; it++, i--)
             {
-                //create a new AssignExp and run it
-                AssignExp* pAssign = new AssignExp((*it)->location_get(), *(*it), *const_cast<Exp*>(&e.right_exp_get()), exec.result_get(i));
-                pAssign->set_verbose(e.is_verbose());
-                pAssign->accept(*this);
-
+                const SimpleVar *pListVar      = dynamic_cast<const SimpleVar*>((*it));
+                symbol::Context::getInstance()->put(pListVar->name_get(), *result_get(i));
+                if (e.is_verbose() && ConfigVariable::isPromptShow())
+                {
+                    std::wostringstream ostr;
+                    ostr << pListVar->name_get().name_get() << L"  = " << std::endl;
+                    ostr << std::endl;
+                    scilabWriteW(ostr.str().c_str());
+                    VariableToString(result_get(i));
+                }
                 //clear result to take care of [n,n]
-                exec.result_set(i, NULL);
+                result_set(i, NULL);
             }
-            exec.result_clear();
+            result_clear();
             return;
         }
 
@@ -785,61 +813,10 @@ void visitprivate(const AssignExp  &e)
         if (pField)
         {
             //a.b = x
-            //a.b can be a struct or a tlist/mlist
-            InternalType *pHead = NULL;
-            Struct* pMain       = NULL;
-            Struct* pCurrent    = NULL;
-
+            //a.b can be a struct or a tlist/mlist or a handle
             /*getting what to assign*/
             expected_size_set(1);
             e.right_exp_get().accept(*this);
-
-            const wstring *pstName = getStructNameFromExp(pField);
-            if (pstName)
-            {
-                InternalType* pCurrentStr = symbol::Context::getInstance()->getCurrentLevel(symbol::Symbol(*pstName));
-                InternalType* pHigherStr = symbol::Context::getInstance()->get(symbol::Symbol(*pstName));
-                if (pHigherStr && pCurrentStr == NULL)
-                {
-                    //struct come from higher scope, so we need to clone and put it in current scope
-                    InternalType *pITClone = pHigherStr->clone();
-                    symbol::Context::getInstance()->put(symbol::Symbol(*pstName), *pITClone);
-                }
-            }
-
-            bool bOK = getStructFromExp(pField, &pMain, &pCurrent, NULL, result_get());
-            if (pMain != NULL)
-            {
-                pHead = pMain;
-            }
-            else
-            {
-                //a is not a struct
-                const SimpleVar* pListVar =  dynamic_cast<const SimpleVar*>(pField->head_get());
-                if (pListVar == NULL)
-                {
-                    std::cout << "Houston ..." << std::endl;
-                }
-                pHead = symbol::Context::getInstance()->get(pListVar->name_get());
-            }
-
-            //if a is already assign, make a copy and replace it
-            if (pHead->isRef(1) == true)
-            {
-                pHead = pHead->clone();
-                pstName = getStructNameFromExp(pField);
-                symbol::Context::getInstance()->put(symbol::Symbol(*pstName), *pHead->clone());
-            }
-
-            //we can assign only one value
-            if (result_getSize() != 1)
-            {
-                std::wostringstream os;
-                os << L"Lhs != Rhs";
-                //os << ((Location)e.right_exp_get().location_get()).location_getString() << std::endl;
-                throw ScilabError(os.str(), 999, e.right_exp_get().location_get());
-            }
-
             InternalType *pIT = result_get();
             if (pIT->isImplicitList())
             {
@@ -858,32 +835,167 @@ void visitprivate(const AssignExp  &e)
                 //pIT = pIT->clone();
             }
 
-            //assign result to new field
-            const SimpleVar* pTail =  dynamic_cast<const SimpleVar*>(pField->tail_get());
-
-            if (pHead->isStruct())
+            //try to find struct or handle
             {
-                //@STRUCT
-                //fillStructFromExp(pField->tail_get(), pStr, 0, pIT);
-            }
-            else if (pHead->isTList())
-            {
-                TList* pT = pHead->getAs<TList>();
-                if (pT->exists(pTail->name_get().name_get()))
+                InternalType* pMain     = NULL;
+                InternalType* pCurrent  = NULL;
+                const Exp* pCurrentExp  = pField;
+  
+                const wstring *pstName  = getStructNameFromExp(pField);
+                if(pstName)
                 {
-                    pT->set(pTail->name_get().name_get(), pIT);
+                    InternalType* pCurrentStr = symbol::Context::getInstance()->getCurrentLevel(symbol::Symbol(*pstName));
+                    InternalType* pHigherStr = symbol::Context::getInstance()->get(symbol::Symbol(*pstName));
+                    if(pHigherStr && pHigherStr->isStruct() && pCurrentStr == NULL)
+                    {//struct come from higher scope, so we need to clone and put it in current scope
+                        InternalType *pITClone = pHigherStr->clone();
+                        symbol::Context::getInstance()->put(symbol::Symbol(*pstName), *pITClone);
+                    }
+                }
+                
+                bool bOK = getStructFromExp(pCurrentExp, &pMain, &pCurrent, NULL, pIT);
+                if(bOK)
+                {
+                    //someting was done
                 }
                 else
                 {
-                    std::wostringstream os;
-                    os << L"Field must be exist";
-                    throw ScilabError(os.str(), 999, pVar->location_get());
+                    //not a struct/handle but it can be a MList ou TList
+                    pField->head_get()->accept(*this);
+                    InternalType *pHead = result_get();
+
+                    if(pHead->isMList())
+                    {
+                        //TODO:
+                    }
+                    else if(pHead->isTList())
+                    {
+                        //assign result to new field
+                        const SimpleVar* pTail =  dynamic_cast<const SimpleVar*>(pField->tail_get());
+                        TList* pT = pHead->getAs<TList>();
+                        if (pT->exists(pTail->name_get().name_get()))
+                        {
+                            pT->set(pTail->name_get().name_get(), pIT);
+                        }
+                        else
+                        {
+                            std::wostringstream os;
+                            os << L"Field must be exist";
+                            throw ScilabError(os.str(), 999, pVar->location_get());
+                        }
+                    }
+                    else
+                    {
+                        std::wostringstream os;
+                        os << L"invalid operation";
+                        throw ScilabError(os.str(), 999, e.right_exp_get().location_get());
+                    }
                 }
             }
-            else if (pHead->isMList())
-            {
-                //TODO:
-            }
+
+            //if(pHead->isStruct() || pHead == NULL)
+            //{
+            //    InternalType* pMain     = NULL;
+            //    InternalType* pCurrent  = NULL;
+            //    const Exp* pCurrentExp  = pField;
+            //    const wstring *pstName  = getStructNameFromExp(pField);
+            //    if(pstName)
+            //    {
+            //        InternalType* pCurrentStr = symbol::Context::getInstance()->getCurrentLevel(symbol::Symbol(*pstName));
+            //        InternalType* pHigherStr = symbol::Context::getInstance()->get(symbol::Symbol(*pstName));
+            //        if(pHigherStr && pCurrentStr == NULL)
+            //        {//struct come from higher scope, so we need to clone and put it in current scope
+            //            InternalType *pITClone = pHigherStr->clone();
+            //            symbol::Context::getInstance()->put(symbol::Symbol(*pstName), *pITClone);
+            //        }
+            //    }
+
+            //    if(pHead != NULL)
+            //    {
+            //        pMain = pHead->getAs<Struct>();
+            //        pCurrentExp = pField->tail_get();
+            //    }
+
+            //    bool bOK = getStructFromExp(pCurrentExp, &pMain, &pCurrent, NULL, pIT);
+            //    if (pMain != NULL)
+            //    {
+            //        pHead = pMain;
+            //    }
+  
+            //    //if a is already assign, make a copy and replace it
+            //    if (pHead->isRef(1) == true)
+            //    {
+            //        pHead = pHead->clone();
+            //        pstName = getStructNameFromExp(pField);
+            //        symbol::Context::getInstance()->put(symbol::Symbol(*pstName), *pHead->clone());
+            //    }
+            //}
+            //else if(pHead->isMList())
+            //{
+            //    //TODO:
+            //}
+            //else if(pHead->isTList())
+            //{
+            //    //assign result to new field
+            //    const SimpleVar* pTail =  dynamic_cast<const SimpleVar*>(pField->tail_get());
+            //    TList* pT = pHead->getAs<TList>();
+            //    if (pT->exists(pTail->name_get().name_get()))
+            //    {
+            //        pT->set(pTail->name_get().name_get(), pIT);
+            //    }
+            //    else
+            //    {
+            //        std::wostringstream os;
+            //        os << L"Field must be exist";
+            //        throw ScilabError(os.str(), 999, pVar->location_get());
+            //    }
+            //}
+            //else if(pHead->isHandle())
+            //{
+            //    //parse head exp to create a list of "index" to call %x_i_h macro
+            //    //List* pList = getPropertyTree((Exp*)pField->tail_get(), new List());
+            //    //typed_list arg;
+            //    //arg.push_back(new Double(1));
+            //    //ListDelete* pDel = new ListDelete();
+            //    //pList->insert(&arg, pDel);
+            //    //delete pDel;
+            //    //delete arg[0];
+
+            //    //call overload %x_i_h
+            //    String* pS = new String(((SimpleVar*)pField->tail_get())->name_get().name_get().c_str());
+            //    std::wstring str = L"%" + pIT->getShortTypeStr() + L"_i_h";
+
+            //    typed_list in;
+            //    typed_list out;
+            //    optional_list opt;
+
+            //    in.push_back(pS);
+            //    in.push_back(pIT);
+            //    in.push_back(pHead);
+            //    pS->IncreaseRef();
+            //    pIT->IncreaseRef();
+            //    pHead->IncreaseRef();
+
+            //    Function* pCall = (Function*)symbol::Context::getInstance()->get(symbol::Symbol(str));
+            //    Callable::ReturnValue ret =  pCall->call(in, opt, 1, out, this);
+            //    //delete pS;
+
+            //    pS->DecreaseRef();
+            //    pIT->DecreaseRef();
+            //    pHead->DecreaseRef();
+            //    if(ret != Callable::OK)
+            //    {
+            //        std::wostringstream os;
+            //        os << L"unable to update handle";
+            //        throw ScilabError(os.str(), 999, e.right_exp_get().location_get());
+            //    }
+            //}
+            //else
+            //{
+            //    std::wostringstream os;
+            //    os << L"invalid operation";
+            //    throw ScilabError(os.str(), 999, e.right_exp_get().location_get());
+            //}
 
             if (e.is_verbose() && ConfigVariable::isPromptShow())
             {
index 995b077..77cef51 100644 (file)
@@ -28,12 +28,34 @@ void visitprivate(const CallExp &e)
         types::Callable *pCall = pIT->getAs<types::Callable>();
         types::typed_list out;
         types::typed_list in;
+        types::optional_list opt;
 
         int iRetCount = expected_getSize();
 
         //get function arguments
         for (itExp = e.args_get().begin (); itExp != e.args_get().end (); ++itExp)
         {
+            AssignExp* pAssign = dynamic_cast<AssignExp*>(*itExp);
+            if(pAssign)
+            {
+                //optional parameter
+                Exp* pL = &pAssign->left_exp_get();
+                SimpleVar* pVar = dynamic_cast<SimpleVar*>(pL);
+                if(pVar == NULL)
+                {
+                    std::wostringstream os;
+                    os << L"left side of optional parameter must be a variable" << std::endl;
+                    throw ScilabError(os.str(), 999, e.location_get());
+                }
+
+                Exp* pR = &pAssign->right_exp_get();
+                pR->accept (*this);
+                InternalType* pITR = result_get();
+
+                opt.push_back(std::pair<std::wstring, InternalType*>(pVar->name_get().name_get(), pITR));
+                continue;
+            }
+
             expected_size_set(1);
             (*itExp)->accept (*this);
 
@@ -80,7 +102,7 @@ void visitprivate(const CallExp &e)
             expected_size_set(iSaveExpectedSize);
             iRetCount = Max(1, iRetCount);
 
-            types::Function::ReturnValue Ret = pCall->call(in, iRetCount, out, this);
+            types::Function::ReturnValue Ret = pCall->call(in, opt, iRetCount, out, this);
             expected_size_set(iSaveExpectedSize);
 
             result_clear();
@@ -505,6 +527,33 @@ void visitprivate(const CallExp &e)
                     {
                         pOut = pIT->getAs<types::Struct>()->extract(pArgs);
                     }
+                    break;
+                }
+            case types::InternalType::RealHandle :
+                {
+                    if(pArgs->size() == 1 && (*pArgs)[0]->isString())
+                    {//s(["x"])
+                        types::GraphicHandle* pH = pIT->getAs<types::GraphicHandle>();
+                        types::String *pS = (*pArgs)[0]->getAs<types::String>();
+                        typed_list in;
+                        typed_list out;
+                        optional_list opt;
+
+                        in.push_back(pS);
+                        in.push_back(pH);
+
+                        Function* pCall = (Function*)symbol::Context::getInstance()->get(symbol::Symbol(L"%h_e"));
+                        Callable::ReturnValue ret =  pCall->call(in, opt, 1, out, this);
+                        if(ret == Callable::OK)
+                        {
+                            pOut = out[0];
+                        }
+                    }
+                    else
+                    {
+                        pOut = pIT->getAs<types::GraphicHandle>()->extract(pArgs);
+                    }
+                    break;
                 }
                 default :
                     break;
index a04f5b3..ca74807 100644 (file)
@@ -40,6 +40,7 @@ extern "C" {
 #include "matrix_transpose.h"
 #include "os_swprintf.h"
 #include "more.h"
+//#include "HandleManagement.h"
 }
 
 #include "timer.hxx"
@@ -549,6 +550,24 @@ public :
                 throw ScilabError(szError, 999, e.location_get());
             }
         }
+        else if(result_get() != NULL && result_get()->isHandle())
+        {
+            SimpleVar *psvRightMember = dynamic_cast<SimpleVar *>(const_cast<Exp *>(e.tail_get()));
+            typed_list in;
+            typed_list out;
+            optional_list opt;
+
+            String* pField = new String(psvRightMember->name_get().name_get().c_str());
+            in.push_back(pField);
+            in.push_back(result_get());
+
+            Function* pCall = (Function*)symbol::Context::getInstance()->get(symbol::Symbol(L"%h_e"));
+            Callable::ReturnValue ret =  pCall->call(in, opt, 1, out, this);
+            if(ret == Callable::OK)
+            {
+                result_set(out[0]);
+            }
+        }
         else
         {
             wchar_t szError[bsiz];
@@ -1062,15 +1081,16 @@ public :
                     if (result_get()->isCallable()) //to manage call without ()
                     {
                         Callable *pCall = ((InternalType*)result_get())->getAs<Callable>();
-                        types::typed_list out;
-                        types::typed_list in;
+                        typed_list out;
+                        typed_list in;
+                        optional_list opt;
 
                         try
                         {
                             //in this case of calling, we can return only one values
                             int iSaveExpectedSize = expected_getSize();
                             expected_size_set(1);
-                            Function::ReturnValue Ret = pCall->call(in, expected_getSize(), out, this);
+                            Function::ReturnValue Ret = pCall->call(in, opt, expected_getSize(), out, this);
                             expected_size_set(iSaveExpectedSize);
 
                             if (Ret == Callable::OK)
@@ -1645,7 +1665,7 @@ public :
 
     void VariableToString(types::InternalType* pIT)
     {
-        if (pIT->isMList() || pIT->isTList())
+        if (pIT->isMList() || pIT->isTList() || pIT->hasToString() == false)
         {
             //call overload %type_p
             std::wostringstream ostr;
index e0b6eea..a89491a 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "internal.hxx"
 #include "struct.hxx"
+#include "list.hxx"
 #include "exp.hxx"
 
 #define bsiz   4096
@@ -40,9 +41,11 @@ EXTERN_AST types::InternalType* AddElementToVariableFromRow(
 
 EXTERN_AST const std::wstring* getStructNameFromExp(const ast::Exp* _pExp);
 
-EXTERN_AST bool getStructFromExp(const ast::Exp* _pExp, types::Struct** _pMain, types::Struct** _pCurrent, types::typed_list** _pArgs, types::InternalType* _pIT);
-EXTERN_AST bool fillStructFromExp(const ast::Exp* _pExp, types::Struct* _pStr, int _iIndex, types::InternalType* _pIT);
+EXTERN_AST bool getStructFromExp(const ast::Exp* _pExp, types::InternalType** _pMain, types::InternalType** _pCurrent, types::typed_list** _pArgs, types::InternalType* _pIT);
 
 EXTERN_AST void callOnPrompt(void);
 
+EXTERN_AST types::List* getPropertyTree(ast::Exp* e, types::List* pList);
+
+
 #endif //!AST_VISITOR_COMMON_HXX
index e270753..1b2bc1e 100644 (file)
@@ -298,6 +298,9 @@ types::InternalType* AddElementToVariable(types::InternalType* _poDest, types::I
             case types::InternalType::RealImplicitList :
                 poResult = new types::ImplicitList();
                 break;
+            case types::GenericType::RealHandle :
+                poResult = new types::GraphicHandle(_iRows, _iCols);
+                break;
             default :
                 // FIXME What should we do here ...
                 break;
@@ -531,6 +534,9 @@ types::InternalType* AddElementToVariable(types::InternalType* _poDest, types::I
                 }
                 break;
             }
+            case types::GenericType::RealHandle :
+                poResult->getAs<types::GraphicHandle>()->append(iCurRow, iCurCol, _poSource->getAs<types::GraphicHandle>());
+                break;
             default:
                 break;
         }
@@ -567,30 +573,7 @@ const std::wstring* getStructNameFromExp(const Exp* _pExp)
     return NULL;
 }
 
-bool fillStructFromExp(const Exp* _pExp, types::Struct* _pStr, int _iIndex, types::InternalType* _pIT)
-{
-    const SimpleVar* pVar =  dynamic_cast<const SimpleVar*>(_pExp);
-    const CallExp* pCall =  dynamic_cast<const CallExp*>(_pExp);
-    const FieldExp* pField =  dynamic_cast<const FieldExp*>(_pExp);
-
-    if (pVar)
-    {
-        //x.a = y
-        _pStr->addField(pVar->name_get().name_get());
-        _pStr->get(_iIndex)->set(pVar->name_get().name_get(), _pIT);
-    }
-    else if (pCall)
-    {
-    }
-    else
-    {
-        int a = 1;
-    }
-
-    return true;
-}
-
-bool getStructFromExp(const Exp* _pExp, types::Struct** _pMain, types::Struct** _pCurrent, typed_list** _pArgs, types::InternalType* _pIT)
+bool getStructFromExp(const Exp* _pExp, types::InternalType** _pMain, types::InternalType** _pCurrent, typed_list** _pArgs, types::InternalType* _pIT)
 {
     const FieldExp* pField      = dynamic_cast<const FieldExp*>(_pExp);
     const SimpleVar* pVar       = dynamic_cast<const SimpleVar*>(_pExp);
@@ -602,119 +585,266 @@ bool getStructFromExp(const Exp* _pExp, types::Struct** _pMain, types::Struct**
         //y.x
 
         //evaluate head "y"
-        typed_list *pArgs   = NULL;
-        Struct* pMain       = *_pMain;
-        Struct* pCurrent    = *_pCurrent;
+        typed_list *pArgs       = NULL;
+        InternalType* pMain     = *_pMain;
+        InternalType* pCurrent  = *_pCurrent;
 
         bool bOK = getStructFromExp(pField->head_get(), &pMain, &pCurrent, &pArgs, NULL);
         if (bOK)
         {
             pVar    = dynamic_cast<const SimpleVar*>(pField->tail_get());
 
-            //clone _pIT BEFORE addField in case of st.b = st
-            types::InternalType* pIT = _pIT ? _pIT->clone() : NULL;
-
-            //create field "x"
-            std::wstring var = pVar->name_get().name_get();
-            bool bOK = pCurrent->addField(pVar->name_get().name_get());
-            if (*_pMain == NULL && _pIT != NULL)
+            if(pCurrent->isStruct())
             {
-                //first stack, assign value to field and return main structure
-
-                if (pArgs != NULL)
+                Struct* pCurStr = pCurrent->getAs<Struct>();
+                //clone _pIT BEFORE addField in case of st.b = st
+                types::InternalType* pIT = _pIT ? _pIT->clone() : NULL;
+
+                //create field "x"
+                std::wstring var = pVar->name_get().name_get();
+                bool bOK = pCurStr->addField(pVar->name_get().name_get());
+                if (*_pMain == NULL && _pIT != NULL)
                 {
-                    //args returned by "parent"
-                    std::wstring var = pVar->name_get().name_get();
-                    //be careful, extract functions copy values
+                    //first stack, assign value to field and return main structure
 
-                    Struct *pStr = pCurrent->extractWithoutClone(pArgs)->getAs<Struct>();
-                    pStr->setCloneInCopyValue(false);
-                    SingleStruct* pSS = pStr->get(0);
-                    pSS->set(pVar->name_get().name_get(), pIT);
-                    pSS->IncreaseRef();
-                    delete pStr;
-                    pSS->DecreaseRef();
-                }
-                else if (_pArgs == NULL || *_pArgs == NULL)
-                {
-                    std::wstring var = pVar->name_get().name_get();
-                    //std::wcout << var << L" <- " << pIT->getTypeStr() << std::endl;
-                    pCurrent->get(0)->set(pVar->name_get().name_get(), pIT);
+                    if (pArgs != NULL && pArgs->size() != 0)
+                    {
+                        //args returned by "parent"
+                        std::wstring var = pVar->name_get().name_get();
+                        //be careful, extract functions copy values
+
+                        Struct *pStr = pCurStr->extractWithoutClone(pArgs)->getAs<Struct>();
+                        pStr->setCloneInCopyValue(false);
+                        SingleStruct* pSS = pStr->get(0);
+                        pSS->set(pVar->name_get().name_get(), pIT);
+                        pSS->IncreaseRef();
+                        delete pStr;
+                        pSS->DecreaseRef();
+                    }
+                    else if (_pArgs == NULL || *_pArgs == NULL)
+                    {
+                        std::wstring var = pVar->name_get().name_get();
+                        //std::wcout << var << L" <- " << pIT->getTypeStr() << std::endl;
+                        pCurStr->get(0)->set(pVar->name_get().name_get(), pIT);
+                    }
+                    else
+                    {
+                        Struct* pStr = new Struct(1, 1);
+                        std::wstring var = pVar->name_get().name_get();
+                        pStr->addField(pVar->name_get().name_get());
+                        pStr->get(0)->set(pVar->name_get().name_get(), pIT);
+                        pCurStr->insertWithoutClone(*_pArgs, pStr->get(0));
+                        delete pStr;
+                    }
                 }
                 else
                 {
-                    Struct* pStr = new Struct(1, 1);
-                    std::wstring var = pVar->name_get().name_get();
-                    pStr->addField(pVar->name_get().name_get());
-                    pStr->get(0)->set(pVar->name_get().name_get(), pIT);
-                    pCurrent->insertWithoutClone(*_pArgs, pStr->get(0));
-                    delete pStr;
+                    //y.x.w
+                    //in this case, we are in the middle of expression
+                    //we know that "x" is a struct but we can't assign value yet
+                    //so assign empty struct and return new pCurrent
+                    Struct* pStr = NULL;
+
+                    /*try to extract field*/
+                    if (pArgs == NULL)
+                    {
+                        //without extract argument
+                        pStr = pCurStr->get(0)->get(pVar->name_get().name_get())->getAs<Struct>();
+                    }
+                    else
+                    {
+                        Struct* pStepStr = pCurStr->extractWithoutClone(pArgs)->getAs<Struct>();
+                        pStepStr->setCloneInCopyValue(false);
+                        SingleStruct* pSS = pStepStr->get(0);
+                        pStr = pSS->get(pVar->name_get().name_get())->getAs<Struct>();
+                        //we can delete pStepStr without deleted its fields
+                        pSS->IncreaseRef();
+                        delete pStepStr;
+                        pSS->DecreaseRef();
+                    }
+
+                    if (pStr == NULL)
+                    {
+                        //new field or not struct field
+                        if (_pArgs == NULL || *_pArgs == NULL)
+                        {
+                            pStr = new Struct(1, 1);
+                        }
+                        else
+                        {
+                            Struct* p = new Struct(1, 1);
+                            pStr = Struct::insertNew(*_pArgs, p)->getAs<Struct>();
+                            delete p;
+                        }
+
+                        if (pArgs != NULL)
+                        {
+                            std::wstring var = pVar->name_get().name_get();
+
+                            Struct* pStepStr = pCurStr->extractWithoutClone(pArgs)->getAs<Struct>();
+                            pStepStr->setCloneInCopyValue(false);
+                            SingleStruct* pSS = pStepStr->get(0);
+                            pSS->set(pVar->name_get().name_get(), pStr);
+                            pSS->IncreaseRef();
+                            delete pStepStr;
+                            pSS->DecreaseRef();
+                        }
+                        else
+                        {
+                            std::wstring var = pVar->name_get().name_get();
+                            pCurStr->get(0)->set(pVar->name_get().name_get(), pStr);
+                        }
+                    }
+
+                    pCurrent = pStr;
                 }
+
+                *_pMain = pMain;
+                *_pCurrent = pCurrent;
             }
-            else
+            else //handle
             {
-                //y.x.w
-                //in this case, we are in the middle of expression
-                //we know that "x" is a struct but we can't assign value yet
-                //so assign empty struct and return new pCurrent
-                Struct* pStr = NULL;
-
-                /*try to extract field*/
-                if (pArgs == NULL)
+                String* pTail = new String(pVar->name_get().name_get().c_str());
+                if(_pArgs != NULL && *_pArgs == NULL)
                 {
-                    //without extract argument
-                    pStr = pCurrent->get(0)->get(pVar->name_get().name_get())->getAs<Struct>();
+                    *_pArgs = new typed_list;
+                    pArgs = *_pArgs;
                 }
-                else
+                else if(pArgs == NULL)
                 {
-                    Struct* pStepStr = pCurrent->extractWithoutClone(pArgs)->getAs<Struct>();
-                    pStepStr->setCloneInCopyValue(false);
-                    SingleStruct* pSS = pStepStr->get(0);
-                    pStr = pSS->get(pVar->name_get().name_get())->getAs<Struct>();
-                    //we can delete pStepStr without deleted its fields
-                    pSS->IncreaseRef();
-                    delete pStepStr;
-                    pSS->DecreaseRef();
+                    pArgs = new typed_list;
                 }
 
-                if (pStr == NULL)
+                if(pArgs)
                 {
-                    //new field or not struct field
-                    if (_pArgs == NULL || *_pArgs == NULL)
+                    pArgs->push_back(pTail);
+                    if(_pIT == NULL)
+                    {
+                        //let caller work
+
+                        //try to extract, if extract work, clear args and flag we need set operation after.
+                        GraphicHandle* pCurH = pCurrent->getAs<GraphicHandle>();
+                        typed_list in;
+                        typed_list out;
+                        optional_list opt;
+                        ExecVisitor exec;
+
+                        if(pArgs->size() == 1)
+                        {
+                            in.push_back((*pArgs)[0]);
+                        }
+                        else
+                        {
+                            List* pList = new List();
+                            for(int i = 0 ; i < pArgs->size() ; i++)
+                            {
+                                pList->append((*pArgs)[i]);
+                            }
+                            in.push_back(pList);
+                        }
+
+                        in.push_back(pMain);
+                        in.front()->IncreaseRef();
+                        pMain->IncreaseRef();
+
+                        Function* pCall = (Function*)symbol::Context::getInstance()->get(symbol::Symbol(L"%h_e"));
+                        Callable::ReturnValue ret =  pCall->call(in, opt, 1, out, &exec);
+
+                        in.front()->DecreaseRef();
+                        pMain->DecreaseRef();
+
+                        if(in.front()->isList())
+                        {
+                            //delete pList
+                            delete in.front();
+                        }
+
+                        if(ret != Callable::OK)
+                        {
+                            std::wostringstream os;
+                            os << L"unable to update handle";
+                            throw ScilabError(os.str(), 999, pField->location_get());
+                        }
+
+                        if(out[0]->isHandle() || out[0]->isStruct())
+                        {
+                            *_pCurrent = out[0];
+                            (*_pCurrent)->IncreaseRef();
+
+                            //clean *_pArgs to do nt extract previons fields
+                            if(_pArgs && *_pArgs)
+                            {
+                                (*_pArgs)->clear();
+                            }
+
+                        }
+                        else
+                        {
+                            *_pCurrent = pCurrent;
+                        }
+
+                        *_pMain = pMain;
+                        return true;
+                    }
+
+                    //call %x_i_h
+                    GraphicHandle* pCurH = pCurrent->getAs<GraphicHandle>();
+                    typed_list in;
+                    typed_list out;
+                    optional_list opt;
+                    ExecVisitor exec;
+
+
+                    if(pArgs->size() == 1)
                     {
-                        pStr = new Struct(1, 1);
+                        in.push_back((*pArgs)[0]);
                     }
                     else
                     {
-                        Struct* p = new Struct(1, 1);
-                        pStr = Struct::insertNew(*_pArgs, p)->getAs<Struct>();
-                        delete p;
+                        List* pList = new List();
+                        for(int i = 0 ; i < pArgs->size() ; i++)
+                        {
+                            pList->append((*pArgs)[i]);
+                        }
+                        in.push_back(pList);
                     }
 
-                    if (pArgs != NULL)
-                    {
-                        std::wstring var = pVar->name_get().name_get();
+                    std::wstring str = L"%" + _pIT->getShortTypeStr() + L"_i_h";
 
-                        Struct* pStepStr = pCurrent->extractWithoutClone(pArgs)->getAs<Struct>();
-                        pStepStr->setCloneInCopyValue(false);
-                        SingleStruct* pSS = pStepStr->get(0);
-                        pSS->set(pVar->name_get().name_get(), pStr);
-                        pSS->IncreaseRef();
-                        delete pStepStr;
-                        pSS->DecreaseRef();
+                    in.push_back(_pIT);
+                    in.push_back(pMain);
+                    in.front()->IncreaseRef();
+                    _pIT->IncreaseRef();
+                    pMain->IncreaseRef();
+
+                    Function* pCall = (Function*)symbol::Context::getInstance()->get(symbol::Symbol(str));
+                    Callable::ReturnValue ret =  pCall->call(in, opt, 1, out, &exec);
+                    in.front()->DecreaseRef();
+                    //_pIT->DecreaseRef();
+                    pMain->DecreaseRef();
+
+                    if(in.front()->isList())
+                    {
+                        //delete pList
+                        delete in.front();
                     }
-                    else
+
+                    if(ret != Callable::OK)
                     {
-                        std::wstring var = pVar->name_get().name_get();
-                        pCurrent->get(0)->set(pVar->name_get().name_get(), pStr);
+                        std::wostringstream os;
+                        os << L"unable to update handle";
+                        throw ScilabError(os.str(), 999, pField->location_get());
                     }
                 }
-
-                pCurrent = pStr;
+                else
+                {
+                    std::wostringstream os;
+                    os << L"impossible !";
+                    throw ScilabError(os.str(), 999, pField->location_get());
+                }
+                
             }
 
-            *_pMain = pMain;
-            *_pCurrent = pCurrent;
 
             //clean pArgs return by getStructFromExp
             for (int iArg = 0 ; pArgs != NULL && iArg < pArgs->size() ; iArg++)
@@ -735,9 +865,13 @@ bool getStructFromExp(const Exp* _pExp, types::Struct** _pMain, types::Struct**
     else if (pVar)
     {
         //a.x : with x not only a SimpleVar
-        types::Struct *pStr = NULL;
+        types::InternalType *pStr = NULL;
         types::InternalType *pIT = symbol::Context::getInstance()->get(pVar->name_get());
-        if (pIT == NULL || pIT->isStruct() == false)
+        if (pIT == NULL || 
+            (   pIT->isStruct() == false && 
+                pIT->isHandle() == false && 
+                pIT->isMList() == false && 
+                pIT->isTList() == false))
         {
             //"a" doest not exist or it is another type, create it with size 1,1 and return it
             //create new structure variable
@@ -761,13 +895,13 @@ bool getStructFromExp(const Exp* _pExp, types::Struct** _pMain, types::Struct**
             //Add variable to scope
             symbol::Context::getInstance()->put(pVar->name_get(), *pStr);
         }
-        else if (pIT->isStruct() == false)
+        else if(pIT->isHandle() || pIT->isStruct())
         {
-            return false;
+            pStr = pIT;
         }
         else
-        {
-            pStr = pIT->getAs<Struct>();
+        {//TList or MList, work will be done outside
+            return false;
         }
 
         if (*_pMain == NULL)
@@ -781,7 +915,7 @@ bool getStructFromExp(const Exp* _pExp, types::Struct** _pMain, types::Struct**
     {
         //a(x,y)
         ExecVisitor execMe;
-        Struct* pCurrent = NULL;
+        InternalType* pCurrent = NULL;
 
         typed_list *pCurrentArgs = execMe.GetArgumentList(pCall->args_get());
         typed_list *pReturnedArgs = NULL;
@@ -811,76 +945,94 @@ bool getStructFromExp(const Exp* _pExp, types::Struct** _pMain, types::Struct**
 
                 wchar_t* pFieldName = pS->get(0);
 
-                Struct* pStr = NULL;
-                if (pReturnedArgs && (*pReturnedArgs)[0]->isString() == false)
-                {
-                    pStr = pCurrent->extractWithoutClone(pReturnedArgs)->getAs<Struct>();
-                    pStr->setCloneInCopyValue(false);
-                }
-                else
+
+                if(pCurrent->isStruct())
                 {
-                    pStr = pCurrent;
-                }
+                    Struct* pStr = NULL;
+                    Struct *pCurStr = pCurrent->getAs<Struct>();
+                    if (pReturnedArgs && (*pReturnedArgs)[0]->isString() == false)
+                    {
+                        pStr = pCurStr->extractWithoutClone(pReturnedArgs)->getAs<Struct>();
+                        pStr->setCloneInCopyValue(false);
+                    }
+                    else
+                    {
+                        pStr = pCurStr;
+                    }
 
-                SingleStruct* pSS = pStr->get(0);
+                    SingleStruct* pSS = pStr->get(0);
 
-                //check if field already exists
-                if (pStr->exists(pFieldName))
-                {
-                    InternalType* pField = pSS->get(pFieldName);
-                    if (pField->isStruct())
+                    //check if field already exists
+                    if (pStr->exists(pFieldName))
                     {
-                        pStr = pField->getAs<Struct>();
+                        InternalType* pField = pSS->get(pFieldName);
+                        if (pField->isStruct())
+                        {
+                            pStr = pField->getAs<Struct>();
+                        }
+                        else
+                        {
+                            //erase previous value by a struct(1,1)
+                            pSS->set(pFieldName, new Struct(1, 1));
+                            pStr = pSS->get(pFieldName)->getAs<Struct>();
+                        }
                     }
                     else
                     {
-                        //erase previous value by a struct(1,1)
+                        //field does not exist
+                        pCurStr->addField(pFieldName);
                         pSS->set(pFieldName, new Struct(1, 1));
-                        pStr = pSS->get(pFieldName)->getAs<Struct>();
+                        pCurrent = pSS->get(pFieldName);
                     }
-                }
-                else
-                {
-                    //field does not exist
-                    pCurrent->addField(pFieldName);
-                    pSS->set(pFieldName, new Struct(1, 1));
-                    pCurrent = pSS->get(pFieldName)->getAs<Struct>();
-                }
-
-                if (pReturnedArgs && (*pReturnedArgs)[0]->isString() == false)
-                {
-                    pSS->IncreaseRef();
-                    delete pStr;
-                    pSS->DecreaseRef();
 
-                    //clean pReturnedArgs return by GetArgumentList
-                    for (int iArg = 0 ; iArg < pReturnedArgs->size() ; iArg++)
+                    if (pReturnedArgs && (*pReturnedArgs)[0]->isString() == false)
                     {
-                        if ((*pReturnedArgs)[iArg]->isDeletable())
+                        pSS->IncreaseRef();
+                        delete pStr;
+                        pSS->DecreaseRef();
+
+                        //clean pReturnedArgs return by GetArgumentList
+                        for (int iArg = 0 ; iArg < pReturnedArgs->size() ; iArg++)
                         {
-                            delete (*pReturnedArgs)[iArg];
+                            if ((*pReturnedArgs)[iArg]->isDeletable())
+                            {
+                                delete (*pReturnedArgs)[iArg];
+                            }
                         }
+                        delete pReturnedArgs;
                     }
-                    delete pReturnedArgs;
+                }
+                else
+                {//handle
+                    GraphicHandle* pCurH = pCurrent->getAs<GraphicHandle>();
                 }
             }
             else
             {
                 /*try to extract sub struct, if it fails, resize the struct and try again*/
-                InternalType* pIT = pCurrent->extract(pCurrentArgs);
-                if (pIT == NULL)
+                if(pCurrent->isStruct())
                 {
-                    //fail to extract, pCurrent is not enough big, resize it !
-                    Struct* p = new Struct(1, 1);
-                    pCurrent->insert(pCurrentArgs, p); //insert empty struct, caller will assign the good value
-                    delete p;
+                    Struct* pCurStr = pCurrent->getAs<Struct>();
+                    InternalType* pIT = pCurStr->extract(pCurrentArgs);
+                    if (pIT == NULL)
+                    {
+                        //fail to extract, pCurrent is not enough big, resize it !
+                        Struct* p = new Struct(1, 1);
+                        pCurStr->insert(pCurrentArgs, p); //insert empty struct, caller will assign the good value
+                        delete p;
+                    }
+                    else
+                    {
+                        delete pIT;
+                    }
+
+                    *_pArgs = pCurrentArgs;
                 }
                 else
                 {
-                    delete pIT;
+                    //handle
+                    GraphicHandle* pCurH = pCurrent->getAs<GraphicHandle>();
                 }
-
-                *_pArgs = pCurrentArgs;
             }
         }
         else
@@ -912,7 +1064,57 @@ void callOnPrompt(void)
     {
         types::typed_list in;
         types::typed_list out;
+        types::optional_list opt;
         ExecVisitor execCall;
-        pOnPrompt->getAs<types::Callable>()->call(in, 1, out, &execCall);
+        pOnPrompt->getAs<types::Callable>()->call(in, opt, 1, out, &execCall);
     }
 }
+
+List* getPropertyTree(Exp* e, List* pList)
+{
+
+    //a.b
+    SimpleVar* pVar = dynamic_cast<SimpleVar*>(e);
+    if(pVar)
+    {
+        pList->append(new String(pVar->name_get().name_get().c_str()));
+        return pList;
+    }
+
+    //a(x).b
+    CallExp* pCall = dynamic_cast<CallExp*>(e);
+    if(pCall)
+    {
+        pList = getPropertyTree(&pCall->name_get(), pList);
+        ExecVisitor exec;
+        std::list<Exp*> l = pCall->args_get();
+        std::list<Exp*>::const_iterator it;
+        for(it = l.begin() ; it != l.end() ; it++)
+        {
+            Exp* pArg = (*it);
+            try
+            {
+                pArg->accept(exec);
+                pList->append(exec.result_get());
+                exec.result_clear();
+            }
+            catch(ScilabException e)
+            {
+                throw e;
+            }
+        }
+
+        return pList;
+    }
+
+    //a.b.c
+    FieldExp* pField = dynamic_cast<FieldExp*>(e);
+    if(pField)
+    {
+        pList = getPropertyTree(pField->head_get(), pList);
+        pList = getPropertyTree(pField->tail_get(), pList);
+        return pList;
+    }
+
+    return pList;
+}
\ No newline at end of file
index fb09e8a..a391bfe 100644 (file)
@@ -40,8 +40,6 @@ src/c/stackinfo.c \
 src/c/InitializeCore.c \
 src/c/TerminateCore.c \
 src/c/coretable.c \
-src/c/returnProperty.c \
-src/c/returnPropertyList.c \
 src/c/GetXmlFileEncoding.c \
 src/c/islittleendian.c \
 src/c/terme.c \
index 6e47f4b..738ab3e 100644 (file)
@@ -157,7 +157,6 @@ am__libscicore_algo_la_SOURCES_DIST = src/c/inffic.c src/c/cs2st.c \
        src/c/returnanan.c src/c/LoadFunctionsTab.c \
        src/c/loadversion.c src/c/version.c src/c/stackinfo.c \
        src/c/InitializeCore.c src/c/TerminateCore.c src/c/coretable.c \
-       src/c/returnProperty.c src/c/returnPropertyList.c \
        src/c/GetXmlFileEncoding.c src/c/islittleendian.c \
        src/c/terme.c src/c/ifexpr.c src/c/getcommandlineargs.c \
        src/c/callFunctionFromGateway.c src/c/getvariablesname.c \
@@ -231,8 +230,6 @@ am__objects_2 = libscicore_algo_la-inffic.lo \
        libscicore_algo_la-InitializeCore.lo \
        libscicore_algo_la-TerminateCore.lo \
        libscicore_algo_la-coretable.lo \
-       libscicore_algo_la-returnProperty.lo \
-       libscicore_algo_la-returnPropertyList.lo \
        libscicore_algo_la-GetXmlFileEncoding.lo \
        libscicore_algo_la-islittleendian.lo \
        libscicore_algo_la-terme.lo libscicore_algo_la-ifexpr.lo \
@@ -650,7 +647,6 @@ CORE_C_SOURCES = src/c/inffic.c src/c/cs2st.c src/c/intmacr2tree.c \
        src/c/returnanan.c src/c/LoadFunctionsTab.c \
        src/c/loadversion.c src/c/version.c src/c/stackinfo.c \
        src/c/InitializeCore.c src/c/TerminateCore.c src/c/coretable.c \
-       src/c/returnProperty.c src/c/returnPropertyList.c \
        src/c/GetXmlFileEncoding.c src/c/islittleendian.c \
        src/c/terme.c src/c/ifexpr.c src/c/getcommandlineargs.c \
        src/c/callFunctionFromGateway.c src/c/getvariablesname.c \
@@ -1093,8 +1089,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-predef.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-readGateway.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-recursionFunction.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-returnProperty.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-returnPropertyList.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-returnanan.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-runner.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-scimem.Plo@am__quote@
@@ -1418,20 +1412,6 @@ libscicore_algo_la-coretable.lo: src/c/coretable.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-coretable.lo `test -f 'src/c/coretable.c' || echo '$(srcdir)/'`src/c/coretable.c
 
-libscicore_algo_la-returnProperty.lo: src/c/returnProperty.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-returnProperty.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-returnProperty.Tpo -c -o libscicore_algo_la-returnProperty.lo `test -f 'src/c/returnProperty.c' || echo '$(srcdir)/'`src/c/returnProperty.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-returnProperty.Tpo $(DEPDIR)/libscicore_algo_la-returnProperty.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/returnProperty.c' object='libscicore_algo_la-returnProperty.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-returnProperty.lo `test -f 'src/c/returnProperty.c' || echo '$(srcdir)/'`src/c/returnProperty.c
-
-libscicore_algo_la-returnPropertyList.lo: src/c/returnPropertyList.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-returnPropertyList.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-returnPropertyList.Tpo -c -o libscicore_algo_la-returnPropertyList.lo `test -f 'src/c/returnPropertyList.c' || echo '$(srcdir)/'`src/c/returnPropertyList.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-returnPropertyList.Tpo $(DEPDIR)/libscicore_algo_la-returnPropertyList.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/returnPropertyList.c' object='libscicore_algo_la-returnPropertyList.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-returnPropertyList.lo `test -f 'src/c/returnPropertyList.c' || echo '$(srcdir)/'`src/c/returnPropertyList.c
-
 libscicore_algo_la-GetXmlFileEncoding.lo: src/c/GetXmlFileEncoding.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-GetXmlFileEncoding.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-GetXmlFileEncoding.Tpo -c -o libscicore_algo_la-GetXmlFileEncoding.lo `test -f 'src/c/GetXmlFileEncoding.c' || echo '$(srcdir)/'`src/c/GetXmlFileEncoding.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-GetXmlFileEncoding.Tpo $(DEPDIR)/libscicore_algo_la-GetXmlFileEncoding.Plo
index a13fb32..9a04f72 100644 (file)
@@ -283,8 +283,6 @@ cd ..
     <ClCompile Include="readGateway.c" />
     <ClCompile Include="recursionFunction.c" />
     <ClCompile Include="returnanan.c" />
-    <ClCompile Include="returnProperty.c" />
-    <ClCompile Include="returnPropertyList.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_arg.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_clearfun.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_clearglobal.c" />
@@ -534,8 +532,6 @@ cd ..
     <ClInclude Include="..\..\includes\realmain.h" />
     <ClInclude Include="..\..\includes\recursionFunction.h" />
     <ClInclude Include="..\..\includes\returnanan.h" />
-    <ClInclude Include="..\..\includes\returnProperty.h" />
-    <ClInclude Include="..\..\includes\returnPropertyList.h" />
     <ClInclude Include="..\..\includes\runner.hxx" />
     <ClInclude Include="..\..\includes\scilabDefaults.h" />
     <ClInclude Include="..\..\includes\scimem.h" />
index 666a549..636917e 100644 (file)
     <ClCompile Include="returnanan.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="returnProperty.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="returnPropertyList.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_clearfun.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClInclude Include="..\..\includes\returnanan.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\returnProperty.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="..\..\includes\returnPropertyList.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\includes\runner.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
diff --git a/scilab/modules/core/src/c/returnProperty.c b/scilab/modules/core/src/c/returnProperty.c
deleted file mode 100644 (file)
index 8539ae7..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Scilab (http://www.scilab.org/) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Jean-Baptiste SILVY
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-/*------------------------------------------------------------------------*/
-/* file: returnProperty.c                                                 */
-/* desc : a set of functions used to return values in Scilab              */
-/*------------------------------------------------------------------------*/
-
-#include "api_scilab.h"
-#include "returnProperty.h"
-#include <string.h>
-
-/*--------------------------------------------------------------------------*/
-int sciReturnEmptyMatrix(void* _pvCtx)
-{
-    return createEmptyMatrix(_pvCtx, nbInputArgument(_pvCtx) + 1);
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnString(void* _pvCtx, const char * value)
-{
-    return createSingleString(_pvCtx, nbInputArgument(_pvCtx) + 1, value);
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnChar(void* _pvCtx, char value)
-{
-    char pstValue[2] = {value, 0};//createSingleString needs null terminated characters string
-    return createSingleString(_pvCtx, nbInputArgument(_pvCtx) + 1, pstValue);
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnDouble(void* _pvCtx, double value)
-{
-    return createScalarDouble(_pvCtx, nbInputArgument(_pvCtx) + 1, value);
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnInt(void* _pvCtx, int value)
-{
-    return sciReturnDouble(_pvCtx, (double)value);
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnRowVector(void* _pvCtx, const double values[], int nbValues)
-{
-    SciErr sciErr = createMatrixOfDouble(_pvCtx, nbInputArgument(_pvCtx) + 1, 1, nbValues, values);
-    if (sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 1;
-    }
-
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnRowVectorFromInt(void* _pvCtx, const int values[], int nbValues)
-{
-    SciErr sciErr = createMatrixOfDoubleAsInteger(_pvCtx, nbInputArgument(_pvCtx) + 1, 1, nbValues, values);
-    if (sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 1;
-    }
-
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnRowIntVector(void* _pvCtx, const int values[], int nbValues)
-{
-    return sciReturnRowVectorFromInt(_pvCtx, values, nbValues);
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnRowStringVector(void* _pvCtx, char * values[], int nbValues)
-{
-    return sciReturnStringMatrix(_pvCtx, values, 1, nbValues);
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnHandle(void* _pvCtx, long handle)
-{
-    return createScalarHandle(_pvCtx, nbInputArgument(_pvCtx) + 1, handle);
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnRowHandleVector(void* _pvCtx, const long handles[], int nbValues)
-{
-    int i = 0;
-    long long* pH = NULL;
-    SciErr sciErr = allocMatrixOfHandle(_pvCtx, nbInputArgument(_pvCtx) + 1, 1, nbValues, &pH);
-    if (sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 1;
-    }
-
-    for (i = 0 ; i < nbValues ; i++)
-    {
-        pH[i] = handles[i];
-    }
-
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnColHandleVector(void* _pvCtx, const long handles[], int nbValues)
-{
-    int i = 0;
-    long long* pH = NULL;
-    SciErr sciErr = allocMatrixOfHandle(_pvCtx, nbInputArgument(_pvCtx) + 1, nbValues, 1, &pH);
-    if (sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 1;
-    }
-
-    for (i = 0 ; i < nbValues ; i++)
-    {
-        pH[i] = handles[i];
-    }
-
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnMatrix(void* _pvCtx, double values[], int nbRow, int nbCol)
-{
-    SciErr sciErr = createMatrixOfDouble(_pvCtx, nbInputArgument(_pvCtx) + 1, nbRow, nbCol, values);
-    if (sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 1;
-    }
-
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnStringMatrix(void* _pvCtx, char * values[], int nbRow, int nbCol)
-{
-    SciErr sciErr = createMatrixOfString(_pvCtx, nbInputArgument(_pvCtx) + 1, nbRow, nbCol, values);
-    if (sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return 1;
-    }
-
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
-int sciReturnUserData(void* _pvCtx, const int * userData, int userDataSize)
-{
-    /*NOT COMPATIBLE WITH SCILAB 6*/
-    //int * data_ptr = NULL ;
-    //int data_size = (userDataSize + 1) / 2 ;
-    //SetWorkSize(nbInputArgument(_pvCtx) + 1, &data_size);
-    //data_ptr = (int*)GetRawData(nbInputArgument(_pvCtx) + 1);
-    //memcpy(data_ptr, userData, userDataSize * sizeof (int));
-    return 0 ;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/returnPropertyList.c b/scilab/modules/core/src/c/returnPropertyList.c
deleted file mode 100644 (file)
index e93656a..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Jean-Baptiste SILVY
- * 
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at    
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-/*------------------------------------------------------------------------*/
-/* file: returnProperty.c                                                 */
-/* desc : a set of functions used to return a tList in Scilab             */
-/*------------------------------------------------------------------------*/
-
-#include "returnPropertyList.h"
-#include "stack-c.h"
-#include "MALLOC.h"
-#include "sciprint.h"
-#include "localization.h"
-/*------------------------------------------------------------------------*/
-returnedList * createReturnedList( int nbElements, char * elementName[] )
-{
-  returnedList * newList = NULL ;
-  int nbRow = 1 ;
-
-  newList = MALLOC( sizeof(returnedList) ) ;
-  if ( newList == NULL )
-  {
-    sciprint(_("Error returning tlist, memory full.\n")) ;
-    return NULL ;
-  }
-
-  newList->nbElements = nbElements + 1 ;
-
-  /* create the tlist in the stack and get the stack pointer in newList->stackPointer */
-  CreateVar( Rhs+1,TYPED_LIST_DATATYPE, &(newList->nbElements), &nbRow, &(newList->stackPointer) );
-
-  /* create the first element : names of properties */
-  CreateListVarFromPtr( Rhs+1, 1,MATRIX_OF_STRING_DATATYPE, &nbRow, &(newList->nbElements), elementName );
-  
-  newList->curElement = 1 ;
-
-  return newList ;
-}
-/*------------------------------------------------------------------------*/
-int destroyReturnedList( returnedList * list )
-{
-  /* safe test to know if the list has been correctly filled */
-  if ( list->curElement != list->nbElements )
-  {
-    sciprint( _("tlist not completely filled.\n") ) ;
-    FREE( list ) ;
-    return 1 ;
-  }
-
-  FREE( list ) ;
-  return 0 ;
-}
-/*------------------------------------------------------------------------*/
-int addRowVectorToReturnedList( returnedList * list, const double vector[], int nbValues )
-{
-  int nbRow = 1 ;
-  /* check we are not using all the allocated space for the list */
-  if ( list->curElement >= list->nbElements )
-  {
-    sciprint(_("List full.\n")) ;
-    return 1 ;
-  }
-
-  /* add a new element */
-  list->curElement++ ;
-  CreateListVarFromPtr( Rhs+1, list->curElement,MATRIX_OF_DOUBLE_DATATYPE, &nbRow, &nbValues, &vector );
-
-  return 0 ;
-}
-/*------------------------------------------------------------------------*/
-int addColVectorToReturnedList( returnedList * list, const double vector[], int nbValues )
-{
-  int nbCol = 1 ;
-  /* check we are not using all the allocated space for the list */
-  if ( list->curElement >= list->nbElements )
-  {
-    sciprint(_("List full.\n")) ;
-    return 1 ;
-  }
-
-  /* add a new element */
-  list->curElement++ ;
-  CreateListVarFromPtr( Rhs+1, list->curElement,MATRIX_OF_DOUBLE_DATATYPE, &nbValues, &nbCol, &vector );
-
-  return 0 ;
-}
-/*------------------------------------------------------------------------*/
-int addMatrixToReturnedList( returnedList * list, const double matrix[], int nbRow, int nbCol )
-{
-  /* check we are not using all the allocated space for the list */
-  if ( list->curElement >= list->nbElements )
-  {
-    sciprint(_("List full.\n")) ;
-    return 1 ;
-  }
-
-  /* add a new element */
-  list->curElement++ ;
-  CreateListVarFromPtr( Rhs+1, list->curElement,MATRIX_OF_DOUBLE_DATATYPE, &nbRow, &nbCol, &matrix );
-
-  return 0 ;
-}
-/*------------------------------------------------------------------------*/
-int addStringColVectorToReturnedList( returnedList * list, char * vector[], int nbValues )
-{
-  int nbCol = 1 ;
-  /* check we are not using all the allocated space for the list */
-  if ( list->curElement >= list->nbElements )
-  {
-    sciprint(_("List full.\n")) ;
-    return 1 ;
-  }
-
-  /* add a new element */
-  list->curElement++ ;
-  CreateListVarFromPtr( Rhs+1, list->curElement,MATRIX_OF_STRING_DATATYPE, &nbValues, &nbCol, vector );
-
-  return 0 ;
-}
-/*------------------------------------------------------------------------*/
diff --git a/scilab/modules/data_structures/macros/lstsize.sci b/scilab/modules/data_structures/macros/lstsize.sci
new file mode 100644 (file)
index 0000000..e83fa30
--- /dev/null
@@ -0,0 +1,28 @@
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2012 - Scilab Enterprises - Antoine ELIAS
+//
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution.  The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+
+
+function l=lstsize(varargin)
+    [lhs, rhs] = argn(0);
+    if lhs <> 1 then
+        error(999, mprintf(_("%s: Wrong number of output arguments: %d expected.\n"), "lstsize", 1));
+    end
+
+    if rhs <> 1 then
+        error(999, mprintf(_("%s: Wrong number of input arguments: %d expected.\n"), "lstsize", 1));
+    end
+
+
+    var = varargin(1);
+    if type(var) <> 15 & type(var) <> 17 then
+        error(999, mprintf(_("%s: Wrong type for argument %d: List expected.\n"), "lstsize", 1));
+    end
+
+    l = size(var);
+endfunction
index 5cd302e..a14a27d 100644 (file)
@@ -124,6 +124,8 @@ function create_frame(my_fig_handle,fr_position,fr_title,fr_items)
   // =========================================================================
 
 
+mprintf("fr_items\n");
+disp(fr_items);
   // if no item, no display
   if fr_items == []  then
     my_visible = "off";
@@ -151,6 +153,7 @@ function create_frame(my_fig_handle,fr_position,fr_title,fr_items)
   if ~isempty(curFrame) then
       delete_frame(my_fig_handle, fr_position);
   end
+
   uicontrol( ...
     "parent"        , my_fig_handle,...
     "relief"        , "groove",...
@@ -177,6 +180,7 @@ function create_frame(my_fig_handle,fr_position,fr_title,fr_items)
     "visible"       , my_visible, ...
     "tag"         , "title_frame_"+string(fr_position));
 
+pause
   // List Box
   uicontrol( ...
     "parent"        , my_fig_handle,...
@@ -192,6 +196,8 @@ function create_frame(my_fig_handle,fr_position,fr_title,fr_items)
     "visible"       , my_visible, ...
     "user_data"       , fr_items, ...
     "tag"         , "listbox_"+string(fr_position));
+    mprintf("%s\n", "listbox_"+string(fr_position));
+    disp(fr_items);
 
   // Logo Scilab
   // =========================================================================
@@ -220,9 +226,10 @@ function script_path = demo_gui_update()
   my_counter = 0;
 
   global subdemolist;
-  
+
   my_selframe   = get(gcbo,"tag");
 
+
   // Suppression d'une figure précédemment dessinée, si figure il y a ...
   all_figs = winsid();
   all_figs = all_figs(all_figs >= 100001); // All Scilab graphic windows opened for demos
@@ -235,7 +242,7 @@ function script_path = demo_gui_update()
 
   // Handle de la figure
   demo_fig    = gcbo.parent;
-  
+
   // Frame sur laquelle on a cliqué
   my_selframe_num = msscanf(my_selframe,"listbox_%d");
 
@@ -244,7 +251,6 @@ function script_path = demo_gui_update()
   my_data  = get(findobj("tag",my_selframe), "user_data");
 
   script_path = my_data(my_index(1,1),2);
-
   if grep(script_path,"dem.gateway.sce") == 1 then
 
     // On est dans le cas ou une nouvelle frame va être affichée
@@ -289,7 +295,11 @@ function resize_gui(my_fig_handle,frame_number)
   // =========================================================================
 
   axes_w           = (frame_number+1)*margin_x + frame_number*frame_w; // axes width
-  my_fig_handle.axes_size(1) = axes_w;
+
+  //my_fig_handle.axes_size(1) = axes_w;
+  temp = my_fig_handle.axes_size;
+  temp(1) = axes_w;
+  my_fig_handle.axes_size = temp;
 
   for i=(frame_number+1):10
 
index 7f01363..a19f148 100644 (file)
@@ -923,6 +923,7 @@ int DifferentialEquationFunctions::callOdeMacroF(int* n, double* t, double* y, d
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblY    = NULL;
@@ -970,7 +971,7 @@ int DifferentialEquationFunctions::callOdeMacroF(int* n, double* t, double* y, d
             in.push_back(m_FArgs[i]);
         }
 
-        bool bOk = m_pCallFFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1049,6 +1050,7 @@ int DifferentialEquationFunctions::callMacroJac(int* n, double* t, double* y, in
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblY = new types::Double(m_odeYRows, m_odeYCols);
@@ -1066,7 +1068,7 @@ int DifferentialEquationFunctions::callMacroJac(int* n, double* t, double* y, in
             in.push_back(m_JacArgs[i]);
         }
 
-        bool bOk = m_pCallJacFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallJacFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1112,6 +1114,7 @@ int DifferentialEquationFunctions::callMacroG(int* n, double* t, double* y, int*
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblY = new types::Double(m_odeYRows, m_odeYCols);
@@ -1129,7 +1132,7 @@ int DifferentialEquationFunctions::callMacroG(int* n, double* t, double* y, int*
             in.push_back(m_odeGArgs[i]);
         }
 
-        bool bOk = m_pCallGFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallGFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1179,6 +1182,7 @@ double DifferentialEquationFunctions::callIntgMacroF(double* t)
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         // create input args
@@ -1193,7 +1197,7 @@ double DifferentialEquationFunctions::callIntgMacroF(double* t)
             in.push_back(m_FArgs[i]);
         }
 
-        bool bOk = m_pCallFFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1241,6 +1245,7 @@ double DifferentialEquationFunctions::callInt2dMacroF(double* x, double* y)
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         // create input args
@@ -1258,7 +1263,7 @@ double DifferentialEquationFunctions::callInt2dMacroF(double* x, double* y)
             in.push_back(m_FArgs[i]);
         }
 
-        bool bOk = m_pCallFFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1312,6 +1317,7 @@ double DifferentialEquationFunctions::callInt3dMacroF(double* xyz, int* numfun,
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         // create input args
@@ -1330,7 +1336,7 @@ double DifferentialEquationFunctions::callInt3dMacroF(double* xyz, int* numfun,
             in.push_back(m_FArgs[i]);
         }
 
-        bool bOk = m_pCallFFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1384,6 +1390,7 @@ int DifferentialEquationFunctions::callFevalMacroF(int* nn, double* x1, double*
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblX = NULL;
@@ -1407,7 +1414,7 @@ int DifferentialEquationFunctions::callFevalMacroF(int* nn, double* x1, double*
             in.push_back(m_FArgs[i]);
         }
 
-        bool bOk = m_pCallFFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1476,6 +1483,7 @@ int DifferentialEquationFunctions::callBvodeMacroGsub(int* i, double* z, double*
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblI = NULL;
@@ -1496,7 +1504,7 @@ int DifferentialEquationFunctions::callBvodeMacroGsub(int* i, double* z, double*
             in.push_back(m_GsubArgs[i]);
         }
 
-        bool bOk = m_pCallGsubFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallGsubFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1551,6 +1559,7 @@ int DifferentialEquationFunctions::callBvodeMacroDgsub(int* i, double* z, double
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblI = NULL;
@@ -1570,7 +1579,7 @@ int DifferentialEquationFunctions::callBvodeMacroDgsub(int* i, double* z, double
             in.push_back(m_DgsubArgs[i]);
         }
 
-        bool bOk = m_pCallDgsubFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallDgsubFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1625,6 +1634,7 @@ int DifferentialEquationFunctions::callBvodeMacroFsub(double* x, double* z, doub
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblX = NULL;
@@ -1645,7 +1655,7 @@ int DifferentialEquationFunctions::callBvodeMacroFsub(double* x, double* z, doub
             in.push_back(m_FsubArgs[i]);
         }
 
-        bool bOk = m_pCallFsubFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallFsubFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1700,6 +1710,7 @@ int DifferentialEquationFunctions::callBvodeMacroDfsub(double* x, double* z, dou
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblX = NULL;
@@ -1720,7 +1731,7 @@ int DifferentialEquationFunctions::callBvodeMacroDfsub(double* x, double* z, dou
             in.push_back(m_DfsubArgs[i]);
         }
 
-        bool bOk = m_pCallDfsubFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallDfsubFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1776,6 +1787,7 @@ int DifferentialEquationFunctions::callBvodeMacroGuess(double* x, double* z, dou
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblX = NULL;
@@ -1789,7 +1801,7 @@ int DifferentialEquationFunctions::callBvodeMacroGuess(double* x, double* z, dou
             in.push_back(m_GuessArgs[i]);
         }
 
-        bool bOk = m_pCallGuessFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallGuessFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1859,6 +1871,7 @@ int DifferentialEquationFunctions::callImplMacroF(int* neq, double* t, double* y
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblT = new types::Double(*t);
@@ -1880,7 +1893,7 @@ int DifferentialEquationFunctions::callImplMacroF(int* neq, double* t, double* y
             in.push_back(m_FArgs[i]);
         }
 
-        bool bOk = m_pCallFFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -1944,6 +1957,7 @@ int DifferentialEquationFunctions::callImplMacroG(int* neq, double* t, double* y
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblT = new types::Double(*t);
@@ -1965,7 +1979,7 @@ int DifferentialEquationFunctions::callImplMacroG(int* neq, double* t, double* y
             in.push_back(m_FArgs[i]);
         }
 
-        bool bOk = m_pCallGFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallGFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -2023,6 +2037,7 @@ int DifferentialEquationFunctions::callImplMacroJac(int* neq, double* t, double*
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblT = new types::Double(*t);
@@ -2044,7 +2059,7 @@ int DifferentialEquationFunctions::callImplMacroJac(int* neq, double* t, double*
             in.push_back(m_FArgs[i]);
         }
 
-        bool bOk = m_pCallJacFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallJacFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -2108,6 +2123,7 @@ int DifferentialEquationFunctions::callDasslMacroF(double* t, double* y, double*
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblT = new types::Double(*t);
@@ -2129,7 +2145,7 @@ int DifferentialEquationFunctions::callDasslMacroF(double* t, double* y, double*
             in.push_back(m_FArgs[i]);
         }
 
-        bool bOk = m_pCallFFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallFFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -2206,6 +2222,7 @@ int DifferentialEquationFunctions::callDasslMacroJac(double* t, double* y, doubl
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblT = new types::Double(*t);
@@ -2231,7 +2248,7 @@ int DifferentialEquationFunctions::callDasslMacroJac(double* t, double* y, doubl
             in.push_back(m_FArgs[i]);
         }
 
-        bool bOk = m_pCallJacFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallJacFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
@@ -2303,6 +2320,7 @@ int DifferentialEquationFunctions::callDasrtMacroG(int* ny, double* t, double* y
 
         typed_list in;
         typed_list out;
+        types::optional_list opt;
         ast::ExecVisitor execFunc;
 
         types::Double* pDblT = new types::Double(*t);
@@ -2319,7 +2337,7 @@ int DifferentialEquationFunctions::callDasrtMacroG(int* ny, double* t, double* y
             in.push_back(m_FArgs[i]);
         }
 
-        bool bOk = m_pCallGFunction->call(in, iRetCount, out, &execFunc) == types::Function::OK;
+        bool bOk = m_pCallGFunction->call(in, opt, iRetCount, out, &execFunc) == types::Function::OK;
 
         if(bOk == false)
         {
index cc6e38e..73bb183 100644 (file)
@@ -222,11 +222,12 @@ Function::ReturnValue sci_exec(types::typed_list &in, int _iRetCount, types::typ
                     Callable *pCall = execMe.result_get()->getAs<Callable>();
                     types::typed_list out;
                     types::typed_list in;
+                    types::optional_list opt;
 
                     try
                     {
                         ExecVisitor execCall;
-                        Function::ReturnValue Ret = pCall->call(in, 1, out, &execCall);
+                        Function::ReturnValue Ret = pCall->call(in, opt, 1, out, &execCall);
 
                         if(Ret == Callable::OK)
                         {
index 9ffeacc..7e3ac64 100644 (file)
@@ -175,11 +175,12 @@ Function::ReturnValue sci_execstr(types::typed_list &in, int _iRetCount, types::
                 Callable *pCall = execMe.result_get()->getAs<Callable>();
                 types::typed_list out;
                 types::typed_list in;
+                types::optional_list opt;
 
                 try
                 {
                     ExecVisitor execCall;
-                    Function::ReturnValue Ret = pCall->call(in, 1, out, &execCall);
+                    Function::ReturnValue Ret = pCall->call(in, opt, 1, out, &execCall);
 
                     if(Ret == Callable::OK)
                     {
index bb1d740..2be9d44 100644 (file)
@@ -330,7 +330,8 @@ src/c/periEmpty.c \
 src/c/scitokenize.c \
 src/c/get_ticks_utils.c
 
-GATEWAY_C_SOURCES = sci_gateway/c/sci_swap_handles.c \
+GATEWAY_C_SOURCES = \
+sci_gateway/c/sci_swap_handles.c \
 sci_gateway/c/sci_grayplot.c \
 sci_gateway/c/sci_matplot1.c \
 sci_gateway/c/sci_xfpolys.c \
@@ -365,12 +366,10 @@ sci_gateway/c/sci_plot3d.c \
 sci_gateway/c/sci_move.c \
 sci_gateway/c/sci_copy.c \
 sci_gateway/c/sci_relocate_handle.c \
-sci_gateway/c/sci_get.c \
 sci_gateway/c/sci_xarcs.c \
 sci_gateway/c/sci_xfpoly.c \
 sci_gateway/c/sci_drawlater.c \
 sci_gateway/c/sci_champ.c \
-sci_gateway/c/sci_set.c \
 sci_gateway/c/sci_unglue.c \
 sci_gateway/c/gw_graphics.c \
 sci_gateway/c/sci_zoom_rect.c \
@@ -385,14 +384,18 @@ sci_gateway/c/sci_xfarcs.c \
 sci_gateway/c/sci_param3d.c \
 sci_gateway/c/sci_contour2di.c \
 sci_gateway/c/sci_xdel.c \
-sci_gateway/c/sci_winsid.c \
 sci_gateway/c/sci_fec.c \
+sci_gateway/c/sci_set.c \
 sci_gateway/c/sci_rubberbox.c \
 sci_gateway/c/sci_rotate_axes.c \
 sci_gateway/c/sci_is_handle_valid.c \
 sci_gateway/c/sci_Legend.c
 
-GATEWAY_CXX_SOURCES = sci_gateway/cpp/graphics_gw.cpp
+GATEWAY_CXX_SOURCES = \
+sci_gateway/cpp/graphics_gw.cpp \
+sci_gateway/cpp/sci_get.cpp \
+sci_gateway/cpp/sci_winsid.cpp
+
 
 libscigraphics_la_CPPFLAGS = \
        -I$(srcdir)/includes/ \
@@ -418,10 +421,11 @@ libscigraphics_la_CPPFLAGS = \
        -I$(top_srcdir)/modules/system_env/includes/ \
        -I$(top_srcdir)/modules/operations/includes/ \
        -I$(top_srcdir)/modules/types/includes/ \
-       -I$(top_srcdir)/modules/core/includes/ \
        -I$(top_srcdir)/modules/ast/includes/ \
        -I$(top_srcdir)/modules/symbol/includes/ \
        -I$(top_srcdir)/modules/localization/includes/ \
+       -I$(top_srcdir)/modules/threads/includes/ \
+       -I$(top_srcdir)/modules/console/includes/ \
        $(EIGEN_CPPFLAGS) \
        $(TCL_INC_PATH) \
        $(TK_INC_PATH) \
index 79f92ff..c085b2e 100644 (file)
@@ -481,11 +481,9 @@ am__objects_2 = libscigraphics_la-sci_swap_handles.lo \
        libscigraphics_la-sci_plot3d.lo libscigraphics_la-sci_move.lo \
        libscigraphics_la-sci_copy.lo \
        libscigraphics_la-sci_relocate_handle.lo \
-       libscigraphics_la-sci_get.lo libscigraphics_la-sci_xarcs.lo \
-       libscigraphics_la-sci_xfpoly.lo \
+       libscigraphics_la-sci_xarcs.lo libscigraphics_la-sci_xfpoly.lo \
        libscigraphics_la-sci_drawlater.lo \
-       libscigraphics_la-sci_champ.lo libscigraphics_la-sci_set.lo \
-       libscigraphics_la-sci_unglue.lo \
+       libscigraphics_la-sci_champ.lo libscigraphics_la-sci_unglue.lo \
        libscigraphics_la-gw_graphics.lo \
        libscigraphics_la-sci_zoom_rect.lo \
        libscigraphics_la-sci_delete.lo \
@@ -498,13 +496,14 @@ am__objects_2 = libscigraphics_la-sci_swap_handles.lo \
        libscigraphics_la-sci_xfarcs.lo \
        libscigraphics_la-sci_param3d.lo \
        libscigraphics_la-sci_contour2di.lo \
-       libscigraphics_la-sci_xdel.lo libscigraphics_la-sci_winsid.lo \
-       libscigraphics_la-sci_fec.lo \
+       libscigraphics_la-sci_xdel.lo libscigraphics_la-sci_fec.lo \
+       libscigraphics_la-sci_set.lo \
        libscigraphics_la-sci_rubberbox.lo \
        libscigraphics_la-sci_rotate_axes.lo \
        libscigraphics_la-sci_is_handle_valid.lo \
        libscigraphics_la-sci_Legend.lo
-am__objects_3 = libscigraphics_la-graphics_gw.lo
+am__objects_3 = libscigraphics_la-graphics_gw.lo \
+       libscigraphics_la-sci_get.lo libscigraphics_la-sci_winsid.lo
 am_libscigraphics_la_OBJECTS = $(am__objects_2) $(am__objects_3)
 libscigraphics_la_OBJECTS = $(am_libscigraphics_la_OBJECTS)
 @GUI_TRUE@am_libscigraphics_la_rpath = -rpath $(pkglibdir)
@@ -1125,7 +1124,8 @@ src/c/periEmpty.c \
 src/c/scitokenize.c \
 src/c/get_ticks_utils.c
 
-GATEWAY_C_SOURCES = sci_gateway/c/sci_swap_handles.c \
+GATEWAY_C_SOURCES = \
+sci_gateway/c/sci_swap_handles.c \
 sci_gateway/c/sci_grayplot.c \
 sci_gateway/c/sci_matplot1.c \
 sci_gateway/c/sci_xfpolys.c \
@@ -1160,12 +1160,10 @@ sci_gateway/c/sci_plot3d.c \
 sci_gateway/c/sci_move.c \
 sci_gateway/c/sci_copy.c \
 sci_gateway/c/sci_relocate_handle.c \
-sci_gateway/c/sci_get.c \
 sci_gateway/c/sci_xarcs.c \
 sci_gateway/c/sci_xfpoly.c \
 sci_gateway/c/sci_drawlater.c \
 sci_gateway/c/sci_champ.c \
-sci_gateway/c/sci_set.c \
 sci_gateway/c/sci_unglue.c \
 sci_gateway/c/gw_graphics.c \
 sci_gateway/c/sci_zoom_rect.c \
@@ -1180,14 +1178,18 @@ sci_gateway/c/sci_xfarcs.c \
 sci_gateway/c/sci_param3d.c \
 sci_gateway/c/sci_contour2di.c \
 sci_gateway/c/sci_xdel.c \
-sci_gateway/c/sci_winsid.c \
 sci_gateway/c/sci_fec.c \
+sci_gateway/c/sci_set.c \
 sci_gateway/c/sci_rubberbox.c \
 sci_gateway/c/sci_rotate_axes.c \
 sci_gateway/c/sci_is_handle_valid.c \
 sci_gateway/c/sci_Legend.c
 
-GATEWAY_CXX_SOURCES = sci_gateway/cpp/graphics_gw.cpp
+GATEWAY_CXX_SOURCES = \
+sci_gateway/cpp/graphics_gw.cpp \
+sci_gateway/cpp/sci_get.cpp \
+sci_gateway/cpp/sci_winsid.cpp
+
 libscigraphics_la_CPPFLAGS = \
        -I$(srcdir)/includes/ \
        -I$(srcdir)/src/c/ \
@@ -1212,10 +1214,11 @@ libscigraphics_la_CPPFLAGS = \
        -I$(top_srcdir)/modules/system_env/includes/ \
        -I$(top_srcdir)/modules/operations/includes/ \
        -I$(top_srcdir)/modules/types/includes/ \
-       -I$(top_srcdir)/modules/core/includes/ \
        -I$(top_srcdir)/modules/ast/includes/ \
        -I$(top_srcdir)/modules/symbol/includes/ \
        -I$(top_srcdir)/modules/localization/includes/ \
+       -I$(top_srcdir)/modules/threads/includes/ \
+       -I$(top_srcdir)/modules/console/includes/ \
        $(EIGEN_CPPFLAGS) \
        $(TCL_INC_PATH) \
        $(TK_INC_PATH) \
@@ -4228,13 +4231,6 @@ libscigraphics_la-sci_relocate_handle.lo: sci_gateway/c/sci_relocate_handle.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_la-sci_relocate_handle.lo `test -f 'sci_gateway/c/sci_relocate_handle.c' || echo '$(srcdir)/'`sci_gateway/c/sci_relocate_handle.c
 
-libscigraphics_la-sci_get.lo: sci_gateway/c/sci_get.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_la-sci_get.lo -MD -MP -MF $(DEPDIR)/libscigraphics_la-sci_get.Tpo -c -o libscigraphics_la-sci_get.lo `test -f 'sci_gateway/c/sci_get.c' || echo '$(srcdir)/'`sci_gateway/c/sci_get.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_la-sci_get.Tpo $(DEPDIR)/libscigraphics_la-sci_get.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_get.c' object='libscigraphics_la-sci_get.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_la-sci_get.lo `test -f 'sci_gateway/c/sci_get.c' || echo '$(srcdir)/'`sci_gateway/c/sci_get.c
-
 libscigraphics_la-sci_xarcs.lo: sci_gateway/c/sci_xarcs.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_la-sci_xarcs.lo -MD -MP -MF $(DEPDIR)/libscigraphics_la-sci_xarcs.Tpo -c -o libscigraphics_la-sci_xarcs.lo `test -f 'sci_gateway/c/sci_xarcs.c' || echo '$(srcdir)/'`sci_gateway/c/sci_xarcs.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_la-sci_xarcs.Tpo $(DEPDIR)/libscigraphics_la-sci_xarcs.Plo
@@ -4263,13 +4259,6 @@ libscigraphics_la-sci_champ.lo: sci_gateway/c/sci_champ.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_la-sci_champ.lo `test -f 'sci_gateway/c/sci_champ.c' || echo '$(srcdir)/'`sci_gateway/c/sci_champ.c
 
-libscigraphics_la-sci_set.lo: sci_gateway/c/sci_set.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_la-sci_set.lo -MD -MP -MF $(DEPDIR)/libscigraphics_la-sci_set.Tpo -c -o libscigraphics_la-sci_set.lo `test -f 'sci_gateway/c/sci_set.c' || echo '$(srcdir)/'`sci_gateway/c/sci_set.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_la-sci_set.Tpo $(DEPDIR)/libscigraphics_la-sci_set.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_set.c' object='libscigraphics_la-sci_set.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_la-sci_set.lo `test -f 'sci_gateway/c/sci_set.c' || echo '$(srcdir)/'`sci_gateway/c/sci_set.c
-
 libscigraphics_la-sci_unglue.lo: sci_gateway/c/sci_unglue.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_la-sci_unglue.lo -MD -MP -MF $(DEPDIR)/libscigraphics_la-sci_unglue.Tpo -c -o libscigraphics_la-sci_unglue.lo `test -f 'sci_gateway/c/sci_unglue.c' || echo '$(srcdir)/'`sci_gateway/c/sci_unglue.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_la-sci_unglue.Tpo $(DEPDIR)/libscigraphics_la-sci_unglue.Plo
@@ -4368,13 +4357,6 @@ libscigraphics_la-sci_xdel.lo: sci_gateway/c/sci_xdel.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_la-sci_xdel.lo `test -f 'sci_gateway/c/sci_xdel.c' || echo '$(srcdir)/'`sci_gateway/c/sci_xdel.c
 
-libscigraphics_la-sci_winsid.lo: sci_gateway/c/sci_winsid.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_la-sci_winsid.lo -MD -MP -MF $(DEPDIR)/libscigraphics_la-sci_winsid.Tpo -c -o libscigraphics_la-sci_winsid.lo `test -f 'sci_gateway/c/sci_winsid.c' || echo '$(srcdir)/'`sci_gateway/c/sci_winsid.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_la-sci_winsid.Tpo $(DEPDIR)/libscigraphics_la-sci_winsid.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_winsid.c' object='libscigraphics_la-sci_winsid.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_la-sci_winsid.lo `test -f 'sci_gateway/c/sci_winsid.c' || echo '$(srcdir)/'`sci_gateway/c/sci_winsid.c
-
 libscigraphics_la-sci_fec.lo: sci_gateway/c/sci_fec.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_la-sci_fec.lo -MD -MP -MF $(DEPDIR)/libscigraphics_la-sci_fec.Tpo -c -o libscigraphics_la-sci_fec.lo `test -f 'sci_gateway/c/sci_fec.c' || echo '$(srcdir)/'`sci_gateway/c/sci_fec.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_la-sci_fec.Tpo $(DEPDIR)/libscigraphics_la-sci_fec.Plo
@@ -4382,6 +4364,13 @@ libscigraphics_la-sci_fec.lo: sci_gateway/c/sci_fec.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_la-sci_fec.lo `test -f 'sci_gateway/c/sci_fec.c' || echo '$(srcdir)/'`sci_gateway/c/sci_fec.c
 
+libscigraphics_la-sci_set.lo: sci_gateway/c/sci_set.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_la-sci_set.lo -MD -MP -MF $(DEPDIR)/libscigraphics_la-sci_set.Tpo -c -o libscigraphics_la-sci_set.lo `test -f 'sci_gateway/c/sci_set.c' || echo '$(srcdir)/'`sci_gateway/c/sci_set.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_la-sci_set.Tpo $(DEPDIR)/libscigraphics_la-sci_set.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_set.c' object='libscigraphics_la-sci_set.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscigraphics_la-sci_set.lo `test -f 'sci_gateway/c/sci_set.c' || echo '$(srcdir)/'`sci_gateway/c/sci_set.c
+
 libscigraphics_la-sci_rubberbox.lo: sci_gateway/c/sci_rubberbox.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscigraphics_la-sci_rubberbox.lo -MD -MP -MF $(DEPDIR)/libscigraphics_la-sci_rubberbox.Tpo -c -o libscigraphics_la-sci_rubberbox.lo `test -f 'sci_gateway/c/sci_rubberbox.c' || echo '$(srcdir)/'`sci_gateway/c/sci_rubberbox.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscigraphics_la-sci_rubberbox.Tpo $(DEPDIR)/libscigraphics_la-sci_rubberbox.Plo
@@ -4445,6 +4434,20 @@ libscigraphics_la-graphics_gw.lo: sci_gateway/cpp/graphics_gw.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscigraphics_la-graphics_gw.lo `test -f 'sci_gateway/cpp/graphics_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/graphics_gw.cpp
 
+libscigraphics_la-sci_get.lo: sci_gateway/cpp/sci_get.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscigraphics_la-sci_get.lo -MD -MP -MF $(DEPDIR)/libscigraphics_la-sci_get.Tpo -c -o libscigraphics_la-sci_get.lo `test -f 'sci_gateway/cpp/sci_get.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_get.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscigraphics_la-sci_get.Tpo $(DEPDIR)/libscigraphics_la-sci_get.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_get.cpp' object='libscigraphics_la-sci_get.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscigraphics_la-sci_get.lo `test -f 'sci_gateway/cpp/sci_get.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_get.cpp
+
+libscigraphics_la-sci_winsid.lo: sci_gateway/cpp/sci_winsid.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscigraphics_la-sci_winsid.lo -MD -MP -MF $(DEPDIR)/libscigraphics_la-sci_winsid.Tpo -c -o libscigraphics_la-sci_winsid.lo `test -f 'sci_gateway/cpp/sci_winsid.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_winsid.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscigraphics_la-sci_winsid.Tpo $(DEPDIR)/libscigraphics_la-sci_winsid.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_winsid.cpp' object='libscigraphics_la-sci_winsid.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscigraphics_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscigraphics_la-sci_winsid.lo `test -f 'sci_gateway/cpp/sci_winsid.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_winsid.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
index 675b07e..7022ff4 100644 (file)
@@ -6,13 +6,8 @@ EXPORTS
 ; core
 ;--------------------------
 vstk_
-addColVectorToReturnedList 
-addMatrixToReturnedList
-addStringColVectorToReturnedList
 callFunctionFromGateway
 com_
-createReturnedList
-destroyReturnedList
 elementtype_
 findopt_
 firstopt_
@@ -20,22 +15,6 @@ freeArrayOfString
 intersci_
 iop_
 numopt_
-overload_
-sciReturnChar
-sciReturnColHandleVector
-sciReturnDouble
-sciReturnEmptyMatrix
-sciReturnHandle
-sciReturnInt
-sciReturnMatrix
-sciReturnRowHandleVector
-sciReturnRowIntVector
-sciReturnRowStringVector
-sciReturnRowVectorFromInt
-sciReturnRowVector
-sciReturnStringMatrix
-sciReturnString
-sciReturnUserData
 stack_
 vartype_
 vstk_
index 0211ca9..cb30b3a 100644 (file)
@@ -413,7 +413,6 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="sci_gateway\c\sci_drawnow.c" />
     <ClCompile Include="sci_gateway\c\sci_fec.c" />
     <ClCompile Include="sci_gateway\c\sci_geom3d.c" />
-    <ClCompile Include="sci_gateway\c\sci_get.c" />
     <ClCompile Include="sci_gateway\c\sci_glue.c" />
     <ClCompile Include="sci_gateway\c\sci_grayplot.c" />
     <ClCompile Include="sci_gateway\c\sci_is_handle_valid.c" />
@@ -436,7 +435,6 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClCompile Include="sci_gateway\c\sci_swap_handles.c" />
     <ClCompile Include="sci_gateway\c\sci_unglue.c" />
     <ClCompile Include="sci_gateway\c\sci_unzoom.c" />
-    <ClCompile Include="sci_gateway\c\sci_winsid.c" />
     <ClCompile Include="sci_gateway\c\sci_xarc.c" />
     <ClCompile Include="sci_gateway\c\sci_xarcs.c" />
     <ClCompile Include="sci_gateway\c\sci_xarrows.c" />
@@ -607,7 +605,6 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     <ClInclude Include="includes\BasicAlgos.h" />
     <ClInclude Include="includes\BuildObjects.h" />
     <ClInclude Include="includes\Champ.h" />
-    <ClInclude Include="includes\graphics_gw.hxx" />
     <ClInclude Include="src\c\CheckScilabXgc.h" />
     <ClInclude Include="src\c\getHandleProperty\CheckTicksProperty.h" />
     <ClInclude Include="includes\CloneObjects.h" />
@@ -697,7 +694,6 @@ lib /DEF:"$(ProjectDir)elementary_functions_f_Import.def" /SUBSYSTEM:WINDOWS /MA
     </ProjectReference>
     <ProjectReference Include="..\jvm\libjvm.vcxproj">
       <Project>{8ba2dda8-bd04-4d4d-8ee6-6caa955f7470}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
     <ProjectReference Include="..\localization\src\localization.vcxproj">
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
index fc6cc63..a3217f3 100644 (file)
     <ClCompile Include="sci_gateway\c\sci_geom3d.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sci_gateway\c\sci_get.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sci_gateway\c\sci_glue.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="sci_gateway\c\sci_unzoom.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sci_gateway\c\sci_winsid.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="sci_gateway\c\sci_xarc.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClInclude Include="src\c\loadTextRenderingAPI.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="includes\graphics_gw.hxx">
-      <Filter>Header Files</Filter>
-    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="Gui_Import.def">
     <None Include="locales\graphics.pot" />
     <None Include="locales\graphics.pot" />
     <None Include="locales\graphics.pot" />
+    <None Include="locales\graphics.pot" />
+    <None Include="locales\graphics.pot" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="graphic.rc">
index b46e5c9..382b5c1 100644 (file)
@@ -21,9 +21,16 @@ class GraphicsModule
 private :
        GraphicsModule(){};
        ~GraphicsModule(){};
+
+
 public :
+    GRAPHICS_GW_IMPEXP static void LoadDeps(void);
        GRAPHICS_GW_IMPEXP static int Load();
+
+    static bool loadedDep;
 };
 
 
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_get, GRAPHICS_GW_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_winsid, GRAPHICS_GW_IMPEXP);
 #endif /* !__GUI_GW_HXX__ */
index f9d98fe..83fcc0f 100644 (file)
@@ -52,7 +52,7 @@ GRAPHICS_IMPEXP int sci_xdel(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_xclick(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_xchange(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_xarrows(char *fname, void *pvApiCtx);
-GRAPHICS_IMPEXP int sci_winsid(char *fname, void *pvApiCtx);
+//GRAPHICS_IMPEXP int sci_winsid(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_unzoom(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_unglue(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_swap_handles(char *fname, void *pvApiCtx);
@@ -85,7 +85,7 @@ GRAPHICS_IMPEXP int sci_Legend(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_is_handle_valid(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_grayplot(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_glue(char *fname, void *pvApiCtx);
-GRAPHICS_IMPEXP int sci_get(char *fname, void *pvApiCtx);
+//GRAPHICS_IMPEXP int sci_get(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_geom3d(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_fec(char *fname, void *pvApiCtx);
 GRAPHICS_IMPEXP int sci_drawnow(char *fname, void *pvApiCtx);
index 6b69da2..1f39cad 100644 (file)
@@ -109,7 +109,6 @@ function %h_p(h)
         // =====================================================================
 
         case "Axes"
-
             T=h.x_ticks
             if size(T.locations,'*')>9 then
                 locx="matrix "+strcat(string(size(T.locations)),'x')
@@ -907,7 +906,7 @@ function %h_p(h)
                 ]
         end
     end
-    write(%io(2),t)
+    printf("%s\n", t);
 endfunction
 
 
index 2520f7a..c654033 100644 (file)
@@ -84,7 +84,7 @@ int sci_champ_G(char *fname,
         return 0;
     }
 
-    if (FirstOpt() < 5)
+    if (FirstOpt(pvApiCtx) < 5)
     {
         Scierror(999, _("%s: Misplaced optional argument: #%d must be at position %d.\n"), fname, 1, 5);
         return -1;
index fe88486..f895dbd 100644 (file)
@@ -66,7 +66,7 @@ int sci_drawaxis(char *fname, void* pvApiCtx)
     int nx = 0, ny = 0, ntics;
     int nb_tics_labels = -1;
 
-    nopt = NumOpt();
+    nopt = NumOpt(pvApiCtx);
 
     CheckInputArgument(pvApiCtx, minrhs, maxrhs + nopt);
     CheckOutputArgument(pvApiCtx, minlhs, maxlhs);
index 8ab1220..d1c7d4b 100644 (file)
@@ -79,7 +79,7 @@ int sci_fec(char *fname, void *pvApiCtx)
         return 0;
     }
 
-    if (FirstOpt() < 5)
+    if (FirstOpt(pvApiCtx) < 5)
     {
         Scierror(999, _("%s: Misplaced optional argument: #%d must be at position %d.\n"), fname, 1, 5);
         return -1;
index 408339c..ab29a24 100644 (file)
 #include "freeArrayOfString.h"
 #include "api_scilab.h"
 /*--------------------------------------------------------------------------*/
-int sciGet(void* _pvCtx, char *pobjUID, char *marker);
-
-/*--------------------------------------------------------------------------*/
-int sciGet(void* _pvCtx, char *pobjUID, char *marker)
-{
-    /* find the function in the hashtable relative to the property name */
-    /* and call it */
-    return callGetProperty(_pvCtx, pobjUID, marker);
-}
-
-/*--------------------------------------------------------------------------*/
 int sci_get(char *fname, void *pvApiCtx)
 {
     SciErr sciErr;
@@ -106,7 +95,7 @@ int sci_get(char *fname, void *pvApiCtx)
             {
                 if (nbInputArgument(pvApiCtx) == 1)
                 {
-                    if (sciReturnHandle(pvApiCtx, getHandle(getConsoleIdentifier())) != 0)    /* Get Console handle */
+                    if (sciReturnHandle(getHandle(getConsoleIdentifier())) != 0)    /* Get Console handle */
                     {
                         /* An error has occurred */
                         ReturnArguments(pvApiCtx);
@@ -261,7 +250,7 @@ int sci_get(char *fname, void *pvApiCtx)
     if (hdl == 0)
     {
         /* No handle specified */
-        if (sciGet(pvApiCtx, NULL, (l2)) != 0)
+        if (callGetProperty(pvApiCtx, NULL, (l2)) != 0)
         {
             /* An error has occurred */
             freeAllocatedSingleString(l2);
@@ -275,7 +264,7 @@ int sci_get(char *fname, void *pvApiCtx)
         if (pobjUID != NULL)
         {
 
-            if (sciGet(pvApiCtx, pobjUID, (l2)) != 0)
+            if (callGetProperty(pvApiCtx, pobjUID, (l2)) != 0)
             {
                 /* An error has occurred */
                 freeAllocatedSingleString(l2);
index 52a5e38..9390199 100644 (file)
@@ -71,7 +71,7 @@ int sci_grayplot(char *fname, void *pvApiCtx)
         return 0;
     }
 
-    if (FirstOpt() < 4)
+    if (FirstOpt(pvApiCtx) < 4)
     {
         Scierror(999, _("%s: Misplaced optional argument: #%d must be at position %d.\n"),
                  fname, 1, 4);
index 856835b..096199a 100644 (file)
@@ -63,7 +63,7 @@ int sci_matplot(char *fname, void *pvApiCtx)
         ReturnArguments(pvApiCtx);
         return 0;
     }
-    if (FirstOpt() < 2)
+    if (FirstOpt(pvApiCtx) < 2)
     {
         Scierror(999, _("%s: Misplaced optional argument: #%d must be at position %d.\n"),
                  fname, 1, 2);
index 441d508..6098512 100644 (file)
@@ -70,7 +70,7 @@ int sci_param3d(char * fname, void *pvApiCtx)
         ReturnArguments(pvApiCtx);
         return 0;
     }
-    if (FirstOpt() < 4)
+    if (FirstOpt(pvApiCtx) < 4)
     {
         Scierror(999, _("%s: Misplaced optional argument: #%d must be at position %d.\n"), fname, 1, 4);
         return(0);
index 1ce7f19..f4aaee4 100644 (file)
@@ -75,7 +75,7 @@ int sci_param3d1(char *fname, void *pvApiCtx)
         return 0;
     }
 
-    if (FirstOpt() < 4)
+    if (FirstOpt(pvApiCtx) < 4)
     {
         Scierror(999, _("%s: Misplaced optional argument: #%d must be at position %d.\n"), fname, 1, 4);
         return(0);
index dbadf53..fb1b31b 100644 (file)
@@ -95,7 +95,7 @@ int sci_plot2d(char* fname, void *pvApiCtx)
         iskip = 1;
     }
 
-    if (FirstOpt() == 2 + iskip)                                       /** plot2d([loglags,] y, <opt_args>); **/
+    if (FirstOpt(pvApiCtx) == 2 + iskip)                                       /** plot2d([loglags,] y, <opt_args>); **/
     {
         sciErr = getVarAddressFromPosition(pvApiCtx, 1 + iskip, &piAddrl2);
         if (sciErr.iErr)
@@ -138,7 +138,7 @@ int sci_plot2d(char* fname, void *pvApiCtx)
             }
         }
     }
-    else if (FirstOpt() >= 3 + iskip)     /** plot2d([loglags,] x, y[, style [,...]]); **/
+    else if (FirstOpt(pvApiCtx) >= 3 + iskip)     /** plot2d([loglags,] x, y[, style [,...]]); **/
     {
         /* x */
         sciErr = getVarAddressFromPosition(pvApiCtx, 1 + iskip, &piAddrl1);
index af48fa7..7a8b489 100644 (file)
@@ -110,7 +110,7 @@ int sci_plot2d1_G(char * fname, int ptype, void *pvApiCtx)
     /* added to support plot2dxx([logflags],y) */
     if (nbInputArgument(pvApiCtx) == 1 + iskip)
     {
-        if (FirstOpt() <= nbInputArgument(pvApiCtx))
+        if (FirstOpt(pvApiCtx) <= nbInputArgument(pvApiCtx))
         {
             Scierror(999, _("%s: Misplaced optional argument: #%d must be at position %d.\n"), fname, 1, 3 + iskip);
             return(0);
@@ -161,7 +161,7 @@ int sci_plot2d1_G(char * fname, int ptype, void *pvApiCtx)
 
     if (nbInputArgument(pvApiCtx) >= 2 + iskip)
     {
-        if (FirstOpt() < 3 + iskip)
+        if (FirstOpt(pvApiCtx) < 3 + iskip)
         {
             Scierror(999, _("%s: Misplaced optional argument: #%d must be at position %d.\n"),
                      fname, 1, 3 + iskip);
index bfb5caf..9f12dc6 100644 (file)
@@ -85,7 +85,7 @@ int sci_plot3d(char * fname, void *pvApiCtx)
         return 0;
     }
 
-    if (FirstOpt() < 4)
+    if (FirstOpt(pvApiCtx) < 4)
     {
         Scierror(999, _("%s: Misplaced optional argument: #%d must be at position %d.\n"), fname, 1, 4);
         return -1;
diff --git a/scilab/modules/graphics/sci_gateway/c/sci_winsid.c b/scilab/modules/graphics/sci_gateway/c/sci_winsid.c
deleted file mode 100644 (file)
index dc7d137..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Fabrice Leray
- * Copyright (C) 2006 - INRIA - Jean-Baptiste Silvy
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-/*------------------------------------------------------------------------*/
-/* file: sci_winsid.c                                                     */
-/* desc : interface for winsid routine                                    */
-/*------------------------------------------------------------------------*/
-#include "api_scilab.h"
-#include "gw_graphics.h"
-#include "MALLOC.h"
-#include "FigureList.h"
-#include "Scierror.h"
-#include "returnProperty.h"
-#include "localization.h"
-
-/*--------------------------------------------------------------------------*/
-int sci_winsid(char *fname, void *pvApiCtx)
-{
-    int status = 0;
-    int nbFigure = sciGetNbFigure();
-    CheckInputArgument(pvApiCtx, -1, 0);
-
-    if (nbFigure <= 0)
-    {
-        /* There is no figure */
-        status = sciReturnEmptyMatrix(pvApiCtx);
-    }
-    else
-    {
-        int * ids = (int*)MALLOC(nbFigure * sizeof(int));
-        if (ids == NULL)
-        {
-            Scierror(999, _("%s: No more memory.\n"), fname);
-            return 0;
-        }
-        sciGetFiguresId(ids);
-
-        status = sciReturnRowIntVector(pvApiCtx, ids, nbFigure);
-        FREE(ids);
-    }
-    AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
-    ReturnArguments(pvApiCtx);
-    return status;
-}
-/*--------------------------------------------------------------------------*/
index 12d3df2..c74ffb8 100644 (file)
@@ -19,6 +19,7 @@
 /*------------------------------------------------------------------------*/
 
 #include <string.h>
+#include "gw_graphics.h"
 #include "api_scilab.h"
 #include "RendererFontManager.h"
 #include "freeArrayOfString.h"
index 5629c99..b88e6be 100644 (file)
@@ -10,6 +10,8 @@
  *
  */
 
+#pragma comment(lib,"../../../../bin/libintl.lib")
+
 #include "graphics_gw.hxx"
 #include "function.hxx"
 #include "context.hxx"
 #define MODULE_NAME L"graphics"
 extern "C"
 {
-       #include "gw_graphics.h"
+#include "gw_graphics.h"
+#include "loadOnUseClassPath.h"
 }
 
 using namespace types;
 
+bool GraphicsModule::loadedDep = false;
+
+void GraphicsModule::LoadDeps(void)
+{
+    if (loadedDep == false)
+    {
+        loadOnUseClassPath("graphics");
+        loadedDep = true;
+    }
+}
+
+
 int GraphicsModule::Load()
 {
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"set", &sci_set, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"get", &sci_get, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"champ", &sci_champ, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"champ1", &sci_champ1, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"fec", &sci_fec, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"geom3d", &sci_geom3d, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"grayplot", &sci_grayplot, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"Matplot", &sci_matplot, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"Matplot1", &sci_matplot1, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"contour2di", &sci_contour2di, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"param3d", &sci_param3d, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"param3d1", &sci_param3d1, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xstringb", &sci_xstringb, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot2d", &sci_plot2d, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot2d1", &sci_plot2d1_1, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot2d2", &sci_plot2d1_2, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot2d3", &sci_plot2d1_3, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot2d4", &sci_plot2d1_4, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot3d", &sci_plot3d, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot3d1", &sci_plot3d, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"winsid", &sci_winsid, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xarc", &sci_xarc, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xarcs", &sci_xarcs, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xarrows", &sci_xarrows, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"drawaxis", &sci_drawaxis, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xchange", &sci_xchange, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xclick", &sci_xclick, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xdel", &sci_xdel, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xfarc", &sci_xarc, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xfarcs", &sci_xfarcs, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xfpoly", &sci_xfpoly, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xfpolys", &sci_xfpolys, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xfrect", &sci_xrect, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xget", &sci_xget, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xgetmouse", &sci_xgetmouse, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xgrid", &sci_xgrid, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xlfont", &sci_xlfont, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xpoly", &sci_xpoly, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xpolys", &sci_xpolys, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xrect", &sci_xrect, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xrects", &sci_xrects, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xsegs", &sci_xsegs, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"show_window", &sci_show_window, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xset", &sci_xset, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xstring", &sci_xstring, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xtitle", &sci_xtitle, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xgraduate", &sci_xgraduate, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xname", &sci_xname, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"zoom_rect", &sci_zoom_rect, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"unzoom", &sci_unzoom, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"stringbox", &sci_stringbox, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"move", &sci_move, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"glue", &sci_glue, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"unglue", &sci_unglue, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"drawnow", &sci_drawnow, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"drawlater", &sci_drawlater, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"copy", &sci_copy, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"delete", &sci_delete, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"get", &sci_get, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"set", &sci_set, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"newaxes", &sci_newaxes, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"relocate_handle", &sci_relocate_handle, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"swap_handles", &sci_swap_handles, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"rubberbox", &sci_rubberbox, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"rotate_axes", &sci_rotate_axes, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"is_handle_valid", &sci_is_handle_valid, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"captions", &sci_Legend, &GraphicsModule::LoadDeps, MODULE_NAME));
     return 1;
 }
index 1c29609..0508fd3 100644 (file)
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="graphics_gw.cpp" />
+    <ClCompile Include="sci_get.cpp" />
+    <ClCompile Include="sci_winsid.cpp" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\..\..\libs\MALLOC\MALLOC.vcxproj">
+      <Project>{6a84ad8c-ba18-4a3f-9c72-ec3df0939e9e}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\..\Visual-Studio-settings\rename-vc-files\rename-vc-files.vcxproj">
       <Project>{dd8a0506-8d31-4cf8-856a-c10ece9c13a4}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
+      <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\ast\ast-tools\ast-tools.vcxproj">
+      <Project>{1f4a0344-99ed-461b-bd53-1593788fb34d}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\ast\ast.vcxproj">
+      <Project>{0d3fa25b-8116-44ec-a45e-260789daa3d9}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\console\src\c\console.vcxproj">
+      <Project>{445d3b85-c9b1-498b-9c88-0a3c2390b1cc}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\graphic_objects\src\c\graphic_objects.vcxproj">
+      <Project>{30f9ee41-587b-4618-8de7-698d3fba4985}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\jvm\libjvm.vcxproj">
+      <Project>{8ba2dda8-bd04-4d4d-8ee6-6caa955f7470}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\localization\src\localization.vcxproj">
+      <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\operations\operations.vcxproj">
+      <Project>{1bb396f7-ce61-4cfc-9c22-266b2cfb2e74}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\output_stream\src\c\output_stream.vcxproj">
+      <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\symbol\symbol.vcxproj">
       <Project>{2c60033b-0dbd-4ca4-80d3-176c9be9ce2f}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\system_env\system_env.vcxproj">
+      <Project>{7ca60aef-9afa-4d06-af28-613c0aa27640}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\types\types.vcxproj">
       <Project>{64e090da-dcb5-4f4d-93d7-e88ddec9c2ef}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\types\typesmacro\typesmacro.vcxproj">
+      <Project>{9252a034-7f22-4cb1-a634-4577da69f2d0}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\graphics.vcxproj">
       <Project>{8ccdd3c2-b025-4a12-a986-1aa28d7c0c33}</Project>
     </ProjectReference>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c/getHandleProperty;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../graphic_objects/includes;../../../../libs/hashtable;../../../system_env/includes;../../../threads/includes;../../../string/includes;../../../console/includes;../../../../libs/Eigen/includes</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c/getHandleProperty;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../graphic_objects/includes;../../../../libs/hashtable;../../../system_env/includes;../../../threads/includes;../../../string/includes;../../../console/includes;../../../../libs/Eigen/includes</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c/getHandleProperty;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../graphic_objects/includes;../../../../libs/hashtable;../../../system_env/includes;../../../threads/includes;../../../string/includes;../../../console/includes;../../../../libs/Eigen/includes</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      <AdditionalIncludeDirectories>../../includes;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c/getHandleProperty;../../../operations/includes;../../../types/includes;../../../core/includes;../../../ast/includes;../../../../libs/dynamiclibrary/includes;../../../symbol/includes;../../../localization/includes;../../../../libs/intl;../../../jvm/includes;../../../output_stream/includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../graphic_objects/includes;../../../../libs/hashtable;../../../system_env/includes;../../../threads/includes;../../../string/includes;../../../console/includes;../../../../libs/Eigen/includes</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;GRAPHICS_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
index e4ae1ed..2144f15 100644 (file)
     <ClCompile Include="graphics_gw.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="sci_get.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_winsid.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/scilab/modules/graphics/sci_gateway/cpp/sci_get.cpp b/scilab/modules/graphics/sci_gateway/cpp/sci_get.cpp
new file mode 100644 (file)
index 0000000..737f015
--- /dev/null
@@ -0,0 +1,151 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "graphics_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+#include "string.hxx"
+#include "graphichandle.hxx"
+#include "overload.hxx"
+#include "execvisitor.hxx"
+
+extern "C"
+{
+#include "MALLOC.h"
+#include "charEncoding.h"
+#include "localization.h"
+#include "Scierror.h"
+#include "BuildObjects.h"
+#include "CurrentObject.h"
+#include "CurrentSubwin.h"
+#include "HandleManagement.h"
+#include "GetHashTable.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_get(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    long long llH = 0;
+    types::String* pS = NULL;
+    const char* pobjUID = NULL;
+    types::InternalType* pOut = NULL;
+
+    if(in.size() < 1)
+    {
+        //Error
+        return types::Function::Error;
+    }
+
+    types::InternalType* p1 = in[0];
+
+    if(p1->isMList() || p1->isTList())
+    {
+        ExecVisitor exec;
+        Overload::generateNameAndCall(L"get", in, _iRetCount, out, &exec);
+        return types::Function::OK;
+    }
+
+    if(p1->isHandle())
+    {
+        if(in.size() != 2)
+        {
+            //Error
+            return types::Function::Error;
+        }
+
+        types::GraphicHandle* pH = p1->getAs<types::GraphicHandle>();
+        if(pH->isScalar() == false)
+        {
+            ExecVisitor exec;
+            return Overload::call(L"%h_get", in, _iRetCount, out, &exec);
+        }
+
+        pS = in[1]->getAs<types::String>();
+        if(in[1]->isString() == false || pS->isScalar() == false)
+        {
+            ScierrorW(202, _W("%ls: Wrong type for argument #%d: A string expected.\n"), L"get", 2);
+            return types::Function::Error;
+        }
+
+        llH = pH->get(0);
+    }
+    else if(p1->isString())
+    {
+        if(in.size() != 1)
+        {
+            //Error
+            return types::Function::Error;
+        }
+
+        pS = in[0]->getAs<types::String>();
+        if(in[0]->isString() == false || pS->isScalar() == false)
+        {
+            ScierrorW(202, _W("%ls: Wrong type for argument #%d: A string expected.\n"), L"get", 1);
+            return types::Function::Error;
+        }
+
+        wchar_t* pstProperty = pS->get(0);
+
+        if(wcscmp(pstProperty, L"default_figure") && wcscmp(pstProperty, L"default_axes"))
+        {
+            if( wcscmp(pstProperty, L"current_figure") &&
+                wcscmp(pstProperty, L"current_axes") &&
+                wcscmp(pstProperty, L"current_entity") &&
+                wcscmp(pstProperty, L"hdl") &&
+                wcscmp(pstProperty, L"figures_id"))
+            {
+                if( wcscmp(pstProperty, L"children") &&
+                    wcscmp(pstProperty, L"zoom_") &&
+                    wcscmp(pstProperty, L"clip_box") &&
+                    wcscmp(pstProperty, L"auto_"))
+                {
+                    getOrCreateDefaultSubwin();
+                    llH = getHandle(getCurrentObject());
+                }
+                else
+                {
+                    llH = getHandle(getCurrentSubWin());    /* on recupere le pointeur d'objet par le handle */
+                }
+            }
+            else
+            {
+                llH = 0;
+            }
+        }
+    }
+
+    char* pstProperty = wide_string_to_UTF8(pS->get(0));
+
+    if(llH)
+    {
+        pobjUID = getObjectFromHandle((long)llH);
+        if (pobjUID == NULL)
+        {
+            FREE(pstProperty);
+            ScierrorW(999, _W("%ls: The handle is not or no more valid.\n"), L"get");
+            return types::Function::Error;
+        }
+    }
+
+
+    pOut = (types::InternalType*)callGetProperty(NULL, (char*)pobjUID, pstProperty);
+    if(pOut == NULL)
+    {
+        /* An error has occurred */
+        FREE(pstProperty);
+        return types::Function::Error;
+    }
+
+    out.push_back(pOut);
+    FREE(pstProperty);
+    return types::Function::OK;
+}
diff --git a/scilab/modules/graphics/sci_gateway/cpp/sci_winsid.cpp b/scilab/modules/graphics/sci_gateway/cpp/sci_winsid.cpp
new file mode 100644 (file)
index 0000000..efcf595
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Scilab Enterprises - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "graphics_gw.hxx"
+#include "function.hxx"
+#include "double.hxx"
+
+extern "C"
+{
+#include "MALLOC.h"
+#include "localization.h"
+#include "Scierror.h"
+#include "FigureList.h"
+#include "returnProperty.h"
+}
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_winsid(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    void* status = NULL;
+
+    if(in.size() != 0)
+    {
+        //Error
+        return types::Function::Error;
+    }
+
+    int nbFigure = sciGetNbFigure();
+    if (nbFigure <= 0)
+    {
+        /* There is no figure */
+        status = sciReturnEmptyMatrix();
+    }
+    else
+    {
+        int * ids = (int*)MALLOC(nbFigure * sizeof(int));
+        if (ids == NULL)
+        {
+            ScierrorW(999, _W("%ls: No more memory.\n"), L"winsid");
+            return types::Function::Error;
+        }
+        sciGetFiguresId(ids);
+
+        status = sciReturnRowIntVector(ids, nbFigure);
+        FREE(ids);
+    }
+
+    out.push_back((types::InternalType*)status);
+    return types::Function::OK;
+}
\ No newline at end of file
index a5cf973..2063a78 100644 (file)
@@ -37,7 +37,7 @@ static char logFlagsCpy[3] ; /* real logflags may use either this or the stack *
 /*--------------------------------------------------------------------------*/
 int get_style_arg(void* _pvCtx, char *fname, int pos, int n1, rhs_opts opts[], int ** style)
 {
-    int m = 0, n = 0, first_opt = FirstOpt(), kopt = 0, un = 1, ix = 0, i = 0, l1 = 0;
+    int m = 0, n = 0, first_opt = FirstOpt(_pvCtx), kopt = 0, un = 1, ix = 0, i = 0, l1 = 0;
 
     if ( pos < first_opt ) /* regular argument  */
     {
@@ -83,14 +83,12 @@ int get_style_arg(void* _pvCtx, char *fname, int pos, int n1, rhs_opts opts[], i
             }
         }
     }
-    else if ((kopt = FindOpt("style", opts)))
+    else if ((kopt = FindOpt(_pvCtx, "style", opts)))
     {
         /* optinal argument: style=value */
-        int* piAddr = 0;
         int* piData = NULL;
 
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
-        getMatrixOfDoubleAsInteger(_pvCtx, piAddr, &m, &n, &piData);
+        getMatrixOfDoubleAsInteger(_pvCtx, opts[kopt].piAddr, &m, &n, &piData);
         if (m * n < n1)
         {
             Scierror(999, _("%s: Wrong size for input argument #%d: %d < %d expected.\n"), fname, kopt, m * n, n1);
@@ -131,7 +129,7 @@ int get_style_arg(void* _pvCtx, char *fname, int pos, int n1, rhs_opts opts[], i
 /*--------------------------------------------------------------------------*/
 int get_rect_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], double ** rect)
 {
-    int m, n, first_opt = FirstOpt(), kopt, i;
+    int m, n, first_opt = FirstOpt(_pvCtx), kopt, i;
 
     if (pos < first_opt)
     {
@@ -169,12 +167,10 @@ int get_rect_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], double **
             *rect = getDefRect();
         }
     }
-    else if ((kopt = FindOpt("rect", opts))) /* named argument: rect=value */
+    else if ((kopt = FindOpt(_pvCtx, "rect", opts))) /* named argument: rect=value */
     {
-        int* piAddr = 0;
         double* pdblData = NULL;
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
-        getMatrixOfDouble(_pvCtx, piAddr, &m, &n, &pdblData);
+        getMatrixOfDouble(_pvCtx, opts[kopt].piAddr, &m, &n, &pdblData);
         if (m * n != 4)
         {
             Scierror(999, "%s: Wrong size for input argument #%d: %d expected\n", fname, kopt, 4);
@@ -205,7 +201,7 @@ int get_rect_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], double **
 /*--------------------------------------------------------------------------*/
 int get_strf_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char ** strf)
 {
-    int first_opt = FirstOpt(), kopt;
+    int first_opt = FirstOpt(_pvCtx), kopt;
 
     if (pos < first_opt)
     {
@@ -232,12 +228,10 @@ int get_strf_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char ** st
             *strf = getDefStrf();
         }
     }
-    else if ((kopt = FindOpt("strf", opts)))
+    else if ((kopt = FindOpt(_pvCtx, "strf", opts)))
     {
-        int* piAddr = 0;
         char* pstData = NULL;
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
-        getAllocatedSingleString(_pvCtx, piAddr, &pstData);
+        getAllocatedSingleString(_pvCtx, opts[kopt].piAddr, &pstData);
         if ((int)strlen(pstData) != 3)
         {
             Scierror(999, _("%s: Wrong size for input argument #%d: String of %d characters expected.\n"), fname, kopt, 3);
@@ -257,7 +251,7 @@ int get_strf_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char ** st
 /*--------------------------------------------------------------------------*/
 int get_legend_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char ** legend)
 {
-    int first_opt = FirstOpt(), kopt;
+    int first_opt = FirstOpt(_pvCtx), kopt;
 
     if (pos < first_opt)
     {
@@ -277,12 +271,10 @@ int get_legend_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char **
             *legend = getDefLegend();
         }
     }
-    else if ((kopt = FindOpt("leg", opts)))
+    else if ((kopt = FindOpt(_pvCtx, "leg", opts)))
     {
-        int* piAddr = 0;
         char* pstData = NULL;
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
-        getAllocatedSingleString(_pvCtx, piAddr, &pstData);
+        getAllocatedSingleString(_pvCtx, opts[kopt].piAddr, &pstData);
         *legend = pstData;
     }
     else
@@ -297,7 +289,7 @@ int get_legend_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char **
  */
 int get_labels_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char ** labels)
 {
-    int first_opt = FirstOpt(), kopt;
+    int first_opt = FirstOpt(_pvCtx), kopt;
 
     if (pos < first_opt)
     {
@@ -327,12 +319,10 @@ int get_labels_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char **
             }
         }
     }
-    else if ((kopt = FindOpt("leg", opts)))
+    else if ((kopt = FindOpt(_pvCtx, "leg", opts)))
     {
-        int* piAddr = 0;
         char* pstData = NULL;
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
-        getAllocatedSingleString(_pvCtx, piAddr, &pstData);
+        getAllocatedSingleString(_pvCtx, opts[kopt].piAddr, &pstData);
         *labels = pstData;
     }
     else
@@ -356,7 +346,7 @@ int get_labels_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char **
 /*--------------------------------------------------------------------------*/
 int get_nax_arg(void* _pvCtx, int pos, rhs_opts opts[], int ** nax, BOOL * flagNax)
 {
-    int i, m, n, first_opt = FirstOpt(), kopt;
+    int i, m, n, first_opt = FirstOpt(_pvCtx), kopt;
 
     if (pos < first_opt)
     {
@@ -388,13 +378,11 @@ int get_nax_arg(void* _pvCtx, int pos, rhs_opts opts[], int ** nax, BOOL * flagN
             *flagNax = FALSE;
         }
     }
-    else if ((kopt = FindOpt("nax", opts)))
+    else if ((kopt = FindOpt(_pvCtx, "nax", opts)))
     {
-        int* piAddr = 0;
         int* piData = NULL;
 
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
-        getMatrixOfDoubleAsInteger(_pvCtx, piAddr, &m, &n, &piData);
+        getMatrixOfDoubleAsInteger(_pvCtx, opts[kopt].piAddr, &m, &n, &piData);
         if (m * n != 4)
         {
             return 1;
@@ -420,7 +408,7 @@ int get_nax_arg(void* _pvCtx, int pos, rhs_opts opts[], int ** nax, BOOL * flagN
 /*--------------------------------------------------------------------------*/
 int get_zminmax_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], double ** zminmax)
 {
-    int m, n, first_opt = FirstOpt(), kopt;
+    int m, n, first_opt = FirstOpt(_pvCtx), kopt;
 
     if (pos < first_opt)
     {
@@ -448,12 +436,10 @@ int get_zminmax_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], double
             *zminmax = getDefZminMax();
         }
     }
-    else if ((kopt = FindOpt("zminmax", opts))) /* named argument: rect=value */
+    else if ((kopt = FindOpt(_pvCtx, "zminmax", opts))) /* named argument: rect=value */
     {
-        int* piAddr = 0;
         double* pdblData = NULL;
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
-        getMatrixOfDouble(_pvCtx, piAddr, &m, &n, &pdblData);
+        getMatrixOfDouble(_pvCtx, opts[kopt].piAddr, &m, &n, &pdblData);
         if (m * n != 2)
         {
             Scierror(999, "%s: Wrong size for input argument #%d: %d expected\n", fname, kopt, 2);
@@ -475,7 +461,7 @@ int get_zminmax_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], double
 /*--------------------------------------------------------------------------*/
 int get_colminmax_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], int ** colminmax)
 {
-    int m, n, first_opt = FirstOpt(), kopt;
+    int m, n, first_opt = FirstOpt(_pvCtx), kopt;
 
     if (pos < first_opt)
     {
@@ -502,13 +488,11 @@ int get_colminmax_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], int *
             *colminmax = getDefColMinMax();
         }
     }
-    else if ((kopt = FindOpt("colminmax", opts)))
+    else if ((kopt = FindOpt(_pvCtx, "colminmax", opts)))
     {
-        int* piAddr = 0;
         int* piData = NULL;
 
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
-        getMatrixOfDoubleAsInteger(_pvCtx, piAddr, &m, &n, &piData);
+        getMatrixOfDoubleAsInteger(_pvCtx, opts[kopt].piAddr, &m, &n, &piData);
         if (m * n != 2)
         {
             return 1;
@@ -528,7 +512,7 @@ int get_colminmax_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], int *
 /*--------------------------------------------------------------------------*/
 int get_colout_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], int ** colout)
 {
-    int m, n, first_opt = FirstOpt(), kopt;
+    int m, n, first_opt = FirstOpt(_pvCtx), kopt;
 
     if (pos < first_opt)
     {
@@ -555,13 +539,11 @@ int get_colout_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], int ** c
             *colout = getDefColOut();
         }
     }
-    else if ((kopt = FindOpt("colout", opts)))
+    else if ((kopt = FindOpt(_pvCtx, "colout", opts)))
     {
-        int* piAddr = 0;
         int* piData = NULL;
 
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
-        getMatrixOfDoubleAsInteger(_pvCtx, piAddr, &m, &n, &piData);
+        getMatrixOfDoubleAsInteger(_pvCtx, opts[kopt].piAddr, &m, &n, &piData);
         if (m * n != 2)
         {
             return 1;
@@ -580,7 +562,7 @@ int get_colout_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], int ** c
 /*--------------------------------------------------------------------------*/
 int get_with_mesh_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], BOOL * withMesh)
 {
-    int first_opt = FirstOpt(), kopt;
+    int first_opt = FirstOpt(_pvCtx), kopt;
 
     if (pos < first_opt)
     {
@@ -602,13 +584,11 @@ int get_with_mesh_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], BOOL
             *withMesh = getDefWithMesh();
         }
     }
-    else if ((kopt = FindOpt("mesh", opts)))
+    else if ((kopt = FindOpt(_pvCtx, "mesh", opts)))
     {
-        int* piAddr = 0;
         int iData = 0;
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
 
-        getScalarBoolean(_pvCtx, piAddr, &iData);
+        getScalarBoolean(_pvCtx, opts[kopt].piAddr, &iData);
         *withMesh = iData;
     }
     else
@@ -628,7 +608,7 @@ int get_logflags_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char *
 
     int iLog = 0;
     char* pstLog = NULL;
-    if (pos < FirstOpt()) //input argument  */
+    if (pos < FirstOpt(_pvCtx)) //input argument  */
     {
         //no idea of the real goal of this, how input var can have type == 0 Oo
         if (getInputArgumentType(_pvCtx, pos) == 0)
@@ -639,9 +619,9 @@ int get_logflags_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char *
 
         getVarAddressFromPosition(_pvCtx, pos, &piAddr);
     }
-    else if ((kopt = FindOpt("logflag", opts))) //optional argument
+    else if ((kopt = FindOpt(_pvCtx, "logflag", opts))) //optional argument
     {
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
+        piAddr = opts[kopt].piAddr;
     }
     else
     {
@@ -691,7 +671,7 @@ int get_logflags_arg(void* _pvCtx, char *fname, int pos, rhs_opts opts[], char *
 /*--------------------------------------------------------------------------*/
 int get_optional_double_arg(void* _pvCtx, char* fname, int pos, char* name, double** value, int sz, rhs_opts opts[])
 {
-    int m, n, first_opt = FirstOpt(), kopt;
+    int m, n, first_opt = FirstOpt(_pvCtx), kopt;
 
     if (pos < first_opt)
     {
@@ -711,12 +691,10 @@ int get_optional_double_arg(void* _pvCtx, char* fname, int pos, char* name, doub
             *value = pdblData;
         }
     }
-    else if ((kopt = FindOpt(name, opts)))
+    else if ((kopt = FindOpt(_pvCtx, name, opts)))
     {
-        int* piAddr = 0;
         double* pdblData = NULL;
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
-        getMatrixOfDouble(_pvCtx, piAddr, &m, &n, &pdblData);
+        getMatrixOfDouble(_pvCtx, opts[kopt].piAddr, &m, &n, &pdblData);
         if (m * n != sz)
         {
             Scierror(999, "%s: Wrong size for input argument #%d: %d expected\n", fname, kopt, 4);
@@ -730,7 +708,7 @@ int get_optional_double_arg(void* _pvCtx, char* fname, int pos, char* name, doub
 /*--------------------------------------------------------------------------*/
 int get_optional_int_arg(void* _pvCtx, char* fname, int pos, char* name, int** value, int sz, rhs_opts opts[])
 {
-    int m, n, first_opt = FirstOpt(), kopt;
+    int m, n, first_opt = FirstOpt(_pvCtx), kopt;
 
     if (pos < first_opt)
     {
@@ -750,13 +728,11 @@ int get_optional_int_arg(void* _pvCtx, char* fname, int pos, char* name, int** v
             *value = piData;
         }
     }
-    else if ((kopt = FindOpt(name, opts)))
+    else if ((kopt = FindOpt(_pvCtx, name, opts)))
     {
-        int* piAddr = 0;
         int* piData = NULL;
 
-        getVarAddressFromPosition(_pvCtx, kopt, &piAddr);
-        getMatrixOfDoubleAsInteger(_pvCtx, piAddr, &m, &n, &piData);
+        getMatrixOfDoubleAsInteger(_pvCtx, opts[kopt].piAddr, &m, &n, &piData);
         if (m * n < 1)
         {
             return 1;
index f771dbd..dfa1762 100644 (file)
@@ -46,13 +46,13 @@ typedef struct
  * don't forget to modify it each time the propertyTable
  * is modified.
  */
-#define NB_PROPERTIES 162
+#define NB_PROPERTIES_TAB 162
 
 /**
  * list of all property names and associated functions in scilab
  * This is inserted in the hashTable
  */
-static getHashTableCouple propertyTable[NB_PROPERTIES] =
+static getHashTableCouple propertyTable[NB_PROPERTIES_TAB] =
 {
     {"figures_id", get_figures_id_property},
     {"visible", get_visible_property},
@@ -238,7 +238,7 @@ GetPropertyHashTable *createScilabGetHashTable(void)
     }
 
     /* insert every couple */
-    for (i = 0; i < NB_PROPERTIES; i++)
+    for (i = 0; i < NB_PROPERTIES_TAB; i++)
     {
         insertGetHashtable(getHashTable, propertyTable[i].key, propertyTable[i].accessor);
     }
@@ -250,14 +250,14 @@ GetPropertyHashTable *createScilabGetHashTable(void)
 }
 
 /*--------------------------------------------------------------------------*/
-int callGetProperty(void* _pvCtx, char *pObjUID, char *propertyName)
+void* callGetProperty(void* _pvCtx, char *pObjUID, char *propertyName)
 {
     getPropertyFunc accessor = searchGetHashtable(getHashTable, propertyName);
 
     if (accessor == NULL)
     {
         Scierror(999, _("Unknown property: %s.\n"), propertyName);
-        return -1;
+        return NULL;
     }
     return accessor(_pvCtx, pObjUID);
 }
@@ -281,13 +281,13 @@ char **getDictionaryGetProperties(int *sizearray)
 
     *sizearray = 0;
 
-    dictionary = (char **)MALLOC(sizeof(char *) * NB_PROPERTIES);
+    dictionary = (char **)MALLOC(sizeof(char *) * NB_PROPERTIES_TAB);
     if (dictionary)
     {
         int i = 0;
 
-        *sizearray = NB_PROPERTIES;
-        for (i = 0; i < NB_PROPERTIES; i++)
+        *sizearray = NB_PROPERTIES_TAB;
+        for (i = 0; i < NB_PROPERTIES_TAB; i++)
         {
             char *propertyname = (char *)MALLOC(sizeof(char) * (strlen(propertyTable[i].key) + 1));
 
@@ -302,4 +302,4 @@ char **getDictionaryGetProperties(int *sizearray)
 }
 
 /*--------------------------------------------------------------------------*/
-#undef NB_PROPERTIES
+#undef NB_PROPERTIES_TAB
index 669848f..b9319cf 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "setGetHashTable.h"
 
+#include "dynlib_graphics.h"
 /**
  * create the fill hash table already filled for get functions
  * this use the singleton pattern since only one hashtable is useful.
@@ -37,6 +38,6 @@ void destroyScilabGetHashTable(void);
  *         -1 if an error occurred in the get function
  *          1 if the property was not found
  */
-int callGetProperty(void* _pvCtx, char *pObjUID, char * propertyName);
+GRAPHICS_IMPEXP void* callGetProperty(void* _pvCtx, char *pObjUID, char * propertyName);
 
 #endif /* _GET_HASH_TABLE_H_ */
index 352be2f..d80e2ee 100644 (file)
 #include "GetConsoleShowHiddenHandles.h"
 #include "GetUicontrolTooltipString.h"
 
-int get_figures_id_property(void* _pvCtx, char* pobjUID);
-int get_visible_property(void* _pvCtx, char* pobjUID);
-int get_pixel_drawing_mode_property(void* _pvCtx, char* pobjUID);
-int get_old_style_property(void* _pvCtx, char* pobjUID);
-int get_figure_style_property(void* _pvCtx, char* pobjUID);
-int get_auto_resize_property(void* _pvCtx, char* pobjUID);
-int get_figure_position_property(void* _pvCtx, char* pobjUID);
-int get_axes_size_property(void* _pvCtx, char* pobjUID);
-int get_figure_size_property(void* _pvCtx, char* pobjUID);
-int get_figure_name_property(void* _pvCtx, char* pobjUID);
-int get_figure_id_property(void* _pvCtx, char* pobjUID);
-int get_figure_resizefcn_property(void* _pvCtx, char* pobjUID);
-int get_figure_closerequestfcn_property(void* _pvCtx, char* pobjUID);
-int get_rotation_style_property(void* _pvCtx, char* pobjUID);
-int get_immediate_drawing_property(void* _pvCtx, char* pobjUID);
-int get_pixmap_property(void* _pvCtx, char* pobjUID);
-int get_type_property(void* _pvCtx, char* pobjUID);
-int get_parent_property(void* _pvCtx, char* pobjUID);
-int get_current_axes_property(void* _pvCtx, char* pobjUID);
-int get_current_figure_property(void* _pvCtx, char* pobjUID);
-int get_current_entity_property(void* _pvCtx, char* pobjUID);
-int get_children_property(void* _pvCtx, char* pobjUID);
-int get_default_figure_property(void* _pvCtx, char* pobjUID);
-int get_default_axes_property(void* _pvCtx, char* pobjUID);
-int get_color_map_property(void* _pvCtx, char* pobjUID);
-int get_interp_color_vector_property(void* _pvCtx, char* pobjUID);
-int get_interp_color_mode_property(void* _pvCtx, char* pobjUID);
-int get_background_property(void* _pvCtx, char* pobjUID);
-int get_foreground_property(void* _pvCtx, char* pobjUID);
-int get_fill_mode_property(void* _pvCtx, char* pobjUID);
-int get_thickness_property(void* _pvCtx, char* pobjUID);
-int get_arrow_size_factor_property(void* _pvCtx, char* pobjUID);
-int get_line_style_property(void* _pvCtx, char* pobjUID);
-int get_line_mode_property(void* _pvCtx, char* pobjUID);
-int get_surface_mode_property(void* _pvCtx, char* pobjUID);
-int get_mark_style_property(void* _pvCtx, char* pobjUID);
-int get_mark_mode_property(void* _pvCtx, char* pobjUID);
-int get_mark_size_unit_property(void* _pvCtx, char* pobjUID);
-int get_mark_size_property(void* _pvCtx, char* pobjUID);
-int get_mark_foreground_property(void* _pvCtx, char* pobjUID);
-int get_mark_background_property(void* _pvCtx, char* pobjUID);
-int get_bar_layout_property(void* _pvCtx, char* pobjUID);
-int get_bar_width_property(void* _pvCtx, char* pobjUID);
-int get_x_shift_property(void* _pvCtx, char* pobjUID);
-int get_y_shift_property(void* _pvCtx, char* pobjUID);
-int get_z_shift_property(void* _pvCtx, char* pobjUID);
-int get_polyline_style_property(void* _pvCtx, char* pobjUID);
-int get_font_size_property(void* _pvCtx, char* pobjUID);
-int get_font_angle_property(void* _pvCtx, char* pobjUID);
-int get_font_foreground_property(void* _pvCtx, char* pobjUID);
-int get_font_color_property(void* _pvCtx, char* pobjUID);
-int get_font_style_property(void* _pvCtx, char* pobjUID);
-int get_text_box_mode_property(void* _pvCtx, char* pobjUID);
-int get_auto_dimensionning_property(void* _pvCtx, char* pobjUID);
-int get_alignment_property(void* _pvCtx, char* pobjUID);
-int get_text_box_property(void* _pvCtx, char* pobjUID);
-int get_text_property(void* _pvCtx, char* pobjUID);
-int get_auto_clear_property(void* _pvCtx, char* pobjUID);
-int get_auto_scale_property(void* _pvCtx, char* pobjUID);
-int get_zoom_box_property(void* _pvCtx, char* pobjUID);
-int get_zoom_state_property(void* _pvCtx, char* pobjUID);
-int get_clip_box_property(void* _pvCtx, char* pobjUID);
-int get_clip_state_property(void* _pvCtx, char* pobjUID);
-int get_data_property(void* _pvCtx, char* pobjUID);
-int get_callback_property(void* _pvCtx, char* pobjUID);
-int get_x_label_property(void* _pvCtx, char* pobjUID);
-int get_y_label_property(void* _pvCtx, char* pobjUID);
-int get_z_label_property(void* _pvCtx, char* pobjUID);
-int get_title_property(void* _pvCtx, char* pobjUID);
-int get_log_flags_property(void* _pvCtx, char* pobjUID);
-int get_tics_direction_property(void* _pvCtx, char* pobjUID);
-int get_x_location_property(void* _pvCtx, char* pobjUID);
-int get_y_location_property(void* _pvCtx, char* pobjUID);
-int get_tight_limits_property(void* _pvCtx, char* pobjUID);
-int get_closed_property(void* _pvCtx, char* pobjUID);
-int get_auto_position_property(void* _pvCtx, char* pobjUID);
-int get_auto_rotation_property(void* _pvCtx, char* pobjUID);
-int get_position_property(void* _pvCtx, char* pobjUID);
-int get_auto_ticks_property(void* _pvCtx, char* pobjUID);
-int get_axes_reverse_property(void* _pvCtx, char* pobjUID);
-int get_view_property(void* _pvCtx, char* pobjUID);
-int get_axes_bounds_property(void* _pvCtx, char* pobjUID);
-int get_data_bounds_property(void* _pvCtx, char* pobjUID);
-int get_margins_property(void* _pvCtx, char* pobjUID);
-int get_tics_color_property(void* _pvCtx, char* pobjUID);
-int get_tics_style_property(void* _pvCtx, char* pobjUID);
-int get_sub_tics_property(void* _pvCtx, char* pobjUID);
-int get_tics_segment_property(void* _pvCtx, char* pobjUID);
-int get_labels_font_size_property(void* _pvCtx, char* pobjUID);
-int get_labels_font_color_property(void* _pvCtx, char* pobjUID);
-int get_labels_font_style_property(void* _pvCtx, char* pobjUID);
-int get_format_n_property(void* _pvCtx, char* pobjUID);
-int get_xtics_coord_property(void* _pvCtx, char* pobjUID);
-int get_ytics_coord_property(void* _pvCtx, char* pobjUID);
-int get_tics_labels_property(void* _pvCtx, char* pobjUID);
-int get_box_property(void* _pvCtx, char* pobjUID);
-int get_grid_property(void* _pvCtx, char* pobjUID);
-int get_axes_visible_property(void* _pvCtx, char* pobjUID);
-int get_hidden_color_property(void* _pvCtx, char* pobjUID);
-int get_isoview_property(void* _pvCtx, char* pobjUID);
-int get_cube_scaling_property(void* _pvCtx, char* pobjUID);
-int get_arrow_size_property(void* _pvCtx, char* pobjUID);
-int get_segs_color_property(void* _pvCtx, char* pobjUID);
-int get_colored_property(void* _pvCtx, char* pobjUID);
-int get_data_mapping_property(void* _pvCtx, char* pobjUID);
-int get_rotation_angles_property(void* _pvCtx, char* pobjUID);
-int get_color_mode_property(void* _pvCtx, char* pobjUID);
-int get_color_flag_property(void* _pvCtx, char* pobjUID);
-int get_cdata_mapping_property(void* _pvCtx, char* pobjUID);
-int get_surface_color_property(void* _pvCtx, char* pobjUID);
-int get_triangles_property(void* _pvCtx, char* pobjUID);
-int get_z_bounds_property(void* _pvCtx, char* pobjUID);
-int get_user_data_property(void* _pvCtx, char* pobjUID);
-int get_handle_visible_property(void* _pvCtx, char* pobjUID);
-int get_callback_type_property(void* _pvCtx, char* pobjUID);
-int get_hidden_axis_color_property(void* _pvCtx, char* pobjUID);
-int get_x_ticks_property(void* _pvCtx, char* pobjUID);
-int get_y_ticks_property(void* _pvCtx, char* pobjUID);
-int get_z_ticks_property(void* _pvCtx, char* pobjUID);
-int get_viewport_property(void* _pvCtx, char* pobjUID);
-int get_info_message_property(void* _pvCtx, char* pobjUID);
-int get_screen_position_property(void* _pvCtx, char* pobjUID);
-int get_event_handler_enable_property(void* _pvCtx, char* pobjUID);
-int get_event_handler_property(void* _pvCtx, char* pobjUID);
-int get_arc_drawing_method_property(void* _pvCtx, char* pobjUID);
-int get_fractional_font_property(void* _pvCtx, char* pobjUID);
-int get_links_property(void* _pvCtx, char* pobjUID);
-int get_legend_location_property(void* _pvCtx, char* pobjUID);
-int get_filled_property(void* _pvCtx, char* pobjUID);
-int get_color_range_property(void* _pvCtx, char* pobjUID);
-int get_outside_colors_property(void* _pvCtx, char* pobjUID);
-int get_grid_position_property(void* _pvCtx, char* pobjUID);
-int get_anti_aliasing_property(void* _pvCtx, char* pobjUID);
-int get_tag_property(void* _pvCtx, char* pobjUID);
-int get_UID(void* _pvCtx, char *pobjUID);
+void* get_figures_id_property(void* _pvCtx, char* pobjUID);
+void* get_visible_property(void* _pvCtx, char* pobjUID);
+void* get_pixel_drawing_mode_property(void* _pvCtx, char* pobjUID);
+void* get_old_style_property(void* _pvCtx, char* pobjUID);
+void* get_figure_style_property(void* _pvCtx, char* pobjUID);
+void* get_auto_resize_property(void* _pvCtx, char* pobjUID);
+void* get_figure_position_property(void* _pvCtx, char* pobjUID);
+void* get_axes_size_property(void* _pvCtx, char* pobjUID);
+void* get_figure_size_property(void* _pvCtx, char* pobjUID);
+void* get_figure_name_property(void* _pvCtx, char* pobjUID);
+void* get_figure_id_property(void* _pvCtx, char* pobjUID);
+void* get_figure_resizefcn_property(void* _pvCtx, char* pobjUID);
+void* get_figure_closerequestfcn_property(void* _pvCtx, char* pobjUID);
+void* get_rotation_style_property(void* _pvCtx, char* pobjUID);
+void* get_immediate_drawing_property(void* _pvCtx, char* pobjUID);
+void* get_pixmap_property(void* _pvCtx, char* pobjUID);
+void* get_type_property(void* _pvCtx, char* pobjUID);
+void* get_parent_property(void* _pvCtx, char* pobjUID);
+void* get_current_axes_property(void* _pvCtx, char* pobjUID);
+void* get_current_figure_property(void* _pvCtx, char* pobjUID);
+void* get_current_entity_property(void* _pvCtx, char* pobjUID);
+void* get_children_property(void* _pvCtx, char* pobjUID);
+void* get_default_figure_property(void* _pvCtx, char* pobjUID);
+void* get_default_axes_property(void* _pvCtx, char* pobjUID);
+void* get_color_map_property(void* _pvCtx, char* pobjUID);
+void* get_interp_color_vector_property(void* _pvCtx, char* pobjUID);
+void* get_interp_color_mode_property(void* _pvCtx, char* pobjUID);
+void* get_background_property(void* _pvCtx, char* pobjUID);
+void* get_foreground_property(void* _pvCtx, char* pobjUID);
+void* get_fill_mode_property(void* _pvCtx, char* pobjUID);
+void* get_thickness_property(void* _pvCtx, char* pobjUID);
+void* get_arrow_size_factor_property(void* _pvCtx, char* pobjUID);
+void* get_line_style_property(void* _pvCtx, char* pobjUID);
+void* get_line_mode_property(void* _pvCtx, char* pobjUID);
+void* get_surface_mode_property(void* _pvCtx, char* pobjUID);
+void* get_mark_style_property(void* _pvCtx, char* pobjUID);
+void* get_mark_mode_property(void* _pvCtx, char* pobjUID);
+void* get_mark_size_unit_property(void* _pvCtx, char* pobjUID);
+void* get_mark_size_property(void* _pvCtx, char* pobjUID);
+void* get_mark_foreground_property(void* _pvCtx, char* pobjUID);
+void* get_mark_background_property(void* _pvCtx, char* pobjUID);
+void* get_bar_layout_property(void* _pvCtx, char* pobjUID);
+void* get_bar_width_property(void* _pvCtx, char* pobjUID);
+void* get_x_shift_property(void* _pvCtx, char* pobjUID);
+void* get_y_shift_property(void* _pvCtx, char* pobjUID);
+void* get_z_shift_property(void* _pvCtx, char* pobjUID);
+void* get_polyline_style_property(void* _pvCtx, char* pobjUID);
+void* get_font_size_property(void* _pvCtx, char* pobjUID);
+void* get_font_angle_property(void* _pvCtx, char* pobjUID);
+void* get_font_foreground_property(void* _pvCtx, char* pobjUID);
+void* get_font_color_property(void* _pvCtx, char* pobjUID);
+void* get_font_style_property(void* _pvCtx, char* pobjUID);
+void* get_text_box_mode_property(void* _pvCtx, char* pobjUID);
+void* get_auto_dimensionning_property(void* _pvCtx, char* pobjUID);
+void* get_alignment_property(void* _pvCtx, char* pobjUID);
+void* get_text_box_property(void* _pvCtx, char* pobjUID);
+void* get_text_property(void* _pvCtx, char* pobjUID);
+void* get_auto_clear_property(void* _pvCtx, char* pobjUID);
+void* get_auto_scale_property(void* _pvCtx, char* pobjUID);
+void* get_zoom_box_property(void* _pvCtx, char* pobjUID);
+void* get_zoom_state_property(void* _pvCtx, char* pobjUID);
+void* get_clip_box_property(void* _pvCtx, char* pobjUID);
+void* get_clip_state_property(void* _pvCtx, char* pobjUID);
+void* get_data_property(void* _pvCtx, char* pobjUID);
+void* get_callback_property(void* _pvCtx, char* pobjUID);
+void* get_x_label_property(void* _pvCtx, char* pobjUID);
+void* get_y_label_property(void* _pvCtx, char* pobjUID);
+void* get_z_label_property(void* _pvCtx, char* pobjUID);
+void* get_title_property(void* _pvCtx, char* pobjUID);
+void* get_log_flags_property(void* _pvCtx, char* pobjUID);
+void* get_tics_direction_property(void* _pvCtx, char* pobjUID);
+void* get_x_location_property(void* _pvCtx, char* pobjUID);
+void* get_y_location_property(void* _pvCtx, char* pobjUID);
+void* get_tight_limits_property(void* _pvCtx, char* pobjUID);
+void* get_closed_property(void* _pvCtx, char* pobjUID);
+void* get_auto_position_property(void* _pvCtx, char* pobjUID);
+void* get_auto_rotation_property(void* _pvCtx, char* pobjUID);
+void* get_position_property(void* _pvCtx, char* pobjUID);
+void* get_auto_ticks_property(void* _pvCtx, char* pobjUID);
+void* get_axes_reverse_property(void* _pvCtx, char* pobjUID);
+void* get_view_property(void* _pvCtx, char* pobjUID);
+void* get_axes_bounds_property(void* _pvCtx, char* pobjUID);
+void* get_data_bounds_property(void* _pvCtx, char* pobjUID);
+void* get_margins_property(void* _pvCtx, char* pobjUID);
+void* get_tics_color_property(void* _pvCtx, char* pobjUID);
+void* get_tics_style_property(void* _pvCtx, char* pobjUID);
+void* get_sub_tics_property(void* _pvCtx, char* pobjUID);
+void* get_tics_segment_property(void* _pvCtx, char* pobjUID);
+void* get_labels_font_size_property(void* _pvCtx, char* pobjUID);
+void* get_labels_font_color_property(void* _pvCtx, char* pobjUID);
+void* get_labels_font_style_property(void* _pvCtx, char* pobjUID);
+void* get_format_n_property(void* _pvCtx, char* pobjUID);
+void* get_xtics_coord_property(void* _pvCtx, char* pobjUID);
+void* get_ytics_coord_property(void* _pvCtx, char* pobjUID);
+void* get_tics_labels_property(void* _pvCtx, char* pobjUID);
+void* get_box_property(void* _pvCtx, char* pobjUID);
+void* get_grid_property(void* _pvCtx, char* pobjUID);
+void* get_axes_visible_property(void* _pvCtx, char* pobjUID);
+void* get_hidden_color_property(void* _pvCtx, char* pobjUID);
+void* get_isoview_property(void* _pvCtx, char* pobjUID);
+void* get_cube_scaling_property(void* _pvCtx, char* pobjUID);
+void* get_arrow_size_property(void* _pvCtx, char* pobjUID);
+void* get_segs_color_property(void* _pvCtx, char* pobjUID);
+void* get_colored_property(void* _pvCtx, char* pobjUID);
+void* get_data_mapping_property(void* _pvCtx, char* pobjUID);
+void* get_rotation_angles_property(void* _pvCtx, char* pobjUID);
+void* get_color_mode_property(void* _pvCtx, char* pobjUID);
+void* get_color_flag_property(void* _pvCtx, char* pobjUID);
+void* get_cdata_mapping_property(void* _pvCtx, char* pobjUID);
+void* get_surface_color_property(void* _pvCtx, char* pobjUID);
+void* get_triangles_property(void* _pvCtx, char* pobjUID);
+void* get_z_bounds_property(void* _pvCtx, char* pobjUID);
+void* get_user_data_property(void* _pvCtx, char* pobjUID);
+void* get_handle_visible_property(void* _pvCtx, char* pobjUID);
+void* get_callback_type_property(void* _pvCtx, char* pobjUID);
+void* get_hidden_axis_color_property(void* _pvCtx, char* pobjUID);
+void* get_x_ticks_property(void* _pvCtx, char* pobjUID);
+void* get_y_ticks_property(void* _pvCtx, char* pobjUID);
+void* get_z_ticks_property(void* _pvCtx, char* pobjUID);
+void* get_viewport_property(void* _pvCtx, char* pobjUID);
+void* get_info_message_property(void* _pvCtx, char* pobjUID);
+void* get_screen_position_property(void* _pvCtx, char* pobjUID);
+void* get_event_handler_enable_property(void* _pvCtx, char* pobjUID);
+void* get_event_handler_property(void* _pvCtx, char* pobjUID);
+void* get_arc_drawing_method_property(void* _pvCtx, char* pobjUID);
+void* get_fractional_font_property(void* _pvCtx, char* pobjUID);
+void* get_links_property(void* _pvCtx, char* pobjUID);
+void* get_legend_location_property(void* _pvCtx, char* pobjUID);
+void* get_filled_property(void* _pvCtx, char* pobjUID);
+void* get_color_range_property(void* _pvCtx, char* pobjUID);
+void* get_outside_colors_property(void* _pvCtx, char* pobjUID);
+void* get_grid_position_property(void* _pvCtx, char* pobjUID);
+void* get_anti_aliasing_property(void* _pvCtx, char* pobjUID);
+void* get_tag_property(void* _pvCtx, char* pobjUID);
+void* get_UID(void* _pvCtx, char *pobjUID);
 
 #endif /* _GET_HANDLE_PROPERTY_H_ */
index 236920c..5c5d4a7 100644 (file)
@@ -30,7 +30,7 @@
 #include "graphicObjectProperties.h"
 
 /*------------------------------------------------------------------------*/
-int get_alignment_property(void* _pvCtx, char* pobjUID)
+void* get_alignment_property(void* _pvCtx, char* pobjUID)
 {
     int iAlignment = 0;
     int* piAlignment = &iAlignment;
@@ -40,25 +40,25 @@ int get_alignment_property(void* _pvCtx, char* pobjUID)
     if (piAlignment == NULL)
     {
         Scierror(999, _("'%s' property does not exist for this handle.\n"), "alignment");
-        return -1;
+        return NULL;
     }
 
     if (iAlignment == 0)
     {
-        return sciReturnString(_pvCtx, "left");
+        return sciReturnString("left");
     }
     else if (iAlignment == 1)
     {
-        return sciReturnString(_pvCtx, "center");
+        return sciReturnString("center");
     }
     else if (iAlignment == 2)
     {
-        return sciReturnString(_pvCtx, "right");
+        return sciReturnString("right");
     }
     else
     {
         Scierror(999, _("Wrong value for '%s' property.\n"), "alignment");
-        return -1;
+        return NULL;
     }
 
 }
index 0b77541..86b1935 100644 (file)
@@ -28,7 +28,7 @@
 #include "graphicObjectProperties.h"
 
 /*------------------------------------------------------------------------*/
-int get_anti_aliasing_property(void* _pvCtx, char* pobjUID)
+void* get_anti_aliasing_property(void* _pvCtx, char* pobjUID)
 {
     int iAntialiasing = 0;
     int* piAntialiasing = &iAntialiasing;
@@ -37,32 +37,32 @@ int get_anti_aliasing_property(void* _pvCtx, char* pobjUID)
     if (piAntialiasing == NULL)
     {
         Scierror(999, _("'%s' property does not exist for this handle.\n"), "anti_aliasing");
-        return -1;
+        return NULL;
     }
 
     switch (iAntialiasing)
     {
         case 0:
-            return sciReturnString(_pvCtx, "off");
+            return sciReturnString("off");
             break;
         case 1:
-            return sciReturnString(_pvCtx, "2x");
+            return sciReturnString("2x");
             break;
         case 2:
-            return sciReturnString(_pvCtx, "4x");
+            return sciReturnString("4x");
             break;
         case 3:
-            return sciReturnString(_pvCtx, "8x");
+            return sciReturnString("8x");
             break;
         case 4:
-            return sciReturnString(_pvCtx, "16x");
+            return sciReturnString("16x");
             break;
         default:
             Scierror(999, _("Wrong value for '%s' property.\n"), "anti_aliasing");
-            return -1;
+            return NULL;
             break;
     }
 
-    return sciReturnString(_pvCtx, "off");
+    return sciReturnString("off");
 }
 /*------------------------------------------------------------------------*/
index 19222f3..8ff0019 100644 (file)
@@ -28,7 +28,7 @@
 #include "graphicObjectProperties.h"
 
 /*------------------------------------------------------------------------*/
-int get_arc_drawing_method_property(void* _pvCtx, char* pobjUID)
+void* get_arc_drawing_method_property(void* _pvCtx, char* pobjUID)
 {
     int iArcDrawingMethod = 0;
     int* piArcDrawingMethod = &iArcDrawingMethod;
@@ -38,23 +38,22 @@ int get_arc_drawing_method_property(void* _pvCtx, char* pobjUID)
     if (piArcDrawingMethod == NULL)
     {
         Scierror(999, _("'%s' property does not exist for this handle.\n"), "arc_drawing_method");
-        return -1;
+        return NULL;
     }
 
     /* 0: nurbs, 1: lines */
     if (iArcDrawingMethod == 0)
     {
-        return sciReturnString(_pvCtx, "nurbs");
+        return sciReturnString("nurbs");
     }
     else if (iArcDrawingMethod == 1)
     {
-        return sciReturnString(_pvCtx, "lines");
+        return sciReturnString("lines");
     }
     else
     {
         Scierror(999, _("Wrong value for '%s' property.\n"), "arc_drawing_method");
-        return -1;
+        return NULL;
     }
-
 }
 /*------------------------------------------------------------------------*/
index ff8ae42..3c7c659 100644 (file)
@@ -30,7 +30,7 @@
 #include "graphicObjectProperties.h"
 
 /*------------------------------------------------------------------------*/
-int get_arrow_size_factor_property(void* _pvCtx, char* pobjUID)
+void* get_arrow_size_factor_property(void* _pvCtx, char* pobjUID)
 {
     double dblArrowSizeFactor = 0;
     double* pdblArrowSizeFactor = &dblArrowSizeFactor;
@@ -40,9 +40,9 @@ int get_arrow_size_factor_property(void* _pvCtx, char* pobjUID)
     if (pdblArrowSizeFactor == NULL)
     {
         Scierror(999, _("'%s' property does not exist for this handle.\n"), "arrow_size_factor");
-        return -1;
+        return NULL;
     }
 
-    return sciReturnDouble(_pvCtx, dblArrowSizeFactor);
+    return sciReturnDouble(dblArrowSizeFactor);
 }
 /*------------------------------------------------------------------------*/
index 04f2b2b..3372867 100644 (file)
@@ -30,7 +30,7 @@
 #include "graphicObjectProperties.h"
 
 /*------------------------------------------------------------------------*/
-int get_arrow_size_property(void* _pvCtx, char* pobjUID)
+void* get_arrow_size_property(void* _pvCtx, char* pobjUID)
 {
     double arrowSize = 0.0;
     double* pdblArrowSize = &arrowSize;
@@ -40,9 +40,9 @@ int get_arrow_size_property(void* _pvCtx, char* pobjUID)
     if (pdblArrowSize == NULL)
     {
         Scierror(999, _("'%s' property does not exist for this handle.\n"), "arrow_size");
-        return -1;
+        return NULL;
     }
 
-    return sciReturnDouble(_pvCtx, arrowSize);
+    return sciReturnDouble(arrowSize);
 }
 /*------------------------------------------------------------------------*/
index 2002bce..6af0443 100644 (file)
@@ -29,7 +29,7 @@
 #include "graphicObjectProperties.h"
 
 /*------------------------------------------------------------------------*/
-int get_auto_clear_property(void* _pvCtx, char* pobjUID)
+void* get_auto_clear_property(void* _pvCtx, char* pobjUID)
 {
     int iAutoClear = 0;
     int* piAutoClear = &iAutoClear;
@@ -39,16 +39,16 @@ int get_auto_clear_property(void* _pvCtx, char* pobjUID)
     if (piAutoClear == NULL)
     {
         Scierror(999, _("'%s' property does not exist for this handle.\n"), "auto_clear");
-        return -1;
+        return NULL;
     }
 
     if (iAutoClear)
     {
-        return sciReturnString(_pvCtx, "on");
+        return sciReturnString("on");
     }
     else
     {
-        return sciReturnString(_pvCtx, "off");
+        return sciReturnString("off");
     }
 }
 
index 8b83978..a53c913 100644 (file)
@@ -30,7 +30,7 @@
 #include "graphicObjectProperties.h"
 
 /*------------------------------------------------------------------------*/
-int get_auto_dimensionning_property(void* _pvCtx, char* pobjUID)
+void* get_auto_dimensionning_property(void* _pvCtx, char* pobjUID)
 {
     int iAutoDimensioning = 0;
     int* piAutoDimensioning = &iAutoDimensioning;
@@ -40,16 +40,16 @@ int get_auto_dimensionning_property(void* _pvCtx, char* pobjUID)
     if (piAutoDimensioning == NULL)
     {
         Scierror(999, _("'%s' property does not exist for this handle.\n"), "auto_dimensionning");
-        return -1;
+        return NULL;
     }
 
     if (iAutoDimensioning)
     {
-        return sciReturnString(_pvCtx, "on");
+        return sciReturnString("on");
     }
     else
     {
-        return sciReturnString(_pvCtx, "off");
+        return sciReturnString("off");
     }
 
 }
index 2f27414..d1d8334 100644 (file)
@@ -30,7 +30,7 @@
 #include "graphicObjectProperties.h"
 
 /*------------------------------------------------------------------------*/
-int get_auto_position_property(void* _pvCtx, char* pobjUID)
+void* get_auto_position_property(void* _pvCtx, char* pobjUID)
 {
     int iAutoPosition = 0;
     int* piAutoPosition = &iAutoPosition;
@@ -40,16 +40,16 @@ int get_auto_position_property(void* _pvCtx, char* pobjUID)
     if (piAutoPosition == NULL)
     {
         Scierror(999, _("'%s' property does not exist for this handle.\n"), "auto_position");
-        return -1;
+        return NULL;
     }
 
     if (iAutoPosition)
     {
-        return sciReturnString(_pvCtx, "on");
+        return sciReturnString("on");
     }
     else
     {
-        return sciReturnString(_pvCtx, "off");
+        return sciReturnString("off");
     }
 }
 /*------------------------------------------------------------------------*/