Salome HOME
Updating copyright date information and version
[modules/adao.git] / src / daSalome / daGUI / ADAOGUI.py
1 # -*- coding: utf-8 -*-
2 # Copyright (C) 2008-2015 EDF R&D
3 #
4 # This file is part of SALOME ADAO module
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 #
20 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 #
22 # Author: AndrĂ© Ribes, andre.ribes@edf.fr, EDF R&D
23
24 """
25 This python file provides the implementation of the interface of the GUI part of
26 this SALOME module. This interface is required by the SALOME GUI framework.
27 We use here a proxy module named under the alias GuiImpl for at least three
28 reasons:
29 1. To Keep the required interface as clear as possible in this file;
30 2. The concrete implementation can be substituted by an alternative version;
31 3. We could mix several concrete implementations provided by different proxy
32    modules, for example for test purposes.
33 """
34
35 from daGuiImpl import ADAOGUI_impl as GuiImpl
36 from daUtils import adaoLogger
37
38 adaoLogger.debug("Import ADAOGUI")
39
40 # called when module is initialized
41 # perform initialization actions
42 def initialize():
43   adaoLogger.debug("initialize")
44   GuiImpl.initialize()
45
46 # called when module is initialized
47 # return map of popup windows to be used by the module
48 def windows():
49   adaoLogger.debug("windows")
50   return GuiImpl.windows()
51
52 def views():
53   adaoLogger.debug("views")
54   return GuiImpl.views()
55
56 # called when module is initialized
57 # export module's preferences
58 def createPreferences():
59   adaoLogger.debug("createPreferences")
60   GuiImpl.createPreferences()
61
62 # called when module is activated
63 # returns True if activating is successfull and False otherwise
64 def activate():
65   adaoLogger.debug("activate")
66   return GuiImpl.activate()
67
68 # called when module is deactivated
69 def deactivate():
70   adaoLogger.debug("deactivate")
71   GuiImpl.deactivate()
72
73 # called when active study is changed
74 # active study ID is passed as parameter
75 def activeStudyChanged( studyID ):
76   adaoLogger.debug("activeStudyChanged")
77   GuiImpl.activeStudyChanged( studyID )
78
79 # called when popup menu is invoked
80 # popup menu and menu context are passed as parameters
81 def createPopupMenu( popup, context ):
82   adaoLogger.debug("createPopupMenu")
83   GuiImpl.createPopupMenu(popup, context )
84
85 # called when GUI action is activated
86 # action ID is passed as parameter
87 def OnGUIEvent(commandID) :
88   adaoLogger.debug("OnGUIEvent")
89   GuiImpl.OnGUIEvent(commandID)
90
91 # called when module's preferences are changed
92 # preference's resources section and setting name are passed as parameters
93 def preferenceChanged( section, setting ):
94   adaoLogger.debug("preferenceChanged")
95   GuiImpl.preferenceChanged( section, setting )
96
97 def activeViewChanged(myView):
98   adaoLogger.debug("activeViewChanged")
99   GuiImpl.activeViewChanged(myView)