2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2011-2011 - DIGITEO - Bruno JOFRET
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
13 #ifndef __SCILAB_VIEW_HXX__
14 #define __SCILAB_VIEW_HXX__
21 #include "dynlib_graphic_objects.h"
25 void ScilabNativeView__createObject(int id);
26 void ScilabNativeView__deleteObject(int id);
27 void ScilabNativeView__updateObject(int id, int iProperty);
28 void ScilabNativeView__setCurrentFigure(int id);
29 void ScilabNativeView__setCurrentSubWin(int id);
30 void ScilabNativeView__setCurrentObject(int id);
31 int ScilabNativeView__getValidDefaultFigureId();
36 typedef std::list<int> __child;
37 typedef __child::iterator __child_iterator;
44 PathItem() : tag(""), uid(0), parent(0) {}
47 class GRAPHIC_OBJECTS_IMPEXP ScilabView
53 // Define type for easy manipulation.
54 typedef std::map<int, long> __handleList;
55 typedef __handleList::iterator __handleList_iterator;
56 typedef std::map<long, int> __uidList;
57 typedef __uidList::iterator __uidList_iterator;
58 typedef std::map<int, int> __figureList;
59 typedef __figureList::iterator __figureList_iterator;
60 typedef __figureList::reverse_iterator __figureList_reverse_iterator;
61 typedef std::map<int, std::vector<int> > __userdata;
63 typedef std::map<int, PathItem*> __pathList;
64 typedef __pathList::iterator __pathList_iterator;
65 typedef std::map<std::string, int> __pathFigList;
66 typedef __pathFigList::iterator __pathFigList_iterator;
68 static __figureList m_figureList;
69 static __handleList m_handleList;
70 static __uidList m_uidList;
71 static __pathFigList m_pathFigList;
72 static __pathList m_pathList;
73 static __userdata m_userdata;
74 static long m_topHandleValue;
75 static int m_currentFigure;
76 static int m_currentObject;
77 static int m_currentSubWin;
78 static int m_figureModel;
79 static int m_axesModel;
82 static void createObject(int iUID);
83 static void deleteObject(int iUID);
84 static void updateObject(int iUID, int iProperty);
86 static int getNbFigure(void);
87 static void getFiguresId(int ids[]);
88 static void registerToController(void);
89 static void unregisterToController(void);
90 static bool existsFigureId(int id);
91 static int getFigureFromIndex(int figureNumber);
92 static bool isEmptyFigureList(void);
93 static int getValidDefaultFigureId();
95 static int getCurrentFigure(void);
96 static void setCurrentFigure(int iUID);
98 static int getCurrentObject(void);
99 static void setCurrentObject(int iUID);
101 static int getCurrentSubWin(void);
102 static void setCurrentSubWin(int iUID);
104 static long getObjectHandle(int iUID);
105 static int getObjectFromHandle(long handle);
107 static int getFigureModel(void);
108 static void setFigureModel(int iUID);
110 static int getAxesModel(void);
111 static void setAxesModel(int iUID);
113 static PathItem* getItem(int uid);
114 static PathItem* getItem(std::string _pstTag);
115 static PathItem* getItem(std::string _pstTag, std::list<int>& _ignoredList);
116 static PathItem* getFigureItem(std::string _pstTag);
118 static int search_path(char* _pstPath);
119 static std::string get_path(int uid);
121 static void setUserdata(int _id, int* _data, int _datasize);
122 static int getUserdataSize(int _id);
123 static int* getUserdata(int _id);
126 static PathItem* search_children(PathItem* _path, std::string _subPath, bool _bDeep, std::list<int>& _ignoredList);
130 #endif /* !__SCILAB_VIEW_HXX__ */