[refactor] Organize INT
This commit is contained in:
@@ -3,11 +3,12 @@
|
||||
// 这个文件存在的目的是让graphics的draw功能不用每次传 GOP hr vr base
|
||||
|
||||
#include <efi.h>
|
||||
#include <common.h>
|
||||
|
||||
struct gfx_context {
|
||||
EFI_GRAPHICS_OUTPUT_PROTOCOL *GOP;
|
||||
unsigned int hr;
|
||||
unsigned int vr;
|
||||
SUINT32 hr;
|
||||
SUINT32 vr;
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *base;
|
||||
};
|
||||
|
||||
@@ -15,13 +16,13 @@ extern gfx_context g_gfx;
|
||||
|
||||
struct draw_target {
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *buf;
|
||||
unsigned int w;
|
||||
unsigned int h;
|
||||
SUINT32 w;
|
||||
SUINT32 h;
|
||||
};
|
||||
|
||||
extern draw_target g_draw_target;
|
||||
|
||||
void gfx_init(EFI_GRAPHICS_OUTPUT_PROTOCOL *GOP);
|
||||
void gfx_clear(void);
|
||||
void draw_set_target(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *buf, unsigned int w, unsigned int h);
|
||||
void draw_set_target(EFI_GRAPHICS_OUTPUT_BLT_PIXEL *buf, SUINT32 w, SUINT32 h);
|
||||
void draw_set_default_target(void);
|
||||
@@ -3,10 +3,10 @@
|
||||
#include <efi.h>
|
||||
#include <graphics/context.h>
|
||||
|
||||
void global_draw_pixel(unsigned int x, unsigned int y, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);
|
||||
void global_draw_rect(unsigned int bx, unsigned int by, unsigned int ex, unsigned int ey,
|
||||
void global_draw_pixel(SUINT32 x, SUINT32 y, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);
|
||||
void global_draw_rect(SUINT32 bx, SUINT32 by, SUINT32 ex, SUINT32 ey,
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);
|
||||
|
||||
void draw_pixel(unsigned int x, unsigned int y, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);
|
||||
void draw_rect(unsigned int bx, unsigned int by, unsigned int ex, unsigned int ey,
|
||||
void draw_pixel(SUINT32 x, SUINT32 y, EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);
|
||||
void draw_rect(SUINT32 bx, SUINT32 by, SUINT32 ex, SUINT32 ey,
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL color);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <efi.h>
|
||||
#include <common.h>
|
||||
|
||||
#define LAYER_MAX 32
|
||||
#define LAYER_NAME_LEN 32
|
||||
@@ -16,9 +17,9 @@ typedef struct layer {
|
||||
UINT32 id;
|
||||
char name[LAYER_NAME_LEN];
|
||||
layer_type_t type;
|
||||
int x, y;
|
||||
SSINT32 x, y;
|
||||
UINT32 w, h;
|
||||
int z;
|
||||
SSINT32 z;
|
||||
bool visible;
|
||||
EFI_GRAPHICS_OUTPUT_BLT_PIXEL* buffer;
|
||||
struct layer* next;
|
||||
@@ -30,8 +31,8 @@ void layer_init(void);
|
||||
// Layer management
|
||||
layer_t* layer_create(const char* name, layer_type_t type, UINT32 w, UINT32 h);
|
||||
void layer_destroy(layer_t* layer);
|
||||
void layer_set_z(layer_t* layer, int z);
|
||||
void layer_set_pos(layer_t* layer, int x, int y);
|
||||
void layer_set_z(layer_t* layer, SSINT32 z);
|
||||
void layer_set_pos(layer_t* layer, SSINT32 x, SSINT32 y);
|
||||
void layer_set_visible(layer_t* layer, bool visible);
|
||||
layer_t* layer_get_by_id(UINT32 id);
|
||||
layer_t* layer_get_focused(void);
|
||||
|
||||
Reference in New Issue
Block a user