GtkNative

GtkNative — Interface for widgets having surfaces

Functions

Types and Values

Object Hierarchy

    GInterface
    ╰── GtkNative

Prerequisites

GtkNative requires GtkWidget.

Known Derived Interfaces

GtkNative is required by GtkRoot.

Known Implementations

GtkNative is implemented by GtkAboutDialog, GtkAppChooserDialog, GtkApplicationWindow, GtkAssistant, GtkColorChooserDialog, GtkDialog, GtkDragIcon, GtkEmojiChooser, GtkFileChooserDialog, GtkFontChooserDialog, GtkMessageDialog, GtkPageSetupUnixDialog, GtkPopover, GtkPopoverMenu, GtkPrintUnixDialog, GtkShortcutsWindow and GtkWindow.

Includes

#include <gtk/gtk.h>

Description

GtkNative is the interface implemented by all widgets that can provide a GdkSurface for widgets to render on.

The obvious example of a GtkNative is GtkWindow.

Functions

gtk_native_get_for_surface ()

GtkNative *
gtk_native_get_for_surface (GdkSurface *surface);

Finds the GtkNative associated with the surface.

Parameters

surface

a GdkSurface

 

Returns

the GtkNative that is associated with surface .

[transfer none]


gtk_native_get_surface ()

GdkSurface *
gtk_native_get_surface (GtkNative *self);

Returns the surface of this GtkNative.

Parameters

self

a GtkNative

 

Returns

the surface of self .

[transfer none]


gtk_native_get_renderer ()

GskRenderer *
gtk_native_get_renderer (GtkNative *self);

Returns the renderer that is used for this GtkNative.

Parameters

self

a GtkNative

 

Returns

the renderer for self .

[transfer none]


gtk_native_check_resize ()

void
gtk_native_check_resize (GtkNative *self);

Reposition and resize a GtkNative.

Widgets need to call this function on their attached native widgets when they receive a new size allocation.

Parameters

self

a GtkNative

 

gtk_native_get_surface_transform ()

void
gtk_native_get_surface_transform (GtkNative *self,
                                  double *x,
                                  double *y);

Retrieves the surface transform of self . This is the translation from self 's surface coordinates into self 's widget coordinates.

Parameters

self

a GtkNative

 

x

return location for the x coordinate.

[out]

y

return location for the y coordinate.

[out]

Types and Values

GtkNative

typedef struct _GtkNative GtkNative;

See Also

GtkRoot