Пример #1
0
/*------------------------------------------------------------------------*/
int get_text_box_mode_property(void* _pvCtx, char* pobjUID)
{
    int iTextBoxMode = 0;
    int* piTextBoxMode = &iTextBoxMode;

    getGraphicObjectProperty(pobjUID, __GO_TEXT_BOX_MODE__, jni_int, (void**)&piTextBoxMode);

    if (piTextBoxMode == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"),"text_box_mode");
        return -1;
    }

    if (iTextBoxMode == 0)
    {
        return sciReturnString(_pvCtx, "off");
    }
    else if (iTextBoxMode == 1)
    {
        return sciReturnString(_pvCtx, "centered");
    }
    else if (iTextBoxMode == 2)
    {
        return sciReturnString(_pvCtx, "filled");
    }
    else
    {
        Scierror(999, _("Wrong value for '%s' property.\n"), "text_box_mode");
        return -1;
    }

}
/*------------------------------------------------------------------------*/
int get_mark_size_unit_property(void* _pvCtx, char* pobjUID)
{
    int iMarkSizeUnit = 0;
    int* piMarkSizeUnit = &iMarkSizeUnit;

    getGraphicObjectProperty(pobjUID, __GO_MARK_SIZE_UNIT__, jni_int, (void**)&piMarkSizeUnit);

    if (piMarkSizeUnit == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "mark_size_unit");
        return -1;
    }

    if (iMarkSizeUnit == 0)
    {
        return sciReturnString(_pvCtx, "point");
    }
    else if (iMarkSizeUnit == 1)
    {
        return sciReturnString(_pvCtx, "tabulated");
    }
    else
    {
        Scierror(999, _("Wrong value for '%s' property.\n"), "mark_size_unit");
        return -1;
    }

}
/*------------------------------------------------------------------------*/
int get_data_mapping_property(void* _pvCtx, char* pobjUID)
{
    int iDataMapping = 0;
    int* piDataMapping = &iDataMapping;

    getGraphicObjectProperty(pobjUID, __GO_DATA_MAPPING__, jni_int, (void **)&piDataMapping);

    if (piDataMapping == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "data_mapping");
        return -1;
    }

    if (iDataMapping == 0)
    {
        return sciReturnString(_pvCtx, "scaled");
    }
    else if (iDataMapping == 1)
    {
        return sciReturnString(_pvCtx, "direct");
    }
    else
    {
        Scierror(999, _("Wrong value for '%s' property.\n"), "data_mapping");
        return -1;
    }
}
/*------------------------------------------------------------------------*/
void* get_alignment_property(void* _pvCtx, int iObjUID)
{
    int iAlignment = 0;
    int* piAlignment = &iAlignment;

    getGraphicObjectProperty(iObjUID, __GO_ALIGNMENT__, jni_int, (void **)&piAlignment);

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

    if (iAlignment == 0)
    {
        return sciReturnString("left");
    }
    else if (iAlignment == 1)
    {
        return sciReturnString("center");
    }
    else if (iAlignment == 2)
    {
        return sciReturnString("right");
    }
    else
    {
        Scierror(999, _("Wrong value for '%s' property.\n"), "alignment");
        return NULL;
    }

}
Пример #5
0
/*------------------------------------------------------------------------*/
int get_clip_state_property(void* _pvCtx, char* pobjUID)
{
    int iClipState = 0;
    int* piClipState = &iClipState;

    getGraphicObjectProperty(pobjUID, __GO_CLIP_STATE__, jni_int, (void **)&piClipState);

    if (piClipState == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "clip_state");
        return -1;
    }

    if (iClipState == 0)
    {
        return sciReturnString(_pvCtx, "off");
    }
    else if (iClipState == 1)
    {
        return sciReturnString(_pvCtx, "clipgrf");
    }
    else if (iClipState == 2)
    {
        return sciReturnString(_pvCtx, "on");
    }
    else
    {
        Scierror(999, _("Wrong value for '%s' property.\n"), "clip_state");
        return -1;
    }

}
Пример #6
0
/*------------------------------------------------------------------------*/
void* get_type_property(void* _pvCtx, int iObjUID)
{
    int iType = -1;
    int *piType = &iType;

    getGraphicObjectProperty(iObjUID, __GO_TYPE__, jni_int, (void **)&piType);
    if (piType == NULL)
    {
        return sciReturnString(getTypeNameFromInt(-1));
    }

    return sciReturnString(getTypeNameFromInt(iType));
}
/*------------------------------------------------------------------------*/
void* get_figure_closerequestfcn_property(void* _pvCtx, int iObjUID)
{
    char* closeRequestFcn = NULL;
    int iType = -1;
    int *piType = &iType;

    getGraphicObjectProperty(iObjUID, __GO_TYPE__, jni_int, (void **)&piType);
    if (piType == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "type");
        return NULL;
    }
    if (iType != __GO_FIGURE__)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "closerequestfcn");
        return NULL;
    }

    getGraphicObjectProperty(iObjUID, __GO_CLOSEREQUESTFCN__, jni_string, (void **) &closeRequestFcn);

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

    return sciReturnString(closeRequestFcn);
}
Пример #8
0
/**
 * Get display mode for datatips
 */
