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