PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations | Functions
layout_node.h File Reference
#include <applib/graphics/text.h>
#include <applib/ui/kino/kino_layer.h>
#include <apps/system/timeline/text_node.h>
#include <resource/resource_ids.auto.h>
#include <pbl/services/timeline/attribute.h>
#include <pbl/services/timeline/layout_layer.h>
#include <pbl/services/timeline/timeline_resources.h>
#include <shell/system_theme.h>

Data Structures

struct  LayoutNodeConfig
 Base of every node config. More...
 
struct  LayoutNodeExtentConfig
 Node config with an extent, added to the node's own. More...
 
struct  LayoutNodeTextConfig
 Text node config. More...
 
struct  LayoutNodeHeadingsParagraphsConfig
 Headings and paragraphs node config. More...
 
struct  LayoutNodeTextAttributeConfig
 Attribute text node config; no node is created if the attribute is empty. More...
 
struct  LayoutNodeTextBufferConfig
 Buffer text node config; no node is created for an empty string. More...
 
struct  LayoutNodeTextDynamicConfig
 Dynamic text node config. More...
 
struct  LayoutNodeContainerConfig
 Container node config. More...
 
struct  LayoutNodeHorizontalConfig
 Horizontal container node config. More...
 
struct  LayoutNodeVerticalConfig
 Vertical container node config. More...
 
struct  LayoutNodeConstructorConfig
 Constructor node config. More...
 
struct  LayoutNodeIconConfig
 Icon node config. More...
 
struct  LayoutNodeExtentConfig.offset
 Position delta, not affecting neighboring nodes. More...
 
struct  LayoutNodeExtentConfig.margin
 Size delta, not affecting the node's internal positioning. More...
 

Macros

#define ToLayoutTextAlignment(alignment)   (alignment + 1)
 Convert a GTextAlignment to a LayoutTextAlignment.
 
#define ToGTextAlignment(alignment)   (alignment - 1)
 Convert a LayoutTextAlignment other than auto to a GTextAlignment.
 
#define ToLayoutVerticalAlignment(alignment)   (alignment + 1)
 Convert a GVerticalAlignment to a LayoutVerticalAlignment.
 
#define ToGVerticalAlignment(alignment)   (alignment - 1)
 Convert a LayoutVerticalAlignment other than auto to a GVerticalAlignment.
 
#define ToLayoutContentSize(size)   ((LayoutContentSize)((size) + 1))
 Convert a PreferredContentSize to a LayoutContentSize.
 
#define ToPreferredContentSize(size)   ((PreferredContentSize)((size) - 1))
 Convert a LayoutContentSize other than auto to a PreferredContentSize.
 

Typedefs

typedef void(* LayoutNodeTextDynamicUpdate) (const LayoutLayer *layout, const LayoutNodeTextDynamicConfig *config, char *buffer, bool render)
 Fill the buffer of a dynamic text node.
 
typedef GTextNode *(* LayoutNodeConstructor) (const LayoutLayer *layout, const LayoutNodeConstructorConfig *config)
 Build the node of a constructor node config.
 

Enumerations

enum  LayoutTextAlignment { LayoutTextAlignment_Auto = 0 , LayoutTextAlignment_Left = GTextAlignmentLeft + 1 , LayoutTextAlignment_Center = GTextAlignmentCenter + 1 , LayoutTextAlignment_Right = GTextAlignmentRight + 1 }
 Horizontal text alignment; GTextAlignment shifted so that 0 means automatic. More...
 
enum  LayoutVerticalAlignment { LayoutVerticalAlignment_Auto = 0 , LayoutVerticalAlignment_Left = GVerticalAlignmentTop + 1 , LayoutVerticalAlignment_Center = GVerticalAlignmentCenter + 1 , LayoutVerticalAlignment_Right = GVerticalAlignmentBottom + 1 }
 Vertical alignment; GVerticalAlignment shifted so that 0 means automatic. More...
 
enum  LayoutColor { LayoutColor_None = 0 , LayoutColor_Primary , LayoutColor_Secondary , LayoutColor_Background }
 Layout color used for text. More...
 
enum  LayoutContentSize {
  LayoutContentSize_Auto = 0 , LayoutContentSize_Small = PreferredContentSizeSmall + 1 , LayoutContentSize_Medium = PreferredContentSizeMedium + 1 , LayoutContentSize_Large = PreferredContentSizeLarge + 1 ,
  LayoutContentSize_ExtraLarge = PreferredContentSizeExtraLarge + 1 , LayoutContentSizeDefault = PreferredContentSizeDefault + 1
}
 Content size; PreferredContentSize shifted so that 0 means the system size. More...
 
enum  LayoutNodeType {
  LayoutNodeType_TextAttribute = 0 , LayoutNodeType_TextBuffer , LayoutNodeType_TextDynamic , LayoutNodeType_Text ,
  LayoutNodeType_Horizontal , LayoutNodeType_Vertical , LayoutNodeType_Constructor , LayoutNodeType_HeadingsParagraphs ,
  LayoutNodeType_Icon , LayoutNodeType_TimelineIcon , LayoutNodeType_TimelinePageBreak , LayoutNodeType_TimelineMetrics
}
 Type of a node config, selecting the config struct. More...
 

Functions

GTextNodeVertical * layout_create_headings_paragraphs_node (const LayoutLayer *layout, const LayoutNodeHeadingsParagraphsConfig *config)
 Create a vertical node with the layout's headings and paragraphs.
 
GTextNode * layout_create_text_node_from_config (const LayoutLayer *layout, const LayoutNodeConfig *config)
 Create a tree of text nodes from a config.
 
GTextNodeCustom * layout_node_create_kino_layer_wrapper (KinoLayer *kino_layer)
 Wrap a KinoLayer in a custom text node that positions the layer during layout.