Class Surface.Builder<B extends Surface.Builder<B>>

Type Parameters:
B - the type of the Builder that is returned
All Implemented Interfaces:
BuilderInterface
Enclosing class:
Surface

public static class Surface.Builder<B extends Surface.Builder<B>> extends GObject.Builder<B>
Inner class implementing a builder pattern to construct a GObject with properties.
  • Constructor Details

    • Builder

      protected Builder()
      Default constructor for a Builder object.
  • Method Details

    • build

      public Surface build()
      Finish building the Surface object. This will call GObject.withProperties(Type, String[], Value[]) to create a new GObject instance, which is then cast to Surface.
      Overrides:
      build in class GObject.Builder<B extends Surface.Builder<B>>
      Returns:
      a new instance of Surface with the properties that were set in the Builder object.
    • setCursor

      public B setCursor(Cursor cursor)
      The mouse pointer for the GdkSurface.
      Parameters:
      cursor - the value for the cursor property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setDisplay

      public B setDisplay(Display display)
      The GdkDisplay connection of the surface.
      Parameters:
      display - the value for the display property
      Returns:
      the Builder instance is returned, to allow method chaining
    • setFrameClock

      public B setFrameClock(FrameClock frameClock)
      The GdkFrameClock of the surface.
      Parameters:
      frameClock - the value for the frame-clock property
      Returns:
      the Builder instance is returned, to allow method chaining
    • onEnterMonitor

      public B onEnterMonitor(Surface.EnterMonitorCallback handler)
      Emitted when surface starts being present on the monitor.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onEvent

      public B onEvent(Surface.EventCallback handler)
      Emitted when GDK receives an input event for surface.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onLayout

      public B onLayout(Surface.LayoutCallback handler)

      Emitted when the size of surface is changed, or when relayout should be performed.

      Surface size is reported in ”application pixels”, not ”device pixels” (see gdk_surface_get_scale_factor()).

      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onLeaveMonitor

      public B onLeaveMonitor(Surface.LeaveMonitorCallback handler)
      Emitted when surface stops being present on the monitor.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also:
    • onRender

      public B onRender(Surface.RenderCallback handler)
      Emitted when part of the surface needs to be redrawn.
      Parameters:
      handler - the signal handler
      Returns:
      the Builder instance is returned, to allow method chaining
      See Also: