Flags

Details

class Gdk.AnchorHints(value)

Bases: GObject.GFlags

Positioning hints for aligning a window relative to a rectangle.

These hints determine how the window should be positioned in the case that the window would fall off-screen if placed in its ideal position.

For example, Gdk.AnchorHints.FLIP_X will replace Gdk.Gravity.NORTH_WEST with Gdk.Gravity.NORTH_EAST and vice versa if the window extends beyond the left or right edges of the monitor.

If Gdk.AnchorHints.SLIDE_X is set, the window can be shifted horizontally to fit on-screen. If Gdk.AnchorHints.RESIZE_X is set, the window can be shrunken horizontally to fit.

In general, when multiple flags are set, flipping should take precedence over sliding, which should take precedence over resizing.

New in version 3.22.

FLIP_X = 1

allow flipping anchors horizontally

SLIDE = 12

allow sliding window on both axes

RESIZE_X = 16

allow resizing window horizontally

FLIP_Y = 2

allow flipping anchors vertically

FLIP = 3

allow flipping anchors on both axes

RESIZE_Y = 32

allow resizing window vertically

SLIDE_X = 4

allow sliding window horizontally

RESIZE = 48

allow resizing window on both axes

SLIDE_Y = 8

allow sliding window vertically

class Gdk.AxisFlags(value)

Bases: GObject.GFlags

Flags describing the current capabilities of a device/tool.

New in version 3.22.

DISTANCE = 128

Distance axis is present

XTILT = 16

X tilt axis is present

X = 2

X axis is present

ROTATION = 256

Z-axis rotation is present

YTILT = 32

Y tilt axis is present

Y = 4

Y axis is present

SLIDER = 512

Slider axis is present

WHEEL = 64

Wheel axis is present

PRESSURE = 8

Pressure axis is present

class Gdk.DragAction(value)

Bases: GObject.GFlags

Used in Gdk.DragContext to indicate what the destination should do with the dropped data.

DEFAULT = 1

Means nothing, and should not be used.

PRIVATE = 16

Special action which tells the source that the destination will do something that the source doesn’t understand.

COPY = 2

Copy the data.

ASK = 32

Ask the user what to do with the data.

MOVE = 4

Move the data, i.e. first copy it, then delete it from the source using the DELETE target of the X selection protocol.

Add a link to the data. Note that this is only useful if source and destination agree on what it means.

class Gdk.EventMask(value)

Bases: GObject.GFlags

A set of bit-flags to indicate which events a window is to receive. Most of these masks map onto one or more of the Gdk.EventType event types above.

See the ‘input handling overview [chap-input-handling]’ for details of ‘event masks [event-masks]’ and ‘event propagation [event-propagation]’.

Gdk.EventMask.POINTER_MOTION_HINT_MASK is deprecated. It is a special mask to reduce the number of Gdk.EventType.MOTION_NOTIFY events received. When using Gdk.EventMask.POINTER_MOTION_HINT_MASK, fewer Gdk.EventType.MOTION_NOTIFY events will be sent, some of which are marked as a hint (the is_hint member is True). To receive more motion events after a motion hint event, the application needs to asks for more, by calling Gdk.Event.request_motions().

Since GTK 3.8, motion events are already compressed by default, independent of this mechanism. This compression can be disabled with Gdk.Window.set_event_compression(). See the documentation of that function for details.

If Gdk.EventMask.TOUCH_MASK is enabled, the window will receive touch events from touch-enabled devices. Those will come as sequences of Gdk.EventTouch with type Gdk.EventType.TOUCH_UPDATE, enclosed by two events with type Gdk.EventType.TOUCH_BEGIN and Gdk.EventType.TOUCH_END (or Gdk.EventType.TOUCH_CANCEL). Gdk.Event.get_event_sequence() returns the event sequence for these events, so different sequences may be distinguished.

KEY_PRESS_MASK = 1024

receive key press events

SUBSTRUCTURE_MASK = 1048576

