ó
ÉÝ{Tc           @   s¥  d  Z  d g Z i  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d	 „  Z
 d
 „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d d, d, d „ Z d „  Z d „  Z d „  Z d „  Z d d, d „ Z d „  Z d „  Z d d d d, d „ Z g  d d d, d „ Z d d d „ Z d „  Z d „  Z d  „  Z d! „  Z  d" „  Z! d# „  Z" d$ „  Z# d% „  Z$ d& „  Z% d' „  Z& d d( d) „ Z' d( d* „ Z( d+ „  Z) d, S(-   s¢  
     python/ui/global_definitions.py: CCP4MG Molecular Graphics Program
     Copyright (C) 2001-2008 University of York, CCLRC
     Copyright (C) 2009-2011 University of York
     Copyright (C) 2012 STFC

     This library is free software: you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public License
     version 3, modified in accordance with the provisions of the 
     license to address the requirements of UK law.
 
     You should have received a copy of the modified GNU Lesser General 
     Public License along with this library.  If not, copies may be 
     downloaded from http://www.ccp4.ac.uk/ccp4license.php
 
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU Lesser General Public License for more details.
t    c         C   s\   d d  l  } | j j j |  ƒ d k r9 | j d ƒ } n  | j j j |  ƒ } | j j | S(   Niÿÿÿÿi    t   mainview(   t   viewt   CViewt   namest   countt   indext   insts(   t   nameR   t   vt   i(    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   VW   s
    c          C   s/   d d  l  }  |  j  j s% |  j  ƒ  n  |  j  j S(   Niÿÿÿÿ(   t   GUIR   (   R   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   MGGUI   s     c          C   s1   d d  l  }  |  j j s' |  j ƒ  } n  |  j j S(   Niÿÿÿÿ(   t   atom_pickingt
   picklabelsR   (   R   t   pl(    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt	   PICKLABEL%   s     c           C   s   t  ƒ  S(   N(   t   PICTUREDEFINITION(    (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   PD+   s    c          C   s1   d d  l  }  |  j  j s' |  j  ƒ  } n  |  j  j S(   Niÿÿÿÿ(   t   picture_definitionR   (   R   t   pd(    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyR   .   s    c           C   s   t  ƒ  S(   N(   t   CL(    (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   MGCOLOUR4   s    c          C   s/   d d  l  }  |  j  j s% |  j  ƒ  n  |  j  j S(   Niÿÿÿÿ(   t   COLOURR   (   R   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyR   7   s     c          C   s/   d d  l  }  |  j j s% |  j ƒ  n  |  j j S(   Niÿÿÿÿ(   t   historyt   CHistoryR   (   R   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   HISTORY<   s    c          C   s1   d d  l  }  |  j j s' |  j ƒ  } n  |  j j S(   Niÿÿÿÿ(   t   EditHistoryt   EditHistoryManagerR   (   R   t   eh(    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   EDITHISTORYB   s    c          C   s/   d d  l  }  |  j  j s% |  j  ƒ  n  |  j  j S(   Niÿÿÿÿ(   t   webR   (   R    (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   WEBH   s     c          C   s/   d d  l  }  |  j  j s% |  j  ƒ  n  |  j  j S(   Niÿÿÿÿ(   t   ccp4i_databaseR   (   R"   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   CCP4DATABASEM   s    c          C   s   d d  l  }  |  j  j d ƒ j S(   Niÿÿÿÿi    (   t   MainLoopContainert   gett	   resources(   R$   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt	   RESOURCESS   s    c          C   s/   d d  l  }  |  j  j s% |  j  ƒ  n  |  j  j S(   Niÿÿÿÿ(   t	   ModelInfoR   (   R(   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt	   MODELINFOW   s    c          C   sm   d d  l  }  |  j  j sc d d  l } d d  l } | j j sK | j ƒ  } n  d  } |  j  | ƒ } n  |  j  j S(   Niÿÿÿÿ(   t   buildR   R   t   dummyMGt   None(   R*   R   R+   t   ct   GRAPHICS_threadt   b(    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   BUILD]   s     i   c         C   s,   d d  l  } | j d |  d | d | ƒ d  S(   Niÿÿÿÿt	   auto_savet   targett   controllingWidget(   t   rebuildt   UpdateDisplay(   R1   R2   R3   R4   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   UPDATEDISPLAYg   s    c          C   s1   d d  l  }  |  j  j s' |  j  ƒ  } n  |  j  j S(   Niÿÿÿÿ(   t   picture_wizardR   (   R7   t   pw(    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   PICTUREWIZARDk   s    c          C   sG   t  d d ƒ }  |  s6 d d  l } | j d d ƒ } n  t  d d ƒ d S(   Nt   object_typet   CrystalDataiÿÿÿÿR   i    (   t   get_dataobjt   CrystalR;   (   t   objlistR=   t   xtl_data(    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   CRYSTALMANAGERr   s
    c          C   s`   d d  l  }  d G|  j j GH|  j j s= t t ƒ  ƒ d k rR |  j d d ƒ } n  |  j j d S(   Niÿÿÿÿs   in GL2DMANAGERi    R   s   Legends&Images(   t   Legendt
   GL2dScreenR   t   lenR<   (   RA   t   screen(    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   GL2DMANAGERz   s
    " c          C   s1   d d  l  }  |  j j s' |  j ƒ  } n  |  j j S(   Niÿÿÿÿ(   t   servicest   ParamsManagerManagerR   (   RF   t   pmm(    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt
   PM_MANAGER‚   s    c         C   s�  d d  l  } |  d k r" | j j Sx' | j j D] } | j |  k r/ | Sq/ Wx' | j j D] } | j |  k rY | SqY W| j j j |  ƒ r¡ | j d |  ƒ } | Sd  } |  d k rÎ d d  l } | j	 ƒ  } n»|  d k rõ d d  l
 } | j ƒ  } n”|  d k rd d  l } | j ƒ  } nm|  d k rId d  l } | j d |  ƒ } n@|  d k rpd d  l } | j ƒ  } n|  d	 k r—d d  l } | j ƒ  } nò|  d
 k r¾d d  l } | j ƒ  } nË|  d k råd d  l } | j ƒ  } n¤|  d k rd d  l } | j d |  ƒ } nw|  d k r?d d  l }	 |	 j d |  ƒ } nJ|  d k rld d  l }
 |
 j d |  ƒ } n|  d k r™d d  l } | j d |  ƒ } nð|  d k rØd d  l } | j sÌ| j ƒ  | _ n  | j } n±|  d k rd d  l } | j j s	| j ƒ  n  | j j j ƒ  } nk|  d k rEd d  l } | j ƒ  } nD|  d k rld d  l }
 |
 j ƒ  } n|  d k r“d d  l } | j  ƒ  } nö |  d k rºd d  l! } | j" ƒ  } nÏ |  d k rád d  l# } | j$ ƒ  } n¨ |  d k rd d  l% } | j& ƒ  } n� |  d k r/d d  l' } | j( ƒ  } nZ |  d k rVd d  l' } | j) ƒ  } n3 t* j+ |  ƒ rmt* |  S| r‰| ƒ  } | t* |  <n  | S(   Niÿÿÿÿt   allR   t   HBond_paramt   Contacts_paramt   SecStr_paramt   model_drawing_stylet   stereo_prefst   ambient_occlusion_prefst   miscell_prefst   render_qualityt   SASArea_paramt   MapDispParamsManagert   surface_drawing_stylet   HBond_drawing_stylet   screenshot_preferencest   movie_preferencest   save_session_optionst   Surface_electrot   Animation_paramt   atom_label_paramst   download_preferencest   annotation_formatt   advanced_optionst   centre_mode(,   RF   t   ParamsManagerR   R   t   ColourSchemeManagert   colour_pref_aliasR   R,   t   HBondst   HBondsParamsManagert   Contactst   ContactsParamsManagert   modelt   SecStructureParamsManagert   createDrawingStylePMt
   MGGLWidgett   createStereoParamsManagert   createAOParamsManagert   createMiscParamsManagert   createRenderParamsManagert   createSASAreaPMt   mapt   SurfaceDispobjt
   screenshott   PREFERENCESt   create_screenshot_preferencest   presentationRX   R   t   createParamsManagert   createElectroParamsManagert	   Animationt   AnimationParamsManagert   MolLabelt   atomLabelParamsManagert   downloadPdbt   createDownloadPMt
   Annotationt   createAnnotationParamsManagert   MGMainWindowt   createAdvancedParamsManagert   createRecentreParamsManagert   pluginsParamst   has_key(   R   t   creatorRF   R
   t   pmRd   Rf   Rh   Rk   Rq   Rr   Rs   Rv   R   Ry   R{   R}   R   R�   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   PMŠ   s²    
  		c         C   sh   d d  l  } | j j j |  ƒ d k rA |  d k r: t ƒ  Sd Sn# | j j j |  ƒ } | j j | Sd  S(   Niÿÿÿÿi    s   Legends&ImagesR    (   t   dataobjt   DataObjt   dataobj_namesR   RE   R   t   dataobj_insts(   R   R‰   R
   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   data  s    c         C   sS   t  |  ƒ } | s d  S| j j | ƒ d k r2 d  S| j j | ƒ } | j | Sd  S(   Ni    (   R�   R,   t   objnamesR   R   t   objinsts(   t   parentR   t   mR
   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   disp  s     RJ   c   	      C   sA  d d  l  } g  } | r“ d d  l } | j | ƒ } | d k r=xN | j j D]= } | j d k rL | | j j ƒ  k r‰ | j | ƒ q‰ qL qL Wq=nª |  d k r© t	 ƒ  g S|  rð | j j
 j |  ƒ r=| j | j j | j j
 j |  ƒ ƒ q=nM xJ | j j D]< } | s| j | k rý | j | ƒ | d k r9| Sqý qý W| S(   NiÿÿÿÿR    t   MolDataR;   t   first(   R‰   t   mmutt   GetMMANManagerAddressRŠ   RŒ   R:   t   molHndt
   GetAddresst   appendR@   R‹   R   R   (	   R   R:   t   modet   PCAtomR‰   t   retR•   t   theAddrt   obj(    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyR<     s*    
, c   
      C   sô  d d  l  } d d  l } d d  l } | j j rl | j j d | j j k rl | j j j | j j d ƒ n  | j j rº | j j d j | j j	 k rº | j j	 j | j j d j ƒ n  t
 |  | j ƒ rí |  d k rá g  }  qí |  g }  n  | r7x= | j j D]/ } | j j | ƒ r | j | j j | ƒ Sq Wd S| r‚x> | j j D]0 } x' | j D] } | j | k rZ| g SqZWqJWg  Sg  }	 xa | j j D]S } xJ | j D]? } |  sÄ|  j | j ƒ r¥|	 j | ƒ | d k rä|	 Sq¥q¥Wq•W|	 Sd  S(   Niÿÿÿÿi    R    R”   (   R‰   t   typesRA   RB   R   RŠ   RŒ   R™   R   R‹   t
   isinstancet
   StringTypeRŽ   R   R�   R   t   graphmodR:   (
   R:   Rš   R   t   graphics_objectR‰   RŸ   RA   t   daRž   Rœ   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   get_dispobj5  s:    ( +#	 t   onec         C   sƒ   d d  l  } |  d k rG d d  l } | j j r: | j j S| j ƒ  Sn  | j  j j |  ƒ r | j  j j |  ƒ } | j  j | Sd  S(   Niÿÿÿÿt	   Superpose(   t   ApplicationR§   R   t   application_namesR   R   t   application_instsR,   (   R   Rš   R¨   R§   R
   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   Appl[  s    
c         C   s:   d d  l  } x' | j  j D] } |  | j k r | Sq Wd  S(   Niÿÿÿÿ(   Rv   R   t
   identifierR,   (   R   Rv   Rž   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   Presentationo  s
     c         C   s7   d d  l  } | j j j |  ƒ r/ | j j |  Sd  Sd  S(   Niÿÿÿÿ(   R7   t   PictureHandlerR   R…   R,   (   R   R7   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyR®   y  s    c          C   s@   d d  l  }  |  j j d ƒ r" d St d ƒ j ƒ  d r< d Sd S(   Niÿÿÿÿt	   DEVELOPERi   R_   t   developer_modei    (   t   ost   environR…   Rˆ   t	   getparams(   R±   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyR¯   ‚  s    c           C   s
   t  ƒ  j S(   N(   t
   MAINWINDOWt	   glWidgets(    (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt	   GLWIDGETSŠ  s    c          C   s   d d  l  }  |  j ƒ  S(   Niÿÿÿÿ(   t   MGApplicationt   GetMainWindow(   R·   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyR´   �  s    c          C   s   d d  l  }  |  j ƒ  S(   Niÿÿÿÿ(   R·   t   QtApp(   R·   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   MGAPPLICATION‘  s    c           C   s   t  ƒ  j ƒ  t  ƒ  j S(   N(   R´   t   handlePreferencest   wPreferences(    (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   PREFERENCESWINDOW•  s    c           C   s
   t  ƒ  j S(   N(   R´   t
   jobControl(    (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt
   JOBCONTROL™  s    c           C   s    t  t ƒ  d ƒ s d  St ƒ  j S(   Nt   MGDisplayTable(   t   hasattrR´   R,   RÀ   (    (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   DISPLAYTABLEœ  s     c          C   s/   d d  l  }  |  j  j s% |  j  ƒ  n  |  j  j S(   Niÿÿÿÿ(   t   FontManagerR   (   RÃ   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   FONTMANAGER   s    s   CCP4mg Data Listingc         C   si   d d  l  } t t ƒ  d ƒ r- t ƒ  j } n$ | j  d |  d | ƒ } | t ƒ  _ | j ƒ  | j ƒ  | S(   Niÿÿÿÿt
   fileViewerR   t   title(   t   mgFileViewerRÁ   R´   RÅ   t   showt   raise_(   R   RÆ   RÇ   t   viewer(    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt
   FILEVIEWER§  s    

c         C   sS   t  t ƒ  d ƒ r! t ƒ  j } n. d d  l } | j ƒ  } | j ƒ  | t ƒ  _ | S(   Nt   graphVieweriÿÿÿÿ(   RÁ   R´   RÌ   t   MGQTmatplotlibt   LogGrapht   showActionBar(   RÆ   RÊ   RÍ   (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   GRAPHVIEWER¹  s    
c           C   s   t  ƒ  j ƒ  S(   N(   R´   t   getHelpBrowser(    (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   HELPBROWSERÃ  s    N(*   t   __doc__t   statusBarMessagesR„   R   R   R   R   R   R   R   R   R   R!   R#   R'   R)   R0   R,   R6   R9   R@   RE   RI   Rˆ   R�   R’   R<   R¥   R«   R­   R®   R¯   R¶   R´   Rº   R½   R¿   RÂ   RÄ   RË   RÐ   RÒ   (    (    (    sI   /opt/xtal/ccp4-6.5-linux32/lib/py2/ccp4mg/python/ui/global_definitions.pyt   <module>   sP   															
				x		&	
										
