OcConsoleLibInternal.h 2.1 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/** @file
  Copyright (C) 2020, vit9696. All rights reserved.

  All rights reserved.

  This program and the accompanying materials
  are licensed and made available under the terms and conditions of the BSD License
  which accompanies this distribution.  The full text of the license may be found at
  http://opensource.org/licenses/bsd-license.php

  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/

#ifndef OC_CONSOLE_LIB_INTERNAL_H
#define OC_CONSOLE_LIB_INTERNAL_H

#include <Library/OcConsoleLib.h>
19
#include <Protocol/ConsoleControl.h>
20
#include <Protocol/GraphicsOutput.h>
21
#include <Protocol/SimpleTextOut.h>
22 23
#include <Protocol/UgaDraw.h>

24 25 26
#define DEFAULT_COLOUR_DEPTH 32
#define DEFAULT_REFRESH_RATE 60

27 28 29 30 31
typedef struct {
  EFI_GRAPHICS_OUTPUT_PROTOCOL  *GraphicsOutput;
  EFI_UGA_DRAW_PROTOCOL         Uga;
} OC_UGA_PROTOCOL;

32 33 34 35 36
typedef struct {
  EFI_UGA_DRAW_PROTOCOL         *Uga;
  EFI_GRAPHICS_OUTPUT_PROTOCOL  GraphicsOutput;
} OC_GOP_PROTOCOL;

37
EFI_STATUS
38
OcSetConsoleResolutionForProtocol (
39
  IN  EFI_GRAPHICS_OUTPUT_PROTOCOL    *GraphicsOutput,
40 41
  IN  UINT32                          Width  OPTIONAL,
  IN  UINT32                          Height OPTIONAL,
42
  IN  UINT32                          Bpp    OPTIONAL
43 44
  );

45
EFI_STATUS
46
OcSetConsoleModeForProtocol (
47 48 49 50 51 52
  IN  EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL  *TextOut,
  IN  UINT32                           Width,
  IN  UINT32                           Height
  );

EFI_STATUS
53 54 55 56 57 58
OcConsoleControlInstallProtocol (
  IN  EFI_CONSOLE_CONTROL_PROTOCOL     *NewProtocol,
  OUT EFI_CONSOLE_CONTROL_PROTOCOL     *OldProtocol  OPTIONAL,
  OUT EFI_CONSOLE_CONTROL_SCREEN_MODE  *OldMode  OPTIONAL
  );

59
EFI_STATUS
60
OcUseBuiltinTextOutput (
61
  IN EFI_CONSOLE_CONTROL_SCREEN_MODE  Mode
62 63
  );

64
EFI_STATUS
65 66 67 68 69 70
OcUseSystemTextOutput (
  IN OC_CONSOLE_RENDERER          Renderer,
  IN BOOLEAN                      IgnoreTextOutput,
  IN BOOLEAN                      SanitiseClearScreen,
  IN BOOLEAN                      ClearScreenOnModeSwitch,
  IN BOOLEAN                      ReplaceTabWithSpace
71 72
  );

73
#endif // OC_CONSOLE_LIB_INTERNAL_H