Pebble Foundation Classes  0.2.0
C++ for Pebble
Pebble::CustomLayer Class Referenceabstract

Layer that is automatically managed and contains an OnUpdate callback for drawing. More...

#include <pebble_layer.hpp>

Inheritance diagram for Pebble::CustomLayer:
Collaboration diagram for Pebble::CustomLayer:

Public Member Functions

 CustomLayer (GRect frame)
 
- Public Member Functions inherited from Pebble::SimpleLayer
 SimpleLayer (GRect frame)
 
virtual ~SimpleLayer ()
 Destroys the underlying AppLayer.
 
- 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 Member Functions

virtual void OnUpdate (const GContext &ctx)=0
 

Additional Inherited Members

- Static Protected Member Functions inherited from Pebble::SimpleLayer
static SimpleLayerGetFromData (::Layer *layer)
 
- Protected Attributes inherited from Pebble::Layer
::Layerlayer_
 

Detailed Description

Layer that is automatically managed and contains an OnUpdate callback for drawing.

This subclass of layer creates and destroys the underlying Pebble OS layer structure automatically. This type of layer must be sublcassed to provide an implementation for the OnUpdate callback method.

See also
Layer

Constructor & Destructor Documentation

◆ CustomLayer()

Pebble::CustomLayer::CustomLayer ( GRect  frame)
inline

Creates a layer and sets its frame and bounds. Default values:

  • bounds : origin (0, 0) and a size equal to the frame that is passed in.
  • clips : true
  • hidden : false
    Parameters
    frameThe frame at which the layer should be initialized.

Member Function Documentation

◆ OnUpdate()

virtual void Pebble::CustomLayer::OnUpdate ( const GContext ctx)
protectedpure virtual

The layer's render function. The system will call this method automatically when the layer needs to redraw.

Parameters
ctxThe destination graphics context to draw into

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