void* get_datatip_display_mode_property(void* _pvCtx, int iObjUID)
{
    int datatip_display_mode = -1;
    int * p_datatip_display_mode = &datatip_display_mode;
    const char * name = NULL;
    getGraphicObjectProperty(iObjUID, __GO_DATATIP_DISPLAY_MODE__, jni_int, (void **)&p_datatip_display_mode);

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

    switch (datatip_display_mode)
    {
        case 0:
            name = "always";
            break;
        case 1:
            name = "mouseclick";
            break;
        case 2:
            name = "mouseover";
            break;
        default:
            name = "always";
            break;
    }

    return sciReturnString(name);
}
/*------------------------------------------------------------------------*/
int get_y_location_property(char *pobjUID)
{
    int iLocation = 0;
    int* piLocation = &iLocation;

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

    getGraphicObjectProperty(pobjUID, __GO_Y_AXIS_LOCATION__, jni_int, &piLocation);

    if (piLocation == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"),"y_location");
        return -1;
    }

    if (iLocation == 4)
    {
        return sciReturnString( "left" );
    }
    else if (iLocation == 5)
    {
        return sciReturnString( "right" );
    }
    else if (iLocation == 2)
    {
        return sciReturnString( "middle" );
    }
    else if (iLocation == 3)
    {
        return sciReturnString( "origin" );
    }
    else
    {
        Scierror(999, _("Wrong value for '%s' property.\n"),"y_location");
        return -1;
    }

}
/*------------------------------------------------------------------------*/
void* get_zoom_state_property(void* _pvCtx, int iObjUID)
{
    int iZoomState = 0;
    int *piZoomState = &iZoomState;

    getGraphicObjectProperty(iObjUID, __GO_ZOOM_ENABLED__, jni_bool, (void **)&piZoomState);

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

    if (iZoomState)
    {
        return sciReturnString("on");
    }
    return sciReturnString("off");
}
int get_old_style_property(char *pobjUID)
{
    if (pobjUID != NULL)
    {
        /* This property should not be called on an handle */
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "old_style");
        return -1;
    }

  /* no more old style */
  return sciReturnString( "off" ) ;
}
Пример #12
0
/*------------------------------------------------------------------------*/
void* get_toolbar_visible_property(void* _pvCtx, int iObjUID)
{
    int iVisible = 0;
    int* piVisible = &iVisible;
    getGraphicObjectProperty(iObjUID, __GO_TOOLBAR_VISIBLE__, jni_bool, (void **)&piVisible);

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

    if (iVisible == 0)
    {
        return sciReturnString("off");
    }
    else
    {
        return sciReturnString("on");
    }
}
Пример #13
0
/*------------------------------------------------------------------------*/
void* get_toolbar_property(void* _pvCtx, int iObjUID)
{
    int itool = 0;
    int* pitool = &itool;
    getGraphicObjectProperty(iObjUID, __GO_TOOLBAR__, jni_int, (void **)&pitool);

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

    switch (itool)
    {
        default :
        case NONE :
            return sciReturnString("none");
        case FIGURE :
            return sciReturnString("figure");
    }
}
/*------------------------------------------------------------------------*/
void* get_log_flags_property(void* _pvCtx, int iObjUID)
{
    int i = 0;
    int iLogFlag = 0;
    int* piLogFlag = &iLogFlag;
    int logFlags[3];
    char logFlagsString[4];

    getGraphicObjectProperty(iObjUID, __GO_X_AXIS_LOG_FLAG__, jni_bool, (void **)&piLogFlag);

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

    logFlags[0] = iLogFlag;

    getGraphicObjectProperty(iObjUID, __GO_Y_AXIS_LOG_FLAG__, jni_bool, (void **)&piLogFlag);
    if (piLogFlag == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "log_flag");
        return NULL;
    }

    logFlags[1] = iLogFlag;

    getGraphicObjectProperty(iObjUID, __GO_Z_AXIS_LOG_FLAG__, jni_bool, (void **)&piLogFlag);
    if (piLogFlag == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "log_flag");
        return NULL;
    }

    logFlags[2] = iLogFlag;

    for (i = 0; i < 3; i++)
    {
        if (logFlags[i] == 0)
        {
            logFlagsString[i] = 'n';
        }
        else
        {
            logFlagsString[i] = 'l';
        }
    }

    /* 0 terminating character */
    logFlagsString[3] = 0;
    return sciReturnString(logFlagsString);
}
Пример #15
0
/**
 * Get the datatip label mode (true or false).
 */
