on:
         * True -> set $DISPLAY to virtual screen
         * False -> set $DISPLAY to original screen

        :param on: bool
324405
def redirect_display(self, on):
        '''
        
        '''
        d = self.new_display_var if on else self.old_display_var
        if d is None:
            log.debug('unset DISPLAY')
            del os.environ['DISPLAY']
        else:
            log.debug('DISPLAY=%s', d)
            os.environ['DISPLAY'] = d
1016895
def on_full_screen_activate(self, *args):
        
        self.sm_notebook.set_show_tabs(False)
        self.main_window_view['graphical_editor_vbox'].remove(self.sm_notebook)
        self.full_screen_window.add(self.sm_notebook)
        position = self.main_window_view.get_top_widget().get_position()
        self.full_screen_window.show()
        self.full_screen_window.move(position[0], position[1])
        self.full_screen_window.set_decorated(False)
        self.full_screen_window.fullscreen()
        self.main_window_view.get_top_widget().iconify()
314887
def on_touch(self, view, event):
        
        d = self.declaration
        r = {'event': event, 'result': False}
        d.touch_event(r)
        return r['result']
1187664
function on(first, operator, second) {
    var data,
        bool = this._bool();
    switch (arguments.length) {
      case 1:
        {
          if (typeof first === 'object' && typeof first.toSQL !== 'function') {
            var i = -1,
                keys = Object.keys(first);
            var method = bool === 'or' ? 'orOn' : 'on';
            while (++i < keys.length) {
              this[method](keys[i], first[keys[i]]);
            }
            return this;
          } else {
            data = [bool, 'on', first];
          }
          break;
        }
      case 2:
        data = [bool, 'on', first, '=', operator];
        break;
      default:
        data = [bool, 'on', first, operator, second];
    }
    this.clauses.push(data);
    return this;
  }
398636
def set(opts)
      # Store new window attributes, or ignore if nil
      @title           = opts[:title]           || @title
      if Color.is_valid? opts[:background]
        @background    = Color.new(opts[:background])
      end
      @icon            = opts[:icon]            || @icon
      @width           = opts[:width]           || @width
      @height          = opts[:height]          || @height
      @fps_cap         = opts[:fps_cap]         || @fps_cap
      @viewport_width  = opts[:viewport_width]  || @viewport_width
      @viewport_height = opts[:viewport_height] || @viewport_height
      @resizable       = opts[:resizable]       || @resizable
      @borderless      = opts[:borderless]      || @borderless
      @fullscreen      = opts[:fullscreen]      || @fullscreen
      @highdpi         = opts[:highdpi]         || @highdpi
      unless opts[:diagnostics].nil?
        @diagnostics = opts[:diagnostics]
        ext_diagnostics(@diagnostics)
      end
    end
1210589
function OnScreen(options = { tolerance: 0, debounce: 100, container: window }) {
    this.options = {};
    this.trackedElements = {};

    Object.defineProperties(this.options, {
        container: {
            configurable: false,
            enumerable: false,
            get() {
                let container;

                if (typeof options.container === 'string') {
                    container = document.querySelector(options.container);
                } else if (options.container instanceof HTMLElement) {
                    container = options.container;
                }

                return container || window;
            },
            set(value) {
                options.container = value;
            }
        },
        debounce: {
            get() {
                return parseInt(options.debounce, 10) || 100;
            },
            set(value) {
                options.debounce = value;
            }
        },
        tolerance: {
            get() {
                return parseInt(options.tolerance, 10) || 0;
            },
            set(value) {
                options.tolerance = value;
            }
        }
    });

    Object.defineProperty(this, '_scroll', {
        enumerable: false,
        configurable: false,
        writable: false,
        value: this._debouncedScroll.call(this)
    });

    observeDOM(document.querySelector('body'), () => {
        Object.keys(this.trackedElements).forEach((element) => {
            this.on('enter', element);
            this.on('leave', element);
        });
    });

    this.attach();
}
1159824
def enter_alternate_screen(self):
        
        if not self._in_alternate_screen:
            GENERIC_READ = 0x80000000
            GENERIC_WRITE = 0x40000000

            # Create a new console buffer and activate that one.
            handle = self._winapi(windll.kernel32.CreateConsoleScreenBuffer, GENERIC_READ|GENERIC_WRITE,
                                  DWORD(0), None, DWORD(1), None)

            self._winapi(windll.kernel32.SetConsoleActiveScreenBuffer, handle)
            self.hconsole = handle
            self._in_alternate_screen = True
1368140
def set_cursor(self, cursor):
        

        if cursor in ["on", "off", "under", "block"]:
            self.cursor = cursor
            self.server.request("screen_set %s cursor %s" % (self.ref, self.cursor))
505527
def _observe_keep_screen_on(self, change):
        
        def set_screen_on(window):
            from .android_window import Window
            window = Window(__id__=window)
            if self.keep_screen_on:
                window.addFlags(Window.FLAG_KEEP_SCREEN_ON)
            else:
                window.clearFlags(Window.FLAG_KEEP_SCREEN_ON)

        self.widget.getWindow().then(set_screen_on)