receive events about window configuration changes of child windows

BUTTON3_MOTION_MASK = 128

receive pointer motion events while 3 button is pressed

VISIBILITY_NOTIFY_MASK = 131072

receive visibility change events

BUTTON_MOTION_MASK = 16

receive pointer motion events while any button is pressed

FOCUS_CHANGE_MASK = 16384

receive focus change events

TOUCHPAD_GESTURE_MASK = 16777216

receive touchpad gesture events.

New in version 3.18.

EXPOSURE_MASK = 2

receive expose events

KEY_RELEASE_MASK = 2048

receive key release events

SCROLL_MASK = 2097152

receive scroll events

BUTTON_PRESS_MASK = 256

receive button press events

PROXIMITY_IN_MASK = 262144

receive proximity in events

BUTTON1_MOTION_MASK = 32

receive pointer motion events while 1 button is pressed

STRUCTURE_MASK = 32768

receive events about window configuration change

TABLET_PAD_MASK = 33554432

receive tablet pad events.

New in version 3.22.

POINTER_MOTION_MASK = 4

receive all pointer motion events

ENTER_NOTIFY_MASK = 4096

receive window enter events

TOUCH_MASK = 4194304

receive touch events.

New in version 3.4.

BUTTON_RELEASE_MASK = 512

receive button release events

PROXIMITY_OUT_MASK = 524288

receive proximity out events

BUTTON2_MOTION_MASK = 64

receive pointer motion events while 2 button is pressed

PROPERTY_CHANGE_MASK = 65536

receive property change events

ALL_EVENTS_MASK = 67108862

the combination of all the above event masks.

POINTER_MOTION_HINT_MASK = 8

deprecated. see the explanation above

LEAVE_NOTIFY_MASK = 8192

receive window leave events

SMOOTH_SCROLL_MASK = 8388608

receive smooth scrolling events.

New in version 3.4.

class Gdk.FrameClockPhase(value)

Bases: GObject.GFlags

Gdk.FrameClockPhase is used to represent the different paint clock phases that can be requested. The elements of the enumeration correspond to the signals of Gdk.FrameClock.

New in version 3.8.

NONE = 0

no phase

FLUSH_EVENTS = 1

corresponds to Gdk.FrameClock ::flush-events. Should not be handled by applications.

PAINT = 16

corresponds to Gdk.FrameClock ::paint.

BEFORE_PAINT = 2

corresponds to Gdk.FrameClock ::before-paint. Should not be handled by applications.

RESUME_EVENTS = 32

corresponds to Gdk.FrameClock ::resume-events. Should not be handled by applications.

UPDATE = 4

corresponds to Gdk.FrameClock ::update.

AFTER_PAINT = 64

corresponds to Gdk.FrameClock ::after-paint. Should not be handled by applications.

LAYOUT = 8

corresponds to Gdk.FrameClock ::layout.

class Gdk.ModifierType(value)

Bases: GObject.GFlags

A set of bit-flags to indicate the state of modifier keys and mouse buttons in various event types. Typical modifier keys are Shift, Control, Meta, Super, Hyper, Alt, Compose, Apple, CapsLock or ShiftLock.

Like the X Window System, GDK supports 8 modifier keys and 5 mouse buttons.

Since 2.10, GDK recognizes which of the Meta, Super or Hyper keys are mapped to Mod2 - Mod5, and indicates this by setting Gdk.ModifierType.SUPER_MASK, Gdk.ModifierType.HYPER_MASK or Gdk.ModifierType.META_MASK in the state field of key events.

Note that GDK may add internal values to events which include reserved values such as Gdk.ModifierType.MODIFIER_RESERVED_13_MASK. Your code should preserve and ignore them. You can use Gdk.ModifierType.MODIFIER_MASK to remove all reserved values.

Also note that the GDK X backend interprets button press events for button 4-7 as scroll events, so Gdk.ModifierType.BUTTON4_MASK and Gdk.ModifierType.BUTTON5_MASK will never be set.