void* get_tip_label_mode_property(void* _pvCtx, int iObjUID)
{
    int tip_label_mode;
    int *piTip_label_mode = &tip_label_mode;

    getGraphicObjectProperty(iObjUID, __GO_DATATIP_LABEL_MODE__, jni_bool, (void **)&piTip_label_mode);

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

    if (tip_label_mode)
    {
        return sciReturnString("on");
    }
    else
    {
        return sciReturnString("off");
    }
}
Пример #16
0
/*------------------------------------------------------------------------*/
int get_mark_mode_property(void* _pvCtx, int iObjUID)
{
    int iMarkMode = 0;
    int *piMarkMode = &iMarkMode;

    getGraphicObjectProperty(iObjUID, __GO_MARK_MODE__, jni_bool, (void **)&piMarkMode);

    if (piMarkMode == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "mark_mode");
        return -1;
    }

    if (iMarkMode)
    {
        return sciReturnString(_pvCtx, "on");
    }
    else
    {
        return sciReturnString(_pvCtx, "off");
    }
}
/**
 * Returns if the diffuse color is used (on/off).
 */
int get_use_color_material_property(void* _pvCtx, int iObjUID)
{
    int iColorMaterial = 0;
    int *piColorMaterial = &iColorMaterial;

    getGraphicObjectProperty(iObjUID, __GO_COLOR_MATERIAL__, jni_bool, (void **)&piColorMaterial);

    if (piColorMaterial == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "use_color_material");
        return -1;
    }

    if (iColorMaterial)
    {
        return sciReturnString(_pvCtx, "on");
    }
    else
    {
        return sciReturnString(_pvCtx, "off");
    }
}
Пример #18
0
int GetUiobjectEnable(char *pObjUID)
{
    int enable = 0;
    int* piEnable = &enable;

    getGraphicObjectProperty(pObjUID, const_cast<char*>(__GO_UI_ENABLE__), jni_bool, (void**) &piEnable);

    if (piEnable == NULL)
    {
        Scierror(999, const_cast<char*>(_("'%s' property does not exist for this handle.\n")), "Enable");
        return FALSE;
    }

    if (enable == TRUE)
    {
        return sciReturnString("on");
    }
    else
    {
        return sciReturnString("off");
    }
}
/*------------------------------------------------------------------------*/
void* get_line_mode_property(void* _pvCtx, int iObjUID)
{
    int iLineMode = 0;
    int* lineMode = &iLineMode;

    getGraphicObjectProperty(iObjUID, __GO_LINE_MODE__, jni_bool, (void **)&lineMode);

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

    if (iLineMode)
    {
        return sciReturnString("on");
    }
    else
    {
        return sciReturnString("off");
    }
}
/*------------------------------------------------------------------------*/
int get_auto_clear_property(char *pobjUID)
{
    int iAutoClear = 0;
    int* piAutoClear = &iAutoClear;

    getGraphicObjectProperty(pobjUID, __GO_AUTO_CLEAR__, jni_bool, &piAutoClear);

    if (piAutoClear == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "auto_clear");
        return -1;
    }

    if (iAutoClear)
    {
        return sciReturnString( "on" );
    }
    else
    {
        return sciReturnString( "off" );
    }
}
Пример #21
0
/*------------------------------------------------------------------------*/
void* get_resize_property(void* _pvCtx, int iObjUID)
{
    int visible = 0;
    int* piVisible = &visible;

    getGraphicObjectProperty(iObjUID, __GO_RESIZE__, jni_bool, (void **)&piVisible);

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

    if (visible)
    {
        return sciReturnString("on");
    }
    else
    {
        return sciReturnString("off");
    }
}
Пример #22
0
/*------------------------------------------------------------------------*/
void* get_interp_color_mode_property(void* _pvCtx, int iObjUID)
{
    int iInterpColorMode = 0;
    int* piInterpColorMode = &iInterpColorMode;

    getGraphicObjectProperty(iObjUID, __GO_INTERP_COLOR_MODE__, jni_bool, (void **)&piInterpColorMode);

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

    if (iInterpColorMode)
    {
        return sciReturnString("on");
    }
    else
    {
        return sciReturnString("off");
    }
}
/*------------------------------------------------------------------------*/
void* get_groupname_property(void* _pvCtx, int iObjUID)
{
    char *pstGroupName = NULL;
    getGraphicObjectProperty(iObjUID, __GO_UI_GROUP_NAME__, jni_string, (void **)&pstGroupName);

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

    return sciReturnString(pstGroupName);
}
Пример #24
0
/**
 * Get the status if the auto-orientation is enabled.
 */
