Commit a988ce27 authored by CeRiAl's avatar CeRiAl

Strip trailing whitespace

parent 54151a3d
......@@ -37,7 +37,7 @@ static DictionaryIterator items_iter;
static void lyr_loading_update_proc(Layer *layer, GContext *ctx) {
GRect bounds = layer_get_bounds(layer);
graphics_fill_rect(ctx, bounds, 0, GCornerNone);
graphics_draw_text(ctx, "Loading...", fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD),
graphics_draw_text(ctx, "Loading...", fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD),
GRect(0, 10, bounds.size.w, 28), GTextOverflowModeTrailingEllipsis, GTextAlignmentCenter, NULL);
}
......@@ -114,7 +114,7 @@ void show_addons(void) {
.unload = handle_window_unload,
});
window_stack_push(s_window, true);
outbox_send("GET_ADDONS");
}
......
......@@ -21,11 +21,11 @@
#include <pebble.h>
#include "basic_menu_layer.h"
#include "common.h"
BasicMenuModel *basic_menu_model_create(void) {
BasicMenuModel *model = malloc(sizeof *model);
model->item_count = 0;
return model;
}
......@@ -37,7 +37,7 @@ void basic_menu_model_destroy(BasicMenuModel *model) {
}
void basic_menu_model_add_item(BasicMenuModel *model, char *label, GBitmap *icon, void *value) {
BasicMenuItem *item = malloc(sizeof *item);
BasicMenuItem *item = malloc(sizeof *item);
item->label = label;
item->icon = icon;
item->value = value;
......@@ -78,7 +78,7 @@ static void menu_draw_row_cb(GContext* ctx, const Layer *cell_layer, MenuIndex *
BasicMenuModel *model = (BasicMenuModel*) data;
GRect bounds = layer_get_frame(cell_layer);
GBitmap *icon = model->items[cell_index->row]->icon;
graphics_context_set_fill_color(ctx, GColorBlack);
#ifdef PBL_COLOR
graphics_context_set_fill_color(ctx, GColorVividCerulean);
......@@ -92,7 +92,7 @@ static void menu_draw_row_cb(GContext* ctx, const Layer *cell_layer, MenuIndex *
offset = 44;
graphics_draw_bitmap_in_rect(ctx, model->items[cell_index->row]->icon, GRect(4, 8, 28, 28));
}
graphics_draw_text(ctx, model->items[cell_index->row]->label, fonts_get_system_font(FONT_KEY_GOTHIC_24),
graphics_draw_text(ctx, model->items[cell_index->row]->label, fonts_get_system_font(FONT_KEY_GOTHIC_24),
GRect(offset, 4, bounds.size.w - offset, 16), GTextOverflowModeTrailingEllipsis, GTextAlignmentLeft, NULL);
}
......@@ -119,4 +119,4 @@ BasicMenuLayer* basic_menu_layer_create(GRect rect, BasicMenuModel* model) {
void basic_menu_layer_destroy(BasicMenuLayer *layer) {
menu_layer_destroy((MenuLayer*) layer);
}
\ No newline at end of file
}
......@@ -40,6 +40,6 @@ BasicMenuModel* basic_menu_model_create(void);
void basic_menu_model_destroy(BasicMenuModel *model);
void basic_menu_model_add_item(BasicMenuModel *model, char *label, GBitmap *icon, void* value);
void basic_menu_model_set_select_callback(BasicMenuModel *model, BasicMenuSelectCallback cb);
BasicMenuLayer* basic_menu_layer_create(GRect rect, BasicMenuModel* model);
void basic_menu_layer_destroy(BasicMenuLayer *layer);
\ No newline at end of file
void basic_menu_layer_destroy(BasicMenuLayer *layer);
......@@ -42,12 +42,12 @@ static void lyr_background_update_proc(Layer *layer, GContext *ctx) {
graphics_fill_rect(ctx, GRect(1, 101, layer_bounds.size.w, 48), 12, GCornersLeft);
graphics_context_set_fill_color(ctx, GColorWhite);
graphics_fill_rect(ctx, GRect(layer_bounds.size.w - 21,2, 21,layer_bounds.size.h - 4), 4, GCornersLeft);
graphics_draw_text(ctx, data->buttons[0].label, fonts_get_system_font(FONT_KEY_GOTHIC_24),
graphics_draw_text(ctx, data->buttons[0].label, fonts_get_system_font(FONT_KEY_GOTHIC_24),
GRect(0, 10, layer_bounds.size.w - 28, 16), GTextOverflowModeTrailingEllipsis, GTextAlignmentRight, NULL);
graphics_draw_text(ctx, data->buttons[1].label, fonts_get_system_font(FONT_KEY_GOTHIC_24),
graphics_draw_text(ctx, data->buttons[1].label, fonts_get_system_font(FONT_KEY_GOTHIC_24),
GRect(0, 59, layer_bounds.size.w - 28, 16), GTextOverflowModeTrailingEllipsis, GTextAlignmentRight, NULL);
graphics_draw_text(ctx, data->buttons[2].label, fonts_get_system_font(FONT_KEY_GOTHIC_24),
graphics_draw_text(ctx, data->buttons[2].label, fonts_get_system_font(FONT_KEY_GOTHIC_24),
GRect(0, 108, layer_bounds.size.w - 28, 16), GTextOverflowModeTrailingEllipsis, GTextAlignmentRight, NULL);
}
......@@ -58,7 +58,7 @@ ButtonsWindow* buttons_window_create() {
button_2.label = "Button 2";
static struct ButtonsWindowButton button_3;
button_3.label = "Button 3";
buttonsWindowData.buttons[0] = button_1;
buttonsWindowData.buttons[1] = button_2;
buttonsWindowData.buttons[2] = button_3;
......@@ -72,7 +72,7 @@ ButtonsWindow* buttons_window_create() {
s_lyr_background = layer_create(bounds);
layer_set_update_proc(s_lyr_background, lyr_background_update_proc);
layer_add_child(window_layer, (Layer *) s_lyr_background);
return window;
}
......
......@@ -25,7 +25,7 @@
#define MSG_KEY_TITLE 101
#define MSG_KEY_ARTIST 102
#define MSG_KEY_PLAY_STATE 103
// convenient macros courtesy of Matthew Tole: github.com/smallstoneapps/pebble-assist
#define DEBUG(...) app_log(APP_LOG_LEVEL_DEBUG, __FILE__, __LINE__, __VA_ARGS__)
#define INFO(...) app_log(APP_LOG_LEVEL_INFO, __FILE__, __LINE__, __VA_ARGS__)
......@@ -36,4 +36,4 @@ void outbox_send(char* button_code);
void outbox_send_with_data(char* send_code, char* send_data);
char* translate_app_message_result(AppMessageResult app_message_error);
char* split_id_name_pair(char *pair);
void strip_ext(char *str);
\ No newline at end of file
void strip_ext(char *str);
......@@ -63,10 +63,10 @@ static void initialize_ui(void) {
basic_menu_model_add_item(s_model, "Video", s_icon_video, "GO_VIDEO");
basic_menu_model_add_item(s_model, "Pictures", s_icon_pics, "GO_PICS");
basic_menu_model_add_item(s_model, "Weather", s_icon_weather, "GO_WEATHER");
s_menu = basic_menu_layer_create(bounds, s_model);
basic_menu_model_set_select_callback(s_model, menu_select_cb);
menu_layer_set_click_config_onto_window(s_menu, s_window);
layer_add_child(window_layer, menu_layer_get_layer(s_menu));
}
......@@ -98,4 +98,4 @@ void show_goto(void) {
void hide_goto(void) {
window_stack_remove(s_window, true);
}
\ No newline at end of file
}
......@@ -20,7 +20,7 @@
//
#include <pebble.h>
#include "main_menu.h"
static void init() {
app_message_open(app_message_inbox_size_maximum(), app_message_outbox_size_maximum());
show_main_menu();
......@@ -33,4 +33,4 @@ int main(void) {
init();
app_event_loop();
deinit();
}
\ No newline at end of file
}
......@@ -21,7 +21,7 @@
#include <pebble.h>
#include "player.h"
#include "common.h"
static Window *s_window;
static GBitmap *s_icon_vol_up;
static GBitmap *s_icon_pause;
......@@ -73,24 +73,24 @@ static void lyr_volume_update_proc(Layer *layer, GContext *ctx) {
static void inbox_received_callback(DictionaryIterator *iterator, void *context) {
uint32_t *layer_data;
Tuple *t = dict_read_first(iterator);
while(t != NULL) {
switch(t->key) {
case MSG_KEY_TITLE:
case MSG_KEY_TITLE:
strncpy(s_title, t->value->cstring, sizeof(s_title));
text_layer_set_text(s_txt_title, s_title);
break;
case MSG_KEY_ARTIST:
case MSG_KEY_ARTIST:
strncpy(s_artist, t->value->cstring, sizeof(s_artist));
text_layer_set_text(s_txt_artist, s_artist);
break;
case MSG_KEY_VOLUME:
case MSG_KEY_VOLUME:
layer_data = (uint32_t *)layer_get_data(s_lyr_volume);
*layer_data = t->value->int32;
layer_mark_dirty(s_lyr_volume);
break;
case MSG_KEY_PLAY_STATE:
case MSG_KEY_PLAY_STATE:
if (t->value->int32 > 0) {
action_bar_layer_set_icon(s_action_bar, BUTTON_ID_SELECT, s_icon_pause);
} else {
......@@ -113,10 +113,10 @@ static void player_tap_cb(AccelAxisType axis, int32_t direction) {
static void window_load(Window *window) {
// window_set_fullscreen(s_window, false);
Layer *window_layer = window_get_root_layer(window);
GRect bounds = layer_get_frame(window_layer);
s_icon_vol_up = gbitmap_create_with_resource(RESOURCE_ID_ICON_VOL_UP);
s_icon_pause = gbitmap_create_with_resource(RESOURCE_ID_ICON_PAUSE);
s_icon_play = gbitmap_create_with_resource(RESOURCE_ID_ICON_PLAY);
......@@ -159,7 +159,7 @@ static void window_load(Window *window) {
uint32_t *len = (uint32_t *) layer_get_data(s_lyr_volume);
*len = 0;
layer_add_child(window_layer, (Layer *) s_lyr_volume);
app_message_register_inbox_received(inbox_received_callback);
app_message_register_inbox_dropped(inbox_dropped_callback);
......
......@@ -35,7 +35,7 @@ static DictionaryIterator items_iter;
static void lyr_loading_update_proc(Layer *layer, GContext *ctx) {
GRect bounds = layer_get_bounds(layer);
graphics_fill_rect(ctx, bounds, 0, GCornerNone);
graphics_draw_text(ctx, "Loading...", fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD),
graphics_draw_text(ctx, "Loading...", fonts_get_system_font(FONT_KEY_GOTHIC_24_BOLD),
GRect(0, 10, bounds.size.w, 28), GTextOverflowModeTrailingEllipsis, GTextAlignmentCenter, NULL);
}
......@@ -111,7 +111,7 @@ void show_playlists(void) {
.unload = handle_window_unload,
});
window_stack_push(s_window, true);
outbox_send("GET_MUSIC_PLAYLISTS");
}
......
......@@ -44,7 +44,7 @@ static void initialize_ui(void) {
basic_menu_model_add_item(s_model, "Reboot", NULL, "PWR_REBOOT");
basic_menu_model_add_item(s_model, "Suspend", NULL, "PWR_SUSPEND");
basic_menu_model_add_item(s_model, "Hibernate", NULL, "PWR_HIBERNATE");
s_menu = basic_menu_layer_create(bounds, s_model);
basic_menu_model_set_select_callback(s_model, menu_select_cb);
menu_layer_set_click_config_onto_window(s_menu, s_window);
......
......@@ -63,7 +63,7 @@ static void initialize_ui() {
action_bar_layer_set_icon(s_action_bar, BUTTON_ID_DOWN, s_icon_cursor_down);
action_bar_layer_set_click_config_provider(s_action_bar, click_provider);
layer_add_child(window_layer, (Layer*) s_action_bar);
buttons_window_set_label(BUTTON_ID_UP, "Up / Left");
buttons_window_set_label(BUTTON_ID_SELECT, "Select / Back");
buttons_window_set_label(BUTTON_ID_DOWN, "Down / Right");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment