From 37190f80369c2eac644cb84a1fdf294a24f579ab Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Tue, 30 May 2023 21:21:05 +0200 Subject: [PATCH] Header uniformity cleanups --- frontend/frontend_driver.h | 39 +++++++++++++++++----------------- gfx/gfx_animation.h | 28 ++++++++++++------------ gfx/gfx_display.h | 20 ++++++++--------- gfx/gfx_widgets.h | 1 - gfx/video_crt_switch.h | 30 +++++++++++++------------- gfx/video_shader_parse.h | 6 ++---- input/input_driver.h | 1 - network/wifi_driver.h | 6 +++--- playlist.h | 6 +++--- retroarch.h | 6 +++--- state_manager.h | 16 +++++++------- ui/drivers/ui_win32_resource.h | 2 +- ui/ui_companion_driver.h | 25 +++++++++++----------- 13 files changed, 92 insertions(+), 94 deletions(-) diff --git a/frontend/frontend_driver.h b/frontend/frontend_driver.h index a7f1f15220..3278fedefa 100644 --- a/frontend/frontend_driver.h +++ b/frontend/frontend_driver.h @@ -125,25 +125,6 @@ typedef struct frontend_ctx_driver_t *current_frontend_ctx; /* ptr alignment */ } frontend_state_t; -extern frontend_ctx_driver_t frontend_ctx_gx; -extern frontend_ctx_driver_t frontend_ctx_wiiu; -extern frontend_ctx_driver_t frontend_ctx_ps3; -extern frontend_ctx_driver_t frontend_ctx_xdk; -extern frontend_ctx_driver_t frontend_ctx_qnx; -extern frontend_ctx_driver_t frontend_ctx_darwin; -extern frontend_ctx_driver_t frontend_ctx_unix; -extern frontend_ctx_driver_t frontend_ctx_psp; -extern frontend_ctx_driver_t frontend_ctx_ps2; -extern frontend_ctx_driver_t frontend_ctx_ctr; -extern frontend_ctx_driver_t frontend_ctx_switch; -extern frontend_ctx_driver_t frontend_ctx_win32; -extern frontend_ctx_driver_t frontend_ctx_uwp; -extern frontend_ctx_driver_t frontend_ctx_xenon; -extern frontend_ctx_driver_t frontend_ctx_emscripten; -extern frontend_ctx_driver_t frontend_ctx_dos; -extern frontend_ctx_driver_t frontend_ctx_switch; -extern frontend_ctx_driver_t frontend_ctx_orbis; - /** * frontend_ctx_find_driver: * @ident : Identifier name of driver to find. @@ -238,6 +219,26 @@ bool frontend_driver_set_gamemode(bool on); frontend_state_t *frontend_state_get_ptr(void); +extern frontend_ctx_driver_t frontend_ctx_gx; +extern frontend_ctx_driver_t frontend_ctx_wiiu; +extern frontend_ctx_driver_t frontend_ctx_ps3; +extern frontend_ctx_driver_t frontend_ctx_xdk; +extern frontend_ctx_driver_t frontend_ctx_qnx; +extern frontend_ctx_driver_t frontend_ctx_darwin; +extern frontend_ctx_driver_t frontend_ctx_unix; +extern frontend_ctx_driver_t frontend_ctx_psp; +extern frontend_ctx_driver_t frontend_ctx_ps2; +extern frontend_ctx_driver_t frontend_ctx_ctr; +extern frontend_ctx_driver_t frontend_ctx_switch; +extern frontend_ctx_driver_t frontend_ctx_win32; +extern frontend_ctx_driver_t frontend_ctx_uwp; +extern frontend_ctx_driver_t frontend_ctx_xenon; +extern frontend_ctx_driver_t frontend_ctx_emscripten; +extern frontend_ctx_driver_t frontend_ctx_dos; +extern frontend_ctx_driver_t frontend_ctx_switch; +extern frontend_ctx_driver_t frontend_ctx_orbis; + + RETRO_END_DECLS #endif diff --git a/gfx/gfx_animation.h b/gfx/gfx_animation.h index 5b5f0723ed..4d0deae672 100644 --- a/gfx/gfx_animation.h +++ b/gfx/gfx_animation.h @@ -25,8 +25,6 @@ #include "font_driver.h" -RETRO_BEGIN_DECLS - #define TICKER_SPACER_DEFAULT " | " #define ANIM_IS_ACTIVE(_p) (((_p)->flags & (GFX_ANIM_FLAG_IS_ACTIVE)) || ((_p)->flags & GFX_ANIM_FLAG_TICKER_IS_ACTIVE)) @@ -34,10 +32,7 @@ RETRO_BEGIN_DECLS #define GFX_ANIMATION_CLEAR_ACTIVE(anim) ((anim)->flags &= ~(GFX_ANIM_FLAG_IS_ACTIVE | GFX_ANIM_FLAG_TICKER_IS_ACTIVE)) #define GFX_ANIMATION_SET_ACTIVE(anim) ((anim)->flags |= (GFX_ANIM_FLAG_IS_ACTIVE | GFX_ANIM_FLAG_TICKER_IS_ACTIVE)) -typedef void (*tween_cb) (void*); - -typedef void (*update_time_cb) (float *ticker_pixel_increment, - unsigned width, unsigned height); +RETRO_BEGIN_DECLS enum gfx_animation_easing_type { @@ -97,6 +92,19 @@ enum gfx_animation_ticker_type TICKER_TYPE_LAST }; +enum gfx_animation_flags +{ + GFX_ANIM_FLAG_PENDING_DELETES = (1 << 0), + GFX_ANIM_FLAG_IN_UPDATE = (1 << 1), + GFX_ANIM_FLAG_IS_ACTIVE = (1 << 2), + GFX_ANIM_FLAG_TICKER_IS_ACTIVE = (1 << 3) +}; + +typedef void (*tween_cb) (void*); + +typedef void (*update_time_cb) (float *ticker_pixel_increment, + unsigned width, unsigned height); + typedef struct gfx_animation_ctx_entry { float *subject; @@ -200,14 +208,6 @@ struct tween bool deleted; }; -enum gfx_animation_flags -{ - GFX_ANIM_FLAG_PENDING_DELETES = (1 << 0), - GFX_ANIM_FLAG_IN_UPDATE = (1 << 1), - GFX_ANIM_FLAG_IS_ACTIVE = (1 << 2), - GFX_ANIM_FLAG_TICKER_IS_ACTIVE = (1 << 3) -}; - struct gfx_animation { uint64_t ticker_idx; /* updated every TICKER_SPEED us */ diff --git a/gfx/gfx_display.h b/gfx/gfx_display.h index 72e6a9c015..8312289c21 100644 --- a/gfx/gfx_display.h +++ b/gfx/gfx_display.h @@ -32,15 +32,6 @@ #include "../retroarch.h" #include "../gfx/font_driver.h" -RETRO_BEGIN_DECLS - -enum gfx_display_flags -{ - GFX_DISP_FLAG_HAS_WINDOWED = (1 << 0), - GFX_DISP_FLAG_MSG_FORCE = (1 << 1), - GFX_DISP_FLAG_FB_DIRTY = (1 << 2) -}; - #define GFX_SHADOW_ALPHA 0.75f /* Number of pixels corner-to-corner on a 1080p @@ -74,6 +65,16 @@ enum gfx_display_flags * */ #define GFX_DISPLAY_GET_UPDATE_PENDING(p_anim, p_disp) (ANIM_IS_ACTIVE(p_anim) || (p_disp->flags & GFX_DISP_FLAG_FB_DIRTY)) + +RETRO_BEGIN_DECLS + +enum gfx_display_flags +{ + GFX_DISP_FLAG_HAS_WINDOWED = (1 << 0), + GFX_DISP_FLAG_MSG_FORCE = (1 << 1), + GFX_DISP_FLAG_FB_DIRTY = (1 << 2) +}; + enum menu_driver_id_type { MENU_DRIVER_ID_UNKNOWN = 0, @@ -83,7 +84,6 @@ enum menu_driver_id_type MENU_DRIVER_ID_XMB }; - enum gfx_display_prim_type { GFX_DISPLAY_PRIM_NONE = 0, diff --git a/gfx/gfx_widgets.h b/gfx/gfx_widgets.h index e6ce466956..3b8195dc70 100644 --- a/gfx/gfx_widgets.h +++ b/gfx/gfx_widgets.h @@ -253,7 +253,6 @@ typedef struct dispgfx_widget bool active; } dispgfx_widget_t; - /* A widget */ /* TODO/FIXME: cleanup all unused parameters */ struct gfx_widget diff --git a/gfx/video_crt_switch.h b/gfx/video_crt_switch.h index 29cb3bd476..f101a1888d 100644 --- a/gfx/video_crt_switch.h +++ b/gfx/video_crt_switch.h @@ -31,11 +31,6 @@ typedef struct videocrt_switch { double p_clock; - int center_adjust; - int porch_adjust; - int tmp_porch_adjust; - int tmp_center_adjust; - int rtn; unsigned ra_core_width; unsigned ra_core_height; unsigned ra_tmp_width; @@ -51,6 +46,21 @@ typedef struct videocrt_switch float fly_aspect; float fb_ra_core_hz; + int center_adjust; + int porch_adjust; + int tmp_porch_adjust; + int tmp_center_adjust; + int rtn; + int interlace; + int doublescan; + int hsync; + int vsync; + + /* Part of drmModeModeInfo struct from xf86drmMode.h */ + uint32_t clock; + uint32_t vrefresh; + uint16_t hdisplay, hsync_start, hsync_end, htotal, hskew; + uint16_t vdisplay, vsync_start, vsync_end, vtotal, vscan; bool sr2_active; bool menu_active; bool hh_core; @@ -58,16 +68,6 @@ typedef struct videocrt_switch bool rotated; bool tmp_rotated; bool kms_ctx; - - /* Part of drmModeModeInfo struct from xf86drmMode.h */ - uint32_t clock; - uint16_t hdisplay, hsync_start, hsync_end, htotal, hskew; - uint16_t vdisplay, vsync_start, vsync_end, vtotal, vscan; - uint32_t vrefresh; - int interlace; - int doublescan; - int hsync; - int vsync; } videocrt_switch_t; void crt_switch_res_core( diff --git a/gfx/video_shader_parse.h b/gfx/video_shader_parse.h index 1dc5294a95..1754902ce9 100644 --- a/gfx/video_shader_parse.h +++ b/gfx/video_shader_parse.h @@ -26,8 +26,6 @@ #include "../configuration.h" -RETRO_BEGIN_DECLS - #ifndef GFX_MAX_SHADERS #define GFX_MAX_SHADERS 64 #endif @@ -57,6 +55,8 @@ RETRO_BEGIN_DECLS **/ #define video_shader_parse_type(path) video_shader_get_type_from_ext(path_get_extension((path)), NULL) +RETRO_BEGIN_DECLS + enum wildcard_type { RARCH_WILDCARD_CONTENT_DIR = 0, @@ -76,7 +76,6 @@ enum wildcard_type RARCH_WILDCARD_VIDEO_DRIVER_PRESET_EXT }; - enum rarch_shader_type { RARCH_SHADER_NONE = 0, @@ -218,7 +217,6 @@ struct video_shader * with the #reference directive, then this will be different * than the path */ char loaded_preset_path[PATH_MAX_LENGTH]; - }; struct wildcard_token diff --git a/input/input_driver.h b/input/input_driver.h index 0ddb6e0b19..bf4a7775dd 100644 --- a/input/input_driver.h +++ b/input/input_driver.h @@ -302,7 +302,6 @@ typedef struct input_list_element_t unsigned int state_size; } input_list_element; - /** * Organizes the functions and data structures of each driver that are accessed * by other parts of the input code. The input_driver structs are the "interface" diff --git a/network/wifi_driver.h b/network/wifi_driver.h index 0141b01294..0b3b3648f6 100644 --- a/network/wifi_driver.h +++ b/network/wifi_driver.h @@ -85,9 +85,6 @@ typedef struct bool active; } wifi_driver_state_t; -extern wifi_driver_t wifi_connmanctl; -extern wifi_driver_t wifi_nmcli; - /** * config_get_wifi_driver_options: * @@ -125,6 +122,9 @@ wifi_driver_state_t *wifi_state_get_ptr(void); extern const wifi_driver_t *wifi_drivers[]; +extern wifi_driver_t wifi_connmanctl; +extern wifi_driver_t wifi_nmcli; + RETRO_END_DECLS #endif diff --git a/playlist.h b/playlist.h index cd402b73e9..facc5ce099 100644 --- a/playlist.h +++ b/playlist.h @@ -26,12 +26,10 @@ #include "core_info.h" -RETRO_BEGIN_DECLS - /* Default maximum playlist size */ #define COLLECTION_SIZE 0x7FFFFFFF -typedef struct content_playlist playlist_t; +RETRO_BEGIN_DECLS enum playlist_runtime_status { @@ -86,6 +84,8 @@ enum playlist_thumbnail_id PLAYLIST_THUMBNAIL_LEFT }; +typedef struct content_playlist playlist_t; + /* Holds all parameters required to uniquely * identify a playlist content path */ typedef struct diff --git a/retroarch.h b/retroarch.h index a0347aa01d..a21e66a2d0 100644 --- a/retroarch.h +++ b/retroarch.h @@ -42,8 +42,6 @@ #include "runloop.h" #include "retroarch_types.h" -RETRO_BEGIN_DECLS - #define RETRO_ENVIRONMENT_RETROARCH_START_BLOCK 0x800000 #define RETRO_ENVIRONMENT_SET_SAVE_STATE_IN_BACKGROUND (2 | RETRO_ENVIRONMENT_RETROARCH_START_BLOCK) @@ -86,6 +84,9 @@ RETRO_BEGIN_DECLS | DRIVER_LED_MASK \ | DRIVER_MIDI_MASK ) + +RETRO_BEGIN_DECLS + enum rarch_state_flags { RARCH_FLAGS_HAS_SET_USERNAME = (1 << 0), @@ -105,7 +106,6 @@ enum rarch_state_flags RARCH_FLAGS_CLI_DATABASE_SCAN = (1 << 14) }; - bool retroarch_ctl(enum rarch_ctl_state state, void *data); int retroarch_get_capabilities(enum rarch_capabilities type, diff --git a/state_manager.h b/state_manager.h index 436c78b0a9..ac14083843 100644 --- a/state_manager.h +++ b/state_manager.h @@ -28,6 +28,14 @@ RETRO_BEGIN_DECLS +enum state_manager_rewind_st_flags +{ + STATE_MGR_REWIND_ST_FLAG_FRAME_IS_REVERSED = (1 << 0), + STATE_MGR_REWIND_ST_FLAG_INIT_ATTEMPTED = (1 << 1), + STATE_MGR_REWIND_ST_FLAG_HOTKEY_WAS_CHECKED = (1 << 2), + STATE_MGR_REWIND_ST_FLAG_HOTKEY_WAS_PRESSED = (1 << 3) +}; + struct state_manager { uint8_t *data; @@ -57,14 +65,6 @@ struct state_manager typedef struct state_manager state_manager_t; -enum state_manager_rewind_st_flags -{ - STATE_MGR_REWIND_ST_FLAG_FRAME_IS_REVERSED = (1 << 0), - STATE_MGR_REWIND_ST_FLAG_INIT_ATTEMPTED = (1 << 1), - STATE_MGR_REWIND_ST_FLAG_HOTKEY_WAS_CHECKED = (1 << 2), - STATE_MGR_REWIND_ST_FLAG_HOTKEY_WAS_PRESSED = (1 << 3) -}; - struct state_manager_rewind_state { /* Rewind support. */ diff --git a/ui/drivers/ui_win32_resource.h b/ui/drivers/ui_win32_resource.h index d47b1f1e17..f960d0ba6f 100644 --- a/ui/drivers/ui_win32_resource.h +++ b/ui/drivers/ui_win32_resource.h @@ -29,4 +29,4 @@ #define ID_M_TAKE_SCREENSHOT 40025 #define ID_M_MUTE_TOGGLE 40026 #define ID_M_TOGGLE_DESKTOP 40027 -#define IDR_ACCELERATOR1 104 +#define IDR_ACCELERATOR1 104 diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index d48cebfe91..f0071b2a2b 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -56,6 +56,12 @@ enum ui_msg_window_type UI_MSG_WINDOW_TYPE_WARNING }; +enum uico_driver_state_flags +{ + UICO_ST_FLAG_QT_IS_INITED = (1 << 0), + UICO_ST_FLAG_IS_ON_FOREGROUND = (1 << 1) +}; + typedef struct ui_msg_window_state { enum ui_msg_window_buttons buttons; @@ -131,12 +137,6 @@ typedef struct ui_companion_driver const char *ident; } ui_companion_driver_t; -enum uico_driver_state_flags -{ - UICO_ST_FLAG_QT_IS_INITED = (1 << 0), - UICO_ST_FLAG_IS_ON_FOREGROUND = (1 << 1) -}; - typedef struct { const ui_companion_driver_t *drv; @@ -147,12 +147,6 @@ typedef struct uint8_t flags; } uico_driver_state_t; -extern ui_companion_driver_t ui_companion_cocoa; -extern ui_companion_driver_t ui_companion_qt; -extern ui_companion_driver_t ui_companion_win32; - -extern ui_msg_window_t ui_msg_window_win32; - uint8_t ui_companion_get_flags(void); void ui_companion_event_command(enum event_command action); @@ -186,6 +180,13 @@ void ui_companion_driver_toggle( uico_driver_state_t *uico_state_get_ptr(void); +extern ui_companion_driver_t ui_companion_cocoa; +extern ui_companion_driver_t ui_companion_qt; +extern ui_companion_driver_t ui_companion_win32; + +extern ui_msg_window_t ui_msg_window_win32; + + RETRO_END_DECLS #endif