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__
20 #include "dynlib_graphic_objects.h"
24 void ScilabNativeView__createObject(int id);
25 void ScilabNativeView__deleteObject(int id);
26 void ScilabNativeView__updateObject(int id, int iProperty);
27 void ScilabNativeView__setCurrentFigure(int id);
28 void ScilabNativeView__setCurrentSubWin(int id);
29 void ScilabNativeView__setCurrentObject(int id);
30 int ScilabNativeView__getValidDefaultFigureId();
35 typedef std::list<int> __child;
36 typedef __child::iterator __child_iterator;
43 PathItem() : tag(""), uid(0), parent(0) {}
46 class GRAPHIC_OBJECTS_IMPEXP ScilabView
52 // Define type for easy manipulation.
53 typedef std::map<int, long> __handleList;
54 typedef __handleList::iterator __handleList_iterator;
55 typedef std::map<long, int> __uidList;
56 typedef __uidList::iterator __uidList_iterator;
57 typedef std::map<int, int> __figureList;
58 typedef __figureList::iterator __figureList_iterator;
59 typedef __figureList::reverse_iterator __figureList_reverse_iterator;
61 typedef std::map<int, PathItem*> __pathList;
62 typedef __pathList::iterator __pathList_iterator;
63 typedef std::map<std::string, int> __pathFigList;
64 typedef __pathFigList::iterator __pathFigList_iterator;
66 static __figureList m_figureList;
67 static __handleList m_handleList;
68 static __uidList m_uidList;
69 static __pathFigList m_pathFigList;
70 static __pathList m_pathList;
71 static long m_topHandleValue;
72 static int m_currentFigure;
73 static int m_currentObject;
74 static int m_currentSubWin;
75 static int m_figureModel;
76 static int m_axesModel;
79 static void createObject(int iUID);
80 static void deleteObject(int iUID);
81 static void updateObject(int iUID, int iProperty);
83 static int getNbFigure(void);
84 static void getFiguresId(int ids[]);
85 static void registerToController(void);
86 static void unregisterToController(void);
87 static bool existsFigureId(int id);
88 static int getFigureFromIndex(int figureNumber);
89 static bool isEmptyFigureList(void);
90 static int getValidDefaultFigureId();
92 static int getCurrentFigure(void);
93 static void setCurrentFigure(int iUID);
95 static int getCurrentObject(void);
96 static void setCurrentObject(int iUID);
98 static int getCurrentSubWin(void);
99 static void setCurrentSubWin(int iUID);
101 static long getObjectHandle(int iUID);
102 static int getObjectFromHandle(long handle);
104 static int getFigureModel(void);
105 static void setFigureModel(int iUID);
107 static int getAxesModel(void);
108 static void setAxesModel(int iUID);
110 static PathItem* getItem(int uid);
111 static PathItem* getItem(std::string _pstTag);
112 static PathItem* getItem(std::string _pstTag, std::list<int>& _ignoredList);
113 static PathItem* getFigureItem(std::string _pstTag);
115 static int search_path(char* _pstPath);
116 static std::string get_path(int uid);
119 static PathItem* search_children(PathItem* _path, std::string _subPath, bool _bDeep, std::list<int>& _ignoredList);
123 #endif /* !__SCILAB_VIEW_HXX__ */