suwako / farfetch アーカイブ

このリポジトリはアーカイブされています。読むだけで、プッシュやイシューの変更は出来ません。

master
ブランチ master
farfetch / src / logo / haiku.c
2.3 KB、81行 生 Blame 履歴
1#if defined(__HAIKU__)
2#include "haiku.h"
3#include "../config.h"
4#include "../resolution.h"
5
6#include <string.h>
7#include <stdlib.h>
8
9char *LOGO[23];
10char *LOGO_SMALL[23];
11const char *color;
12const char *titlecolor;
13size_t logosize = 20;
14int minsize = MIN_SIZE;
15
16void getOS() {
17 if (!customcolor) color = GREEN;
18 else color = customcolor;
19 if (!customtitlecolor) titlecolor = RED;
20 else titlecolor = customtitlecolor;
21 const char *res = display_resolution();
22 if (!res) minsize--;
23 else free((void *)res);
24
25 if (!isbiglogo && !issmalllogo) {
26 for (int i = 0; i < LOGO_SIZE; i++) {
27 LOGO[i] = NULL;
28 LOGO_SMALL[i] = NULL;
29 }
30 }
31
32 if (!isbiglogo) {
33 LOGO[0] = YELLOW " / " RESET;
34 LOGO[1] = YELLOW " // " RESET;
35 LOGO[2] = YELLOW " / \\ " RESET;
36 LOGO[3] = YELLOW " / - " RESET;
37 LOGO[4] = YELLOW " / \\ " RESET;
38 LOGO[5] = YELLOW " \\ \\ " RESET;
39 LOGO[6] = YELLOW " - / " RESET;
40 LOGO[7] = YELLOW "/ / " RESET;
41 LOGO[8] = YELLOW "| \\ " RESET;
42 LOGO[9] = YELLOW "| \\ " RESET;
43 LOGO[10] = YELLOW "\\ \\ " RESET;
44 LOGO[11] = YELLOW "- - " RESET;
45 LOGO[12] = YELLOW "\\ \\ " RESET;
46 LOGO[13] = YELLOW " \\ \\ " RESET;
47 LOGO[14] = YELLOW " \\ / " RESET;
48 LOGO[15] = YELLOW " \\ / " RESET;
49 LOGO[16] = YELLOW " \\ / " RESET;
50 LOGO[17] = YELLOW " | | " RESET;
51 LOGO[18] = YELLOW " | | " RESET;
52 LOGO[19] = YELLOW " |_| " RESET;
53 } else {
54 logosize = biglogoi;
55 if (biglogoi < (size_t)minsize) {
56 for (size_t i = biglogoi; i < (size_t)minsize; i++) {
57 LOGO[i] = WHITE " " RESET;
58 }
59 }
60 }
61
62 if (!issmalllogo) {
63 LOGO_SMALL[0] = YELLOW " / " RESET;
64 LOGO_SMALL[1] = YELLOW " / \\ " RESET;
65 LOGO_SMALL[2] = YELLOW "/ | " RESET;
66 LOGO_SMALL[3] = YELLOW "| | " RESET;
67 LOGO_SMALL[4] = YELLOW "\\ / " RESET;
68 LOGO_SMALL[5] = YELLOW " || " RESET;
69 LOGO_SMALL[6] = YELLOW " || " RESET;
70 for (int i = 7; i < minsize; i++) {
71 LOGO_SMALL[i] = YELLOW " " RESET;
72 }
73 } else {
74 if (smalllogoi < (size_t)minsize) {
75 for (size_t i = smalllogoi; i < (size_t)minsize; i++) {
76 LOGO_SMALL[i] = WHITE " " RESET;
77 }
78 }
79 }
80}
81#endif