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 /* file: get_auto_clear_property.c                                        */
22 /* desc : function to retrieve in Scilab the auto_clear field of          */
23 /*        a handle                                                        */
24 /*------------------------------------------------------------------------*/
25 
26 #include "getHandleProperty.h"
27 #include "returnProperty.h"
28 #include "Scierror.h"
29 #include "localization.h"
30 
31 #include "getGraphicObjectProperty.h"
32 #include "graphicObjectProperties.h"
33 
34 /*------------------------------------------------------------------------*/
get_auto_clear_property(void * _pvCtx,int iObjUID)35 void* get_auto_clear_property(void* _pvCtx, int iObjUID)
36 {
37     int iAutoClear = 0;
38     int* piAutoClear = &iAutoClear;
39 
40     getGraphicObjectProperty(iObjUID, __GO_AUTO_CLEAR__, jni_bool, (void **)&piAutoClear);
41 
42     if (piAutoClear == NULL)
43     {
44         Scierror(999, _("'%s' property does not exist for this handle.\n"), "auto_clear");
45         return NULL;
46     }
47 
48     if (iAutoClear)
49     {
50         return sciReturnString("on");
51     }
52     else
53     {
54         return sciReturnString("off");
55     }
56 }
57 
58 /*------------------------------------------------------------------------*/
59