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