Search documentation of Plushie

# Plushie.Command.WindowQuery (Plushie v0.7.2)

Copy Markdown View Source

Window query commands. Results arrive as `%Plushie.Event.SystemEvent{}` in `update/2`.

## Summary

### Functions

is_maximized(window_id, tag)

Query whether a window is maximized.

is_minimized(window_id, tag)

Query whether a window is minimized.

monitor_size(window_id, tag)

Query the monitor size for the display containing a window.

raw_id(window_id, tag)

Query the raw platform window ID (e.g. X11 window ID, HWND).

scale_factor(window_id, tag)

Query the window's current scale factor (DPI scaling).

window_mode(window_id, tag)

Query the current window mode (windowed, fullscreen, hidden).

window_position(window_id, tag)

Query the position of a window.

window_size(window_id, tag)

Query the size of a window.

## Functions

# is_maximized(window_id, tag)

    @spec is_maximized(
      window_id :: Plushie.Command.window_id(),
      tag :: Plushie.Command.event_tag()
    ) ::
      Plushie.Command.t()

Query whether a window is maximized.

Result arrives as `%Plushie.Event.SystemEvent{tag: tag, value: boolean}`.

# is_minimized(window_id, tag)

    @spec is_minimized(
      window_id :: Plushie.Command.window_id(),
      tag :: Plushie.Command.event_tag()
    ) ::
      Plushie.Command.t()

Query whether a window is minimized.

Result arrives as `%Plushie.Event.SystemEvent{tag: tag, value: boolean}`.

# monitor_size(window_id, tag)

    @spec monitor_size(
      window_id :: Plushie.Command.window_id(),
      tag :: Plushie.Command.event_tag()
    ) ::
      Plushie.Command.t()

Query the monitor size for the display containing a window.

Result arrives as `%Plushie.Event.SystemEvent{tag: tag, value: data}` where `data` is `%{width: width, height: height}` or `nil` if the monitor cannot be determined.

# raw_id(window_id, tag)

    @spec raw_id(
      window_id :: Plushie.Command.window_id(),
      tag :: Plushie.Command.event_tag()
    ) ::
      Plushie.Command.t()

Query the raw platform window ID (e.g. X11 window ID, HWND).

Result arrives as `%Plushie.Event.SystemEvent{tag: tag, value: platform_id}`.

# scale_factor(window_id, tag)

    @spec scale_factor(
      window_id :: Plushie.Command.window_id(),
      tag :: Plushie.Command.event_tag()
    ) ::
      Plushie.Command.t()

Query the window's current scale factor (DPI scaling).

Result arrives as `%Plushie.Event.SystemEvent{tag: tag, value: factor}`.

# window_mode(window_id, tag)

    @spec window_mode(
      window_id :: Plushie.Command.window_id(),
      tag :: Plushie.Command.event_tag()
    ) ::
      Plushie.Command.t()

Query the current window mode (windowed, fullscreen, hidden).

Result arrives as `%Plushie.Event.SystemEvent{tag: tag, value: mode}`.

# window_position(window_id, tag)

    @spec window_position(
      window_id :: Plushie.Command.window_id(),
      tag :: Plushie.Command.event_tag()
    ) ::
      Plushie.Command.t()

Query the position of a window.

Result arrives as `%Plushie.Event.SystemEvent{tag: tag, value: data}` where `data` is `%{x: x, y: y}` or `nil` if unavailable.

# window_size(window_id, tag)

    @spec window_size(
      window_id :: Plushie.Command.window_id(),
      tag :: Plushie.Command.event_tag()
    ) ::
      Plushie.Command.t()

Query the size of a window.

Result arrives as `%Plushie.Event.SystemEvent{tag: tag, value: data}` where `data` is `%{width: width, height: height}`.