/*------------------------------------------------------------------------*/ int set_bar_layout_property(char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol ) { // FIXME #if 0 if ( !isParameterStringMatrix( valueType ) ) { Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "bar_layout"); return SET_PROPERTY_ERROR ; } if ( sciGetEntityType(pobj) != SCI_POLYLINE ) { Scierror(999, _("'%s' property does not exist for this handle.\n"),"bar_layout") ; return SET_PROPERTY_ERROR ; } if( isStringParamEqual( stackPointer, "grouped" ) ) { pPOLYLINE_FEATURE (pobj)->bar_layout = 0 ; } else if( isStringParamEqual( stackPointer, "stacked" ) ) { pPOLYLINE_FEATURE (pobj)->bar_layout = 1 ; } else { Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "bar_layout", "grouped", "stacked"); return SET_PROPERTY_ERROR ; } #endif return SET_PROPERTY_ERROR; }
/*------------------------------------------------------------------------*/ int set_figure_style_property(char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol ) { if ( !isParameterStringMatrix( valueType ) ) { Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "figure_style"); return SET_PROPERTY_ERROR ; } if ( isStringParamEqual( stackPointer, "old" ) ) { Scierror(999, _("Old graphic mode is no longer available. Please refer to the set help page.\n")) ; return SET_PROPERTY_ERROR ; } else if ( isStringParamEqual( stackPointer, "new" ) ) { /* graphic mode must be new */ /* nothing to do */ return SET_PROPERTY_UNCHANGED ; } else { Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "figure_style", "'old'", "'new'"); } return SET_PROPERTY_ERROR ; }
/*------------------------------------------------------------------------*/ int set_y_location_property(char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol ) { BOOL status; int axisLocation; if ( !isParameterStringMatrix( valueType ) ) { Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "y_location"); return SET_PROPERTY_ERROR ; } #if 0 if ( sciGetEntityType(pobj) != SCI_SUBWIN ) { Scierror(999, _("'%s' property does not exist for this handle.\n"),"y_location") ; return SET_PROPERTY_ERROR ; } #endif if ( isStringParamEqual( stackPointer, "left" ) ) { axisLocation = 4; } else if ( isStringParamEqual( stackPointer, "right" ) ) { axisLocation = 5; } else if ( isStringParamEqual( stackPointer, "middle" ) ) { axisLocation = 2; } else if ( isStringParamEqual( stackPointer, "origin" ) ) { axisLocation = 3; } else { Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "y_location", "left, right, middle, origin"); return SET_PROPERTY_ERROR ; } status = setGraphicObjectProperty(pobjUID, __GO_Y_AXIS_LOCATION__, &axisLocation, jni_int, 1); if (status == TRUE) { return SET_PROPERTY_SUCCEED; } else { Scierror(999, _("'%s' property does not exist for this handle.\n"),"y_location"); return SET_PROPERTY_ERROR; } }
/*------------------------------------------------------------------------*/ int set_anti_aliasing_property(char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol ) { int quality = 0; BOOL status; if ( !isParameterStringMatrix( valueType ) ) { Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "anti_aliasing"); return SET_PROPERTY_ERROR ; } if ( isStringParamEqual( stackPointer, "off" ) ) { quality = 0; } else if ( isStringParamEqual( stackPointer, "2x" ) ) { quality = 2; } else if ( isStringParamEqual( stackPointer, "4x" ) ) { quality = 4; } else if ( isStringParamEqual( stackPointer, "8x" ) ) { quality = 8; } else if ( isStringParamEqual( stackPointer, "16x" ) ) { quality = 16; } else { Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "anti_aliasing", "off, 2x, 4x, 8x, 16x"); return SET_PROPERTY_ERROR ; } status = setGraphicObjectProperty(pobjUID, __GO_ANTIALIASING__, &quality, jni_int, 1); if (status == TRUE) { return SET_PROPERTY_SUCCEED; } else { Scierror(999, _("'%s' property does not exist for this handle.\n"), "anti_aliasing") ; return SET_PROPERTY_ERROR; } return status; }
/*------------------------------------------------------------------------*/ int set_mark_size_unit_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol ) { BOOL status = FALSE; int markSizeUnit = 0; if ( !( valueType == sci_strings ) ) { Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "mark_size_unit"); return SET_PROPERTY_ERROR ; } /* 0 : point, 1 : tabulated */ if ( isStringParamEqual( stackPointer, "point") ) { markSizeUnit = 0; } else if ( isStringParamEqual( stackPointer, "tabulated" ) ) { markSizeUnit = 1; } else { Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "mark_size_unit", "'point'", "'tabulated'"); } status = setGraphicObjectProperty(pobjUID, __GO_MARK_SIZE_UNIT__, &markSizeUnit, jni_int, 1); if (status == TRUE) { return SET_PROPERTY_SUCCEED; } else { Scierror(999, _("'%s' property does not exist for this handle.\n"), "mark_size_unit"); return SET_PROPERTY_ERROR; } }
/*------------------------------------------------------------------------*/ int set_arc_drawing_method_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol ) { BOOL status = FALSE; int arcDrawingMethod = 0; if ( !( valueType == sci_strings ) ) { Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "arc_drawing_method"); return SET_PROPERTY_ERROR; } if ( isStringParamEqual( stackPointer, "nurbs" ) ) { arcDrawingMethod = 0; } else if ( isStringParamEqual( stackPointer, "lines" ) ) { arcDrawingMethod = 1; } else { Scierror(999, _("Wrong value for '%s' property: %s or %s expected.\n"), "drawing_method", "nurbs", "lines"); return SET_PROPERTY_ERROR; } status = setGraphicObjectProperty(pobjUID, __GO_ARC_DRAWING_METHOD__, &arcDrawingMethod, jni_int, 1); if (status == TRUE) { return SET_PROPERTY_SUCCEED; } else { Scierror(999, _("'%s' property does not exist for this handle.\n"), "arc_drawing_method"); return SET_PROPERTY_ERROR; } }
/*------------------------------------------------------------------------*/ int set_box_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol ) { BOOL status = FALSE; int type = -1; int *piType = &type; if ( !( valueType == sci_strings ) ) { Scierror(999, _("Wrong type for '%s' property: String expected.\n"), "box"); return SET_PROPERTY_ERROR ; } getGraphicObjectProperty(pobjUID, __GO_TYPE__, jni_int, (void **)&piType); /* * Required since the Box property is implemented differently for the Axes and Text * objects (respectively as an Integer and a Boolean). * To be corrected */ if (type == __GO_AXES__) { int boxType; if ( isStringParamEqual( stackPointer, "off" ) ) { boxType = 0; } else if ( isStringParamEqual( stackPointer, "on" ) ) { boxType = 1; } else if ( isStringParamEqual( stackPointer, "hidden_axes" ) ) { boxType = 2; } else if ( isStringParamEqual( stackPointer, "back_half" ) ) { boxType = 3; } else if ( isStringParamEqual( stackPointer, "hidden_axis" ) ) { sciprint(_("WARNING !!!\nIn '%s' property: '%s' is deprecated use '%s' instead.\n"), "box", "hidden_axis", "hidden_axes"); boxType = 2; } else { Scierror(999, _("Wrong value for '%s' property: Must be in the set {%s}.\n"), "box", "on, off, hidden_axes, back_half"); return SET_PROPERTY_ERROR; } status = setGraphicObjectProperty(pobjUID, __GO_BOX_TYPE__, &boxType, jni_int, 1); if (status == TRUE) { return SET_PROPERTY_SUCCEED; } else { Scierror(999, _("'%s' property does not exist for this handle.\n"), "box"); return SET_PROPERTY_ERROR; } } else if (type == __GO_TEXT__) { int box; if ( isStringParamEqual( stackPointer, "on" ) ) { box = 1; } else if ( isStringParamEqual( stackPointer, "off" ) ) { box = 0; } else { Scierror(999, _("Wrong value for '%s' property: '%s' or '%s' expected.\n"), "box", "on", "off"); return SET_PROPERTY_ERROR; } status = setGraphicObjectProperty(pobjUID, __GO_BOX__, &box, jni_bool, 1); if (status == TRUE) { return SET_PROPERTY_SUCCEED; } else { Scierror(999, _("'%s' property does not exist for this handle.\n"), "box"); return SET_PROPERTY_ERROR; } } else { Scierror(999, _("'%s' property does not exist for this handle.\n"), "box"); return SET_PROPERTY_ERROR; } }