aboutsummaryrefslogtreecommitdiffstats
path: root/com32/elflink/modules/background.c
blob: 467f6fd9bf0a20d9c7b5615a4c45fb538da12b13 (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
/* ----------------------------------------------------------------------- *
 *
 *   Copyright 2008 H. Peter Anvin - All Rights Reserved
 *
 *   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, Inc., 51 Franklin St, Fifth Floor,
 *   Boston MA 02110-1301, USA; either version 2 of the License, or
 *   (at your option) any later version; incorporated herein by reference.
 *
 * ----------------------------------------------------------------------- */

#include <consoles.h>
#include <string.h>
#include <core-elf.h>
#include <syslinux/vesacon.h>
#include <sys/module.h>
#include "menu.h"

static int background_init(void)
{
    return 0;			// Nothing to do; return success
}

const char *current_background = NULL;

int draw_background(const char *what)
{
#if 0
    if (!what)
	return vesacon_default_background();
    else if (what[0] == '#')
	return vesacon_set_background(parse_argb((char **)&what));
    else
	return vesacon_load_background(what);
#endif

    return 0;
}

void set_background(const char *new_background)
{
    if (!current_background || !new_background ||
	strcmp(current_background, new_background)) {
	draw_background(new_background);
	current_background = new_background;
    }
}

static void background_exit(void)
{
    // Nothing to do
}

// Define entry and exit points.
MODULE_INIT(background_init);
MODULE_EXIT(background_exit);