/* gui.h - GUI components header file. */
/*
* GRUB -- GRand Unified Bootloader
* Copyright (C) 2008,2009 Free Software Foundation, Inc.
*
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* GRUB is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRUB. If not, see <http://www.gnu.org/licenses/>.
*/
#include <grub/gfxmenu_view.h>
#ifndef GRUB_GUI_H
/* The component ID identifying GUI components to be updated as the timeout
status changes. */
void *userdata);
/* Component interface. */
struct grub_gui_component_ops
{
};
struct grub_gui_container_ops
{
};
struct grub_gui_list_ops
{
};
struct grub_gui_progress_ops
{
};
struct grub_gfxmenu_timeout_notify
{
};
extern struct grub_gfxmenu_timeout_notify *grub_gfxmenu_timeout_notifications;
static inline grub_err_t
{
if (!ne)
return grub_errno;
return GRUB_ERR_NONE;
}
static inline void
{
struct grub_gfxmenu_timeout_notify **p, *q;
for (p = &grub_gfxmenu_timeout_notifications, q = *p;
{
*p = q->next;
break;
}
}
typedef signed grub_fixed_signed_t;
static inline signed
{
return (a * GRUB_FIXED_1) / b;
}
static inline grub_fixed_signed_t
{
return a / b;
}
static inline signed
{
return (a * b) / GRUB_FIXED_1;
}
static inline signed
{
return in / GRUB_FIXED_1;
}
static inline grub_fixed_signed_t
{
return in * GRUB_FIXED_1;
}
struct grub_gui_component
{
signed x;
signed y;
signed w;
signed h;
};
struct grub_gui_progress
{
};
struct grub_gui_container
{
};
struct grub_gui_list
{
};
/* Interfaces to concrete component classes. */
/* Manipulation functions. */
/* Visit all components with the specified ID. */
const char *id,
void *userdata);
/* Visit all components. */
void *userdata);
/* Helper functions. */
static __inline void
{
grub_video_get_viewport ((unsigned *) &r->x,
(unsigned *) &r->y,
(unsigned *) &r->width,
(unsigned *) &r->height);
}
static __inline void
{
}
/* Set a new viewport relative the the current one, saving the current
viewport in OLD so it can be later restored. */
static __inline void
{
grub_video_set_viewport (old->x + r->x,
old->y + r->y,
r->width,
r->height);
}
static inline int
const grub_video_rect_t *b)
{
if (!((a->x <= b->x && b->x <= a->x + a->width)
|| (b->x <= a->x && a->x <= b->x + b->width)))
return 0;
if (!((a->y <= b->y && b->y <= a->y + a->height)
|| (b->y <= a->y && a->y <= b->y + b->height)))
return 0;
return 1;
}
#endif /* ! GRUB_GUI_H */