### launch_get_args Source: https://developer.rebble.io/docs/c/Foundation/Launch_Reason Get the argument passed to the app when it was launched. ```APIDOC ## launch_get_args ### Description Get the argument passed to the app when it was launched. ### Note Currently the only way to pass arguments to apps is by using an openWatchApp action on a pin. ### Signature uint32_t launch_get_args(void) ### Returns The argument passed to the app, or 0 if the app wasn't launched from a Launch App action ``` -------------------------------- ### AnimationImplementation Source: https://developer.rebble.io/docs/symbols The 3 callbacks that implement a custom animation: setup, update, and teardown. ```APIDOC ## AnimationImplementation ### Description The 3 callbacks that implement a custom animation. Only the `.update` callback is mandatory, `.setup` and `.teardown` are optional. See the documentation with the function pointer typedefs for more information. ### Type Definition (Structure or type definition for implementation callbacks) ``` -------------------------------- ### window_create Source: https://developer.rebble.io/docs/c/User_Interface/Window Creates a new Window on the heap and initializes it with default values. The background color is GColorWhite, the root layer's update_proc fills the window's background, click_config_provider is NULL, and window_handlers are all NULL. ```APIDOC ## window_create ### Description Creates a new Window on the heap and initializes it with default values. ### Returns A pointer to the window. `NULL` if the window could not be created. ``` -------------------------------- ### animation_schedule Source: https://developer.rebble.io/docs/symbols Schedules the animation. Call this once after configuring an animation to get it to start running. ```APIDOC ## animation_schedule ### Description Schedules the animation. Call this once after configuring an animation to get it to start running. ### Method (Not specified, likely a control function) ### Endpoint (Not applicable for SDK functions) ### Parameters - **animation** (handle) - Required - The animation to schedule. ``` -------------------------------- ### animation_get_duration Source: https://developer.rebble.io/docs/symbols Get the static duration of an animation from start to end (ignoring how much has already played, if any). ```APIDOC ## animation_get_duration ### Description Get the static duration of an animation from start to end (ignoring how much has already played, if any). ### Method (Not specified, likely a getter function) ### Endpoint (Not applicable for SDK functions) ### Parameters - **animation** (handle) - Required - The animation to query. ### Response - **duration** (milliseconds) - The static duration of the animation in milliseconds. ``` -------------------------------- ### Example Usage of grect_inset Source: https://developer.rebble.io/docs/c/Graphics/Graphics_Types Demonstrates how to use grect_inset with different GEdgeInsets configurations for insetting, expanding, and mixed operations. ```c GRect r_inset_all_sides = grect_inset(r, GEdgeInsets(10)); GRect r_inset_vertical_horizontal = grect_inset(r, GEdgeInsets(10, 20)); GRect r_expand_top_right_shrink_bottom_left = grect_inset(r, GEdgeInsets(-10, -10, 10, 10)); ``` -------------------------------- ### Create, Log, and Finish Data Logging Session Source: https://developer.rebble.io/docs/c/Foundation/DataLogging Demonstrates how to create a data logging session for 4-byte unsigned integers, log sample data, and then finish the session. Ensure the session is finished when no more data needs to be logged. ```c DataLoggingSessionRef logging_session = data_logging_create(0x1234, DATA_LOGGING_UINT, 4, false); // Fake creating some data and logging it to the session. uint32_t data[] = { 1, 2, 3}; data_logging_log(logging_session, &data, 3); // Fake creating more data and logging that as well. uint32_t data2[] = { 1, 2 }; data_logging_log(logging_session, &data, 2); // When we don't need to log anything else, we can close off the session. data_logging_finish(logging_session); ``` -------------------------------- ### animation_set_handlers Source: https://developer.rebble.io/docs/symbols Sets the callbacks for the animation. Often an application needs to run code at the start or at the end of an animation. Using this function is possible to register callback functions with an animation, that will get called at the start and end of the animation. ```APIDOC ## animation_set_handlers ### Description Sets the callbacks for the animation. Often an application needs to run code at the start or at the end of an animation. Using this function is possible to register callback functions with an animation, that will get called at the start and end of the animation. ### Method (Not specified, likely a setter function) ### Endpoint (Not applicable for SDK functions) ### Parameters - **animation** (handle) - Required - The animation to configure. - **started_handler** (AnimationStartedHandler) - Optional - The callback function to call when the animation starts. - **stopped_handler** (AnimationStoppedHandler) - Optional - The callback function to call when the animation stops. - **context** (void*) - Optional - Application-specific context pointer passed to handlers. ``` -------------------------------- ### memset Source: https://developer.rebble.io/docs/c/Standard_C/Memory Sets n bytes to c starting at dest. This can be used to clear a memory region for example if c is 0. ```APIDOC ## memset ### Description Sets n bytes to c starting at dest. This can be used to clear a memory region for example if c is 0. ### Parameters #### Parameters - **dest** (void *) - The pointer to the destination memory region - **c** (int) - The integer used as an unsigned char to assign to each byte - **n** (size_t) - The number of bytes to set ``` -------------------------------- ### + firmwareVersionWithString: Source: https://developer.rebble.io/docs/pebblekit-ios/Classes/PBFirmwareVersion Creates a PBFirmwareVersion object given a tag string. ```APIDOC ## + firmwareVersionWithString: ### Description Creates a PBFirmwareVersion object given a tag string. ### Method `+ (nullable instancetype)firmwareVersionWithString:(NSString *)_tag_` ### Parameters #### Path Parameters * **_tag_** (NSString) - The firmware version string to parse. ``` -------------------------------- ### Set Memory with memset Source: https://developer.rebble.io/docs/c/Standard_C/Memory Sets n bytes to c starting at dest. This can be used to clear a memory region for example if c is 0. ```c void * memset(void * dest, int c, size_t n) ``` -------------------------------- ### Initialize and Configure ActionBarLayer Source: https://developer.rebble.io/docs/c/User_Interface/Layers/ActionBarLayer Sets up the action bar in a window's load handler, associating it with the window and defining click handlers and icons. Ensure click handler functions and icon resources are defined elsewhere. ```c ActionBarLayer *action_bar; // The implementation of my_next_click_handler and my_previous_click_handler // is omitted for the sake of brevity. See the Clicks reference docs. void click_config_provider(void *context) { window_single_click_subscribe(BUTTON_ID_DOWN, (ClickHandler) my_next_click_handler); window_single_click_subscribe(BUTTON_ID_UP, (ClickHandler) my_previous_click_handler); } void window_load(Window *window) { ... // Initialize the action bar: action_bar = action_bar_layer_create(); // Associate the action bar with the window: action_bar_layer_add_to_window(action_bar, window); // Set the click config provider: action_bar_layer_set_click_config_provider(action_bar, click_config_provider); // Set the icons: // The loading of the icons is omitted for brevity... See gbitmap_create_with_resource() action_bar_layer_set_icon_animated(action_bar, BUTTON_ID_UP, my_icon_previous, true); action_bar_layer_set_icon_animated(action_bar, BUTTON_ID_DOWN, my_icon_next, true); } ``` -------------------------------- ### ActionBarLayer Creation and Initialization Source: https://developer.rebble.io/docs/c/User_Interface/Layers/ActionBarLayer This snippet demonstrates how to create, add to a window, and configure an ActionBarLayer, including setting click handlers and icons. ```APIDOC ## ActionBarLayer Initialization Example ### Description This example shows the basic setup of an ActionBarLayer within a window's load handler. It covers creating the layer, associating it with the window, setting a click configuration provider, and assigning icons. ### Code ```c ActionBarLayer *action_bar; // Assume my_next_click_handler and my_previous_click_handler are defined elsewhere. void click_config_provider(void *context) { window_single_click_subscribe(BUTTON_ID_DOWN, (ClickHandler) my_next_click_handler); window_single_click_subscribe(BUTTON_ID_UP, (ClickHandler) my_previous_click_handler); } void window_load(Window *window) { // ... other window setup ... // Initialize the action bar: action_bar = action_bar_layer_create(); // Associate the action bar with the window: action_bar_layer_add_to_window(action_bar, window); // Set the click config provider: action_bar_layer_set_click_config_provider(action_bar, click_config_provider); // Set the icons (assuming my_icon_previous and my_icon_next are GBitmap pointers): action_bar_layer_set_icon_animated(action_bar, BUTTON_ID_UP, my_icon_previous, true); action_bar_layer_set_icon_animated(action_bar, BUTTON_ID_DOWN, my_icon_next, true); } ``` ``` -------------------------------- ### isMobileAppInstalled Source: https://developer.rebble.io/docs/pebblekit-ios/Classes/PBPebbleCentral Checks if the Pebble iOS companion application is installed on the device. Returns `YES` if installed, `NO` otherwise. ```APIDOC ## isMobileAppInstalled ### Description Determines if the Pebble iOS app is installed in the device. ### Method `- (BOOL)isMobileAppInstalled` ### Return Value `YES` if the Pebble iOS app is installed, `NO` if it is not installed. ### Discussion **Note:** Since iOS 9.0 you have to add “pebble” to `LSApplicationQueriesSchemes` in your application `Info.plist` or this method will return `NO` all the time. ### Declared In `PBPebbleCentral.h` ``` -------------------------------- ### Get Today's Health Metric Sum Source: https://developer.rebble.io/docs/c/Foundation/Event_Service/HealthService A convenience function to get the sum of a health metric's data for the current day. This simplifies querying daily totals. ```c HealthValue health_service_sum_today(HealthMetric metric) ``` -------------------------------- ### PBSemanticVersion Initialization Methods Source: https://developer.rebble.io/docs/pebblekit-ios/Classes/PBSemanticVersion Methods for creating instances of PBSemanticVersion. ```APIDOC ## PBSemanticVersion Initialization Methods ### initWithVersionString: Returns a new instance by parsing the input. `- (nullable instancetype)initWithVersionString:(NSString *)_versionString_` **Parameters:** * `_versionString_` (NSString) - Expected format: major.minor.revision-sffix. Example: “2.0.1-rc2”. If a parsing error occurs, nil will be returned. **Return Value:** A version or `nil` if some error happens. ### initWithMajor:minor:revision:suffix: Returns a new instance by using the given components. `- (instancetype)initWithMajor:(NSUInteger)_major_ minor:(NSUInteger)_minor_ revision:(NSUInteger)_revision_ suffix:(nullable NSString *)_suffix_` **Parameters:** * `_major_` (NSUInteger) - The version major number. * `_minor_` (NSUInteger) - The version minor number. * `_revision_` (NSUInteger) - The version revision number. * `_suffix_` (nullable NSString) - The version suffix. Can be nil. ``` -------------------------------- ### number_window_get_value Source: https://developer.rebble.io/docs/symbols Gets the current value. ```APIDOC ## number_window_get_value ### Description Gets the current value. ### Method GET (assumed) ### Endpoint /number_windows/{id}/value ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the NumberWindow. ``` -------------------------------- ### Create a New Window Source: https://developer.rebble.io/docs/c/User_Interface/Window Creates a new Window on the heap with default values. Returns a pointer to the window or NULL if creation fails. ```c Window * window_create(void); ``` -------------------------------- ### gbitmap_get_format Source: https://developer.rebble.io/docs/c/Graphics/Graphics_Types Get the GBitmapFormat for the GBitmap. ```APIDOC ## gbitmap_get_format ### Description Get the GBitmapFormat for the GBitmap. ### Parameters bitmap A pointer to the GBitmap to get the format ### Returns GBitmapFormat The format of the given GBitmap. ``` -------------------------------- ### Create a NumberWindow Source: https://developer.rebble.io/docs/c/User_Interface/Window/NumberWindow Initializes a new NumberWindow. Remember to push it to the window stack using window_stack_push() after creation. The label must be a long-lived string. ```c NumberWindow * number_window_create(const char * label, NumberWindowCallbacks callbacks, void * callback_context) ``` -------------------------------- ### Initializing Dictionary Iterator Source: https://developer.rebble.io/docs/c/Foundation/Dictionary Shows how to initialize a dictionary iterator with a buffer and size using dict_write_begin. This prepares the iterator for writing key/value tuples. ```c DictionaryResult dict_write_begin(DictionaryIterator * iter, uint8_t *const buffer, const uint16_t size) ``` -------------------------------- ### action_menu_get_root_level Source: https://developer.rebble.io/docs/symbols Get the root level of an ActionMenu. ```APIDOC ## action_menu_get_root_level ### Description Get the root level of an ActionMenu. ### Method GET (assumed) ### Endpoint /action_menus/{id}/root_level ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the ActionMenu. ``` -------------------------------- ### appMessagesLaunch: Source: https://developer.rebble.io/docs/symbols Sends a command to launch the watch application. Must be called from the main thread. ```APIDOC ## appMessagesLaunch: ### Description Sends a command to launch the watch application with UUID as set using [PBPebbleCentral setAppUUID:]. ### Method void ### Parameters #### Request Body - **onSent** (void (^ __nullable )(PBWatch *watch, NSError *__nullable error)) - Required - The block that will be called after the launch command has been sent to the watch. ### Discussion Must be called from the main thread. ``` -------------------------------- ### animation_get_elapsed Source: https://developer.rebble.io/docs/symbols Get the current location in the animation. ```APIDOC ## animation_get_elapsed ### Description Get the current location in the animation. ### Method (Not specified, likely a getter function) ### Endpoint (Not applicable for SDK functions) ### Parameters - **animation** (handle) - Required - The animation to query. ### Response - **elapsed_time** (time) - The current normalized location in the animation. ``` -------------------------------- ### animation_get_curve Source: https://developer.rebble.io/docs/c/User_Interface/Animation Gets the animation curve for the animation. ```APIDOC ## animation_get_curve ### Description Gets the animation curve for the animation. ### Parameters - **animation** (Animation *) - The animation for which to get the curve. ### Returns - AnimationCurve - The type of curve. ``` -------------------------------- ### Initialize Click Configuration Provider Source: https://developer.rebble.io/docs/c/User_Interface/Clicks Associate a click configuration provider callback with your window during application initialization. ```c void app_init(void) { ... window_set_click_config_provider(&window, (ClickConfigProvider) config_provider); ... } ``` -------------------------------- ### gbitmap_get_palette Source: https://developer.rebble.io/docs/c/Graphics/Graphics_Types Get the palette for the given GBitmap. ```APIDOC ## gbitmap_get_palette ### Description Get the palette for the given GBitmap. ### Parameters bitmap A pointer to the GBitmap to get the palette from. ### Returns GColor * Pointer to a GColor array containing the palette colors. ``` -------------------------------- ### number_window_create Source: https://developer.rebble.io/docs/symbols Creates a new NumberWindow on the heap and initializes it with the default values. ```APIDOC ## number_window_create ### Description Creates a new NumberWindow on the heap and initializes it with the default values. ### Method POST (assumed) ### Endpoint /number_windows ### Parameters #### Request Body - **callbacks** (NumberWindowCallbacks) - Optional - Callbacks for the NumberWindow. ``` -------------------------------- ### status_bar_layer_get_foreground_color Source: https://developer.rebble.io/docs/c/User_Interface/Layers/StatusBarLayer Gets the foreground color of the StatusBarLayer. ```APIDOC ## status_bar_layer_get_foreground_color ### Description Gets foreground color of StatusBarLayer. ### Parameters * **status_bar_layer** (*StatusBarLayer*) - The StatusBarLayer of which to get the color. ### Returns GColor of foreground color property. ``` -------------------------------- ### launch_reason Source: https://developer.rebble.io/docs/c/Foundation/Launch_Reason Provides the method used to launch the current application. ```APIDOC ## launch_reason ### Description Provides the method used to launch the current application. ### Signature AppLaunchReason launch_reason(void) ### Returns The method or reason the current application was launched ``` -------------------------------- ### status_bar_layer_get_background_color Source: https://developer.rebble.io/docs/c/User_Interface/Layers/StatusBarLayer Gets the background color of the StatusBarLayer. ```APIDOC ## status_bar_layer_get_background_color ### Description Gets background color of StatusBarLayer. ### Parameters * **status_bar_layer** (*StatusBarLayer*) - The StatusBarLayer of which to get the color. ### Returns GColor of background color property. ``` -------------------------------- ### run Source: https://developer.rebble.io/docs/pebblekit-ios/Classes/PBPebbleCentral Initializes and announces internal Bluetooth services. This method may trigger a dialog prompting the user to allow the app to communicate with other devices. ```APIDOC ## run ### Description Registers and announces internal Bluetooth services. Might cause a dialog to allow this app to talk to other devices. ### Method `- (void)run` ### Declared In `PBPebbleCentral.h` ``` -------------------------------- ### GDrawCommand Type Source: https://developer.rebble.io/docs/c/Graphics/Draw_Commands Get the type of a GDrawCommand. ```APIDOC ## gdraw_command_get_type ### Description Get the command type. ### Parameters - **command** (GDrawCommand *) - GDrawCommand from which to get the type ### Returns The type of the given GDrawCommand ``` -------------------------------- ### Create, Rotate, Translate, and Draw a Path Source: https://developer.rebble.io/docs/c/Graphics/Drawing_Paths This snippet demonstrates how to create a GPath, set its rotation and translation, and then draw it as both a filled shape and an outline. It requires the GPathInfo structure to define the path's points. ```c static GPath *s_my_path_ptr = NULL; static const GPathInfo BOLT_PATH_INFO = { .num_points = 6, .points = (GPoint []) {{21, 0}, {14, 26}, {28, 26}, {7, 60}, {14, 34}, {0, 34}} }; // .update_proc of my_layer: void my_layer_update_proc(Layer *my_layer, GContext* ctx) { // Fill the path: graphics_context_set_fill_color(ctx, GColorWhite); gpath_draw_filled(ctx, s_my_path_ptr); // Stroke the path: graphics_context_set_stroke_color(ctx, GColorBlack); gpath_draw_outline(ctx, s_my_path_ptr); } void setup_my_path(void) { s_my_path_ptr = gpath_create(&BOLT_PATH_INFO); // Rotate 15 degrees: gpath_rotate_to(s_my_path_ptr, TRIG_MAX_ANGLE / 360 * 15); // Translate by (5, 5): gpath_move_to(s_my_path_ptr, GPoint(5, 5)); } // For brevity, the setup of my_layer is not written out... ``` -------------------------------- ### action_menu_get_context Source: https://developer.rebble.io/docs/symbols Get the context pointer this ActionMenu was created with. ```APIDOC ## action_menu_get_context ### Description Get the context pointer this ActionMenu was created with. ### Method GET (assumed) ### Endpoint /action_menus/{id}/context ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the ActionMenu. ``` -------------------------------- ### Define and Enqueue Custom Vibe Pattern Source: https://developer.rebble.io/docs/c/User_Interface/Vibes Example demonstrating how to define a custom vibration pattern with specific on and off durations and then enqueue it for playback. Ensure the number of segments and their durations are correctly specified. ```c // Vibe pattern: ON for 200ms, OFF for 100ms, ON for 400ms: static const uint32_t const segments[] = { 200, 100, 400 }; VibePattern pat = { .durations = segments, .num_segments = ARRAY_LENGTH(segments), }; vibes_enqueue_custom_pattern(pat); ``` -------------------------------- ### bitmap_layer_create Source: https://developer.rebble.io/docs/c/User_Interface/Layers/BitmapLayer Creates a new BitmapLayer on the heap and initializes it with default values. The default values include a NULL bitmap, GColorClear background, GCompOpAssign compositing mode, and clipping enabled. ```APIDOC ## bitmap_layer_create ### Description Creates a new bitmap layer on the heap and initializes it with default values. ### Returns A pointer to the BitmapLayer. `NULL` if the BitmapLayer could not be created. ### Parameters * frame (GRect) - The frame for the BitmapLayer. ``` -------------------------------- ### layer_get_window Source: https://developer.rebble.io/docs/c/User_Interface/Layers Gets the window that the layer is currently attached to. ```APIDOC ## layer_get_window ### Description Gets the window that the layer is currently attached to. ### Parameters #### layer (const Layer *) - The layer for which to get the window. ### Returns (struct Window *) - The window that the layer is currently attached to. ``` -------------------------------- ### PebbleKit.startAppOnPebble Source: https://developer.rebble.io/docs/symbols Initiates the launch of an application on the Pebble smartwatch. This allows for seamless transitions between a companion app and a watch app. ```APIDOC ## com.getpebble.android.kit.PebbleKit.startAppOnPebble ### Description Starts an application on the Pebble smartwatch. ### Method (Implicitly a method call within the Android SDK) ### Parameters - **appUUID** (UUID) - The UUID of the application to start. ### Code Example ```java PebbleKit.startAppOnPebble(appUUID); ``` ``` -------------------------------- ### animation_get_implementation Source: https://developer.rebble.io/docs/c/User_Interface/Animation Gets the implementation details of a custom animation. ```APIDOC ## animation_get_implementation(Animation * animation) ### Description Gets the implementation of the custom animation. ### Method const AnimationImplementation * animation_get_implementation(Animation * animation) ### Parameters #### Path Parameters - **animation** (Animation *) - The animation for which to get the implementation. ### Returns - **const AnimationImplementation *** - NULL if animation implementation has not been setup. ``` -------------------------------- ### gbitmap_create_blank_with_palette Source: https://developer.rebble.io/docs/symbols Creates a new blank GBitmap on the heap, initialized to zeroes, and assigns it the given palette. ```APIDOC ## gbitmap_create_blank_with_palette Creates a new blank GBitmap on the heap, initialized to zeroes, and assigns it the given palette. No deep-copying of the palette occurs, so the caller is responsible for making sure the palette remains available when using the resulting bitmap. Management of that memory can be handed off to the system with the free_on_destroy argument. ``` -------------------------------- ### sportsAppLaunch: Source: https://developer.rebble.io/docs/pebblekit-ios/Classes/PBWatch Sends a command to launch the sports app on the watch. The handler is called when the command is sent or times out. ```APIDOC ## sportsAppLaunch: (void) ### Description Send a command to launch the sports app on the watch that the receiver represents. ### Method `- (void)sportsAppLaunch:(void ( ^ __nullable ) ( PBWatch *watch , NSError *__nullable error ))_onSent_` ### Parameters #### onSent - **watch** (PBWatch *) - The recipient of the command. - **error** (NSError *__nullable) - nil if the operation was successful, or else an NSError with more information on why it failed. ### Discussion Must be called from the main thread, and before sportsAppSetMetric:onSent: or sportsAppUpdate:onSent:. ### Declared In `PBWatch+Sports.h` ``` -------------------------------- ### AnimationHandlers Source: https://developer.rebble.io/docs/symbols The handlers that will be called when an animation starts and stops. ```APIDOC ## AnimationHandlers ### Description The handlers that will be called when an animation starts and stops. See documentation with the function pointer types for more information. ### Type Definition (Structure or type definition for handlers) ``` -------------------------------- ### Initialize PBPebbleKitLogging - Objective-C Source: https://developer.rebble.io/docs/pebblekit-ios/Classes/PBPebbleKitLogging Instances of PBPebbleKitLogging should not be created directly. This method is provided for completeness but should not be called. ```Objective-C + (instancetype)new ``` -------------------------------- ### NSNumber+PBStandardIntegerExtensions.pb_byteWidth Source: https://developer.rebble.io/docs/symbols Gets the width in bytes of the integer that is stored by the receiver. ```APIDOC ## GET /NSNumber+PBStandardIntegerExtensions.pb_byteWidth ### Description Gets the width in bytes of the integer that is stored by the receiver. ### Method GET ### Endpoint /NSNumber+PBStandardIntegerExtensions.pb_byteWidth ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None (operates on the receiver object) ### Request Example None (operates on the receiver object) ### Response #### Success Response (200) - **uint8_t** - The width of the integer in bytes. #### Response Example ```json { "example": 4 } ``` ``` -------------------------------- ### animation_get_custom_curve Source: https://developer.rebble.io/docs/symbols Gets the custom animation curve function for the animation. ```APIDOC ## animation_get_custom_curve ### Description Gets the custom animation curve function for the animation. ### Method (Not specified, likely a getter function) ### Endpoint (Not applicable for SDK functions) ### Parameters - **animation** (handle) - Required - The animation to query. ### Response - **curve_function** (AnimationCurveFunction) - The custom curve function currently set. ``` -------------------------------- ### Create a GSize Source: https://developer.rebble.io/docs/c/Graphics/Graphics_Types Convenience macro to create a GSize with specified width and height. ```c #define GSize ( w, h) Convenience macro to make a GSize. ``` -------------------------------- ### Get Application Launch Reason Source: https://developer.rebble.io/docs/c/Foundation/Launch_Reason Call this function to determine how the current application was launched. This is useful for tailoring the app's behavior based on its initiation. ```c AppLaunchReason launch_reason(void); ``` -------------------------------- ### pb_byteWidth Source: https://developer.rebble.io/docs/pebblekit-ios/Categories/NSNumber%2BPBStandardIntegerExtensions Gets the width in bytes of the integer that is stored by the receiver. ```APIDOC ## pb_byteWidth ### Description Gets the width in bytes of the integer that is stored by the receiver. ### Property `@property (readonly) uint8_t pb_byteWidth` ### Declared In `NSNumber+stdint.h` ``` -------------------------------- ### app_sync_init Source: https://developer.rebble.io/docs/c/Foundation/AppSync Initializes an AppSync system with a specific buffer size and initial keys and values. The `tuple_changed_callback` will be invoked asynchronously with the initial values to facilitate UI updates. ```APIDOC ## app_sync_init ### Description Initializes an AppSync system with specific buffer size and initial keys and values. The `callback.value_changed` callback will be called **asynchronously** with the initial keys and values, as to avoid duplicating code to update your app's UI. ##### Note Only updates for the keys specified in this initial array will be accepted by AppSync, updates for other keys that might come in will just be ignored. ### Parameters s The AppSync context to initialize buffer The buffer that AppSync should use buffer_size The size of the backing storage of the "current" dictionary. Use dict_calc_buffer_size_from_tuplets() to estimate the size you need. keys_and_initial_values An array of Tuplets with the initial keys and values. count The number of Tuplets in the `keys_and_initial_values` array. tuple_changed_callback The callback that will handle changed key/value pairs error_callback The callback that will handle errors context Pointer to app specific data that will get passed into calls to the callbacks ### Signature void app_sync_init(struct AppSync * s, uint8_t * buffer, const uint16_t buffer_size, const Tuplet *const keys_and_initial_values, const uint8_t count, AppSyncTupleChangedCallback tuple_changed_callback, AppSyncErrorCallback error_callback, void * context) ``` -------------------------------- ### window_get_click_config_provider Source: https://developer.rebble.io/docs/c/User_Interface/Window Gets the current click configuration provider of the window. ```APIDOC ## window_get_click_config_provider ### Description Gets the current click configuration provider of the window. ### Parameters - **window** (const Window *) - The window for which to get the click config provider. ### Returns - The current click configuration provider of the window. ``` -------------------------------- ### layer_get_unobstructed_bounds Source: https://developer.rebble.io/docs/c/User_Interface/Layers Gets the largest unobstructed bounds rectangle of a layer. ```APIDOC ## layer_get_unobstructed_bounds ### Description Get the largest unobstructed bounds rectangle of a layer. ### Parameters #### layer (const Layer *) - The layer for which to get the unobstructed bounds. ### Returns (GRect) - The unobstructed bounds of the layer. ### See Also UnobstructedArea ``` -------------------------------- ### Configure Click Handlers Source: https://developer.rebble.io/docs/c/User_Interface/Clicks Set up desired configurations for each button within the click configuration provider callback. This includes single click, repeating click, multi-click, and long click subscriptions. ```c void config_provider(Window *window) { // single click / repeat-on-hold config: window_single_click_subscribe(BUTTON_ID_DOWN, down_single_click_handler); window_single_repeating_click_subscribe(BUTTON_ID_SELECT, 1000, select_single_click_handler); // multi click config: window_multi_click_subscribe(BUTTON_ID_SELECT, 2, 10, 0, true, select_multi_click_handler); // long click config: window_long_click_subscribe(BUTTON_ID_SELECT, 700, select_long_click_handler, select_long_click_release_handler); } ``` -------------------------------- ### AppLaunchReason Enum Source: https://developer.rebble.io/docs/c/Foundation/Launch_Reason Defines the possible reasons an application can be launched. Handle only the cases your app needs, as new reasons may be added in the future. ```c enum AppLaunchReason { APP_LAUNCH_SYSTEM, APP_LAUNCH_USER, APP_LAUNCH_PHONE, APP_LAUNCH_WAKEUP, APP_LAUNCH_WORKER, APP_LAUNCH_QUICK_LAUNCH, APP_LAUNCH_TIMELINE_ACTION, APP_LAUNCH_SMARTSTRAP }; ``` -------------------------------- ### GDrawCommandFrame Duration Source: https://developer.rebble.io/docs/c/Graphics/Draw_Commands Functions to get and set the duration of a GDrawCommandFrame. ```APIDOC ## gdraw_command_frame_get_duration ### Description Get the duration of the frame. ### Parameters - **frame** (GDrawCommandFrame *) - GDrawCommandFrame from which to get the duration ### Returns duration of the frame in milliseconds ## gdraw_command_frame_set_duration ### Description Set the duration of the frame. ### Parameters - **frame** (GDrawCommandFrame *) - GDrawCommandFrame for which to set the duration - **duration** (uint32_t) - duration of the frame in milliseconds ``` -------------------------------- ### appMessagesLaunch:withUUID: Source: https://developer.rebble.io/docs/symbols Sends a command to launch the watch application with the specified UUID. Must be called from the main thread. ```APIDOC ## appMessagesLaunch:withUUID: ### Description Sends a command to launch the watch application with the specified UUID. ### Method void ### Parameters #### Request Body - **appUUID** (NSUUID *) - Required - The UUID of the watchapp to which the launch command should be sent. - **onSent** (void (^ __nullable )(PBWatch *watch, NSError *__nullable error)) - Required - The block that will be called after the launch command has been sent to the watch. ### Discussion Must be called from the main thread. ``` -------------------------------- ### GDrawCommand Radius Source: https://developer.rebble.io/docs/c/Graphics/Draw_Commands Set or get the radius of a circle command. ```APIDOC ## gdraw_command_set_radius ### Description Set the radius of a circle command. ### Note This only works for commands of type GDrawCommandCircle ### Parameters - **command** (GDrawCommand *) - GDrawCommand for which to set the circle radius - **radius** (uint16_t) - The radius to set for the circle. ## gdraw_command_get_radius ### Description Get the radius of a circle command. ### Note this only works for commands of typeGDrawCommandCircle. ### Parameters - **command** (GDrawCommand *) - GDrawCommand from which to get the circle radius ### Returns The radius in pixels if command is of type GDrawCommandCircle ``` -------------------------------- ### resource_size Source: https://developer.rebble.io/docs/c/Foundation/Resources Gets the size of the resource given a resource handle. ```APIDOC ## resource_size ### Description Gets the size of the resource given a resource handle. ### Parameters #### h - **h** (ResHandle) - The handle to the resource ### Returns - **size_t** - The size of the resource in bytes ``` -------------------------------- ### Window Management Source: https://developer.rebble.io/docs/symbols Create, destroy, and manage window properties including handlers, background color, and user data. ```APIDOC ## Create Window ### Description Creates a new Window on the heap and initializes it with the default values. ### Method create ### Endpoint window_create ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - None ### Request Example ```json { "example": "No request body" } ``` ### Response #### Success Response (200) - **window** (Window) - A pointer to the newly created window. #### Response Example ```json { "window": "" } ``` ## Destroy Window ### Description Destroys a Window previously created by `window_create`. ### Method destroy ### Endpoint window_destroy ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to destroy. ### Request Example ```json { "window": "" } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ## Set Window Click Configuration Provider ### Description Sets the click configuration provider callback function on the window. This will automatically set up the input handlers of the window to use the click recognizer subsystem. ### Method set_click_config_provider ### Endpoint window_set_click_config_provider ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to configure. - **click_config_provider** (function) - Required - The callback function to set as the click configuration provider. ### Request Example ```json { "window": "", "click_config_provider": "function() { ... }" } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ## Set Window Click Configuration Provider with Context ### Description Same as `window_set_click_config_provider()`, but assigns a custom context pointer that will be passed into the `ClickHandler` click event handlers. ### Method set_click_config_provider_with_context ### Endpoint window_set_click_config_provider_with_context ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to configure. - **click_config_provider** (function) - Required - The callback function to set as the click configuration provider. - **context** (pointer) - Required - The custom context pointer to pass to the click event handlers. ### Request Example ```json { "window": "", "click_config_provider": "function() { ... }", "context": "" } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ## Get Window Click Configuration Provider ### Description Gets the current click configuration provider of the window. ### Method get_click_config_provider ### Endpoint window_get_click_config_provider ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to query. ### Request Example ```json { "window": "" } ``` ### Response #### Success Response (200) - **click_config_provider** (function) - The current click configuration provider. #### Response Example ```json { "click_config_provider": "function() { ... }" } ``` ## Get Window Click Configuration Context ### Description Gets the current click configuration context of the window. ### Method get_click_config_context ### Endpoint window_get_click_config_context ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to query. ### Request Example ```json { "window": "" } ``` ### Response #### Success Response (200) - **context** (pointer) - The current click configuration context. #### Response Example ```json { "context": "" } ``` ## Set Window Handlers ### Description Sets the window handlers of the window. These handlers are called, for example, when the user enters or leaves the window. ### Method set_window_handlers ### Endpoint window_set_window_handlers ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to set handlers for. - **handlers** (WindowHandlers) - Required - An object containing the window event handlers. ### Request Example ```json { "window": "", "handlers": { "load": "function() { ... }", "unload": "function() { ... }", "update": "function() { ... }" } } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ## Get Root Layer of Window ### Description Gets the root Layer of the window. The root layer is the layer at the bottom of the layer hierarchy for this window. It is the window's "canvas". By default, the root layer only draws a solid fill with the window's background color. ### Method get_root_layer ### Endpoint window_get_root_layer ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to get the root layer from. ### Request Example ```json { "window": "" } ``` ### Response #### Success Response (200) - **layer** (Layer) - A pointer to the root layer of the window. #### Response Example ```json { "layer": "" } ``` ## Set Window Background Color ### Description Sets the background color of the window, which is drawn automatically by the root layer of the window. ### Method set_background_color ### Endpoint window_set_background_color ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to set the background color for. - **color** (GColor) - Required - The background color to set. ### Request Example ```json { "window": "", "color": "GColorWhite" } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ## Check if Window is Loaded ### Description Gets whether the window has been loaded. A window is considered loaded if its `.load` handler has been called and its `.unload` handler has not been called since. ### Method is_loaded ### Endpoint window_is_loaded ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to check. ### Request Example ```json { "window": "" } ``` ### Response #### Success Response (200) - **loaded** (boolean) - True if the window is loaded, false otherwise. #### Response Example ```json { "loaded": true } ``` ## Set Window User Data ### Description Sets a pointer to developer-supplied data that the window uses. This provides a means to access the data at later times in one of the window event handlers. ### Method set_user_data ### Endpoint window_set_user_data ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to set user data for. - **user_data** (pointer) - Required - A pointer to the developer-supplied data. ### Request Example ```json { "window": "", "user_data": "" } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ## Get Window User Data ### Description Gets the pointer to developer-supplied data that was previously set using `window_set_user_data()`. ### Method get_user_data ### Endpoint window_get_user_data ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to get user data from. ### Request Example ```json { "window": "" } ``` ### Response #### Success Response (200) - **user_data** (pointer) - A pointer to the developer-supplied data. #### Response Example ```json { "user_data": "" } ``` ## Subscribe to Single Click Events ### Description Subscribe to single click events. ### Method single_click_subscribe ### Endpoint window_single_click_subscribe ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to subscribe to click events. - **handler** (ClickHandler) - Required - The handler function to call on single click events. ### Request Example ```json { "window": "", "handler": "function(event) { ... }" } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ## Subscribe to Single Repeating Click Events ### Description Subscribe to single click events with a repeat interval. A single click is detected every time "repeat_interval_ms" has been reached. ### Method single_repeating_click_subscribe ### Endpoint window_single_repeating_click_subscribe ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to subscribe to click events. - **handler** (ClickHandler) - Required - The handler function to call on single click events. - **repeat_interval_ms** (int) - Required - The interval in milliseconds between repeat clicks. ### Request Example ```json { "window": "", "handler": "function(event) { ... }", "repeat_interval_ms": 1000 } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ## Subscribe to Multi Click Events ### Description Subscribe to multi click events. ### Method multi_click_subscribe ### Endpoint window_multi_click_subscribe ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to subscribe to click events. - **handler** (ClickHandler) - Required - The handler function to call on multi click events. ### Request Example ```json { "window": "", "handler": "function(event) { ... }" } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ## Subscribe to Long Click Events ### Description Subscribe to long click events. ### Method long_click_subscribe ### Endpoint window_long_click_subscribe ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to subscribe to click events. - **handler** (ClickHandler) - Required - The handler function to call on long click events. ### Request Example ```json { "window": "", "handler": "function(event) { ... }" } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ## Subscribe to Raw Click Events ### Description Subscribe to raw click events. ### Method raw_click_subscribe ### Endpoint window_raw_click_subscribe ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window to subscribe to click events. - **handler** (ClickHandler) - Required - The handler function to call on raw click events. ### Request Example ```json { "window": "", "handler": "function(event) { ... }" } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ## Set Click Context ### Description Set the context that will be passed to handlers for the given button's events. By default, the context passed to handlers is equal to the `ClickConfigProvider` context (defaults to the window). ### Method set_click_context ### Endpoint window_set_click_context ### Parameters #### Path Parameters - None #### Query Parameters - None #### Request Body - **window** (Window) - Required - The window containing the button. - **button** (Button) - Required - The button to set the context for. - **context** (pointer) - Required - The context to pass to the button's event handlers. ### Request Example ```json { "window": "", "button": "ButtonIdUp", "context": "" } ``` ### Response #### Success Response (200) - **None** #### Response Example ```json { "example": "No response body" } ``` ``` -------------------------------- ### Start New Path Source: https://developer.rebble.io/docs/rockyjs/CanvasRenderingContext2D Initialize a new path by clearing the list of existing sub-paths. Call this method before defining a new shape. ```javascript ctx.beginPath(); ``` -------------------------------- ### watchDidDisconnect: Source: https://developer.rebble.io/docs/symbols Delegate method called on PBWatchDelegate when the watch gets disconnected. ```APIDOC ## watchDidDisconnect: ### Description Called when the watch got disconnected. ### Method (void) ### Parameters - **watch** (PBWatch *) - The watch that was disconnected. ``` -------------------------------- ### number_window_get_window Source: https://developer.rebble.io/docs/symbols Gets the "root" Window of the number window. ```APIDOC ## number_window_get_window ### Description Gets the "root" Window of the number window. ### Method GET (assumed) ### Endpoint /number_windows/{id}/window ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the NumberWindow. ```