Add new built-in theme "No comets"

This theme displays all aspects and antiscia, but only planets. No comets
and dwarves are displayed.
This commit is contained in:
Gergely Polonkai 2014-09-21 19:32:10 +02:00
parent e5c2b628b4
commit cc4b37d1ac
2 changed files with 66 additions and 3 deletions

View File

@ -44,6 +44,7 @@ static AgDisplayTheme **builtin_themes = NULL;
static gchar *builtin_theme_name[AG_DISPLAY_THEME_COUNT] = {
NC_("Display theme name", "Everything"),
NC_("Display theme name", "Classic"),
NC_("Display theme name", "No comets"),
};
gchar *
@ -224,6 +225,67 @@ ag_display_theme_get_builtin(gint id)
break;
case AG_DISPLAY_THEME_NO_COMETS:
// TODO: If SWE-GLib would support it, we could programatically get
// classic planets and aspects here, thus, if it is messed up,
// we need to fix it only once.
theme->id = id;
theme->name = gettext(builtin_theme_name[-id - 1]);
theme->builtin = TRUE;
theme->planets_include = TRUE;
theme->planets = NULL;
theme->aspects_include = FALSE;
theme->aspects = NULL;
theme->antiscia_include = FALSE;
theme->antiscia = NULL;
theme->planets = g_list_prepend(
theme->planets,
GINT_TO_POINTER(GSWE_PLANET_SUN)
);
theme->planets = g_list_prepend(
theme->planets,
GINT_TO_POINTER(GSWE_PLANET_MOON)
);
theme->planets = g_list_prepend(
theme->planets,
GINT_TO_POINTER(GSWE_PLANET_MERCURY)
);
theme->planets = g_list_prepend(
theme->planets,
GINT_TO_POINTER(GSWE_PLANET_VENUS)
);
theme->planets = g_list_prepend(
theme->planets,
GINT_TO_POINTER(GSWE_PLANET_MARS)
);
theme->planets = g_list_prepend(
theme->planets,
GINT_TO_POINTER(GSWE_PLANET_JUPITER)
);
theme->planets = g_list_prepend(
theme->planets,
GINT_TO_POINTER(GSWE_PLANET_SATURN)
);
theme->planets = g_list_prepend(
theme->planets,
GINT_TO_POINTER(GSWE_PLANET_URANUS)
);
theme->planets = g_list_prepend(
theme->planets,
GINT_TO_POINTER(GSWE_PLANET_NEPTUNE)
);
theme->planets = g_list_prepend(
theme->planets,
GINT_TO_POINTER(GSWE_PLANET_PLUTO)
);
theme->planets = g_list_prepend(
theme->planets,
GINT_TO_POINTER(GSWE_PLANET_MOON_NODE)
);
break;
default:
g_free(theme);
g_warning("Trying to instantiate unknown builtin theme %d", id);

View File

@ -16,10 +16,11 @@ typedef struct _AgDisplayTheme {
} AgDisplayTheme;
enum {
AG_DISPLAY_THEME_ALL = -1,
AG_DISPLAY_THEME_CLASSIC = -2,
AG_DISPLAY_THEME_ALL = -1,
AG_DISPLAY_THEME_CLASSIC = -2,
AG_DISPLAY_THEME_NO_COMETS = -3,
AG_DISPLAY_THEME_PREV,
AG_DISPLAY_THEME_COUNT = - AG_DISPLAY_THEME_PREV + 1
AG_DISPLAY_THEME_COUNT = - AG_DISPLAY_THEME_PREV + 1
};
gchar *ag_display_theme_to_css(AgDisplayTheme *display_theme);