SHIFT_MASK = 1

the Shift key.

BUTTON3_MASK = 1024

the third mouse button.

MODIFIER_RESERVED_20_MASK = 1048576

A reserved bit flag; do not use in your own code

RELEASE_MASK = 1073741824

not used in GDK itself. GTK+ uses it to differentiate between (keyval, modifiers) pairs from key press and release events.

MOD5_MASK = 128

the eighth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).

MODIFIER_RESERVED_17_MASK = 131072

A reserved bit flag; do not use in your own code

HYPER_MASK = 134217728

the Hyper modifier.

New in version 2.10.

MODIFIER_MASK = 1543512063

a mask covering all modifier types.

MOD2_MASK = 16

the fifth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).

MODIFIER_RESERVED_14_MASK = 16384

A reserved bit flag; do not use in your own code

MODIFIER_RESERVED_24_MASK = 16777216

A reserved bit flag; do not use in your own code

LOCK_MASK = 2

a Lock key (depending on the modifier mapping of the X server this may either be CapsLock or ShiftLock).

BUTTON4_MASK = 2048

the fourth mouse button.

MODIFIER_RESERVED_21_MASK = 2097152

A reserved bit flag; do not use in your own code

BUTTON1_MASK = 256

the first mouse button.

MODIFIER_RESERVED_18_MASK = 262144

A reserved bit flag; do not use in your own code

META_MASK = 268435456

the Meta modifier.

New in version 2.10.

MOD3_MASK = 32

the sixth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).

MODIFIER_RESERVED_15_MASK = 32768

A reserved bit flag; do not use in your own code

MODIFIER_RESERVED_25_MASK = 33554432

A reserved bit flag; do not use in your own code

CONTROL_MASK = 4

the Control key.

BUTTON5_MASK = 4096

the fifth mouse button.

MODIFIER_RESERVED_22_MASK = 4194304

A reserved bit flag; do not use in your own code

BUTTON2_MASK = 512

the second mouse button.

MODIFIER_RESERVED_19_MASK = 524288

A reserved bit flag; do not use in your own code

MODIFIER_RESERVED_29_MASK = 536870912

A reserved bit flag; do not use in your own code

MOD4_MASK = 64

the seventh modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier).

MODIFIER_RESERVED_16_MASK = 65536

A reserved bit flag; do not use in your own code

SUPER_MASK = 67108864

the Super modifier.

New in version 2.10.

MOD1_MASK = 8

the fourth modifier key (it depends on the modifier mapping of the X server which key is interpreted as this modifier, but normally it is the Alt key).

MODIFIER_RESERVED_13_MASK = 8192

A reserved bit flag; do not use in your own code

MODIFIER_RESERVED_23_MASK = 8388608

A reserved bit flag; do not use in your own code

class Gdk.SeatCapabilities(value)

Bases: GObject.GFlags

Flags describing the seat capabilities.

New in version 3.20.

NONE = 0

No input capabilities

POINTER = 1

The seat has a pointer (e.g. mouse)

ALL = 15

The union of all capabilities

TOUCH = 2

The seat has touchscreen(s) attached

TABLET_STYLUS = 4

The seat has drawing tablet(s) attached

ALL_POINTING = 7

The union of all pointing capabilities

KEYBOARD = 8

The seat has keyboard(s) attached

class Gdk.WMDecoration(value)

Bases: GObject.GFlags

These are hints originally defined by the Motif toolkit. The window manager can use them when determining how to decorate the window. The hint must be set before mapping the window.

ALL = 1

all decorations should be applied.

MENU = 16

a button for opening a menu should be included.

BORDER = 2

a frame should be drawn around the window.

MINIMIZE = 32

a minimize button should be included.

RESIZEH = 4

the frame should have resize handles.

MAXIMIZE = 64

a maximize button should be included.

TITLE = 8

a titlebar should be placed above the window.

class Gdk.WMFunction(value)

Bases: GObject.GFlags

