2 * GRUB -- GRand Unified Bootloader
3 * Copyright (C) 2002,2003,2005,2007 Free Software Foundation, Inc.
5 * GRUB is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * GRUB is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef GRUB_TERMINFO_HEADER
20 #define GRUB_TERMINFO_HEADER 1
23 #include <grub/types.h>
24 #include <grub/term.h>
26 char *EXPORT_FUNC(grub_terminfo_get_current
) (struct grub_term_output
*term
);
27 grub_err_t
EXPORT_FUNC(grub_terminfo_set_current
) (struct grub_term_output
*term
,
30 #define GRUB_TERMINFO_READKEY_MAX_LEN 6
31 struct grub_terminfo_input_state
33 int input_buf
[GRUB_TERMINFO_READKEY_MAX_LEN
];
35 #if defined(__powerpc__) && defined(GRUB_MACHINE_IEEE1275)
37 grub_uint64_t last_key_time
;
39 int (*readkey
) (struct grub_term_input
*term
);
42 struct grub_terminfo_output_state
44 struct grub_term_output
*next
;
50 char *reverse_video_on
;
51 char *reverse_video_off
;
56 struct grub_term_coordinate size
;
57 struct grub_term_coordinate pos
;
59 void (*put
) (struct grub_term_output
*term
, const int c
);
62 grub_err_t
EXPORT_FUNC(grub_terminfo_output_init
) (struct grub_term_output
*term
);
63 void EXPORT_FUNC(grub_terminfo_gotoxy
) (grub_term_output_t term
,
64 struct grub_term_coordinate pos
);
65 void EXPORT_FUNC(grub_terminfo_cls
) (grub_term_output_t term
);
66 struct grub_term_coordinate
EXPORT_FUNC (grub_terminfo_getxy
) (struct grub_term_output
*term
);
67 void EXPORT_FUNC (grub_terminfo_setcursor
) (struct grub_term_output
*term
,
69 void EXPORT_FUNC (grub_terminfo_setcolorstate
) (struct grub_term_output
*term
,
70 const grub_term_color_state state
);
73 grub_err_t
EXPORT_FUNC (grub_terminfo_input_init
) (struct grub_term_input
*term
);
74 int EXPORT_FUNC (grub_terminfo_getkey
) (struct grub_term_input
*term
);
75 void EXPORT_FUNC (grub_terminfo_putchar
) (struct grub_term_output
*term
,
76 const struct grub_unicode_glyph
*c
);
77 struct grub_term_coordinate
EXPORT_FUNC (grub_terminfo_getwh
) (struct grub_term_output
*term
);
80 grub_err_t
EXPORT_FUNC (grub_terminfo_output_register
) (struct grub_term_output
*term
,
82 grub_err_t
EXPORT_FUNC (grub_terminfo_output_unregister
) (struct grub_term_output
*term
);
84 void grub_terminfo_init (void);
85 void grub_terminfo_fini (void);
87 #endif /* ! GRUB_TERMINFO_HEADER */