summaryrefslogtreecommitdiff
path: root/users/ericgebhart/oled/oled_layers.c
blob: 57424d1d6c1fb64ebe9831a2ed06f548c454381d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
/*
  Copyright 2018-2022 Eric Gebhart <e.a.gebhart@gmail.com>

  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/
#include "ericgebhart.h"
#include <stdio.h>

#ifdef OLED_CUSTOM_ENABLE

void oled_render_default_layer_state(void) {
  //oled_write_P(PSTR("Layout: "), false);
  uint16_t layer = get_highest_layer(default_layer_state);
  char layer_str[8];
  snprintf(layer_str, sizeof(layer_str), "%u ",layer);
  oled_write(layer_str , false);
  switch (layer) {
#ifdef DVORAK_LAYER_ENABLE
    WRITE_STR_LAYER(_DVORAK, "Dvorak")
#endif
#ifdef DVORAK_RLC_IU_LAYER_ENABLE
      WRITE_STR_LAYER(_DVORAK_RLC_IU_, "Dvorak-rlc")
#endif
#ifdef BOO_LAYER_ENABLE
      WRITE_STR_LAYER(_BOO, "Boo")
#endif
#ifdef CAPEWELL_DVORAK_LAYER_ENABLE
      WRITE_STR_LAYER(_CAPEWELL_DVORAK, "Capewell Dvorak")
#endif
#ifdef AHEI_LAYER_ENABLE
      WRITE_STR_LAYER(_AHEI, "Ahei")
#endif

#ifdef QWERTY_LAYER_ENABLE
      WRITE_STR_LAYER(_QWERTY, "Qwerty")
#endif
#ifdef WORKMAN_LAYER_ENABLE
      WRITE_STR_LAYER(_WORKMAN, "Workman")
#endif
#ifdef NORMAN_LAYER_ENABLE
      WRITE_STR_LAYER(_NORMAN, "Norman")
#endif

#ifdef COLEMAK_LAYER_ENABLE
      WRITE_STR_LAYER(_COLEMAK, "Colemak")
#endif
#ifdef COLEMAK_DH_LAYER_ENABLE
      WRITE_STR_LAYER(_COLEMAK_DH, "Colemak")
#endif
#ifdef HALMAK_LAYER_ENABLE
      WRITE_STR_LAYER(_HALMAK, "Halmak")
#endif
#ifdef MINIMAK_LAYER_ENABLE
      WRITE_STR_LAYER(_MINIMAK, "Minimak")
#endif
#ifdef MINIMAK_8_LAYER_ENABLE
      WRITE_STR_LAYER(_MINIMAK_8, "Minimak 8")
#endif
#ifdef MINIMAK_12_LAYER_ENABLE
      WRITE_STR_LAYER(_MINIMAK_12, "Minimak 12")
#endif

#ifdef BEAKL15_LAYER_ENABLE
      WRITE_STR_LAYER(_BEAKL15, "Beakl")
#endif
#ifdef BEAKL19_LAYER_ENABLE
      WRITE_STR_LAYER(_BEAKL19, "Beakl19")
#endif
#ifdef BEAKL27_LAYER_ENABLE
      WRITE_STR_LAYER(_BEAKL27, "Beakl27")
#endif
#ifdef BEAKLWI_LAYER_ENABLE
      WRITE_STR_LAYER(_BEAKLWI, "BeaklWi")
#endif

#ifdef CARPALX_QFMLWY_LAYER_ENABLE
      WRITE_STR_LAYER(_CARPALX_QFMLWY, "Carpalx qfmlwy")
#endif

#ifdef CARPALX_QGMLWB_LAYER_ENABLE
      WRITE_STR_LAYER(_CARPALX_QGMLWB, "Carpalx qgmlwb")
#endif

#ifdef CARPALX_QGMLWY_LAYER_ENABLE
      WRITE_STR_LAYER(_CARPALX_QGMLWY, "Carpalx qgmlwy")
#endif

#ifdef HD_NEU_LAYER_ENABLE
      WRITE_STR_LAYER(_HD_NEU, "HD Neu")
#endif
#ifdef HD_NEU_NARROW_LAYER_ENABLE
      WRITE_STR_LAYER(_HD_NEU_NARROW, "HD Neu N")
#endif
#ifdef HD_TITANIUM_LAYER_ENABLE
      WRITE_STR_LAYER(_HD_TITANIUM, "HD Titanium")
#endif
#ifdef HD_GOLD_LAYER_ENABLE
      WRITE_STR_LAYER(_HD_GOLD, "HD Gold")
#endif
#ifdef HD_SILVER_LAYER_ENABLE
      WRITE_STR_LAYER(_HD_SILVER, "HD Silver")
#endif
#ifdef HD_PLATINUM_LAYER_ENABLE
      WRITE_STR_LAYER(_HD_PLATINUM, "HD Platinum")
#endif
#ifdef HD_BRONZE_LAYER_ENABLE
      WRITE_STR_LAYER(_HD_BRONZE, "HD Bronze")
#endif
#ifdef HD_ELAN_LAYER_ENABLE
      WRITE_STR_LAYER(_HD_ELAN, "HD Elan")
#endif
#ifdef HD_DASH_LAYER_ENABLE
      WRITE_STR_LAYER(_HD_DASH, "HD Dash")
#endif
#ifdef HD_REF_LAYER_ENABLE
      WRITE_STR_LAYER(_HD_REF, "HD Ref")
#endif

#ifdef MTGAP_LAYER_ENABLE
      WRITE_STR_LAYER(_MTGAP, "Mtgap")
#endif
#ifdef CTGAP_LAYER_ENABLE
      WRITE_STR_LAYER(_CTGAP, "Ctgap")
#endif
#ifdef APT_LAYER_ENABLE
      WRITE_STR_LAYER(_APT, "Apt")
#endif
#ifdef CANARY_LAYER_ENABLE
      WRITE_STR_LAYER(_CANARY, "Canary")
#endif

#ifdef MALTRON_LAYER_ENABLE
      WRITE_STR_LAYER(_MALTRON, "Maltron")
#endif
#ifdef EUCALYN_LAYER_ENABLE
      WRITE_STR_LAYER(_EUCALYN, "Eucalyn")
#endif
#ifdef RSTHD_LAYER_ENABLE
      WRITE_STR_LAYER(_RSTHD, "Rsthd")
#endif
#ifdef HAND_UP_LAYER_ENABLE
      WRITE_STR_LAYER(_HANDS_UP, "Hands up")
#endif
#ifdef WHITE_LAYER_ENABLE
      WRITE_STR_LAYER(_WHITE, "White")
#endif
#ifdef ISRT_LAYER_ENABLE
      WRITE_STR_LAYER(_ISRT, "Isrt")
#endif
#ifdef SOUL_LAYER_ENABLE
      WRITE_STR_LAYER(_SOUL, "Soul")
#endif
#ifdef NIRO_LAYER_ENABLE
      WRITE_STR_LAYER(_NIRO, "Niro")
#endif
#ifdef ASSET_LAYER_ENABLE
      WRITE_STR_LAYER(_ASSET, "Asset")
#endif
#ifdef WHORF_LAYER_ENABLE
      WRITE_STR_LAYER(_WHORF, "Whorf")
#endif
#ifdef WHORF6_LAYER_ENABLE
      WRITE_STR_LAYER(_WHORF6, "Whorf 6")
#endif

#ifdef OPTIMOT_LAYER_ENABLE
      WRITE_STR_LAYER(_OPTIMOT, "Optimot")
#endif
#ifdef OPTIMOT_COMPACT_LAYER_ENABLE
      WRITE_STR_LAYER(_OPTIMOT_COMPACT, "Optimot")
#endif
#ifdef BEAKL19bis_LAYER_ENABLE
      WRITE_STR_LAYER(_BEAKL19bis, "Beakl19bis")
#endif
#ifdef BEPO_LAYER_ENABLE  // Bepo only works on bepo.
      WRITE_STR_LAYER(_BEPO, "Bepo")
#endif
      }
}

void oled_render_layer_state(void) {
  uint16_t layer = get_highest_layer(layer_state);
  char layer_str[8];
  snprintf(layer_str, sizeof(layer_str), "%u ",layer);
  oled_write_P(PSTR(""), false);
  if (layer > 0)
    oled_write(layer_str , false);

  switch (layer) {
    // language variant layers.
#ifdef TOPROWS_LAYER_ENABLE
    WRITE_STR_LAYER(_TOPROWS, "TopRows");
#endif

#ifdef SYMBOL_LAYER_ENABLE
    WRITE_STR_LAYER(_SYMB, "Symbols");
#endif

#ifdef KEYPAD_LAYER_ENABLE
    WRITE_STR_LAYER(_KEYPAD, "Keypad");
#endif

    // single case, BP or no suffix.
#ifdef ACCENTS_MORTE_LAYER_ENABLE
    WRITE_STR_LAYER(_ACCENTS_MORTE, "Accents Morte");
#endif
#ifdef ACCENTS_LAYER_ENABLE
    WRITE_STR_LAYER(_ACCENTS, "Accents");
#endif
#ifdef MORTE_LAYER_ENABLE
    WRITE_STR_LAYER(_MORTE, "Morte");
#endif


    // language agnostic layers.
#ifdef NAV_LAYER_ENABLE
    WRITE_STR_CASE(_NAV, "Navigation");
    WRITE_STR_CASE(_NAVm, "Mouse");
#endif
#ifdef MEDIA_LAYER_ENABLE
    WRITE_STR_CASE(_MEDIA, "Media");
#endif
#ifdef FUNC_LAYER_ENABLE
    WRITE_STR_CASE(_FUN, "Func");
#endif

    WRITE_STR_CASE(_LAYERS, "Layers");

#ifdef RGB_LAYER_ENABLE
    WRITE_STR_CASE(_RGB, "RGB");
#endif
#ifdef ADJUST_LAYER_ENABLE
    WRITE_STR_CASE(_ADJUST, "Adjust");
#endif
#ifdef COMBO_REF_LAYER_ENABLE
    WRITE_STR_CASE(_COMBO_REF, "COMBO Ref");
#endif

  }
}
#endif