These are hints originally defined by the Motif toolkit. The window manager can use them when determining the functions to offer for the window. The hint must be set before mapping the window.

ALL = 1

all functions should be offered.

MAXIMIZE = 16

the window should be maximizable.

RESIZE = 2

the window should be resizable.

CLOSE = 32

the window should be closable.

MOVE = 4

the window should be movable.

MINIMIZE = 8

the window should be minimizable.

class Gdk.WindowAttributesType(value)

Bases: GObject.GFlags

Used to indicate which fields in the Gdk.WindowAttr struct should be honored. For example, if you filled in the “cursor” and “x” fields of Gdk.WindowAttr, pass “Gdk.WindowAttributesType.X | Gdk.WindowAttributesType.CURSOR” to Gdk.Window.new(). Fields in Gdk.WindowAttr not covered by a bit in this enum are required; for example, the width/height, wclass, and window_type fields are required, they have no corresponding flag in Gdk.WindowAttributesType.

NOREDIR = 128

Honor the override_redirect field

CURSOR = 16

Honor the cursor field

TITLE = 2

Honor the title field

TYPE_HINT = 256

Honor the type_hint field

VISUAL = 32

Honor the visual field

X = 4

Honor the X coordinate field

WMCLASS = 64

Honor the wmclass_class and wmclass_name fields

Y = 8

Honor the Y coordinate field

class Gdk.WindowHints(value)

Bases: GObject.GFlags

Used to indicate which fields of a Gdk.Geometry struct should be paid attention to. Also, the presence/absence of Gdk.WindowHints.POS, Gdk.WindowHints.USER_POS, and Gdk.WindowHints.USER_SIZE is significant, though they don’t directly refer to Gdk.Geometry fields. Gdk.WindowHints.USER_POS will be set automatically by #GtkWindow if you call gtk_window_move(). Gdk.WindowHints.USER_POS and Gdk.WindowHints.USER_SIZE should be set if the user specified a size/position using a –geometry command-line argument; gtk_window_parse_geometry() automatically sets these flags.

POS = 1

indicates that the program has positioned the window

USER_POS = 128

indicates that the window’s position was explicitly set by the user

ASPECT = 16

aspect ratio fields are set

MIN_SIZE = 2

min size fields are set

USER_SIZE = 256

indicates that the window’s size was explicitly set by the user

RESIZE_INC = 32

resize increment fields are set

MAX_SIZE = 4

max size fields are set

WIN_GRAVITY = 64

window gravity field is set

BASE_SIZE = 8

base size fields are set

class Gdk.WindowState(value)

Bases: GObject.GFlags

Specifies the state of a toplevel window.

WITHDRAWN = 1

the window is not shown.

TOP_RESIZABLE = 1024

whether the top edge is resizable,

New in version 3.22.23.

FOCUSED = 128

the window is presented as focused (with active decorations).

FULLSCREEN = 16

the window is maximized without decorations.

BOTTOM_RESIZABLE = 16384

whether the bottom edge is resizable,

New in version 3.22.23.

ICONIFIED = 2

the window is minimized.

RIGHT_TILED = 2048

whether the right edge is tiled,

New in version 3.22.23.

TILED = 256

the window is in a tiled state,Since 3.22.23, this is deprecated in favor of per-edge information.

New in version 3.10.

ABOVE = 32

the window is kept above other windows.

LEFT_TILED = 32768

whether the left edge is tiled,

New in version 3.22.23.

MAXIMIZED = 4

the window is maximized.

RIGHT_RESIZABLE = 4096

whether the right edge is resizable,

New in version 3.22.23.

TOP_TILED = 512

whether the top edge is tiled,

New in version 3.22.23.

BELOW = 64

the window is kept below other windows.

LEFT_RESIZABLE = 65536

whether the left edge is resizable,

New in version 3.22.23.

STICKY = 8

the window is sticky.

BOTTOM_TILED = 8192

whether the bottom edge is tiled,

New in version 3.22.23.