Skip to content

Instantly share code, notes, and snippets.

@tanb
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tanb/4ebe52ea01d0d5231b37 to your computer and use it in GitHub Desktop.
Save tanb/4ebe52ea01d0d5231b37 to your computer and use it in GitHub Desktop.
- PROPERTYANIMATION
struct PropertyAnimation * property_animation_create_layer_frame(struct Layer * layer, GRect * from_frame, GRect * to_frame)
struct PropertyAnimation * property_animation_create(const struct PropertyAnimationImplementation * implementation, void * subject, void * from_value, void * to_value)
void property_animation_destroy(struct PropertyAnimation * property_animation)
void property_animation_update_int16(struct PropertyAnimation * property_animation, const uint32_t distance_normalized)
void property_animation_update_gpoint(struct PropertyAnimation * property_animation, const uint32_t distance_normalized)
void property_animation_update_grect(struct PropertyAnimation * property_animation, const uint32_t distance_normalized)
struct PropertyAnimation {
Animation animation
struct PropertyAnimation::@13 values
void * subject
}
struct PropertyAnimationAccessors {
union PropertyAnimationAccessors::@16 setter
union PropertyAnimationAccessors::@17 getter
}
struct PropertyAnimationImplementation {
AnimationImplementation base
PropertyAnimationAccessors accessors
}
typedef GPoint GPointReturn
typedef GRect GRectReturn
typedef void(* Int16Setter)(void *subject, int16_t int16)
typedef int16_t(* Int16Getter)(void *subject)
typedef void(* GPointSetter)(void *subject, GPoint gpoint)
typedef GPointReturn(* GPointGetter)(void *subject)
typedef void(* GRectSetter)(void *subject, GRect grect)
typedef GRectReturn(* GRectGetter)(void *subject)
#define property_animation_get_animation(prop_anim)
#define property_animation_get_from_grect(prop_anim, value_ptr)
#define property_animation_set_from_grect(prop_anim, value_ptr)
#define property_animation_get_from_gpoint(prop_anim, value_ptr)
#define property_animation_set_from_gpoint(prop_anim, value_ptr)
#define property_animation_get_from_int16(prop_anim, value_ptr)
#define property_animation_set_from_int16(prop_anim, value_ptr)
#define property_animation_get_to_grect(prop_anim, value_ptr)
#define property_animation_set_to_grect(prop_anim, value_ptr)
#define property_animation_get_to_gpoint(prop_anim, value_ptr)
#define property_animation_set_to_gpoint(prop_anim, value_ptr)
#define property_animation_get_to_int16(prop_anim, value_ptr)
#define property_animation_set_to_int16(prop_anim, value_ptr)
#define property_animation_get_subject(prop_anim, value_ptr)
#define property_animation_set_subject(prop_anim, value_ptr)
- Animation
struct Animation * animation_create(void)
void animation_destroy(struct Animation * animation)
void animation_set_duration(struct Animation * animation, uint32_t duration_ms)
void animation_set_delay(struct Animation * animation, uint32_t delay_ms)
void animation_set_curve(struct Animation * animation, AnimationCurve curve)
void animation_set_custom_curve(struct Animation * animation, AnimationCurveFunction curve_function)
void animation_set_handlers(struct Animation * animation, AnimationHandlers callbacks, void * context)
void * animation_get_context(struct Animation * animation)
void animation_schedule(struct Animation * animation)
void animation_unschedule(struct Animation * animation)
void animation_unschedule_all(void)
bool animation_is_scheduled(struct Animation * animation)
void animation_set_implementation(struct Animation * animation, const AnimationImplementation * implementation)
struct Animation {
ListNode list_node
AnimationHandlers handlers
void * context
uint32_t abs_start_time_ms
uint32_t delay_ms
uint32_t duration_ms
bool is_completed
uintptr_t custom_curve_function
}
struct AnimationHandlers {
AnimationStartedHandler started
AnimationStoppedHandler stopped
}
struct AnimationImplementation{
AnimationSetupImplementation setup
AnimationUpdateImplementation update
AnimationTeardownImplementation teardown
}
enum AnimationCurve {
AnimationCurveLinear
AnimationCurveEaseIn
AnimationCurveEaseOut
AnimationCurveEaseInOut
AnimationCurveDefault
AnimationCurveCustomFunction
AnimationCurve_Reserved1
AnimationCurve_Reserved2
AnimationCurve_Reserved3
}
typedef AnimationProgress(* AnimationCurveFunction)(AnimationProgress linear_distance)
typedef void(* AnimationStartedHandler)(struct Animation *animation, void *context)
typedef void(* AnimationStoppedHandler)(struct Animation *animation, bool finished, void *context)
typedef void(* AnimationSetupImplementation)(struct Animation *animation)
typedef void(* AnimationUpdateImplementation)(struct Animation *animation, const AnimationProgress distance_normalized)
typedef void(* AnimationTeardownImplementation)(struct Animation *animation)
#define AnimationProgress uint32_t
#define ANIMATION_DURATION_INFINITE ((uint32_t) ~0)
#define ANIMATION_NORMALIZED_MIN 0
#define ANIMATION_NORMALIZED_MAX 65535
#define animation_get_duration(animation, include_delay, include_play_count)
#define animation_get_delay(animation)
#define animation_get_curve(animation)
#define animation_get_implementation(animation)
- Click
uint8_t click_number_of_clicks_counted(ClickRecognizerRef recognizer)
ButtonId click_recognizer_get_button_id(ClickRecognizerRef recognizer)
bool click_recognizer_is_repeating(ClickRecognizerRef recognizer)
enum ButtonId {
BUTTON_ID_BACK
BUTTON_ID_UP
BUTTON_ID_SELECT
BUTTON_ID_DOWN
NUM_BUTTONS
}
typedef void * ClickRecognizerRef
typedef void(* ClickHandler)(ClickRecognizerRef recognizer, void *context)
typedef void(* ClickConfigProvider)(void *context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment