basic launcher switching between two widgets
This commit is contained in:
@@ -1,24 +0,0 @@
|
||||
#include "fake_widget.h"
|
||||
|
||||
void fake_widget_setup(LauncherSettings *settings, void ** context_ptr) {
|
||||
(void) settings;
|
||||
*context_ptr = NULL;
|
||||
}
|
||||
|
||||
void fake_widget_activate(LauncherSettings *settings, void *context) {
|
||||
(void) settings;
|
||||
(void) context;
|
||||
}
|
||||
|
||||
void fake_widget_loop(LauncherEvent event, LauncherSettings *settings, void *context) {
|
||||
(void) event;
|
||||
(void) settings;
|
||||
(void) context;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void fake_widget_resign(LauncherSettings *settings, void *context) {
|
||||
(void) settings;
|
||||
(void) context;
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#ifndef FAKE_WIDGET_H_
|
||||
#define FAKE_WIDGET_H_
|
||||
|
||||
#include "launcher.h"
|
||||
|
||||
void fake_widget_setup(LauncherSettings *settings, void ** context_ptr);
|
||||
void fake_widget_activate(LauncherSettings *settings, void *context);
|
||||
void fake_widget_loop(LauncherEvent event, LauncherSettings *settings, void *context);
|
||||
void fake_widget_resign(LauncherSettings *settings, void *context);
|
||||
|
||||
#define fake_widget { \
|
||||
"WI dGIt01", \
|
||||
true, \
|
||||
fake_widget_setup, \
|
||||
fake_widget_activate, \
|
||||
fake_widget_loop, \
|
||||
fake_widget_resign, \
|
||||
}
|
||||
|
||||
#endif // FAKE_WIDGET_H_
|
||||
32
launcher/widgets/fake_widget_1.c
Normal file
32
launcher/widgets/fake_widget_1.c
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "fake_widget_1.h"
|
||||
|
||||
void fake_widget_1_setup(LauncherSettings *settings, void ** context_ptr) {
|
||||
(void) settings;
|
||||
// *context_ptr = NULL;
|
||||
}
|
||||
|
||||
void fake_widget_1_activate(LauncherSettings *settings, void *context) {
|
||||
(void) settings;
|
||||
(void) context;
|
||||
}
|
||||
|
||||
void fake_widget_1_loop(LauncherEvent event, LauncherSettings *settings, void *context) {
|
||||
(void) settings;
|
||||
(void) context;
|
||||
|
||||
switch (event) {
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
launcher_move_to_next_widget();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
launcher_illuminate_led();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void fake_widget_1_resign(LauncherSettings *settings, void *context) {
|
||||
(void) settings;
|
||||
(void) context;
|
||||
}
|
||||
19
launcher/widgets/fake_widget_1.h
Normal file
19
launcher/widgets/fake_widget_1.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef FAKE_WIDGET_1_H_
|
||||
#define FAKE_WIDGET_1_H_
|
||||
|
||||
#include "launcher.h"
|
||||
|
||||
void fake_widget_1_setup(LauncherSettings *settings, void ** context_ptr);
|
||||
void fake_widget_1_activate(LauncherSettings *settings, void *context);
|
||||
void fake_widget_1_loop(LauncherEvent event, LauncherSettings *settings, void *context);
|
||||
void fake_widget_1_resign(LauncherSettings *settings, void *context);
|
||||
|
||||
#define fake_widget_1 { \
|
||||
"W1 d get01", \
|
||||
fake_widget_1_setup, \
|
||||
fake_widget_1_activate, \
|
||||
fake_widget_1_loop, \
|
||||
fake_widget_1_resign, \
|
||||
}
|
||||
|
||||
#endif // FAKE_WIDGET_1_H_
|
||||
32
launcher/widgets/fake_widget_2.c
Normal file
32
launcher/widgets/fake_widget_2.c
Normal file
@@ -0,0 +1,32 @@
|
||||
#include "fake_widget_2.h"
|
||||
|
||||
void fake_widget_2_setup(LauncherSettings *settings, void ** context_ptr) {
|
||||
(void) settings;
|
||||
*context_ptr = NULL;
|
||||
}
|
||||
|
||||
void fake_widget_2_activate(LauncherSettings *settings, void *context) {
|
||||
(void) settings;
|
||||
(void) context;
|
||||
}
|
||||
|
||||
void fake_widget_2_loop(LauncherEvent event, LauncherSettings *settings, void *context) {
|
||||
(void) settings;
|
||||
(void) context;
|
||||
|
||||
switch (event) {
|
||||
case EVENT_MODE_BUTTON_UP:
|
||||
launcher_move_to_next_widget();
|
||||
break;
|
||||
case EVENT_LIGHT_BUTTON_UP:
|
||||
launcher_illuminate_led();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void fake_widget_2_resign(LauncherSettings *settings, void *context) {
|
||||
(void) settings;
|
||||
(void) context;
|
||||
}
|
||||
19
launcher/widgets/fake_widget_2.h
Normal file
19
launcher/widgets/fake_widget_2.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef FAKE_WIDGET_2_H_
|
||||
#define FAKE_WIDGET_2_H_
|
||||
|
||||
#include "launcher.h"
|
||||
|
||||
void fake_widget_2_setup(LauncherSettings *settings, void ** context_ptr);
|
||||
void fake_widget_2_activate(LauncherSettings *settings, void *context);
|
||||
void fake_widget_2_loop(LauncherEvent event, LauncherSettings *settings, void *context);
|
||||
void fake_widget_2_resign(LauncherSettings *settings, void *context);
|
||||
|
||||
#define fake_widget_2 { \
|
||||
"W1 d get02", \
|
||||
fake_widget_2_setup, \
|
||||
fake_widget_2_activate, \
|
||||
fake_widget_2_loop, \
|
||||
fake_widget_2_resign, \
|
||||
}
|
||||
|
||||
#endif // FAKE_WIDGET_2_H_
|
||||
Reference in New Issue
Block a user