From a193c324e398e98169f1796b1b8e7e1b6e4d7a34 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Mon, 20 Mar 2023 20:50:57 +0200 Subject: [PATCH 32/32] sdl2: Improve header file coding style See osdn #47617 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/cityrep.h | 5 ++-- client/gui-sdl2/finddlg.h | 5 ++-- client/gui-sdl2/gotodlg.h | 3 ++- client/gui-sdl2/gui_mouse.h | 3 ++- client/gui-sdl2/gui_string.h | 28 ++++++++++----------- client/gui-sdl2/gui_tilespec.h | 12 ++++----- client/gui-sdl2/helpdlg.h | 3 ++- client/gui-sdl2/inteldlg.h | 3 ++- client/gui-sdl2/messagedlg.h | 4 +-- client/gui-sdl2/messagewin.h | 5 ++-- client/gui-sdl2/pages.h | 4 +-- client/gui-sdl2/plrdlg.h | 5 ++-- client/gui-sdl2/ratesdlg.h | 5 ++-- client/gui-sdl2/spaceshipdlg.h | 3 ++- client/gui-sdl2/themecolors.h | 46 ++++++++++++++++++---------------- client/gui-sdl2/voteinfo_bar.h | 6 ++--- 16 files changed, 76 insertions(+), 64 deletions(-) diff --git a/client/gui-sdl2/cityrep.h b/client/gui-sdl2/cityrep.h index 0e8241c51e..76e68ef0ac 100644 --- a/client/gui-sdl2/cityrep.h +++ b/client/gui-sdl2/cityrep.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 @@ -14,9 +14,10 @@ #ifndef FC__CITYREP_H #define FC__CITYREP_H +/* client */ #include "cityrep_g.h" bool is_city_report_open(void); void city_report_dialog_popdown(void); -#endif /* FC__CITYREP_H */ +#endif /* FC__CITYREP_H */ diff --git a/client/gui-sdl2/finddlg.h b/client/gui-sdl2/finddlg.h index f36cb22988..3a64452c33 100644 --- a/client/gui-sdl2/finddlg.h +++ b/client/gui-sdl2/finddlg.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2003 - The Freeciv Project 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 @@ -13,8 +13,9 @@ #ifndef FC__FINDDLG_H #define FC__FINDDLG_H +/* client */ #include "finddlg_g.h" void popdown_find_dialog(void); -#endif /* FC__FINDDLG_H */ +#endif /* FC__FINDDLG_H */ diff --git a/client/gui-sdl2/gotodlg.h b/client/gui-sdl2/gotodlg.h index 3f57a56dd7..ef4bf40aa3 100644 --- a/client/gui-sdl2/gotodlg.h +++ b/client/gui-sdl2/gotodlg.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 @@ -14,6 +14,7 @@ #ifndef FC__GOTODLG_H #define FC__GOTODLG_H +/* client */ #include "gotodlg_g.h" void popdown_goto_airlift_dialog(void); diff --git a/client/gui-sdl2/gui_mouse.h b/client/gui-sdl2/gui_mouse.h index 9be102644b..da7c283f73 100644 --- a/client/gui-sdl2/gui_mouse.h +++ b/client/gui-sdl2/gui_mouse.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2006 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 @@ -14,6 +14,7 @@ #ifndef FC__GUI_MOUSE_H #define FC__GUI_MOUSE_H +/* client */ #include "mapview_g.h" void animate_mouse_cursor(void); diff --git a/client/gui-sdl2/gui_string.h b/client/gui-sdl2/gui_string.h index 60eff8d53f..8296e6fcf3 100644 --- a/client/gui-sdl2/gui_string.h +++ b/client/gui-sdl2/gui_string.h @@ -37,23 +37,23 @@ /* gui-sdl2 */ #include "gui_main.h" -#define SF_CENTER 0x10 -#define SF_CENTER_RIGHT 0x20 - -/* styles: - TTF_STYLE_NORMAL 0 - TTF_STYLE_BOLD 1 - TTF_STYLE_ITALIC 2 - TTF_STYLE_UNDERLINE 4 - SF_CENTER 0x10 - use with multi string, must be > 0x0f - SF_CENTER_RIGHT 0x20 - use with multi string, must be > 0x0f +#define SF_CENTER 0x10 +#define SF_CENTER_RIGHT 0x20 + +/* Styles: + TTF_STYLE_NORMAL 0 + TTF_STYLE_BOLD 1 + TTF_STYLE_ITALIC 2 + TTF_STYLE_UNDERLINE 4 + SF_CENTER 0x10 - Use with multi string, must be > 0x0f + SF_CENTER_RIGHT 0x20 - Use with multi string, must be > 0x0f */ typedef struct utf8_str { Uint8 style; Uint8 render; Uint16 ptsize; - size_t n_alloc; /* total allocated text memory */ + size_t n_alloc; /* Total allocated text memory */ SDL_Color fgcol; SDL_Color bgcol; TTF_Font *font; @@ -74,7 +74,7 @@ void change_ptsize_utf8(utf8_str *pstr, Uint16 new_ptsize); void unload_font(Uint16 ptsize); void free_font_system(void); -/* adjust font sizes on 320x240 screen */ +/* Adjust font sizes on 320x240 screen */ #ifdef SMALL_SCREEN int adj_font(int size); #else @@ -82,7 +82,7 @@ void free_font_system(void); #endif /* - * here we use ordinary free( ... ) because check is made + * Here we use ordinary free( ... ) because check is made * on start. */ #define FREEUTF8STR( pstr ) \ @@ -99,6 +99,6 @@ void free_font_system(void); (string_in) == NULL ? \ create_utf8_str(NULL, 0, ptsize) : \ copy_chars_to_utf8_str(create_utf8_str(NULL, 0, ptsize), string_in) - + #endif /* FC__GUISTRING_H */ diff --git a/client/gui-sdl2/gui_tilespec.h b/client/gui-sdl2/gui_tilespec.h index 2e123ff967..71b6ce9362 100644 --- a/client/gui-sdl2/gui_tilespec.h +++ b/client/gui-sdl2/gui_tilespec.h @@ -38,7 +38,7 @@ struct theme_icons { - /* Frame */ + /* Frame */ SDL_Surface *fr_left; SDL_Surface *fr_right; SDL_Surface *fr_top; @@ -88,10 +88,10 @@ struct theme_icons { SDL_Surface *load_icon; SDL_Surface *delete_icon; - /* help icons */ + /* Help icons */ SDL_Surface *tech_tree_icon; - /* city icons */ + /* City icons */ SDL_Surface *army_icon; SDL_Surface *support_icon; SDL_Surface *happy_icon; @@ -100,11 +100,11 @@ struct theme_icons { SDL_Surface *qprod_icon; SDL_Surface *buy_prod_icon; - /* diplomacy */ + /* Diplomacy */ SDL_Surface *ok_pact_icon; SDL_Surface *cancel_pact_icon; - /* orders icons */ + /* Orders icons */ SDL_Surface *order_icon; SDL_Surface *o_disband_icon; SDL_Surface *o_wait_icon; @@ -172,7 +172,7 @@ struct city_icon { SDL_Surface *coint; SDL_Surface *pColb; SDL_Surface *face; - /*SDL_Surface *pDark_Face;*/ + /* SDL_Surface *pDark_Face; */ SDL_Surface *pollution; SDL_Surface *police; diff --git a/client/gui-sdl2/helpdlg.h b/client/gui-sdl2/helpdlg.h index 7ee1b82665..3e26668332 100644 --- a/client/gui-sdl2/helpdlg.h +++ b/client/gui-sdl2/helpdlg.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 @@ -17,6 +17,7 @@ /* common */ #include "tech.h" +/* client */ #include "helpdlg_g.h" void popup_help_browser(void); diff --git a/client/gui-sdl2/inteldlg.h b/client/gui-sdl2/inteldlg.h index 7f771a10da..e69f465d74 100644 --- a/client/gui-sdl2/inteldlg.h +++ b/client/gui-sdl2/inteldlg.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2003 - The Freeciv Project 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 @@ -13,6 +13,7 @@ #ifndef FC__INTELDLG_H #define FC__INTELDLG_H +/* client */ #include "inteldlg_g.h" void intel_dialog_init(void); diff --git a/client/gui-sdl2/messagedlg.h b/client/gui-sdl2/messagedlg.h index 5a17ccb003..3f6d0f3662 100644 --- a/client/gui-sdl2/messagedlg.h +++ b/client/gui-sdl2/messagedlg.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2003 - The Freeciv Project 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 @@ -15,6 +15,6 @@ #include "messagedlg_g.h" -/* nothing to add */ +/* Nothing to add */ #endif /* FC__MESSAGEDLG_H */ diff --git a/client/gui-sdl2/messagewin.h b/client/gui-sdl2/messagewin.h index 0d6c0f2431..56b6f473c9 100644 --- a/client/gui-sdl2/messagewin.h +++ b/client/gui-sdl2/messagewin.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 @@ -14,9 +14,10 @@ #ifndef FC__MESSAGEWIN_H #define FC__MESSAGEWIN_H +/* client */ #include "messagewin_g.h" #include "messagewin_common.h" void meswin_dialog_popdown(void); -#endif /* FC__MESSAGEWIN_H */ +#endif /* FC__MESSAGEWIN_H */ diff --git a/client/gui-sdl2/pages.h b/client/gui-sdl2/pages.h index 2ccbda4d74..cdb1f87105 100644 --- a/client/gui-sdl2/pages.h +++ b/client/gui-sdl2/pages.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996-2004 - 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 @@ -15,4 +15,4 @@ #include "pages_g.h" -#endif /* FC__PAGES_H */ +#endif /* FC__PAGES_H */ diff --git a/client/gui-sdl2/plrdlg.h b/client/gui-sdl2/plrdlg.h index cad38e4999..2565dacb02 100644 --- a/client/gui-sdl2/plrdlg.h +++ b/client/gui-sdl2/plrdlg.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 @@ -14,10 +14,11 @@ #ifndef FC__PLRDLG_H #define FC__PLRDLG_H +/* client */ #include "plrdlg_g.h" void popdown_players_nations_dialog(void); void popup_players_nations_dialog(void); void popdown_players_dialog(void); -#endif /* FC__PLRDLG_H */ +#endif /* FC__PLRDLG_H */ diff --git a/client/gui-sdl2/ratesdlg.h b/client/gui-sdl2/ratesdlg.h index 8fe2ff47ff..bd60934bed 100644 --- a/client/gui-sdl2/ratesdlg.h +++ b/client/gui-sdl2/ratesdlg.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2003 - The Freeciv Project 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 @@ -13,8 +13,9 @@ #ifndef FC__RATESDLG_H #define FC__RATESDLG_H +/* client */ #include "ratesdlg_g.h" -/* nothing to add */ +/* Nothing to add */ #endif /* FC__RATESDLG_H */ diff --git a/client/gui-sdl2/spaceshipdlg.h b/client/gui-sdl2/spaceshipdlg.h index 09821df31a..b18e0387ca 100644 --- a/client/gui-sdl2/spaceshipdlg.h +++ b/client/gui-sdl2/spaceshipdlg.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 @@ -14,6 +14,7 @@ #ifndef FC__SPACESHIPDLG_H #define FC__SPACESHIPDLG_H +/* client */ #include "spaceshipdlg_g.h" diff --git a/client/gui-sdl2/themecolors.h b/client/gui-sdl2/themecolors.h index 9dc4b6b837..960212f1b5 100644 --- a/client/gui-sdl2/themecolors.h +++ b/client/gui-sdl2/themecolors.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2005 - The Freeciv Project 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 @@ -14,6 +14,7 @@ #ifndef FC__THEMECOLORS_H #define FC__THEMECOLORS_H +/* client */ #include "colors_common.h" /* The color system is designed on the assumption that almost, but @@ -25,47 +26,47 @@ enum theme_color { COLOR_THEME_CUSTOM_WIDGET_NORMAL_TEXT, COLOR_THEME_CUSTOM_WIDGET_SELECTED_FRAME, COLOR_THEME_CUSTOM_WIDGET_SELECTED_TEXT, - COLOR_THEME_CUSTOM_WIDGET_PRESSED_FRAME, + COLOR_THEME_CUSTOM_WIDGET_PRESSED_FRAME, COLOR_THEME_CUSTOM_WIDGET_PRESSED_TEXT, COLOR_THEME_CUSTOM_WIDGET_DISABLED_TEXT, COLOR_THEME_EDITFIELD_CARET, COLOR_THEME_LABEL_BAR, - COLOR_THEME_QUICK_INFO_BG, /* Quick info Background color */ - COLOR_THEME_QUICK_INFO_FRAME, /* Quick info frame color */ - COLOR_THEME_QUICK_INFO_TEXT, /* Quick info Text color */ + COLOR_THEME_QUICK_INFO_BG, /* Quick info Background color */ + COLOR_THEME_QUICK_INFO_FRAME, /* Quick info frame color */ + COLOR_THEME_QUICK_INFO_TEXT, /* Quick info Text color */ COLOR_THEME_SELECTIONRECTANGLE, COLOR_THEME_TEXT, COLOR_THEME_THEMELABEL2_BG, - COLOR_THEME_WIDGET_NORMAL_TEXT, /* currently not used */ - COLOR_THEME_WIDGET_SELECTED_TEXT, /* currently not used */ - COLOR_THEME_WIDGET_PRESSED_TEXT, /* currently not used */ - COLOR_THEME_WIDGET_DISABLED_TEXT, /* text on disabled widgets */ + COLOR_THEME_WIDGET_NORMAL_TEXT, /* Currently not used */ + COLOR_THEME_WIDGET_SELECTED_TEXT, /* Currently not used */ + COLOR_THEME_WIDGET_PRESSED_TEXT, /* Currently not used */ + COLOR_THEME_WIDGET_DISABLED_TEXT, /* Text on disabled widgets */ COLOR_THEME_WINDOW_TITLEBAR_SEPARATOR, COLOR_THEME_ADVANCEDTERRAINDLG_TEXT, COLOR_THEME_CITYDLG_BUY, - COLOR_THEME_CITYDLG_CELEB, /* city celebrating color */ + COLOR_THEME_CITYDLG_CELEB, /* City celebrating color */ COLOR_THEME_CITYDLG_CORRUPTION, COLOR_THEME_CITYDLG_FOODPERTURN, COLOR_THEME_CITYDLG_FOODSTOCK, - COLOR_THEME_CITYDLG_FOOD_SURPLUS, /* city food surplus color */ + COLOR_THEME_CITYDLG_FOOD_SURPLUS, /* City food surplus color */ COLOR_THEME_CITYDLG_FRAME, - COLOR_THEME_CITYDLG_GOLD, /* city gold color */ + COLOR_THEME_CITYDLG_GOLD, /* City gold color */ COLOR_THEME_CITYDLG_GRANARY, COLOR_THEME_CITYDLG_GROWTH, - COLOR_THEME_CITYDLG_HAPPY, /* city happy color */ - COLOR_THEME_CITYDLG_IMPR, /* city improvements */ + COLOR_THEME_CITYDLG_HAPPY, /* City happy color */ + COLOR_THEME_CITYDLG_IMPR, /* City improvements */ COLOR_THEME_CITYDLG_INFOPANEL, - COLOR_THEME_CITYDLG_LUX, /* city luxuries color */ + COLOR_THEME_CITYDLG_LUX, /* City luxuries color */ COLOR_THEME_CITYDLG_PANEL, - COLOR_THEME_CITYDLG_PROD, /* city production color */ - COLOR_THEME_CITYDLG_SCIENCE, /* city science color */ + COLOR_THEME_CITYDLG_PROD, /* City production color */ + COLOR_THEME_CITYDLG_SCIENCE, /* City science color */ COLOR_THEME_CITYDLG_SELL, COLOR_THEME_CITYDLG_SHIELDSTOCK, COLOR_THEME_CITYDLG_STOCKS, - COLOR_THEME_CITYDLG_SUPPORT, /* city units support color */ - COLOR_THEME_CITYDLG_TRADE, /* city trade color */ - COLOR_THEME_CITYDLG_UPKEEP, /* city upkeep color */ + COLOR_THEME_CITYDLG_SUPPORT, /* City units support color */ + COLOR_THEME_CITYDLG_TRADE, /* City trade color */ + COLOR_THEME_CITYDLG_UPKEEP, /* City upkeep color */ COLOR_THEME_CITYREP_FOODSTOCK, COLOR_THEME_CITYREP_FRAME, COLOR_THEME_CITYREP_PROD, @@ -105,12 +106,13 @@ enum theme_color { COLOR_THEME_OPTIONDLG_WORKLISTLIST_TEXT, COLOR_THEME_PLRDLG_ALLIANCE, COLOR_THEME_PLRDLG_ARMISTICE, - COLOR_THEME_PLRDLG_CEASEFIRE, + COLOR_THEME_PLRDLG_CEASEFIRE, COLOR_THEME_PLRDLG_FRAME, COLOR_THEME_PLRDLG_PEACE, COLOR_THEME_PLRDLG_TEXT, COLOR_THEME_PLRDLG_WAR, - COLOR_THEME_PLRDLG_WAR_RESTRICTED, /* player at war but can't meet or get intel. data */ + COLOR_THEME_PLRDLG_WAR_RESTRICTED, /* Player at war but can't meet + * or get intel. data */ COLOR_THEME_REVOLUTIONDLG_TEXT, COLOR_THEME_SABOTAGEDLG_SEPARATOR, COLOR_THEME_SCIENCEDLG_FRAME, diff --git a/client/gui-sdl2/voteinfo_bar.h b/client/gui-sdl2/voteinfo_bar.h index f5d103105f..a0ec1dc907 100644 --- a/client/gui-sdl2/voteinfo_bar.h +++ b/client/gui-sdl2/voteinfo_bar.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996 - A Kjeldberg, L Gregersen, P Unold 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 @@ -13,7 +13,7 @@ #ifndef FC__VOTEBAR_H #define FC__VOTEBAR_H -/* include */ +/* client */ #include "voteinfo_bar_g.h" -#endif /* FC__VOTEBAR_H */ +#endif /* FC__VOTEBAR_H */ -- 2.39.2