Logo Search packages:      
Sourcecode: kde-guidance version File versions  Download package

def displayconfigabstraction::Screen::__init__ (   self,
  gfx_card = None,
  x_config_screen = None,
  x_config_monitor = None,
  monitor_model = None,
  x_config = None 
)

Create a Screen object.

This method is private to this module.

Definition at line 1453 of file displayconfigabstraction.py.

                                                      :
        """Create a Screen object.
        
        This method is private to this module.
        """
        self.gfx_card = gfx_card
        self.x_config_screen = x_config_screen
        
        self.x_config_monitor = x_config_monitor
        self.monitor_model = monitor_model
        self.monitor_aspect = ModeLine.ASPECT_4_3
        self.original_monitor_model = monitor_model
        self.x_config = x_config
        
        # Cookup some sensible screen sizes.
        self.standard_sizes = GetMonitorModeDB().getAllResolutions()
        
        self.x_live_screen = None
       
        # Intialise the gamma settings with defaults.
        self.redgamma = 1.0
        self.greengamma = 1.0
        self.bluegamma = 1.0
        self.allgamma = 1.0
        self.settingall = True
    
        # If there is a monitor xorg.conf section then look there for gamma info.
        if self.x_config_monitor is not None:
            gamma_row = self.x_config_monitor.getRow('gamma')
            if gamma_row is not None:
                # Read the gamma info out of xorg.conf
                try:
                    if len(gamma_row)==3:
                        self.redgamma = float(gamma_row[0])
                        self.greengamma = float(gamma_row[1])
                        self.bluegamma = float(gamma_row[2])
                        self.allgamma = self.redgamma
                    elif len(gamma_row)==1:
                        self.allgamma = float(gamma_row[0])
                        self.redgamma = self.allgamma
                        self.greengamma = self.allgamma
                        self.bluegamma = self.allgamma
                except ValueError:
                    pass
    
            # Try to work out if this monitor is setup for 4:3 modes or 16:9.
            aspect_43_count = 0
            aspect_169_count = 0
            # Count the number of 4:3 modelines compared to 16:9 modes.
            for mode in self.x_config_monitor.modeline:
                try:
                    # Don't count the fallback resolution. It is also present
                    # if the monitor is widescreen. Just ignore it.
                    if (mode._row[2],mode._row[6])!=FALLBACK_RESOLUTION:
                        if MonitorModeDB.aspectRatio(mode._row[2],mode._row[6])==ModeLine.ASPECT_4_3:
                            aspect_43_count += 1
                        else:
                            aspect_169_count += 1
                except IndexError:
                    pass
                    
            if aspect_43_count >= aspect_169_count:
                self.monitor_aspect = ModeLine.ASPECT_4_3
            else:
                self.monitor_aspect = ModeLine.ASPECT_16_9
                
        # Backup the settings
        (self.originalredgamma, self.originalgreengamma, self.originalbluegamma) = (
            self.redgamma, self.greengamma, self.bluegamma)
        self.originalallgamma = self.allgamma
        self.originalsettingall = self.settingall
        self.original_monitor_aspect = self.monitor_aspect
        
    def _setXLiveScreen(self,x_live_screen):


Generated by  Doxygen 1.6.0   Back to index