783622
def on(screen_class, &block)
      return super(screen_class, &block) unless screen_class.ancestors.include? TE3270
      raise '@emulator instance variable must be available to use the ScreenFactory methods' unless @emulator
      @current_screen = screen_class.new @emulator
      block.call @current_screen if block
      @current_screen
    end
736450
function() {
		var flags6 = this.header[6];
		this.mirroring = ( flags6 & 0x1 ) ? VERTICAL : HORIZONTAL;
		this.battery = ( flags6 & 0x2 );
		this.trainer = ( flags6 & 0x4 );
		this.mirroring = ( flags6 & 0x8 ) ? FOUR_SCREEN : this.mirroring;
		
		var flags7 = this.header[7];
		this.vs = (flags7 & 0x1);

		this.mapper = (
			(( flags6 & 0xf0 ) >> 4) |
			( flags7 & 0xf0 )
		);
		
		this.pal = (this.header[9] & 0x1);
	}
496167
def OnToggleFullscreen(self, event):
        """"""

        is_full_screen = self.main_window.IsFullScreen()

        # Make sure that only the grid is shown in fullscreen mode
        if is_full_screen:
            try:
                self.main_window.grid.SetRowLabelSize(self.row_label_size)
                self.main_window.grid.SetColLabelSize(self.col_label_size)
            except AttributeError:
                pass

            # Restore toolbars from before fullscreen mode
            try:
                self.main_window._mgr.LoadPerspective(self.aui_windowed)
            except AttributeError:
                pass

        else:
            # Save the perspective of the AUI manager
            self.aui_windowed = self.main_window._mgr.SavePerspective()

            # Hide toolbars
            for pane in self.main_window._mgr.GetAllPanes():
                if pane.name != "grid":
                    pane.Hide()

            self.main_window._mgr.Update()

            self.row_label_size = self.main_window.grid.GetRowLabelSize()
            self.col_label_size = self.main_window.grid.GetColLabelSize()

            self.main_window.grid.SetRowLabelSize(0)
            self.main_window.grid.SetColLabelSize(0)

        self.main_window.ShowFullScreen(not is_full_screen)
1129496
def enable_display(self, enable):
        """"""
        if enable:
            self.displaycontrol |= LCD_DISPLAYON
        else:
            self.displaycontrol &= ~LCD_DISPLAYON
        self.write8(LCD_DISPLAYCONTROL | self.displaycontrol)
421998
def refresh(self, simp=None, isauto=0):
        

        if simp==None:
            simp = self.simp
        if self.autorefresh==0 and isauto==1:
            return
        sim = simp.contents
        size_changed = clibrebound.reb_display_copy_data(simp)
        clibrebound.reb_display_prepare_data(simp,c_int(self.orbits))
        if sim.N>0:
            self.particle_data = (c_char * (4*7*sim.N)).from_address(sim.display_data.contents.particle_data).raw
            if self.orbits:
                self.orbit_data = (c_char * (4*9*(sim.N-1))).from_address(sim.display_data.contents.orbit_data).raw
        if size_changed:
            #TODO: Implement better GPU size change
            pass
        if self.useroverlay==True:
            self.overlay = "REBOUND (%s), N=%d, t=%g"%(sim.integrator,sim.N,sim.t)
        elif self.useroverlay==None or self.useroverlay==False:
            self.overlay = ""
        else:
            self.overlay = self.useroverlay + ", N=%d, t=%g"%(sim.N,sim.t)
        self.N = sim.N
        self.t = sim.t
        self.count += 1
568193
def _load_screen_settings(self):
        """"""
        # display number / use primary display
        combo = self.get_widget('display_n')
        dest_screen = self.settings.general.get_int('display-n')
        # If Guake is configured to use a screen that is not currently attached,
        # default to 'primary display' option.
        screen = self.get_widget('config-window').get_screen()
        n_screens = screen.get_n_monitors()
        if dest_screen > n_screens - 1:
            self.settings.general.set_boolean('mouse-display', False)
            dest_screen = screen.get_primary_monitor()
            self.settings.general.set_int('display-n', dest_screen)

        if dest_screen == ALWAYS_ON_PRIMARY:
            first_item = combo.get_model().get_iter_first()
            combo.set_active_iter(first_item)
        else:
            seen_first = False  # first item "always on primary" is special
            for i in combo.get_model():
                if seen_first:
                    i_int = int(i[0].split()[0])  # extracts 1 from '1' or from '1 (primary)'
                    if i_int == dest_screen:
                        combo.set_active_iter(i.iter)
                else:
                    seen_first = True
122111
public function set_active_status( $screen ) {

		if ( 'post' == $screen->base && ( null === $this->struct['screen'] || in_array( $screen->id, (array) $this->struct['screen'] ) ) ) {
			$this->is_active = true;
		}

	}
78891
def switchDisplay(self, display):
        
        if display in self.displays:
            self.setWidget(self.displays[display])
            self._current = display
        else:
            raise Exception("Undefined display type "+ display)