github.com/geniusesgroup/libgo@v0.0.0-20220713101832-828057a9d3d4/protocol/gui-screen.go (about)

     1  /* For license and copyright information please see LEGAL file in repository */
     2  
     3  package protocol
     4  
     5  // Screen indicate some information about screen that a page-state(window) can render to it.
     6  // https://developer.mozilla.org/en-US/docs/Web/API/Screen
     7  type GUIScreen interface {
     8  	ID() int
     9  	Type() ScreenType
    10  	Mode() ScreenMode
    11  
    12  	Height() int
    13  	Width() int
    14  	AvailHeight() int
    15  	AvailWidth() int
    16  	// The rate where screen updates are performed (per seconds).
    17  	UpdateRate() int
    18  	PixelDepth() int
    19  	ColorDepth() int
    20  	Orientation() ScreenOrientation
    21  
    22  	EventTarget
    23  }
    24  
    25  type ScreenType uint8
    26  
    27  const (
    28  	ScreenType_Unset ScreenType = iota
    29  	ScreenType_Primary
    30  	ScreenType_Secondary
    31  	ScreenType_Extend
    32  	ScreenType_Duplicate
    33  )
    34  
    35  // ScreenMode is the window mode (ScreenMode.Option sets it).
    36  // Note that mode can be changed programmatically as well as by the user
    37  // clicking on the minimize/maximize buttons on the window's title bar.
    38  type ScreenMode uint8
    39  
    40  const (
    41  	ScreenMode_Unset ScreenMode = iota
    42  	// Screened is the normal window mode with any OS specific window decorations.
    43  	ScreenMode_Screened
    44  	// FullScreen is the full screen window mode.
    45  	ScreenMode_FullScreen
    46  	// Minimized is for systems where the window can be minimized to an icon.
    47  	ScreenMode_Minimized
    48  	// Maximized is for systems where the window can be made to fill the available monitor area.
    49  	ScreenMode_Maximized
    50  )
    51  
    52  type ScreenOrientation uint8
    53  
    54  const (
    55  	// ScreenOrientation_Any or Unset or Natural allows the window to be freely orientated.
    56  	ScreenOrientation_Any ScreenOrientation = iota
    57  	// ScreenOrientation_Landscape constrains the window to landscape orientations.
    58  	ScreenOrientation_Landscape
    59  	// ScreenOrientation_Portrait constrains the window to portrait orientations.
    60  	ScreenOrientation_Portrait
    61  )
    62  
    63  type ScreenEvent uint8
    64  
    65  // absolute?: boolean;
    66  // alpha?: number | null;
    67  // beta?: number | null;
    68  // gamma?: number | null;