Skip to content

Commit

Permalink
Formartted project with clang formatter to match flipper catalog requ…
Browse files Browse the repository at this point in the history
…irements
  • Loading branch information
kala13x committed Oct 7, 2023
1 parent ee32e15 commit 3826cb3
Show file tree
Hide file tree
Showing 25 changed files with 875 additions and 1,099 deletions.
5 changes: 3 additions & 2 deletions infrared/infrared_remote.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ bool infrared_remote_find_button_by_name(InfraredRemote* remote, const char* nam
return false;
}

InfraredRemoteButton* infrared_remote_get_button_by_name(InfraredRemote* remote, const char* name) {
InfraredRemoteButton*
infrared_remote_get_button_by_name(InfraredRemote* remote, const char* name) {
for(size_t i = 0; i < InfraredButtonArray_size(remote->buttons); i++) {
InfraredRemoteButton* button = *InfraredButtonArray_get(remote->buttons, i);
if(!strcmp(infrared_remote_button_get_name(button), name)) {
Expand Down Expand Up @@ -139,7 +140,7 @@ bool infrared_remote_delete_button(InfraredRemote* remote, size_t index) {

bool infrared_remote_delete_button_by_name(InfraredRemote* remote, const char* name) {
size_t index = 0;
if (!infrared_remote_find_button_by_name(remote, name, &index)) return false;
if(!infrared_remote_find_button_by_name(remote, name, &index)) return false;
return infrared_remote_delete_button(remote, index);
}

Expand Down
26 changes: 9 additions & 17 deletions views/xremote_about_view.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
#include "xremote_about_view.h"
#include "../xremote.h"

static void xremote_about_view_draw_vertical(Canvas* canvas, XRemoteViewModel* model)
{
static void xremote_about_view_draw_vertical(Canvas* canvas, XRemoteViewModel* model) {
UNUSED(model);
char version[32];

Expand All @@ -30,8 +29,7 @@ static void xremote_about_view_draw_vertical(Canvas* canvas, XRemoteViewModel* m
canvas_draw_str_aligned(canvas, 11, 100, AlignLeft, AlignTop, "gmail.com");
}

static void xremote_about_view_draw_horizontal(Canvas* canvas, XRemoteViewModel* model)
{
static void xremote_about_view_draw_horizontal(Canvas* canvas, XRemoteViewModel* model) {
UNUSED(model);
char version[32];

Expand All @@ -51,33 +49,27 @@ static void xremote_about_view_draw_horizontal(Canvas* canvas, XRemoteViewModel*
canvas_draw_str_aligned(canvas, 10, 52, AlignLeft, AlignTop, "gmail.com");
}

static void xremote_about_view_draw_callback(Canvas* canvas, void* context)
{
static void xremote_about_view_draw_callback(Canvas* canvas, void* context) {
furi_assert(context);
XRemoteViewModel* model = context;
XRemoteAppContext *app_ctx = model->context;
XRemoteAppContext* app_ctx = model->context;
XRemoteViewDrawFunction xremote_about_view_draw_body;

ViewOrientation orientation = app_ctx->app_settings->orientation;
xremote_about_view_draw_body = orientation == ViewOrientationVertical ?
xremote_about_view_draw_vertical : xremote_about_view_draw_horizontal;
xremote_about_view_draw_vertical :
xremote_about_view_draw_horizontal;

xremote_canvas_draw_header(canvas, orientation, "About");
xremote_about_view_draw_body(canvas, model);
xremote_canvas_draw_exit_footer(canvas, orientation, "Press to exit");
}

XRemoteView* xremote_about_view_alloc(void* app_ctx)
{
XRemoteView *view = xremote_view_alloc(app_ctx,
NULL, xremote_about_view_draw_callback);
XRemoteView* xremote_about_view_alloc(void* app_ctx) {
XRemoteView* view = xremote_view_alloc(app_ctx, NULL, xremote_about_view_draw_callback);

with_view_model(
xremote_view_get_view(view),
XRemoteViewModel* model,
{ model->context = app_ctx; },
true
);
xremote_view_get_view(view), XRemoteViewModel * model, { model->context = app_ctx; }, true);

return view;
}
Loading

0 comments on commit 3826cb3

Please sign in to comment.