Pebble Foundation Classes  0.2.0
C++ for Pebble
Pebble::Window Class Reference

Wraps and existing Pebble window but does not take ownership of it.
More...

#include <pebble_window.hpp>

Inheritance diagram for Pebble::Window:
Collaboration diagram for Pebble::Window:

Public Member Functions

 Window (::Window *window)
 
virtual ~Window ()
 Window destructor

 
 operator::Window * ()
 Instances of this class can be automatically converted to Pebble window pointers.
 
void StackPush (bool animated)
 
bool StackContainsWindow () const
 
bool WindowIsTop ()
 
bool StackRemove (bool animated)
 
bool IsLoaded () const
 
inline ::ClickConfigProvider GetClickConfigProvider () const
 Gets the current click configuration provider of the window.
 
void SetBackgroundColor (GColor background_color)
 
- Public Member Functions inherited from Pebble::Layer
 Layer (::Layer *layer)
 Wraps an existing TextLayer.
 
 operator::Layer * ()
 Instances of this class can be automatically converted to Pebble Layers.
 
 operator const ::Layer * () const
 
void MarkDirty ()
 
void SetFrame (GRect frame)
 
void SetFrame (int16_t x, int16_t y, int16_t w, int16_t h)
 
void SetFrame (GPoint origin, GSize size)
 
GRect GetFrame ()
 
void SetBounds (GRect bounds)
 
GRect GetBounds ()
 
void RemoveFromParent ()
 
void RemoveChildLayers ()
 
void AddChild (Layer &child)
 
void InsertBelowSibling (Layer &below_sibling_layer)
 
void InsertAboveSibling (Layer &above_sibling_layer)
 
void SetHidden (bool hidden)
 
bool GetHidden ()
 
void SetClips (bool clips)
 
bool GetClips ()
 

Protected Attributes

::Windowwindow_
 
- Protected Attributes inherited from Pebble::Layer
::Layerlayer_
 

Detailed Description

Wraps and existing Pebble window but does not take ownership of it.

Constructor & Destructor Documentation

◆ Window()

Pebble::Window::Window ( ::Window window)
inline

Constructs a Window instance

Parameters
ExistingPebble window to wrap

Member Function Documentation

◆ IsLoaded()

bool Pebble::Window::IsLoaded ( ) const
inline

Gets whether the window has been loaded. If a window is loaded, its .load handler has been called (and the .unload handler has not been called since).

Returns
true if the window is currently loaded or false if not.
See also
WindowHandlers

◆ SetBackgroundColor()

void Pebble::Window::SetBackgroundColor ( GColor  background_color)
inline

Sets the background color of the window, which is drawn automatically by the root layer of the window.

Parameters
background_colorThe new background color
See also
window_get_root_layer()

◆ StackContainsWindow()

bool Pebble::Window::StackContainsWindow ( ) const
inline

Checks if the window is on the window stack

Returns
true if the window is currently on the window stack.

◆ StackPush()

void Pebble::Window::StackPush ( bool  animated)
inline

Pushes this window onto the window navigation stack, on top of the current topmost window of the app.

Parameters
animatedPass in true to animate the push using a sliding animation, or false to skip the animation.

◆ StackRemove()

bool Pebble::Window::StackRemove ( bool  animated)
inline

Removes a given window from the window stack that belongs to the app task.

Note
If there are no windows for the app left on the stack, the app will be killed by the system, shortly. To avoid this, make sure to push another window shortly after or before removing the last window.
Parameters
animatedPass in true to animate the removal of the window using a side-to-side sliding animation to reveal the next window. This is only used in case the window happens to be on top of the window stack (thus visible).
Returns
True if window was successfully removed, false otherwise.

◆ WindowIsTop()

bool Pebble::Window::WindowIsTop ( )
inline

Returns whether or not this Window is on the top of the app's window stack.

Returns
True if the topmost window on the stack that belongs to the app is this window.

The documentation for this class was generated from the following file: