[NTOS:INBV] Code refactoring: Move all the boot animation-specific code out of inbv.c and into the new bootanim.c file.

- inbv.c now only contains the Inbv-specific API and nothing else.

- It will make easier for people to write their own boot themes & animations,
  by just copying/adapting the bootanim.c file (and the resources).

- Add SAL annotations.

- All INBV progress bar functions (except for InbvIndicateProgress())
  should not be INIT-only functions, since they can be (not yet in ROS)
  used at later times -- namely, for feedback during hibernation.
This commit is contained in:
Hermès Bélusca-Maïto 2022-02-13 20:57:12 +01:00
parent 17bd71b570
commit f7e8214b55
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
7 changed files with 362 additions and 1682 deletions

View file

@ -11,6 +11,8 @@
#include <ntoskrnl.h>
#include <reactos/buildno.h>
#include "inbv/logo.h"
#define NDEBUG
#include <debug.h>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,3 +1,10 @@
/*
* PROJECT: ReactOS Kernel
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
* PURPOSE: Boot Theme & Animation header
* COPYRIGHT: Copyright 2020 Dmitry Borisov (di.sean@protonmail.com)
*/
#pragma once
//
@ -32,3 +39,36 @@
#define VID_SKU_TEXT_TOP 121
#define VID_FOOTER_BG_TOP (SCREEN_HEIGHT - 59)
//
// Boot Splash-Screen Functions
//
CODE_SEG("INIT")
BOOLEAN
NTAPI
BootAnimInitialize(
_In_ PLOADER_PARAMETER_BLOCK LoaderBlock,
_In_ ULONG Count);
VOID
NTAPI
BootAnimTickProgressBar(
_In_ ULONG SubPercentTimes100);
CODE_SEG("INIT")
VOID
NTAPI
InbvRotBarInit(VOID);
CODE_SEG("INIT")
VOID
NTAPI
DisplayBootBitmap(
_In_ BOOLEAN TextMode);
CODE_SEG("INIT")
VOID
NTAPI
FinalizeBootLogo(VOID);

View file

@ -1,6 +1,14 @@
/*
* PROJECT: ReactOS Kernel
* LICENSE: BSD - See COPYING.ARM in the top level directory
* PURPOSE: Boot Video Driver support header
* COPYRIGHT: Copyright 2007 Alex Ionescu (alex.ionescu@reactos.org)
* Copyright 2019-2022 Hermès Bélusca-Maïto
*/
#pragma once
// Native definitions from BOOTVID (Boot Video Driver).
/* Native definitions from BOOTVID (Boot Video Driver) */
#include "bootvid/bootvid.h"
//
@ -10,35 +18,78 @@ CODE_SEG("INIT")
BOOLEAN
NTAPI
InbvDriverInitialize(
IN PLOADER_PARAMETER_BLOCK LoaderBlock,
IN ULONG Count
_In_ PLOADER_PARAMETER_BLOCK LoaderBlock,
_In_ ULONG Count
);
extern BOOLEAN InbvBootDriverInstalled;
INBV_DISPLAY_STATE
NTAPI
InbvGetDisplayState(VOID);
VOID
NTAPI
InbvAcquireLock(VOID);
VOID
NTAPI
InbvReleaseLock(VOID);
PUCHAR
NTAPI
InbvGetResourceAddress(
IN ULONG ResourceNumber
_In_ ULONG ResourceNumber
);
//
// Display Functions
//
VOID
NTAPI
InbvBitBlt(
_In_ PUCHAR Buffer,
_In_ ULONG X,
_In_ ULONG Y
);
VOID
NTAPI
InbvBitBlt(
IN PUCHAR Buffer,
IN ULONG X,
IN ULONG Y
InbvBufferToScreenBlt(
_In_ PUCHAR Buffer,
_In_ ULONG X,
_In_ ULONG Y,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta
);
VOID
NTAPI
InbvScreenToBufferBlt(
_Out_ PUCHAR Buffer,
_In_ ULONG X,
_In_ ULONG Y,
_In_ ULONG Width,
_In_ ULONG Height,
_In_ ULONG Delta
);
//
// Progress-Bar Functions
//
VOID
NTAPI
InbvSetProgressBarCoordinates(
_In_ ULONG Left,
_In_ ULONG Top
);
CODE_SEG("INIT")
VOID
NTAPI
InbvIndicateProgress(VOID);
CODE_SEG("INIT")
VOID
NTAPI
InbvSetProgressBarSubset(
@ -46,44 +97,12 @@ InbvSetProgressBarSubset(
_In_ ULONG Ceiling
);
CODE_SEG("INIT")
VOID
NTAPI
InbvUpdateProgressBar(
_In_ ULONG Percentage
);
//
// Boot Splash-Screen Functions
//
CODE_SEG("INIT")
VOID
NTAPI
InbvRotBarInit(
VOID
);
CODE_SEG("INIT")
VOID
NTAPI
DisplayBootBitmap(
IN BOOLEAN TextMode
);
CODE_SEG("INIT")
VOID
NTAPI
DisplayFilter(
IN PCHAR *String
);
CODE_SEG("INIT")
VOID
NTAPI
FinalizeBootLogo(
VOID
);
//
// Headless Terminal Support Functions
//

View file

@ -124,6 +124,7 @@ list(APPEND SOURCE
${REACTOS_SOURCE_DIR}/ntoskrnl/fstub/fstubex.c
${REACTOS_SOURCE_DIR}/ntoskrnl/fstub/halstub.c
${REACTOS_SOURCE_DIR}/ntoskrnl/fstub/translate.c
${REACTOS_SOURCE_DIR}/ntoskrnl/inbv/bootanim.c
${REACTOS_SOURCE_DIR}/ntoskrnl/inbv/inbv.c
${REACTOS_SOURCE_DIR}/ntoskrnl/inbv/inbvport.c
${REACTOS_SOURCE_DIR}/ntoskrnl/io/iomgr/adapter.c

View file

@ -41,14 +41,14 @@ typedef enum _INBV_DISPLAY_STATE
typedef
BOOLEAN
(NTAPI *INBV_RESET_DISPLAY_PARAMETERS)(
ULONG Cols,
ULONG Rows
_In_ ULONG Cols,
_In_ ULONG Rows
);
typedef
VOID
(NTAPI *INBV_DISPLAY_STRING_FILTER)(
PCHAR *Str
_Inout_ PCHAR* String
);
#endif