Project

General

Profile

Bug #431 » 0052-Correct-useable-to-usable.patch

main - Marko Lindqvist, 04/08/2024 06:40 PM

View differences:

client/gui-gtk-3.22/themes.c
/*************************************************************************//**
Return an array of names of usable themes in the given directory.
Array size is stored in count.
Useable theme for gtk+ is a directory which contains file gtk-3.0/gtk.css.
Usable theme for gtk+ is a directory which contains file gtk-3.0/gtk.css.
The caller is responsible for freeing the array and the names
*****************************************************************************/
char **get_useable_themes_in_directory(const char *directory, int *count)
char **get_usable_themes_in_directory(const char *directory, int *count)
{
DIR *dir;
struct dirent *entry;
client/gui-gtk-4.0/themes.c
/*************************************************************************//**
Return an array of names of usable themes in the given directory.
Array size is stored in count.
Useable theme for gtk is a directory which contains file gtk-4.0/gtk.css.
Usable theme for gtk is a directory which contains file gtk-4.0/gtk.css.
The caller is responsible for freeing the array and the names
*****************************************************************************/
char **get_useable_themes_in_directory(const char *directory, int *count)
char **get_usable_themes_in_directory(const char *directory, int *count)
{
DIR *dir;
struct dirent *entry;
client/gui-gtk-5.0/themes.c
/*************************************************************************//**
Return an array of names of usable themes in the given directory.
Array size is stored in count.
Useable theme for gtk is a directory which contains file gtk-4.0/gtk.css.
Usable theme for gtk is a directory which contains file gtk-4.0/gtk.css.
The caller is responsible for freeing the array and the names
*****************************************************************************/
char **get_useable_themes_in_directory(const char *directory, int *count)
char **get_usable_themes_in_directory(const char *directory, int *count)
{
DIR *dir;
struct dirent *entry;
client/gui-qt/qtg_cxxside.cpp
funcs->gui_load_theme = qtg_gui_load_theme;
funcs->gui_clear_theme = qtg_gui_clear_theme;
funcs->get_gui_specific_themes_directories = qtg_get_gui_specific_themes_directories;
funcs->get_useable_themes_in_directory = qtg_get_useable_themes_in_directory;
funcs->get_gui_specific_themes_directories
= qtg_get_gui_specific_themes_directories;
funcs->get_usable_themes_in_directory = qtg_get_usable_themes_in_directory;
funcs->gui_init_meeting = qtg_init_meeting;
funcs->gui_recv_cancel_meeting = qtg_recv_cancel_meeting;
client/gui-qt/qtg_cxxside.h
void qtg_gui_load_theme(const char *directory, const char *theme_name);
void qtg_gui_clear_theme();
char **qtg_get_gui_specific_themes_directories(int *count);
char **qtg_get_useable_themes_in_directory(const char *directory, int *count);
char **qtg_get_usable_themes_in_directory(const char *directory, int *count);
void qtg_init_meeting(struct Treaty *ptreaty, struct player *they,
struct player *initiator);
client/gui-qt/themes.cpp
Array size is stored in count.
The caller is responsible for freeing the array and the names.
*****************************************************************************/
char **qtg_get_useable_themes_in_directory(const char *directory, int *count)
char **qtg_get_usable_themes_in_directory(const char *directory, int *count)
{
QStringList sl, theme_list;
char **array;
client/gui-sdl2/themes.c
/*************************************************************************//**
Return an array of names of usable themes in the given directory.
Array size is stored in count.
Useable theme for gui-sdl2 is a directory which contains file theme.themespec.
Usable theme for gui-sdl2 is a directory which contains file theme.themespec.
The caller is responsible for freeing the array and the names
*****************************************************************************/
char **get_useable_themes_in_directory(const char *directory, int *count)
char **get_usable_themes_in_directory(const char *directory, int *count)
{
DIR *dir;
struct dirent *entry;
client/gui-sdl3/themes.c
/*************************************************************************//**
Return an array of names of usable themes in the given directory.
Array size is stored in count.
Useable theme for gui-sdl3 is a directory which contains file theme.themespec.
Usable theme for gui-sdl3 is a directory which contains file theme.themespec.
The caller is responsible for freeing the array and the names
*****************************************************************************/
char **get_useable_themes_in_directory(const char *directory, int *count)
char **get_usable_themes_in_directory(const char *directory, int *count)
{
DIR *dir;
struct dirent *entry;
client/gui-stub/themes.c
Array size is stored in count.
The caller is responsible for freeing the array and the names
*****************************************************************************/
char **gui_get_useable_themes_in_directory(const char *directory, int *count)
char **gui_get_usable_themes_in_directory(const char *directory, int *count)
{
*count = 0;
return fc_malloc(sizeof(char*) * 0);
client/gui_cbsetter.c
funcs->gui_load_theme = gui_gui_load_theme;
funcs->gui_clear_theme = gui_gui_clear_theme;
funcs->get_gui_specific_themes_directories = gui_get_gui_specific_themes_directories;
funcs->get_useable_themes_in_directory = gui_get_useable_themes_in_directory;
funcs->get_usable_themes_in_directory = gui_get_usable_themes_in_directory;
}
client/gui_interface.c
}
/**********************************************************************//**
Call get_useable_themes_in_directory callback
Call get_usable_themes_in_directory callback
**************************************************************************/
char **get_useable_themes_in_directory(const char *directory, int *count)
char **get_usable_themes_in_directory(const char *directory, int *count)
{
return funcs.get_useable_themes_in_directory(directory, count);
return funcs.get_usable_themes_in_directory(directory, count);
}
/**********************************************************************//**
client/gui_interface.h
void (*gui_load_theme)(const char *directory, const char *theme_name);
void (*gui_clear_theme)(void);
char **(*get_gui_specific_themes_directories)(int *count);
char **(*get_useable_themes_in_directory)(const char *directory, int *count);
char **(*get_usable_themes_in_directory)(const char *directory, int *count);
void (*gui_init_meeting)(struct Treaty *ptreaty, struct player *they,
struct player *initiator);
client/include/themes_g.h
/**********************************************************************
/***********************************************************************
Freeciv - Copyright (C) 2005 The Freeciv Team
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
......
const char *theme_name)
GUI_FUNC_PROTO(void, gui_clear_theme, void)
GUI_FUNC_PROTO(char**, get_gui_specific_themes_directories, int *count)
GUI_FUNC_PROTO(char**, get_useable_themes_in_directory,
GUI_FUNC_PROTO(char**, get_usable_themes_in_directory,
const char *directory, int* count)
#endif /* FC__THEMES_G_H */
client/themes_common.c
Theme is stored in a directory called like the theme. The directory contains
some data files. Each gui defines its own format in the
get_useable_themes_in_directory() function.
get_usable_themes_in_directory() function.
****************************************************************************/
/* A directory containing a list of usable themes */
......
void init_themes(void)
{
int i;
/* get GUI-specific theme directories */
/* Get GUI-specific theme directories */
char **gui_directories =
get_gui_specific_themes_directories(&num_directories);
directories =
directories =
fc_malloc(sizeof(struct theme_directory) * num_directories);
for (i = 0; i < num_directories; i++) {
directories[i].path = gui_directories[i];
/* get useable themes in this directory */
/* Get usable themes in this directory */
directories[i].themes =
get_useable_themes_in_directory(directories[i].path,
&(directories[i].num_themes));
get_usable_themes_in_directory(directories[i].path,
&(directories[i].num_themes));
}
free(gui_directories);
}
/************************************************************************//**
Return a static string vector of useable theme names.
Return a static string vector of usable theme names.
****************************************************************************/
const struct strvec *get_themes_list(const struct option *poption)
{
common/generate_packets.py
@abstractmethod
def array(self, size: SizeInfo) -> "FieldType":
"""Add an array size to this field type, either to make a type which
needs a size fully useable, or to make an array type with self as
needs a size fully usable, or to make an array type with self as
the element type."""
raise NotImplementedError
......
self.cls = cls
def array(self, size: SizeInfo) -> "FieldType":
"""Add an array size to make a useable type."""
"""Add an array size to make a usable type."""
return self.cls(self.dataio_type, self.public_type, size)
def __str__(self) -> str:
(1-1/3)