feat: added colour code preview infobox

This commit is contained in:
frosty
2026-04-14 18:13:55 -04:00
parent 3a99a37b0c
commit 6738ab0eac
3 changed files with 181 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
#include "Search.h"
#include "../Cache/Cache.h"
#include "../Infobox/Calculator.h"
#include "../Infobox/ColourCode.h"
#include "../Infobox/CurrencyConversion.h"
#include "../Infobox/Dictionary.h"
#include "../Infobox/UnitConversion.h"
@@ -216,11 +217,16 @@ static int is_calculator_query(const char *query) {
return 0;
}
static InfoBox fetch_colour_wrapper(char *query) {
return fetch_colour_data(query);
}
static InfoBoxHandler handlers[] = {
{is_dictionary_query, fetch_dict_wrapper, NULL},
{is_calculator_query, fetch_calc_wrapper, NULL},
{is_unit_conv_query, fetch_unit_wrapper, NULL},
{is_currency_query, fetch_currency_wrapper, NULL},
{is_colour_code_query, fetch_colour_wrapper, NULL},
{always_true, fetch_wiki_wrapper, construct_wiki_url},
};
enum { HANDLER_COUNT = sizeof(handlers) / sizeof(handlers[0]) };