Salome HOME
Python 3 compatibility improvement (encoding)
[modules/adao.git] / src / daSalome / daGUI / ADAOGUI.py
1 # -*- coding: utf-8 -*-
2 #
3 # Copyright (C) 2008-2017 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 from daGuiImpl import ADAOGUI_impl as GuiImpl
37 from daUtils import adaoLogger
38
39 adaoLogger.debug("Import ADAOGUI")
40
41 # called when module is initialized
42 # perform initialization actions
43 def initialize():
44   adaoLogger.debug("initialize")
45   GuiImpl.initialize()
46
47 # called when module is initialized
48 # return map of popup windows to be used by the module
49 def windows():
50   adaoLogger.debug("windows")
51   return GuiImpl.windows()
52
53 def views():
54   adaoLogger.debug("views")
55   return GuiImpl.views()
56
57 # called when module is initialized
58 # export module's preferences
59 def createPreferences():
60   adaoLogger.debug("createPreferences")
61   GuiImpl.createPreferences()
62
63 # called when module is activated
64 # returns True if activating is successfull and False otherwise
65 def activate():
66   adaoLogger.debug("activate")
67   return GuiImpl.activate()
68
69 # called when module is deactivated
70 def deactivate():
71   adaoLogger.debug("deactivate")
72   GuiImpl.deactivate()
73
74 # called when active study is changed
75 # active study ID is passed as parameter
76 def activeStudyChanged( studyID ):
77   adaoLogger.debug("activeStudyChanged")
78   GuiImpl.activeStudyChanged( studyID )
79
80 # called when popup menu is invoked
81 # popup menu and menu context are passed as parameters
82 def createPopupMenu( popup, context ):
83   adaoLogger.debug("createPopupMenu")
84   GuiImpl.createPopupMenu(popup, context )
85
86 # called when GUI action is activated
87 # action ID is passed as parameter
88 def OnGUIEvent(commandID) :
89   adaoLogger.debug("OnGUIEvent")
90   GuiImpl.OnGUIEvent(commandID)
91
92 # called when module's preferences are changed
93 # preference's resources section and setting name are passed as parameters
94 def preferenceChanged( section, setting ):
95   adaoLogger.debug("preferenceChanged")
96   GuiImpl.preferenceChanged( section, setting )
97
98 def activeViewChanged(myView):
99   adaoLogger.debug("activeViewChanged")
100   GuiImpl.activeViewChanged(myView)