### ----------------------------------------------------
### -- Gnome::Gtk3
### -- Licenses: Artistic-2.0
### -- Authors: Marcel Timmerman
### -- File: lib/Gnome/Gtk3/StyleContext.rakumod
### ----------------------------------------------------
### -- Chunk 2 of 4
, $class_name
  );
}

sub gtk_style_context_remove_class (
  N-GObject $context, gchar-ptr $class_name
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:remove-provider:
=begin pod
=head2 remove-provider

Removes I<provider> from the style providers list in I<context>.

  method remove-provider ( N-GObject $provider )

=item N-GObject $provider; a B<Gnome::Gtk3::StyleProvider>
=end pod

method remove-provider ( $provider is copy ) {
  $provider .= _get-native-object-no-reffing unless $provider ~~ N-GObject;

  gtk_style_context_remove_provider(
    self._get-native-object-no-reffing, $provider
  );
}

sub gtk_style_context_remove_provider (
  N-GObject $context, N-GObject $provider
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:remove-provider-for-screen:
=begin pod
=head2 remove-provider-for-screen

Removes I<provider> from the global style providers list in I<screen>.

  method remove-provider-for-screen ( N-GObject $screen, N-GObject $provider )

=item N-GObject $screen; a B<Gnome::Gtk3::Screen>
=item N-GObject $provider; a B<Gnome::Gtk3::StyleProvider>
=end pod

method remove-provider-for-screen ( $screen is copy, $provider is copy ) {
  $screen .= _get-native-object-no-reffing unless $screen ~~ N-GObject;
  $provider .= _get-native-object-no-reffing unless $provider ~~ N-GObject;

  _gtk_style_context_remove_provider_for_screen( $screen, $provider);
}

# needed to apply this trick to prevent a wrong interpretation of N-GObject
# $screen argument in test-call() from Gnome::N::X. It would be replaced by the
# N-GObject $context argument which is wrong.
sub gtk_style_context_remove_provider_for_screen( |c ) is inlinable {
  _gtk_style_context_remove_provider_for_screen(|c);
}

sub _gtk_style_context_remove_provider_for_screen (
  N-GObject $screen, N-GObject $provider
) is native(&gtk-lib)
  is symbol('gtk_style_context_remove_provider_for_screen')
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-activity:
=begin pod
=head2 render-activity

Renders an activity indicator (such as in B<Gnome::Gtk3::Spinner>). The state C<GTK-STATE-FLAG-CHECKED> determines whether there is activity going on.

  method render-activity (
    cairo_t $cr, Num() $x, Num() $y, Num() $width, Num() $height
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x; X origin of the rectangle
=item Num() $y; Y origin of the rectangle
=item Num() $width; rectangle width
=item Num() $height; rectangle height
=end pod

method render-activity (
  $cr is copy, Num() $x, Num() $y, Num() $width, Num() $height
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_activity(
    self._get-native-object-no-reffing, $cr, $x, $y, $width, $height
  );
}

sub gtk_render_activity (
  N-GObject $context, cairo_t $cr, gdouble $x, gdouble $y, gdouble $width, gdouble $height
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-arrow:
=begin pod
=head2 render-arrow

Renders an arrow pointing to I<angle>.

Typical arrow rendering at 0, 1⁄2 π;, π; and 3⁄2 π:

![](images/arrows.png)

  method render-arrow (
    cairo_t $cr, Num() $angle, Num() $x, Num() $y, Num() $size
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $angle; arrow angle from 0 to 2 * C<G-PI>, being 0 the arrow pointing to the north
=item Num() $x; X origin of the render area
=item Num() $y; Y origin of the render area
=item Num() $size; square side for render area
=end pod

method render-arrow (
  $cr is copy, Num() $angle, Num() $x, Num() $y, Num() $size
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_arrow(
    self._get-native-object-no-reffing, $cr, $angle, $x, $y, $size
  );
}

sub gtk_render_arrow (
  N-GObject $context, cairo_t $cr, gdouble $angle, gdouble $x, gdouble $y, gdouble $size
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-background:
=begin pod
=head2 render-background

Renders the background of an element.

Typical background rendering, showing the effect of `background-image`, `border-width` and `border-radius`:

![](images/background.png)

  method render-background (
    cairo_t $cr, Num() $x, Num() $y, Num() $width, Num() $height
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x; X origin of the rectangle
=item Num() $y; Y origin of the rectangle
=item Num() $width; rectangle width
=item Num() $height; rectangle height
=end pod

method render-background (
  $cr is copy, Num() $x, Num() $y, Num() $width, Num() $height
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_background(
    self._get-native-object-no-reffing, $cr, $x, $y, $width, $height
  );
}

sub gtk_render_background (
  N-GObject $context, cairo_t $cr, gdouble $x, gdouble $y, gdouble $width, gdouble $height
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-background-get-clip:
=begin pod
=head2 render-background-get-clip

Returns the area that will be affected (i.e. drawn to) when calling C<background()> for the given I<context> and rectangle. Returns a N-GdkRectangle (defined in B<Gnome::Gdk3::Types>).

  method render-background-get-clip (
    Num() $x, Num() $y, Num() $width, Num() $height --> N-GdkRectangle
  )

=item Num() $x; X origin of the rectangle
=item Num() $y; Y origin of the rectangle
=item Num() $width; rectangle width
=item Num() $height; rectangle height
=end pod

method render-background-get-clip (
  Num() $x, Num() $y, Num() $width, Num() $height --> N-GdkRectangle
) {
  my N-GdkRectangle $out_clip .= new;
  gtk_render_background_get_clip(
    self._get-native-object-no-reffing, $x, $y, $width, $height, $out_clip
  );

  $out_clip
}

sub gtk_render_background_get_clip (
  N-GObject $context, gdouble $x, gdouble $y, gdouble $width, gdouble $height, N-GdkRectangle $out_clip
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-check:
=begin pod
=head2 render-check

Renders a checkmark (as in a B<Gnome::Gtk3::CheckButton>).

The C<GTK-STATE-FLAG-CHECKED> state determines whether the check is on or off, and C<GTK-STATE-FLAG-INCONSISTENT> determines whether it should be marked as undefined.

Typical checkmark rendering:

![](images/checks.png)

  method render-check (
    cairo_t $cr, Num() $x, Num() $y, Num() $width, Num() $height
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x; X origin of the rectangle
=item Num() $y; Y origin of the rectangle
=item Num() $width; rectangle width
=item Num() $height; rectangle height
=end pod

method render-check (
  $cr is copy, Num() $x, Num() $y, Num() $width, Num() $height
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_check(
    self._get-native-object-no-reffing, $cr, $x, $y, $width, $height
  );
}

sub gtk_render_check (
  N-GObject $context, cairo_t $cr, gdouble $x, gdouble $y, gdouble $width, gdouble $height
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-expander:
=begin pod
=head2 render-expander

Renders an expander (as used in B<Gnome::Gtk3::TreeView> and B<Gnome::Gtk3::Expander>) in the area defined by I<x>, I<y>, I<width>, I<height>. The state C<GTK-STATE-FLAG-CHECKED> determines whether the expander is collapsed or expanded.

Typical expander rendering:

![](images/expanders.png)

  method render-expander (
    cairo_t $cr, Num() $x, Num() $y, Num() $width, Num() $height
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x; X origin of the rectangle
=item Num() $y; Y origin of the rectangle
=item Num() $width; rectangle width
=item Num() $height; rectangle height
=end pod

method render-expander (
  $cr is copy, Num() $x, Num() $y, Num() $width, Num() $height
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_expander(
    self._get-native-object-no-reffing, $cr, $x, $y, $width, $height
  );
}

sub gtk_render_expander (
  N-GObject $context, cairo_t $cr, gdouble $x, gdouble $y, gdouble $width, gdouble $height
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-extension:
=begin pod
=head2 render-extension

Renders a extension (as in a B<Gnome::Gtk3::Notebook> tab) in the rectangle defined by I<x>, I<y>, I<width>, I<height>. The side where the extension connects to is defined by I<gap-side>.

Typical extension rendering:

![](images/extensions.png)

  method render-extension (
    cairo_t $cr, Num() $x, Num() $y, Num() $width, Num() $height,
    GtkPositionType $gap_side
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x; X origin of the rectangle
=item Num() $y; Y origin of the rectangle
=item Num() $width; rectangle width
=item Num() $height; rectangle height
=item GtkPositionType $gap_side; side where the gap is
=end pod

method render-extension (
  $cr is copy, Num() $x, Num() $y, Num() $width, Num() $height,
  GtkPositionType $gap_side
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_extension(
    self._get-native-object-no-reffing, $cr, $x, $y, $width, $height, $gap_side
  );
}

sub gtk_render_extension (
  N-GObject $context, cairo_t $cr, gdouble $x, gdouble $y, gdouble $width, gdouble $height, GEnum $gap_side
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-focus:
=begin pod
=head2 render-focus

Renders a focus indicator on the rectangle determined by I<x>, I<y>, I<width>, I<height>.

Typical focus rendering:

![](images/focus.png)

  method render-focus (
    cairo_t $cr, Num() $x, Num() $y, Num() $width, Num() $height
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x; X origin of the rectangle
=item Num() $y; Y origin of the rectangle
=item Num() $width; rectangle width
=item Num() $height; rectangle height
=end pod

method render-focus (
  $cr is copy, Num() $x, Num() $y, Num() $width, Num() $height
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_focus(
    self._get-native-object-no-reffing, $cr, $x, $y, $width, $height
  );
}

sub gtk_render_focus (
  N-GObject $context, cairo_t $cr, gdouble $x, gdouble $y, gdouble $width, gdouble $height
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-frame:
=begin pod
=head2 render-frame

Renders a frame around the rectangle defined by I<x>, I<y>, I<width>, I<height>.

Examples of frame rendering, showing the effect of `border-image`, `border-color`, `border-width`, `border-radius` and junctions:

![](images/frames.png)

  method render-frame (
    cairo_t $cr, Num() $x, Num() $y, Num() $width, Num() $height
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x; X origin of the rectangle
=item Num() $y; Y origin of the rectangle
=item Num() $width; rectangle width
=item Num() $height; rectangle height
=end pod

method render-frame (
  $cr is copy, Num() $x, Num() $y, Num() $width, Num() $height
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_frame(
    self._get-native-object-no-reffing, $cr, $x, $y, $width, $height
  );
}

sub gtk_render_frame (
  N-GObject $context, cairo_t $cr, gdouble $x, gdouble $y, gdouble $width, gdouble $height
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-handle:
=begin pod
=head2 render-handle

Renders a handle (as in B<Gnome::Gtk3::HandleBox>, B<Gnome::Gtk3::Paned> and B<Gnome::Gtk3::Window>’s resize grip), in the rectangle determined by I<x>, I<y>, I<width>, I<height>.

Handles rendered for the paned and grip classes:

![](images/handles.png)

  method render-handle (
    cairo_t $cr, Num() $x, Num() $y, Num() $width, Num() $height
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x; X origin of the rectangle
=item Num() $y; Y origin of the rectangle
=item Num() $width; rectangle width
=item Num() $height; rectangle height
=end pod

method render-handle (
  $cr is copy, Num() $x, Num() $y, Num() $width, Num() $height
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_handle(
    self._get-native-object-no-reffing, $cr, $x, $y, $width, $height
  );
}

sub gtk_render_handle (
  N-GObject $context, cairo_t $cr, gdouble $x, gdouble $y, gdouble $width, gdouble $height
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-icon:
=begin pod
=head2 render-icon

Renders the icon in I<pixbuf> at the specified I<x> and I<y> coordinates.

This function will render the icon in I<pixbuf> at exactly its size, regardless of scaling factors, which may not be appropriate when drawing on displays with high pixel densities.

You probably want to use C<icon-surface()> instead, if you already have a Cairo surface.

  method render-icon (
    cairo_t $cr, N-GPixbuf $pixbuf, Num() $x, Num() $y
  )

=item cairo_t $cr; a B<cairo-t>
=item N-GObject $pixbuf; a B<Gnome::Gtk3::Pixbuf> containing the icon to draw
=item Num() $x; X position for the I<pixbuf>
=item Num() $y; Y position for the I<pixbuf>
=end pod

method render-icon ( $cr is copy, $pixbuf is copy, Num() $x, Num() $y ) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  $pixbuf .= _get-native-object-no-reffing unless $pixbuf ~~ N-GObject;
  gtk_render_icon(
    self._get-native-object-no-reffing, $cr, $pixbuf, $x, $y
  );
}

sub gtk_render_icon (
  N-GObject $context, cairo_t $cr, N-GObject $pixbuf, gdouble $x, gdouble $y
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-icon-surface:
=begin pod
=head2 render-icon-surface

Renders the icon in I<surface> at the specified I<x> and I<y> coordinates.

  method render-icon-surface (
    cairo_t $cr, cairo_surface_t $surface, Num() $x, Num() $y
  )

=item cairo_t $cr; a B<cairo-t>
=item cairo_surface_t $surface; a B<cairo-surface-t> containing the icon to draw
=item Num() $x; X position for the I<icon>
=item Num() $y; Y position for the I<incon>
=end pod

method render-icon-surface (
  $cr is copy, $surface is copy, Num() $x, Num() $y
) {
  $surface .= _get-native-object-no-reffing unless $surface ~~ cairo_surface_t;
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_icon_surface(
    self._get-native-object-no-reffing, $cr, $surface, $x, $y
  );
}

sub gtk_render_icon_surface (
  N-GObject $context, cairo_t $cr, cairo_surface_t $surface, gdouble $x, gdouble $y
) is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:render-layout:
=begin pod
=head2 render-layout

Renders I<layout> on the coordinates I<x>, I<y>

  method render-layout (
    cairo_t $cr, Num() $x, Num() $y, N-GObject $layout
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x; X origin
=item Num() $y; Y origin
=item N-GObject $layout; the B<PangoLayout> to render
=end pod

method render-layout (
  $cr is copy, Num() $x, Num() $y, $layout is copy
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  $layout .= _get-native-object-no-reffing unless $layout ~~ N-GObject;
  gtk_render_layout(
    self._get-native-object-no-reffing, $cr, $x, $y, $layout
  );
}

sub gtk_render_layout (
  N-GObject $context, cairo_t $cr, gdouble $x, gdouble $y, N-GObject $layout
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:render-line:
=begin pod
=head2 render-line

Renders a line from (x0, y0) to (x1, y1).

  method render-line (
    cairo_t $cr, Num() $x0, Num() $y0, Num() $x1, Num() $y1
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x0; X coordinate for the origin of the line
=item Num() $y0; Y coordinate for the origin of the line
=item Num() $x1; X coordinate for the end of the line
=item Num() $y1; Y coordinate for the end of the line
=end pod

method render-line ( $cr is copy, Num() $x0, Num() $y0, Num() $x1, Num() $y1 ) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_line(
    self._get-native-object-no-reffing, $cr, $x0, $y0, $x1, $y1
  );
}

sub gtk_render_line (
  N-GObject $context, cairo_t $cr, gdouble $x0, gdouble $y0, gdouble $x1, gdouble $y1
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-option:
=begin pod
=head2 render-option

Renders an option mark (as in a B<Gnome::Gtk3::RadioButton>), the C<GTK-STATE-FLAG-CHECKED> state will determine whether the option is on or off, and C<GTK-STATE-FLAG-INCONSISTENT> whether it should be marked as undefined.

Typical option mark rendering:

![](images/options.png)

  method render-option (
    cairo_t $cr, Num() $x, Num() $y, Num() $width, Num() $height
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x; X origin of the rectangle
=item Num() $y; Y origin of the rectangle
=item Num() $width; rectangle width
=item Num() $height; rectangle height
=end pod

method render-option (
  $cr is copy, Num() $x, Num() $y, Num() $width, Num() $height
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_option(
    self._get-native-object-no-reffing, $cr, $x, $y, $width, $height
  );
}

sub gtk_render_option (
  N-GObject $context, cairo_t $cr, gdouble $x, gdouble $y, gdouble $width, gdouble $height
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:render-slider:
=begin pod
=head2 render-slider

Renders a slider (as in B<Gnome::Gtk3::Scale>) in the rectangle defined by I<x>, I<y>, I<width>, I<height>. I<orientation> defines whether the slider is vertical or horizontal.

Typical slider rendering:

![](images/sliders.png)

  method render-slider (
    cairo_t $cr, Num() $x, Num() $y, Num() $width, Num() $height,
    GtkOrientation $orientation
  )

=item cairo_t $cr; a B<cairo-t>
=item Num() $x; X origin of the rectangle
=item Num() $y; Y origin of the rectangle
=item Num() $width; rectangle width
=item Num() $height; rectangle height
=item GtkOrientation $orientation; orientation of the slider
=end pod

method render-slider (
  $cr is copy, Num() $x, Num() $y, Num() $width, Num() $height,
  GtkOrientation $orientation
) {
  $cr .= _get-native-object-no-reffing unless $cr ~~ cairo_t;
  gtk_render_slider(
    self._get-native-object-no-reffing, $cr, $x, $y, $width, $height,
    $orientation
  );
}

sub gtk_render_slider (
  N-GObject $context, cairo_t $cr, gdouble $x, gdouble $y, gdouble $width, gdouble $height, GEnum $orientation
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:reset-widgets:
=begin pod
=head2 reset-widgets

This function recomputes the styles for all widgets under a particular B<Gnome::Gtk3::Screen>. This is useful when some global parameter has changed that affects the appearance of all widgets, because when a widget gets a new style, it will both redraw and recompute any cached information about its appearance. As an example, it is used when the color scheme changes in the related B<Gnome::Gtk3::Settings> object.

  method reset-widgets ( N-GObject $screen )

=item N-GObject $screen; a B<Gnome::Gtk3::Screen>
=end pod

method reset-widgets ( $screen is copy ) {
  $screen .= _get-native-object-no-reffing unless $screen ~~ N-GObject;
  gtk_style_context_reset_widgets($screen);
}

sub gtk_style_context_reset_widgets (
  N-GObject $screen
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:restore:
=begin pod
=head2 restore

Restores I<context> state to a previous stage. See C<save()>.

  method restore ( )

=end pod

method restore ( ) {
  gtk_style_context_restore(self._get-native-object-no-reffing);
}

sub gtk_style_context_restore (
  N-GObject $context
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:save:
=begin pod
=head2 save

Saves the I<context> state, so temporary modifications done through C<add-class()>, C<remove-class()>, C<set-state()>, etc. can quickly be reverted in one go through C<gtk-style-context-restore()>.

The matching call to C<gtk-style-context-restore()> must be done before GTK returns to the main loop.

  method save ( )

=end pod

method save ( ) {

  gtk_style_context_save(
    self._get-native-object-no-reffing,
  );
}

sub gtk_style_context_save (
  N-GObject $context
) is native(&gtk-lib)
  { * }

#`{{
#-------------------------------------------------------------------------------
#TM:0:set-frame-clock:
=begin pod
=head2 set-frame-clock

Attaches I<context> to the given frame clock.

The frame clock is used for the timing of animations.

If you are using a B<Gnome::Gtk3::StyleContext> returned from C<gtk-widget-get-style-context()>, you do not need to call this yourself.

  method set-frame-clock ( N-GObject $frame-clock )

=item N-GObject $frame-clock; a B<Gnome::Gtk3::FrameClock>
=end pod

method set-frame-clock ( $frame-clock is copy ) {
  $frame-clock .= _get-native-object-no-reffing unless $frame-clock ~~ N-GObject;

  gtk_style_context_set_frame_clock(
    self._get-native-object-no-reffing, $frame-clock
  );
}

sub gtk_style_context_set_frame_clock (
  N-GObject $context, N-GObject $frame-clock
) is native(&gtk-lib)
  { * }
}}

#-------------------------------------------------------------------------------
#TM:1:set-junction-sides:
=begin pod
=head2 set-junction-sides

Sets the sides where rendered elements (mostly through C<render-frame()>) will visually connect with other visual elements.

This is merely a hint that may or may not be honored by themes.

Container widgets are expected to set junction hints as appropriate for their children, so it should not normally be necessary to call this function manually.

  method set-junction-sides ( UInt $sides )

=item UInt $sides; sides where rendered elements are visually connected to other elements. Bits ae from GtkJunctionSides.
=end pod

method set-junction-sides ( UInt $sides ) {
  gtk_style_context_set_junction_sides(
    self._get-native-object-no-reffing, $sides
  );
}

sub gtk_style_context_set_junction_sides (
  N-GObject $context, GFlag $sides
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-parent:
=begin pod
=head2 set-parent

Sets the parent style context for I<context>. The parent style context is used to implement [inheritance](http://www.w3.org/TR/css3-cascade/B<inheritance>) of properties.

If you are using a B<Gnome::Gtk3::StyleContext> returned from C<gtk-widget-get-style-context()>, the parent will be set for you.

  method set-parent ( N-GObject $parent )

=item N-GObject $parent; the new parent or C<undefined>
=end pod

method set-parent ( $parent is copy ) {
  $parent .= _get-native-object-no-reffing unless $parent ~~ N-GObject;
  gtk_style_context_set_parent( self._get-native-object-no-reffing, $parent);
}

sub gtk_style_context_set_parent (
  N-GObject $context, N-GObject $parent
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:0:set-path:
=begin pod
=head2 set-path

Sets the B<Gnome::Gtk3::WidgetPath> used for style matching. As a consequence, the style will be regenerated to match the new given path.

If you are using a B<Gnome::Gtk3::StyleContext> returned from C<Gnome::Gtk3::Widget.get-style-context()>, you do not need to call this yourself.

  method set-path ( N-GObject $path )

=item N-GObject $path; a B<Gnome::Gtk3::WidgetPath>
=end pod

method set-path ( $path is copy ) {
  $path .= _get-native-object-no-reffing unless $path ~~ N-GObject;
  gtk_style_context_set_path( self._get-native-object-no-reffing, $path);
}

sub gtk_style_context_set_path (
  N-GObject $context, N-GObject $path
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-scale:
=begin pod
=head2 set-scale

Sets the scale to use when getting image assets for the style.

  method set-scale ( Int() $scale )

=item Int() $scale; scale
=end pod

method set-scale ( Int() $scale ) {
  gtk_style_context_set_scale( self._get-native-object-no-reffing, $scale);
}

sub gtk_style_context_set_scale (
  N-GObject $context, gint $scale
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-screen:
=begin pod
=head2 set-screen

Attaches I<context> to the given screen.

The screen is used to add style information from “global” style providers, such as the screen’s B<Gnome::Gtk3::Settings> instance.

If you are using a B<Gnome::Gtk3::StyleContext> returned from C<gtk-widget-get-style-context()>, you do not need to call this yourself.

  method set-screen ( N-GObject $screen )

=item N-GObject $screen; a B<Gnome::Gtk3::Screen>
=end pod

method set-screen ( $screen is copy ) {
  $screen .= _get-native-object-no-reffing unless $screen ~~ N-GObject;

  gtk_style_context_set_screen(
    self._get-native-object-no-reffing, $screen
  );
}

sub gtk_style_context_set_screen (
  N-GObject $context, N-GObject $screen
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:set-state:
=begin pod
=head2 set-state

Sets the state bit mask to be used for style matching.

  method set-state ( UInt $flags )

=item UInt $flags; state to represent using bits from GtkStateFlags
=end pod

method set-state ( UInt $flags ) {
  gtk_style_context_set_state( self._get-native-object-no-reffing, $flags);
}

sub gtk_style_context_set_state (
  N-GObject $context, GFlag $flags
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:to-string:
=begin pod
=head2 to-string

Converts the style context into a string representation.

The string representation always includes information about the name, state, id, visibility and style classes of the CSS node that is backing I<context>. Depending on the flags, more information may be included.

This function is intended for testing and debugging of the CSS implementation in GTK+. There are no guarantees about the format of the returned string, it may change.

Returns: a newly allocated string representing I<context>

  method to-string ( Uint $flags --> Str )

=item UInt $flags; Flags that determine what to print. Nits are from GtkStyleContextPrintFlags
=end pod

method to-string ( UInt $flags --> Str ) {
  gtk_style_context_to_string( self._get-native-object-no-reffing, $flags)
}

sub gtk_style_context_to_string (
  N-GObject $context, GFlag $flags --> gchar-ptr
) is native(&gtk-lib)
  { * }

#-------------------------------------------------------------------------------
#TM:1:_gtk_style_context_new:
#`{{
=begin pod
=head2 _gtk_style_context_new

Creates a standalone B<Gnome::Gtk3::StyleContext>, this style context won’t be attached to any widget, so you may want to call C<set-path()> yourself.

This function is only useful when using the theming layer separated from GTK+, if you are using B<Gnome::Gtk3::StyleContext> to theme B<Gnome::Gtk3::Widgets>, use C<gtk-widget-get-style-context()> in order to get a style context ready to theme the widget.

Returns: A newly created B<Gnome::Gtk3::StyleContext>.

  method _gtk_style_context_new ( --> N-GObject )

=end pod
}}

sub _gtk_style_context_new (  --> N-GObject )
  is native(&gtk-lib)
  is symbol('gtk_style_context_new')
  { * }

#-------------------------------------------------------------------------------
=begin pod
=head1 Signals

There are two ways to connect to a signal. The first option you have is to use C<register-signal()> from B<Gnome::GObject::Object>. The second option is to use C<connect-object()> directly from B<Gnome::GObject::Signal>.

=head2 First method

The positional arguments of the signal handler are all obligatory as well as their types. The named attributes C<:$widget> and user data are optional.

  # handler method
  method mouse-event ( GdkEvent $event, :$widget ) { ... }

  # connect a signal on window object
  my Gnome::Gtk3::Window $w .= new( ... );
  $w.register-signal( self, 'mouse-event', 'button-press-event');

=head2 Second method

  my Gnome::Gtk3::Window $w .= new( ... );
  my Callable $handler = sub (
    N-GObject $native, GdkEvent $event, OpaquePointer $data
  ) {
    ...
  }

  $w.connect-object( 'button-press-event', $handler);

Also here, the types of positional arguments in the signal handler are important. This is because both methods C<register-signal()> and C<connect-object()> are using the signatures of the handler routines to setup the native call interface.

=head2 Supported signals


=comment -----------------------------------------------------------------------
=comment #TS:0:changed:
=head3 changed

The I<changed> signal is emitted when there is a change in the B<Gnome::Gtk3::StyleContext>.

For a B<Gnome::Gtk3::StyleContext> returned by C<Gnome::Gtk3::Widget.get-style-context()>, the I<style-updated> signal might be more convenient to use.

This signal is useful when using the theming layer standalone.

  method handler (
    Int :$_handle_id,
    Gnome::Gtk3::StyleContext() :$_native_object,
    *%user-options
  );

=item $_handle_id; the registered event handler id=item $_widget; the object which received the signal.
=item $_native-object; The native object provided by the caller wrapped in the Raku object which registered the signal.
=item %user-options; A list of named arguments provided at the C<register-signal()> method

=end pod


#-------------------------------------------------------------------------------
=begin pod
=head1 Properties

An example of using a string type property of a B<Gnome::Gtk3::Label> object. This is just showing how to set/read a property, not that it is the best way to do it. This is because a) The class initialization often provides some options to set some of the properties and b) the classes provide many methods to modify just those properties. In the case below one can use B<new(:label('my text label'))> or B<.set-text('my text label')>.

  my Gnome::Gtk3::Label $label .= new;
  my Gnome::GObject::Value $gv .= new(:init(G_TYPE_STRING));
  $label.get-property