void* get_tip_auto_orientation_property(void* _pvCtx, int iObjUID)
{
    int tip_auto_orientation;
    int *piTip_auto_orientation = &tip_auto_orientation;

    getGraphicObjectProperty(iObjUID, __GO_DATATIP_AUTOORIENTATION__, jni_bool, (void **)&piTip_auto_orientation);

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

    if (tip_auto_orientation)
    {
        return sciReturnString("on");
    }
    else
    {
        return sciReturnString("off");
    }
}
Пример #25
0
/**
 * Get the datatip components that should be displayed
 */
void* get_tip_display_components_property(void* _pvCtx, int iObjUID)
{
    char * tip_display_components;
    getGraphicObjectProperty(iObjUID, __GO_DATATIP_DISPLAY_COMPONENTS__, jni_string, (void **)&tip_display_components);

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

    return sciReturnString(tip_display_components);
}
Пример #26
0
/*------------------------------------------------------------------------*/
int get_event_handler_property(void* _pvCtx, char* pobjUID)
{
    char* eventHandler = NULL;
    getGraphicObjectProperty(pobjUID, __GO_EVENTHANDLER_NAME__, jni_string, (void **)&eventHandler);

    if (eventHandler == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "event_handler");
        return -1;
    }

    return sciReturnString(_pvCtx, eventHandler);
}
Пример #27
0
/*------------------------------------------------------------------------*/
int get_auto_rotation_property(void* _pvCtx, char* pobjUID)
{
    int iAutoRotation = 0;
    int* piAutoRotation = &iAutoRotation;

    getGraphicObjectProperty(pobjUID, __GO_AUTO_ROTATION__, jni_bool, (void **)&piAutoRotation);

    if (piAutoRotation == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "auto_rotation");
        return -1;
    }

    if (iAutoRotation)
    {
        return sciReturnString(_pvCtx, "on");
    }
    else
    {
        return sciReturnString(_pvCtx, "off");
    }
}
Пример #28
0
/*------------------------------------------------------------------------*/
int get_colored_property(void* _pvCtx, char* pobjUID)
{
    int colored = 0;
    int* piColored = &colored;

    getGraphicObjectProperty(pobjUID, __GO_COLORED__, jni_bool, (void **)&piColored);

    if (piColored == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"), "colored");
        return -1;
    }

    if (colored)
    {
        return sciReturnString(_pvCtx, "on");
    }
    else
    {
        return sciReturnString(_pvCtx, "off");
    }
}
Пример #29
0
/**
 * Get the datatip display function.
 */
void* get_tip_disp_function_property(void* _pvCtx, int iObjUID)
{
    char *tip_disp_function = NULL;
    getGraphicObjectProperty(iObjUID, __GO_DATATIP_DISPLAY_FNC__, jni_string, (void **)&tip_disp_function);

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

    return sciReturnString(tip_disp_function);
}
Пример #30
0
/*------------------------------------------------------------------------*/
int get_isoview_property(void* _pvCtx, char* pobjUID)
{
    int iIsoview = 0;
    int* piIsoview = &iIsoview;

    getGraphicObjectProperty(pobjUID, __GO_ISOVIEW__, jni_bool, (void **)&piIsoview);

    if (piIsoview == NULL)
    {
        Scierror(999, _("'%s' property does not exist for this handle.\n"),"isoview");
        return -1;
    }

    if (iIsoview)
    {
        return sciReturnString(_pvCtx, "on");
    }
    else
    {
        return sciReturnString(_pvCtx, "off");
    }
}