gdk.global
Global functions for gdk3 library
fn addOptionEntriesLibgtkOnly beep cairoCreate cairoDrawFromGl cairoGetClipRectangle cairoGetDrawingContext cairoRectangle cairoRegion cairoRegionCreateFromSurface cairoSetSourceColor cairoSetSourcePixbuf cairoSetSourceRgba cairoSetSourceWindow cairoSurfaceCreateFromPixbuf disableMultidevice dragAbort dragDrop dragDropDone dragDropSucceeded dragFindWindowForScreen dragGetSelection dragMotion dragStatus dropFinish dropReply errorTrapPop errorTrapPopIgnored errorTrapPush eventsGetAngle eventsGetCenter eventsGetDistance eventsPending flush getDefaultRootWindow getDisplay getDisplayArgName getProgramClass getShowEvents keyboardGrab keyboardUngrab keyvalConvertCase keyvalFromName keyvalIsLower keyvalIsUpper keyvalName keyvalToLower keyvalToUnicode keyvalToUpper listVisuals notifyStartupComplete notifyStartupCompleteWithId offscreenWindowGetEmbedder offscreenWindowGetSurface offscreenWindowSetEmbedder pangoContextGet pangoContextGetForDisplay pangoContextGetForScreen pixbufGetFromSurface pixbufGetFromWindow pointerGrab pointerIsGrabbed pointerUngrab preParseLibgtkOnly propertyDelete propertyGet queryDepths queryVisualTypes selectionConvert selectionOwnerGet selectionOwnerGetForDisplay selectionOwnerSet selectionOwnerSetForDisplay selectionSendNotify selectionSendNotifyForDisplay setAllowedBackends setDoubleClickTime setProgramClass setShowEvents settingGet synthesizeWindowState testRenderSync testSimulateButton testSimulateKey textPropertyToUtf8ListForDisplay threadsAddIdle threadsAddTimeout threadsAddTimeoutSeconds threadsEnter threadsInit threadsLeave unicodeToKeyval utf8ToStringTarget
Functions 92
fn
void addOptionEntriesLibgtkOnly(glib.option_group.OptionGroup group) nothrowAppends gdk option entries to the passed in option group. This is not public API and must not be used by applications.fn
cairo.context.Context cairoCreate(gdk.window.Window window) nothrowCreates a Cairo context for drawing to window.fn
void cairoDrawFromGl(cairo.context.Context cr, gdk.window.Window window, int source, int sourceType, int bufferScale, int x, int y, int width, int height) nothrowThis is the main way to draw GL content in GTK+. It takes a render buffer ID (source_type == #GL_RENDERBUFFER) or a texture id (source_type == #GL_TEXTURE) and draws it onto cr with an OVER operati...fn
bool cairoGetClipRectangle(cairo.context.Context cr, out gdk.rectangle.Rectangle rect) nothrowThis is a convenience function around [cairo.context.Context.clipExtents]. It rounds the clip extents to integer coordinates and returns a boolean indicating if a clip area exists.fn
gdk.drawing_context.DrawingContext cairoGetDrawingContext(cairo.context.Context cr) nothrowRetrieves the #GdkDrawingContext that created the Cairo context cr.fn
void cairoRectangle(cairo.context.Context cr, gdk.rectangle.Rectangle rectangle) nothrowAdds the given rectangle to the current path of cr.fn
void cairoRegion(cairo.context.Context cr, cairo.region.Region region) nothrowAdds the given region to the current path of cr.fn
cairo.region.Region cairoRegionCreateFromSurface(cairo.surface.Surface surface) nothrowCreates region that describes covers the area where the given surface is more than 50% opaque.fn
void cairoSetSourceColor(cairo.context.Context cr, gdk.color.Color color) nothrowSets the specified #GdkColor as the source color of cr.fn
void cairoSetSourcePixbuf(cairo.context.Context cr, gdkpixbuf.pixbuf.Pixbuf pixbuf, double pixbufX, double pixbufY) nothrowSets the given pixbuf as the source pattern for cr.fn
void cairoSetSourceRgba(cairo.context.Context cr, gdk.rgba.RGBA rgba) nothrowSets the specified #GdkRGBA as the source color of cr.fn
void cairoSetSourceWindow(cairo.context.Context cr, gdk.window.Window window, double x, double y) nothrowSets the given window as the source pattern for cr.fn
cairo.surface.Surface cairoSurfaceCreateFromPixbuf(gdkpixbuf.pixbuf.Pixbuf pixbuf, int scale, gdk.window.Window forWindow = null) nothrowCreates an image surface with the same contents as the pixbuf.fn
void disableMultidevice() nothrowDisables multidevice support in GDK. This call must happen prior to [gdk.display.Display.open], [gtk.global.init_], [gtk.global.initWithArgs] or [gtk.global.initCheck] in order to take effect.fn
void dragAbort(gdk.drag_context.DragContext context, uint time) nothrowAborts a drag without dropping.fn
void dragDrop(gdk.drag_context.DragContext context, uint time) nothrowDrops on the current destination.fn
void dragDropDone(gdk.drag_context.DragContext context, bool success) nothrowInform GDK if the drop ended successfully. Passing false for success may trigger a drag cancellation animation.fn
bool dragDropSucceeded(gdk.drag_context.DragContext context) nothrowReturns whether the dropped data has been successfully transferred. This function is intended to be used while handling a [gdk.types.EventType.DropFinished] event, its return value is meaningless a...fn
void dragFindWindowForScreen(gdk.drag_context.DragContext context, gdk.window.Window dragWindow, gdk.screen.Screen screen, int xRoot, int yRoot, out gdk.window.Window destWindow, out gdk.types.DragProtocol protocol) nothrowFinds the destination window and DND protocol to use at the given pointer position.fn
gdk.atom.Atom dragGetSelection(gdk.drag_context.DragContext context) nothrowReturns the selection atom for the current source window.fn
bool dragMotion(gdk.drag_context.DragContext context, gdk.window.Window destWindow, gdk.types.DragProtocol protocol, int xRoot, int yRoot, gdk.types.DragAction suggestedAction, gdk.types.DragAction possibleActions, uint time) nothrowUpdates the drag context when the pointer moves or the set of actions changes.fn
void dragStatus(gdk.drag_context.DragContext context, gdk.types.DragAction action, uint time) nothrowSelects one of the actions offered by the drag source.fn
void dropFinish(gdk.drag_context.DragContext context, bool success, uint time) nothrowEnds the drag operation after a drop.fn
void dropReply(gdk.drag_context.DragContext context, bool accepted, uint time) nothrowAccepts or rejects a drop.fn
int errorTrapPop() nothrowRemoves an error trap pushed with [gdk.global.errorTrapPush]. May block until an error has been definitively received or not received from the X server. [gdk.global.errorTrapPopIgnored] is preferre...fn
void errorTrapPopIgnored() nothrowRemoves an error trap pushed with [gdk.global.errorTrapPush], but without bothering to wait and see whether an error occurred. If an error arrives later asynchronously that was triggered while the...fn
void errorTrapPush() nothrowThis function allows X errors to be trapped instead of the normal behavior of exiting the application. It should only be used if it is not possible to avoid the X error in any other way. Errors are...fn
bool eventsGetAngle(gdk.event.Event event1, gdk.event.Event event2, out double angle) nothrowIf both events contain X/Y information, this function will return true and return in angle the relative angle from event1 to event2. The rotation direction for positive angles is from the positive ...fn
bool eventsGetCenter(gdk.event.Event event1, gdk.event.Event event2, out double x, out double y) nothrowIf both events contain X/Y information, the center of both coordinates will be returned in `x` and `y`.fn
bool eventsGetDistance(gdk.event.Event event1, gdk.event.Event event2, out double distance) nothrowIf both events have X/Y information, the distance between both coordinates (as in a straight line going from event1 to event2) will be returned.fn
bool eventsPending() nothrowChecks if any events are ready to be processed for any display. Returns: true if any events are pending.fn
void flush() nothrowFlushes the output buffers of all display connections and waits until all requests have been processed. This is rarely needed by applications.fn
gdk.window.Window getDefaultRootWindow() nothrowObtains the root window (parent all other windows are inside) for the default display and screen. Returns: the default root windowfn
string getDisplay() nothrowGets the name of the display, which usually comes from the `DISPLAY` environment variable or the `--display` command line option. Returns: the name of the display.fn
string getDisplayArgName() nothrowGets the display name specified in the command line arguments passed to [gdk.global.init_] or [gdk.global.parseArgs], if any. Returns: the display name, if specified explicitly, otherwise null this...fn
string getProgramClass() nothrowGets the program class. Unless the program class has explicitly been set with [gdk.global.setProgramClass] or with the `--class` commandline option, the default value is the program name (determine...fn
bool getShowEvents() nothrowGets whether event debugging output is enabled. Returns: true if event debugging output is enabled.fn
gdk.types.GrabStatus keyboardGrab(gdk.window.Window window, bool ownerEvents, uint time) nothrowGrabs the keyboard so that all events are passed to this application until the keyboard is ungrabbed with [gdk.global.keyboardUngrab]. This overrides any previous keyboard grab by this client.fn
void keyboardUngrab(uint time) nothrowUngrabs the keyboard on the default display, if it is grabbed by this application.fn
void keyvalConvertCase(uint symbol, out uint lower, out uint upper) nothrowObtains the upper- and lower-case versions of the keyval symbol. Examples of keyvals are #GDK_KEY_a, #GDK_KEY_Enter, #GDK_KEY_F1, etc.fn
uint keyvalToUnicode(uint keyval) nothrowConvert from a GDK key symbol to the corresponding ISO10646 (Unicode) character.fn
gdk.visual.Visual[] listVisuals() nothrowLists the available visuals for the default screen. (See [gdk.screen.Screen.listVisuals]) A visual describes a hardware image data format. For example, a visual might support 24-bit color, or 8-bit...fn
void notifyStartupComplete() nothrowIndicates to the GUI environment that the application has finished loading. If the applications opens windows, this function is normally called after opening the application’s initial set of wind...fn
void notifyStartupCompleteWithId(string startupId) nothrowIndicates to the GUI environment that the application has finished loading, using a given identifier.fn
gdk.window.Window offscreenWindowGetEmbedder(gdk.window.Window window) nothrowGets the window that window is embedded in.fn
cairo.surface.Surface offscreenWindowGetSurface(gdk.window.Window window) nothrowGets the offscreen surface that an offscreen window renders into. If you need to keep this around over window resizes, you need to add a reference to it.fn
void offscreenWindowSetEmbedder(gdk.window.Window window, gdk.window.Window embedder) nothrowSets window to be embedded in embedder.fn
pango.context.Context pangoContextGet() nothrowCreates a #PangoContext for the default GDK screen.fn
pango.context.Context pangoContextGetForDisplay(gdk.display.Display display) nothrowCreates a #PangoContext for display.fn
pango.context.Context pangoContextGetForScreen(gdk.screen.Screen screen) nothrowCreates a #PangoContext for screen.fn
gdkpixbuf.pixbuf.Pixbuf pixbufGetFromSurface(cairo.surface.Surface surface, int srcX, int srcY, int width, int height) nothrowTransfers image data from a #cairo_surface_t and converts it to an RGB(A) representation inside a #GdkPixbuf. This allows you to efficiently read individual pixels from cairo surfaces. For #GdkWind...fn
gdkpixbuf.pixbuf.Pixbuf pixbufGetFromWindow(gdk.window.Window window, int srcX, int srcY, int width, int height) nothrowTransfers image data from a #GdkWindow and converts it to an RGB(A) representation inside a #GdkPixbuf.fn
gdk.types.GrabStatus pointerGrab(gdk.window.Window window, bool ownerEvents, gdk.types.EventMask eventMask, gdk.window.Window confineTo, gdk.cursor.Cursor cursor, uint time) nothrowGrabs the pointer (usually a mouse) so that all events are passed to this application until the pointer is ungrabbed with [gdk.global.pointerUngrab], or the grab window becomes unviewable. This ove...fn
bool pointerIsGrabbed() nothrowReturns true if the pointer on the default display is currently grabbed by this application.fn
void pointerUngrab(uint time) nothrowUngrabs the pointer on the default display, if it is grabbed by this application.fn
void preParseLibgtkOnly() nothrowPrepare for parsing command line arguments for GDK. This is not public API and should not be used in application code.fn
void propertyDelete(gdk.window.Window window, gdk.atom.Atom property) nothrowDeletes a property from a window.fn
bool propertyGet(gdk.window.Window window, gdk.atom.Atom property, gdk.atom.Atom type, gulong offset, gulong length, int pdelete, out gdk.atom.Atom actualPropertyType, out int actualFormat, out ubyte[] data) nothrowRetrieves a portion of the contents of a property. If the property does not exist, then the function returns false, and `GDK_NONE` will be stored in actual_property_type.fn
void queryDepths(out int[] depths) nothrowThis function returns the available bit depths for the default screen. It’s equivalent to listing the visuals ([gdk.global.listVisuals]) and then looking at the depth field in each visual, removi...fn
void queryVisualTypes(out gdk.types.VisualType[] visualTypes) nothrowThis function returns the available visual types for the default screen. It’s equivalent to listing the visuals ([gdk.global.listVisuals]) and then looking at the type field in each visual, remov...fn
void selectionConvert(gdk.window.Window requestor, gdk.atom.Atom selection, gdk.atom.Atom target, uint time) nothrowRetrieves the contents of a selection in a given form.fn
gdk.window.Window selectionOwnerGet(gdk.atom.Atom selection) nothrowDetermines the owner of the given selection.fn
gdk.window.Window selectionOwnerGetForDisplay(gdk.display.Display display, gdk.atom.Atom selection) nothrowDetermine the owner of the given selection.fn
bool selectionOwnerSet(gdk.window.Window owner, gdk.atom.Atom selection, uint time, bool sendEvent) nothrowSets the owner of the given selection.fn
bool selectionOwnerSetForDisplay(gdk.display.Display display, gdk.window.Window owner, gdk.atom.Atom selection, uint time, bool sendEvent) nothrowSets the #GdkWindow owner as the current owner of the selection selection.fn
void selectionSendNotify(gdk.window.Window requestor, gdk.atom.Atom selection, gdk.atom.Atom target, gdk.atom.Atom property, uint time) nothrowSends a response to SelectionRequest event.fn
void selectionSendNotifyForDisplay(gdk.display.Display display, gdk.window.Window requestor, gdk.atom.Atom selection, gdk.atom.Atom target, gdk.atom.Atom property, uint time) nothrowSend a response to SelectionRequest event.fn
void setAllowedBackends(string backends) nothrowSets a list of backends that GDK should try to use.fn
void setDoubleClickTime(uint msec) nothrowSet the double click time for the default display. See [gdk.display.Display.setDoubleClickTime]. See also [gdk.display.Display.setDoubleClickDistance]. Applications should not set this, it is a glo...fn
void setProgramClass(string programClass) nothrowSets the program class. The X11 backend uses the program class to set the class name part of the `WM_CLASS` property on toplevel windows; see the ICCCM.fn
void setShowEvents(bool showEvents) nothrowSets whether a trace of received events is output. Note that GTK+ must be compiled with debugging (that is, configured using the `--enable-debug` option) to use this option.fn
bool settingGet(string name, gobject.value.Value value) nothrowObtains a desktop-wide setting, such as the double-click time, for the default screen. See [gdk.screen.Screen.getSetting].fn
void synthesizeWindowState(gdk.window.Window window, gdk.types.WindowState unsetFlags, gdk.types.WindowState setFlags) nothrowfn
void testRenderSync(gdk.window.Window window) nothrowRetrieves a pixel from window to force the windowing system to carry out any pending rendering commands.fn
bool testSimulateButton(gdk.window.Window window, int x, int y, uint button, gdk.types.ModifierType modifiers, gdk.types.EventType buttonPressrelease) nothrowThis function is intended to be used in GTK+ test programs. It will warp the mouse pointer to the given (`x`,`y`) coordinates within window and simulate a button press or release event. Because the...fn
bool testSimulateKey(gdk.window.Window window, int x, int y, uint keyval, gdk.types.ModifierType modifiers, gdk.types.EventType keyPressrelease) nothrowThis function is intended to be used in GTK+ test programs. If (`x`,`y`) are > (-1,-1), it will warp the mouse pointer to the given (`x`,`y`) coordinates within window and simulate a key press or r...fn
int textPropertyToUtf8ListForDisplay(gdk.display.Display display, gdk.atom.Atom encoding, int format, ubyte[] text, out string[] list) nothrowConverts a text property in the given encoding to a list of UTF-8 strings.fn
uint threadsAddIdle(int priority, glib.types.SourceFunc function_) nothrowAdds a function to be called whenever there are no higher priority events pending. If the function returns false it is automatically removed from the list of event sources and will not be called a...fn
uint threadsAddTimeout(int priority, uint interval, glib.types.SourceFunc function_) nothrowSets a function to be called at regular intervals holding the GDK lock, with the given priority. The function is called repeatedly until it returns false, at which point the timeout is automatical...fn
uint threadsAddTimeoutSeconds(int priority, uint interval, glib.types.SourceFunc function_) nothrowA variant of [gdk.global.threadsAddTimeoutFull] with second-granularity. See [glib.global.timeoutAddSecondsFull] for a discussion of why it is a good idea to use this function if you don’t need f...fn
void threadsEnter() nothrowThis function marks the beginning of a critical section in which GDK and GTK+ functions can be called safely and without causing race conditions. Only one thread at a time can be in such a critial ...fn
void threadsInit() nothrowInitializes GDK so that it can be used from multiple threads in conjunction with [gdk.global.threadsEnter] and [gdk.global.threadsLeave].fn
string utf8ToStringTarget(string str) nothrowConverts an UTF-8 string into the best possible representation as a STRING. The representation of characters not in STRING is not specified; it may be as pseudo-escape sequences \x{ABCD}, or it may...