Core DEPUI functions
This module is the core DEPUI module. It contains code for:
Part of the depui library.
MX_EVENT
Event types
# define mx_event(o,t,d,l)
Send an event
This macro sends an event to an object. (../include/depui/corepui.h)
# define mx_eventmatch(e,o)
Check if two events match with type and destination
This macro is useful in window event handler to recognize events for different objects. (../include/depui/corepui.h)
# define mx_dirty(o,c)
Mark an object for later redraw
This macro marks an object derived from MX_OBJ and optionally its children as for later redraw. (../include/depui/corepui.h)
# define MXOBJ(o)
Convert to base MX_OBJ class
# define MXID(o)
Get an objects ID number
This macro returns the id number associated with an object. (../include/depui/corepui.h)
# define MXCLASS(o)
Return an objects class
# define mx_x(o)
Return the X-coordinate of an MX_OBJ
# define mx_y(o)
Return the Y-coordinate of an MX_OBJ
# define mx_place(o,r)
Place an MX_OBJ at a given recyangle
# define mx_position(o,x,y,w,h)
Position an MX_OBJ at given coordinates
# define mx_move(o,x,y)
Move an MX_OBJ to a given poistion
# define mx_resize(o,w,h)
Resize an MX_OBJ to a given width and height
# define mx_geometry(o)
Make an object check/correct its geometry
This macro causes a MX_GEOMETRY event to be sent to an object. The object should do any internal processing necessary so the object functions properly with the current poistion and size. (../include/depui/corepui.h)
MX_RECT* mx_defaultrect_data(void)
Get default rect informatoin
When handling a MX_DEFAULTRECT event, and object can call this function to
get information as to where to put the default rect information.
(../include/depui/corepui.h)
During handling the MX_DEFAULTRECT event an object should call this
function to indicate its desired area.
(../include/depui/corepui.c)
This function should only be called while handling an MX_DEFAULTRECT event. (../include/depui/corepui.c)
# define mx_defaultrect(o,r)
Find out what size/position and object wants to have
This macro causes a MX_DEFAULTRECT event to be sent to an object derived from MX_OBJ. (../include/depui/corepui.h)
# define mx_layout(o,f,r,x,y)
Set the layout of an MX_OBJ
# define mx_armed(o)
Return if an MX_OBJ is armed or not
# define mx_selected(o)
Return if an MX_OBJ is selected or not
# define mx_select(o,s)
Select an MX_OBJ
# define mx_disable(o,d)
Disable an MXOBJ
# define mx_disabled(o)
Return if a MX_OBJ is disabled or not
# define mx_wantmove(o,w)
Determine if an object recieves MX_POINTER_MOVE events
# define mx_wantpointer(o,w)
Determine if an object will recieve MX_POINTER_* events
# define mx_haspointer(o)
Determine if an object has the pointer
# define mx_wantfocus(o,w)
Determine if an object wants the focus or not
This function return non-zero if the focus was changed. In this case the object probaly needs to be marked as dirty. (../include/depui/corepui.h)
# define mx_focused(o)
Return if an MX_OBJ is focused or not
# define mx_focus_default(o)
Set a object to be the default focus object
This function returns non-zero if the object immediatly received the focus i.e. no other object has the focus at that moment. (../include/depui/corepui.h)
void mx_obj_class(void)
Class function for MX_OBJECT
# define mx_obj(o,c,s,p,i)
Construct an MX_OBJ object
# define MXTEXTUAL(o)
Convert to MX_TEXTUAL base class
# define mx_text_set(o,t,l,f)
Set the text of a MX_TEXTUAL object
# define mx_text_setcopy(o,t,l)
Set the text of a MX_TEXTUAL object to a copy of some text
# define mx_text_font(o,f)
Set the font associated with the MX_TEXTUAL object
# define mx_text(o,l)
Return the text of a MX_TEXTUAL object
# define mx_text_align(o,a)
Set the alignment associated with the MX_TEXTUAL object
# define mx_text_align_get(o)
Return the alignment associated with the MX_TEXTUAL object
void mx_textual_class(void)
Class function for MX_TEXTUAL
# define mx_textual(m,s,p,i)
Construct a MX_TEXTUAL object
# define MXBUTTON(o)
Convert to MX_BUTTON base class
void mx_button_class(void)
Class function for MX_BUTTON
# define mx_button(m,s,p,i)
Construct a button
typedef void (*MX_HANDLER) (struct MX_WIN* win);
Event handler
Functions of this type are assoctaied with windows. These functions process all events bieng passed to all objects within the window. (../include/depui/corepui.h)
MX_WIN
A window object
# define MXWIN(o)
Convert to base MX_WIN class
This macro does a typesafe conversion between an object derived from MX_WINDOW and the underlying window. (../include/depui/corepui.h)
void mx_win_class(void)
Class function for MX_WIN
void mx_win_handler(MX_WIN* win)
The default window handler function
(../include/depui/corepui.h)
!The default window handler
(../include/depui/corepui.c)
void mx_default_handler(void)
The default window handler function
(../include/depui/corepui.h)
!The default window handler
(../include/depui/corepui.c)
If any object of a window is pressed, the window is brought to the top. (../include/depui/corepui.c)
This function passes the event to the desination object. (../include/depui/corepui.c)
# define mx_win(w,s,h,i)
Construct a standard window (and border)
# define mx_basicwin(w,s,h,i)
Construct a basic window (no boprder)
# define mx_active(w)
Is window active?
This function returns non-zero if an object derivded from MX_WIN is the active window. This macro is just a wrapper for mx_win_active(). (../include/depui/corepui.h)
# define mx_win_dirty(w)
Mark a window for later redraw
This function marks a window and its border for redraw (../include/depui/corepui.h)
# define mx_modal(w)
Make a window modal
This macro marks a window as modal. This means that no interaction can take place with a parent window while a child modal window is open. (../include/depui/corepui.h)
void mx_winborder_class(void)
Class function for MX_WINBORDER
# define mx_winborder(b,s,o,i)
Create a border for a window
# define mx_win_noresize(w,res)
Make a window resizeable/unresizable
# define mx_win_noclose(w,res)
Make a window closeable/uncloseable
# define mx_win_nomove(w,res)
Make a window moveable/unmoveable
# define mx_win_notitle(w,res)
Make a window have no title
# define mx_win_rootchild(w)
Make a window a child of the root window
unsigned int mx_emit(MX_EVENT event, const void* data, unsigned int datalen)
Emit an event to parent object
This function informs the current objects parent of an event. This is indended for very local communication. This is used between scrollbars (MX_SLIDER) and scrollabale areas (MX_SCROLL) to indicate movement of the scrollbar. (../include/depui/corepui.c)
unsigned int mx_inform(MX_EVENT event, const void* data, unsigned int datalen)
Inform parent window of event
This function passes an event to a parent window of the object/window currently handling an event. This is intended for child windows to pass events to thier parents without explicitly knowing who thier parent are. (../include/depui/corepui.c)
void mx_answer(unsigned int answer)
Set the answer to an event
This function sets the return value of the event. (../include/depui/corepui.c)
This function does not force an end to event handling, you have to do that by returning from the event handler. (../include/depui/corepui.c)
If this function is called twice during the handling of the event then the first return value is forgotten and the last one is used. (../include/depui/corepui.c)
void mx_theme_set(const MX_THEME* theme)
Set the current theme
This function changes the current theme. (../include/depui/corepui.c)
This function does nothing if the requested theme is already being used. (../include/depui/corepui.c)
The current theme is stopped before trying the new one. (../include/depui/corepui.c)
If the new theme cannot be started the previous theme is restarted. (../include/depui/corepui.c)
If both the new theme and the previous theme can't be started the default theme for the platform is found and started. (../include/depui/corepui.c)
If we get here then NO themes, not even the default, work anymore. Indicate some kind of (platform specific?) fatal error. (../include/depui/corepui.c)
When the new theme is started successfully, all objects in the main tree get an MX_THEME_CHANGE event so that they can change their sizes or geometry to handle the new theme properly. (../include/depui/corepui.c)
MX_GUIFONT* mx_guifont_load(const char* filename, const char* text)
Load a gui font from a file
The request is passed on to the platform code and the DEPUI core code keeps track of what fonts are in use and what fonts need deleting. (../include/depui/corepui.c)
MX_GUIFONT* mx_guifont_index(int i)
Returns the available gui fonts.
Pass a number less than 0 and the default font will be returned. (../include/depui/corepui.c)
Lower indicies return platform builtin fonts. (../include/depui/corepui.c)
Higher indicies return platform loaded fonts. (../include/depui/corepui.c)
Too high indicies returns 0. (../include/depui/corepui.c)
const char* mx_guifont_text(const MX_GUIFONT* guifont)
Get font desriptive text
This function return a portion of descriptive text for a font put there by the platform code. (../include/depui/corepui.c)
void mx_guifont_default(MX_GUIFONT* guifont)
Set the default gui font
const MX_POINTER_INFO* mx_pointer_info(void)
Returns pointer information
It can be called at any time. (../include/depui/corepui.c)
unsigned mx_pointer_hold(void)
Hold the pointer
If the object handling the current event is pointed to by the pointer
then the object will keep recieving pointer messages even if the pointer
leaves the object. This can be 'turned off' by calling mx_pointer_release()
.
(../include/depui/corepui.c)
If the current object does not have the pointer then this function does nothing. (../include/depui/corepui.c)
This function return non-zero if the pointer has been successfully held. (../include/depui/corepui.c)
unsigned mx_pointer_release(void)
Release the pointer
If the object handling the current event has the pointer held using
mx_pointer_hold()
then this function 'releases' the pointer.
(../include/depui/corepui.c)
If the current object is not holding the pointer then this function does nothing. (../include/depui/corepui.c)
This function return non-zero if the pointer has been successfully released. (../include/depui/corepui.c)
const MX_KEY_INFO* mx_key_info(void)
Return keypress information.
This function should only be called when handling a MX_KEY or MX_KEY_UNUSED event. (../include/depui/corepui.c)
static void mx__destroy(void* atom)
Should drawing be done in destructor? if (mx_tree_parent(obj)) mx_platform_dirty(MXRECT(obj)); (../include/depui/corepui.c)
const MX_RECT* mx_expose_rect(void)
While handling an MX_EXPOSE event we can find out what area of the screen is being exposed. (../include/depui/corepui.c)
unsigned mx_exposing(void)
This function can only be used while handling an MX_EXPOSE event. It determines wether we are actually exposing the object or are just pretending to expose so that we can find out what portions of the screen are used by the object. This function should probably not be used by end users, only by theme designers. (../include/depui/corepui.c)
static void mx__expose(MX_OBJ_DATA* obj, const MX_RECT* rect)
MX_EXPOSE events dont get passed to the window handler. Instead they go directly to the object class function. (../include/depui/corepui.c)
void mx_expose_background(const MX_RECT* rect)
This function can be used while handling an MX_EXPOSE event to tell the drawing code to make sure that underlying objects are drawn first. This is necessary when drawing transparent or non-rectangular objects. This function is probably only useful for theme designers. (../include/depui/corepui.c)
unsigned mx_start(void)
The initialization function for DEPUI.
If DEPUI has already been started then this function does nothing. (../include/depui/corepui.c)
The default theme is started. (../include/depui/corepui.c)
The default and built-in fonts are loaded. (../include/depui/corepui.c)
The root window is created. (../include/depui/corepui.c)
This function returns non-zero if initialization succeeded. (../include/depui/corepui.c)
int mx_execute(void)
The main gui loop for DEPUI
If the gui has not yet been initialized with mx_start() this function calls mx_start() now. (../include/depui/corepui.c)
If this function is being called recursively it returns immediately. This possibility makes the source code for a simple main gui function and launching a gui window to be exactly the same. (../include/depui/corepui.c)
The first time this function is called it loops until the gui is closed. (../include/depui/corepui.c)
If the screen dimensions change between interation of the main gui loop then the root object is adjusted to fill the entire screen and the entire screen is marked for redrawing. (../include/depui/corepui.c)
The guimain loop will stop if there are no child objects. (../include/depui/corepui.c)
If the pointer is moved over an object and that object has called mx_obj_wantmove(true) then the object will recieve a MX_POINTER_MOVE event whenever the pointer moves over the object. See the function mx_obj_wantmove(). (../include/depui/corepui.c)
If an object calls mx_pointer_hold() the the object will continue recieving pointer messages even after the pointer actually leaves the area of the object on screen. See the function mx_pointer_hold(). (../include/depui/corepui.c)
If the pointer enters or leaves the area of the object on screen then the appropriate object recieve MX_POINTER_LEAVE and MX_POINTER_ENTER events. These event do not occur if an object has called mx_pointer_hold(). (../include/depui/corepui.c)
If the pointer is pressed or released then the approriate object recieves MX_POINTER_PRESS or MX_POINTER_RELEASE events. (../include/depui/corepui.c)
If a key is pressed the focus object gets a MX_KEY event. If the focus object uses the key then it should return non-zero from the event handler (see function mx_answer()). If event handler return zero then the objects window will recieve a MX_KEY_UNUSED event. (../include/depui/corepui.c)
Generated by MXDOC 2.2 on Sun Feb 4 15:16:27 2007