Development notice

This commit is contained in:
Linus Dierheimer
2021-11-01 19:33:12 +01:00
parent bf1fbd572a
commit 7663637ea9
2 changed files with 65 additions and 2 deletions
+64
View File
@@ -0,0 +1,64 @@
# Development help
This file is not an official documentation!
Here i just add things that are easy to forget.
## Adding a logo
Assuming foobar is the name of the logo:
In `src/common/logo.c`:
* create method `initLogoFoobar(FFinstance* instance)`, at alphabetic ordered placement. Set the fields of `instance->logo`:
```c
instance->config.logo.lines =
"$1Foo\n"
" $2bar";
instance->config.logo.colors[0] = "\033[32m"; //green
instance->config.logo.colors[1] = "\033[35m"; //magenta
```
* go to method `loadLogoSet` and add an if at alphabetical position to load it:
```c
else if(strcasecmp(logo, "foobar") == 0)
initLogoFoobar(instance);
```
* if different logos exist for different versions, differ betwenn them in `loadLogoSetWithVersion`:
```c
[...]
bool isFoobar = ffStrbufIgnCaseCompS(name, "foobar") == 0;
if(versionID->length == 0 || (
[...] &&
!isFoobar
)) return loadLogoSet(instance, name->chars);
[...]
if(isFoobar)
{
if(version > 64)
return loadLogoSet(instance, "foobar");
else
return loadLogoSet(instance, "foobar_old");
}
```
* go to `ffPrintLogos` and at `FF_LOGO_PRINT` at alphabetical position:
```c
FF_LOGO_PRINT(foobar, initLogoFoobar)
```
In `src/data/logos.txt`:
* Add the name of the logo at alphabetical position.
```
[...]
foobar
[...]
```
In `README.md`:
* Add the pretty name of the logo to the list of supported logos
```
[...] Foobar, [...]
```
+1 -2
View File
@@ -600,6 +600,7 @@ void ffPrintLogos(FFinstance* instance)
FF_LOGO_PRINT(celos, initLogoCelOS)
FF_LOGO_PRINT(debian, initLogoDebian)
FF_LOGO_PRINT(fedora, initLogoFedora)
FF_LOGO_PRINT(fedora_old, initLogoFedoraOld)
FF_LOGO_PRINT(garuda, initLogoGaruda)
FF_LOGO_PRINT(gentoo, initLogoGentoo)
FF_LOGO_PRINT(manjaro, initLogoManjaro)
@@ -607,8 +608,6 @@ void ffPrintLogos(FFinstance* instance)
FF_LOGO_PRINT(pop, initLogoPop)
FF_LOGO_PRINT(ubuntu, initLogoUbuntu)
FF_LOGO_PRINT(void, initLogoVoid)
#undef FF_LOGO_PRINT
}
#endif