<commit_before>#ifndef _EFIDROID_MENU_PRIVATE_H_
#define _EFIDROID_MENU_PRIVATE_H_

#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/EFIDroid.h>
#include <Library/BaseMemoryLib.h>
#include <Protocol/GraphicsOutput.h>
#include <Protocol/SimpleTextIn.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <LittleKernel.h>

#define INCBIN(symname, sizename, filename, section)                    \
    __asm__ (".section " section "; .align 4; .globl "#symname);        \
    __asm__ (""#symname ":\n.incbin \"" filename "\"");                 \
    __asm__ (".section " section "; .align 1;");                        \
    __asm__ (""#symname "_end:");                                       \
    __asm__ (".section " section "; .align 4; .globl "#sizename);       \
    __asm__ (""#sizename ": .long "#symname "_end - "#symname " - 1");  \
    extern unsigned char symname[];                                     \
    extern unsigned int sizename

#define INCFILE(symname, sizename, filename) INCBIN(symname, sizename, filename, ".rodata")

extern EFI_GRAPHICS_OUTPUT_PROTOCOL *mGop;
extern lkapi_t* mLKApi;

extern UINT8 mColorRed;
extern UINT8 mColorGreen;
extern UINT8 mColorBlue;
extern UINTN mDPI;
extern BOOLEAN mAutoFlush;

STATIC inline
UINTN
dp2px (
  UINTN dp
)
{
  return (dp * (mDPI / 160));
}

STATIC inline
UINTN
px2dp (
  UINTN px
)
{
  return (px / (mDPI / 160));
}

EFI_STATUS
TextInit (
  VOID
);

VOID
SetColor (
  UINT8 Red,
  UINT8 Green,
  UINT8 Blue
);

VOID
SetDensity (
  UINTN Density
);

VOID
SetFontSize (
  UINTN Size,
  UINTN LineHeight
);<commit_msg>Library: MenuLib: fix rounding failures in dp<->px conversion<commit_after>#ifndef _EFIDROID_MENU_PRIVATE_H_
#define _EFIDROID_MENU_PRIVATE_H_

#include <Library/BaseLib.h>
#include <Library/DebugLib.h>
#include <Library/EFIDroid.h>
#include <Library/BaseMemoryLib.h>
#include <Protocol/GraphicsOutput.h>
#include <Protocol/SimpleTextIn.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/MemoryAllocationLib.h>
#include <LittleKernel.h>

#define INCBIN(symname, sizename, filename, section)                    \
    __asm__ (".section " section "; .align 4; .globl "#symname);        \
    __asm__ (""#symname ":\n.incbin \"" filename "\"");                 \
    __asm__ (".section " section "; .align 1;");                        \
    __asm__ (""#symname "_end:");                                       \
    __asm__ (".section " section "; .align 4; .globl "#sizename);       \
    __asm__ (""#sizename ": .long "#symname "_end - "#symname " - 1");  \
    extern unsigned char symname[];                                     \
    extern unsigned int sizename

#define INCFILE(symname, sizename, filename) INCBIN(symname, sizename, filename, ".rodata")

extern EFI_GRAPHICS_OUTPUT_PROTOCOL *mGop;
extern lkapi_t* mLKApi;

extern UINT8 mColorRed;
extern UINT8 mColorGreen;
extern UINT8 mColorBlue;
extern UINTN mDPI;
extern BOOLEAN mAutoFlush;

STATIC inline
UINTN
dp2px (
  UINTN dp
)
{
  return ((dp * mDPI) / 160);
}

STATIC inline
UINTN
px2dp (
  UINTN px
)
{
  return ((px * 160) / mDPI);
}

EFI_STATUS
TextInit (
  VOID
);

VOID
SetColor (
  UINT8 Red,
  UINT8 Green,
  UINT8 Blue
);

VOID
SetDensity (
  UINTN Density
);

VOID
SetFontSize (
  UINTN Size,
  UINTN LineHeight
);
{'fraction_non_alphanumeric': 0.12432915921288014, 'fraction_numerical': 0.01073345259391771, 'mean_word_length': 2.8474770642201834, 'pattern_counts': {'":': 4, '<': 22, '<?xml version=': 0, '>': 22, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5592815', 'n_tokens_mistral': 1249, 'n_tokens_neox': 1197, 'n_words': 283}