/*------------------------------------------------------------------------*/
int set_handle_visible_property(void* _pvCtx, char* pobjUID, void* _pvData, int valueType, int nbRow, int nbCol)
{
    int b = (int)FALSE;
    BOOL status = FALSE;

    b = tryGetBooleanValueFromStack(_pvData, valueType, nbRow, nbCol, "handle_visible");
    if (b == NOT_A_BOOLEAN_VALUE)
    {
        return SET_PROPERTY_ERROR;
    }

    b = 1 - b;                  /* Handle visible is equivalent to not hidden */

    status = setGraphicObjectProperty(pobjUID, __GO_HIDDEN__, &b, jni_bool, 1);

    if (status == TRUE)
    {
        return SET_PROPERTY_SUCCEED;
    }
    else
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "handle_visible");
        return SET_PROPERTY_ERROR;
    }
}
/*------------------------------------------------------------------------*/
int set_auto_rotation_property(char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
    BOOL status;
    int b =  (int)FALSE;
#if 0
    if ( sciGetEntityType(pobj) != SCI_LABEL )
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"),"auto_rotation");
        return SET_PROPERTY_ERROR ;
    }
#endif

    b = tryGetBooleanValueFromStack(stackPointer, valueType, nbRow, nbCol, "auto_rotation");
    if(b == NOT_A_BOOLEAN_VALUE)
    {
        return SET_PROPERTY_ERROR;
    }

    status = setGraphicObjectProperty(pobjUID, __GO_AUTO_ROTATION__, &b, jni_bool, 1);

    if (status == TRUE)
    {
        return SET_PROPERTY_SUCCEED;
    }
    else
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"),"auto_rotation");
        return SET_PROPERTY_ERROR;
    }
}
/*------------------------------------------------------------------------*/
int set_immediate_drawing_property(char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
	int b =  (int)FALSE;
	BOOL status;

#if 0
	if ( sciGetEntityType (pobj) != SCI_FIGURE )
	{
		Scierror(999, _("'%s' property does not exist for this handle.\n"),"immediate_drawing");
		return SET_PROPERTY_ERROR ;
	}
#endif

	b = tryGetBooleanValueFromStack(stackPointer, valueType, nbRow, nbCol, "immediate_drawing");
	if(b == NOT_A_BOOLEAN_VALUE) return SET_PROPERTY_ERROR;

	status = setGraphicObjectProperty(pobjUID, __GO_IMMEDIATE_DRAWING__, &b, jni_bool, 1);

	if (status == TRUE)
	{
		return SET_PROPERTY_SUCCEED;
	}
	else
	{
		Scierror(999, _("'%s' property does not exist for this handle.\n"),"immediate_drawing");
		return SET_PROPERTY_ERROR;
	}
}
/*------------------------------------------------------------------------*/
int set_scrollable_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
{
    int b = (int)FALSE;
    BOOL status = FALSE;

    b =  tryGetBooleanValueFromStack(_pvData, valueType, nbRow, nbCol, "scrollable");
    if (b == NOT_A_BOOLEAN_VALUE)
    {
        return SET_PROPERTY_ERROR;
    }

    if (setGraphicObjectProperty(iObjUID, __GO_UI_SCROLLABLE__, &b, jni_bool, 1) == FALSE)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "scrollable");
        return SET_PROPERTY_ERROR;
    }

    return SET_PROPERTY_SUCCEED;
}
/*------------------------------------------------------------------------*/
int set_interp_color_mode_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
{
    BOOL status = FALSE;
    int b =  (int)FALSE;
    int iInterpColorVectorSet = 0;
    int* piInterpColorVectorSet = &iInterpColorVectorSet;

    b = tryGetBooleanValueFromStack(_pvData, valueType, nbRow, nbCol, "interp_color_mode");
    if (b == NOT_A_BOOLEAN_VALUE)
    {
        return SET_PROPERTY_ERROR;
    }

    if (b == TRUE)
    {
        getGraphicObjectProperty(iObjUID, __GO_INTERP_COLOR_VECTOR_SET__, jni_bool, (void **)&piInterpColorVectorSet);

        if (piInterpColorVectorSet == NULL)
        {
            Scierror(999, _("'%s' property does not exist for this handle.\n"), "interp_color_mode");
            return SET_PROPERTY_ERROR;
        }

        if (iInterpColorVectorSet  == FALSE)
        {
            Scierror(999, _("You must first specify an %s for this object.\n"), "interp_color_vector");
            return SET_PROPERTY_ERROR;
        }
    }

    status = setGraphicObjectProperty(iObjUID, __GO_INTERP_COLOR_MODE__, &b, jni_bool, 1);

    if (status == TRUE)
    {
        return SET_PROPERTY_SUCCEED;
    }
    else
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "interp_color_mode");
        return SET_PROPERTY_ERROR;
    }
}
Esempio n. 6
0
/*------------------------------------------------------------------------*/
int set_pixmap_property(void* _pvCtx, char* pobjUID, size_t stackPointer, int valueType, int nbRow, int nbCol )
{
	int b =  (int)FALSE;
	BOOL status = FALSE;

	b = tryGetBooleanValueFromStack(stackPointer, valueType, nbRow, nbCol, "pixmap");
	if(b == NOT_A_BOOLEAN_VALUE) return SET_PROPERTY_ERROR;

	status = setGraphicObjectProperty(pobjUID, __GO_PIXMAP__, &b, jni_bool, 1);

	if (status == TRUE)
	{
		return SET_PROPERTY_SUCCEED;
	}
	else
	{
		Scierror(999, _("'%s' property does not exist for this handle.\n"),"pixmap");
		return SET_PROPERTY_ERROR;
	}
}
/*------------------------------------------------------------------------*/
int set_event_handler_enable_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
{
    int b =  (int)FALSE;
    BOOL status = FALSE;

    b =  tryGetBooleanValueFromStack(_pvData, valueType, nbRow, nbCol, "event_handler_enable");
    if (b == NOT_A_BOOLEAN_VALUE)
    {
        return SET_PROPERTY_ERROR;
    }

    status = setGraphicObjectProperty(iObjUID, __GO_EVENTHANDLER_ENABLE__, &b, jni_bool, 1);

    if (status == TRUE)
    {
        return SET_PROPERTY_SUCCEED;
    }
    else
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "event_handler_enable");
        return SET_PROPERTY_ERROR;
    }
}
Esempio n. 8
0
/*------------------------------------------------------------------------*/
int set_filled_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
{
    BOOL status;
    int b =  (int)FALSE;

    b = tryGetBooleanValueFromStack(_pvData, valueType, nbRow, nbCol, "filled");
    if (b == NOT_A_BOOLEAN_VALUE)
    {
        return SET_PROPERTY_ERROR;
    }

    status = setGraphicObjectProperty(iObjUID, __GO_FILLED__, &b, jni_bool, 1);

    if (status == TRUE)
    {
        return SET_PROPERTY_SUCCEED;
    }
    else
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "filled");
        return SET_PROPERTY_ERROR;
    }
}
/*------------------------------------------------------------------------*/
int set_auto_resize_property(void* _pvCtx, char* pobjUID, void* _pvData, int valueType, int nbRow, int nbCol)
{
    BOOL result = FALSE;
    int b =  (int)FALSE;

    b = tryGetBooleanValueFromStack(_pvData, valueType, nbRow, nbCol, "auto_resize");
    if (b == NOT_A_BOOLEAN_VALUE)
    {
        return SET_PROPERTY_ERROR;
    }

    result = setGraphicObjectProperty(pobjUID, __GO_AUTORESIZE__, &b, jni_bool, 1);

    if (result == TRUE)
    {
        return SET_PROPERTY_SUCCEED;
    }
    else
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "auto_resize");
        return SET_PROPERTY_ERROR;
    }
}
int SetConsoleShowHiddenHandles(void* _pvCtx, char *pobjUID, void* _pvData, int valueType, int nbRow, int nbCol)
{
    int b = (int)FALSE;
    BOOL status = FALSE;

    b = tryGetBooleanValueFromStack(_pvData, valueType, nbRow, nbCol, const_cast < char *>("ShowHiddenHandles"));

    if (b == NOT_A_BOOLEAN_VALUE)
    {
        return SET_PROPERTY_ERROR;
    }

    status = setGraphicObjectProperty(pobjUID, __GO_SHOWHIDDENHANDLES__, &b, jni_bool, 1);

    if (status == TRUE)
    {
        return SET_PROPERTY_SUCCEED;
    }
    else
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "ShowHiddenHandles");
        return SET_PROPERTY_ERROR;
    }
}
/*------------------------------------------------------------------------*/
int set_tight_limits_property(void* _pvCtx, int iObjUID, void* _pvData, int valueType, int nbRow, int nbCol)
{
    BOOL status[3];
    char ** values = NULL;
    int mSize = nbRow * nbCol;

    int const axesTightLimitsPropertiesNames[3] = {__GO_X_TIGHT_LIMITS__, __GO_Y_TIGHT_LIMITS__, __GO_Z_TIGHT_LIMITS__};

    if (mSize == 1)
    {
        int tightLimits = (int) FALSE;

        if (valueType == sci_strings)
        {
            tightLimits = tryGetBooleanValueFromStack(((char **)_pvData)[0], valueType, nbRow, nbCol, "tight_limits");
        }
        else
        {
            tightLimits = tryGetBooleanValueFromStack(_pvData, valueType, nbRow, nbCol, "tight_limits");
        }

        if (tightLimits == NOT_A_BOOLEAN_VALUE)
        {
            return SET_PROPERTY_ERROR;
        }

        status[0] = setGraphicObjectProperty(iObjUID, axesTightLimitsPropertiesNames[0], &tightLimits, jni_bool, 1);
        status[1] = setGraphicObjectProperty(iObjUID, axesTightLimitsPropertiesNames[1], &tightLimits, jni_bool, 1);
        status[2] = setGraphicObjectProperty(iObjUID, axesTightLimitsPropertiesNames[2], &tightLimits, jni_bool, 1);

        if (status[0] == TRUE && status[1] == TRUE && status[2] == TRUE)
        {
            return SET_PROPERTY_SUCCEED;
        }
        else
        {
            Scierror(999, _("'%s' property does not exist for this handle.\n"), "tight_limits");
            return SET_PROPERTY_ERROR;
        }
    }
    else if (mSize == 2 || mSize == 3)
    {
        int i;
        BOOL tightLimits[3];
        int iTightLimits = 0;
        int *piTightLimits = &iTightLimits;

        if (valueType != sci_strings)
        {
            Scierror(999, _("Wrong type for '%s' property: string expected.\n"), "tight_limits");
            return SET_PROPERTY_ERROR;
        }

        getGraphicObjectProperty(iObjUID, axesTightLimitsPropertiesNames[0], jni_bool, (void **)&piTightLimits);

        if (piTightLimits == NULL)
        {
            Scierror(999, _("'%s' property does not exist for this handle.\n"), "tight_limits");
            return SET_PROPERTY_ERROR;
        }

        tightLimits[0] = iTightLimits;

        getGraphicObjectProperty(iObjUID, axesTightLimitsPropertiesNames[1], jni_bool, (void **)&piTightLimits);
        tightLimits[1] = iTightLimits;

        getGraphicObjectProperty(iObjUID, axesTightLimitsPropertiesNames[2], jni_bool, (void **)&piTightLimits);
        tightLimits[2] = iTightLimits;

        values = (char**)_pvData;

        for (i = 0; i < mSize; i++)
        {
            if (strcmp(values[i], "off") == 0)
            {
                tightLimits[i] = FALSE;
            }
            else if (strcmp(values[i], "on") == 0)
            {
                tightLimits[i] = TRUE;
            }
            else
            {
                Scierror(999, _("Wrong value for '%s' property: '%s' or '%s' expected.\n"), "tight_limits", "on", "off");
                return SET_PROPERTY_ERROR;
            }
        }

        status[0] = setGraphicObjectProperty(iObjUID, axesTightLimitsPropertiesNames[0], &tightLimits[0], jni_bool, 1);
        status[1] = setGraphicObjectProperty(iObjUID, axesTightLimitsPropertiesNames[1], &tightLimits[1], jni_bool, 1);
        status[2] = setGraphicObjectProperty(iObjUID, axesTightLimitsPropertiesNames[2], &tightLimits[2], jni_bool, 1);

        if (status[0] == TRUE && status[1] == TRUE && status[2] == TRUE)
        {
            return SET_PROPERTY_SUCCEED;
        }
        else
        {
            Scierror(999, _("'%s' property does not exist for this handle.\n"), "tight_limits");
            return SET_PROPERTY_ERROR;
        }
    }
    else
    {
        Scierror(999, _("Wrong size for '%s' property: At most %d elements expected.\n"), "tight_limits", 3);
        return SET_PROPERTY_ERROR;
    }
    return SET_PROPERTY_ERROR;
}