1 /*
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2004-2006 - INRIA - Fabrice Leray
4 * Copyright (C) 2006 - INRIA - Allan Cornet
5 * Copyright (C) 2006 - INRIA - Jean-Baptiste Silvy
6 * Copyright (C) 2010 - DIGITEO - Manuel Juliachs
7 * Copyright (C) 2011 - DIGITEO - Vincent Couvert
8 *
9 * Copyright (C) 2012 - 2016 - Scilab Enterprises
10 *
11 * This file is hereby licensed under the terms of the GNU GPL v2.0,
12 * pursuant to article 5.3.4 of the CeCILL v.2.1.
13 * This file was originally licensed under the terms of the CeCILL v2.1,
14 * and continues to be available under such terms.
15 * For more information, see the COPYING file which you should have received
16 * along with this program.
17 *
18 */
19
20
21 /*------------------------------------------------------------------------*/
22 /* file: get_auto_scale_property.c */
23 /* desc : function to retrieve in Scilab the auto_scale field of */
24 /* a handle */
25 /*------------------------------------------------------------------------*/
26
27 #include "getHandleProperty.h"
28 #include "returnProperty.h"
29 #include "localization.h"
30 #include "Scierror.h"
31
32 #include "getGraphicObjectProperty.h"
33 #include "graphicObjectProperties.h"
34
35 /*------------------------------------------------------------------------*/
get_auto_scale_property(void * _pvCtx,int iObjUID)36 void* get_auto_scale_property(void* _pvCtx, int iObjUID)
37 {
38 int iAutoScale = 0;
39 int* piAutoScale = &iAutoScale;
40
41 getGraphicObjectProperty(iObjUID, __GO_AUTO_SCALE__, jni_bool, (void **)&piAutoScale);
42
43 if (piAutoScale == NULL)
44 {
45 Scierror(999, _("'%s' property does not exist for this handle.\n"), "auto_scale");
46 return NULL;
47 }
48
49 if (iAutoScale)
50 {
51 return sciReturnString("on");
52 }
53 else
54 {
55 return sciReturnString("off");
56 }
57
58 }
59 /*------------------------------------------------------------------------*/
60