[mainpage]
[tags]
A GPL portable gui library
Take a look at the [changelog]
[Page at Freshmeat]
Download [DEPUI 3.0 (stable)]
[DEPUI 3.3 (Work-in-progress)]
DEPUI is a small extremely portable user interface library. It uses an object oriented C API with reference counting for
many of the objects. The majority of DEPUI souce code is independant of the supporting graphics library, all
platform dependent functions are in a single file. DEPUI uses the
DEDS library for data structures and the
DETK library for assorted gui functions. For drawing on the screen
DEPUI can use several different libraries:
- DEGFX (tested on djgpp, mingw, Borland free compiler, Open Watcom, linux svgalib)
- Allegro (tested on DOS)
- MGRX (tested on djgpp, mingw, x11 and linux framebuffer)
- Borland Turbo C++ 3.1 DOS compiler using BGI graphics
Features:
- Clean object oriented C API
- Memory efficient and fast
- Extensive documentation using MXDOC 2.0,
Doxygen and GNU GLobal
- Themes and GFX mode changable at runtime
- Widgets:
- Text objects
- Editable text objects
- Buttons
- Horizontal and vertical sliders
- Scrollable area
- Lists with scrollbars if necessary
- Windows and window borders
- Child windows and modal windows
- Graphic mode/theme window
- File selector window
- Font selector window and run-time loadable fonts (depending on the platform)
- Objects can be transparent and can have any shape
- Library source is completly self-contained - You dont have to link to external libraries, not even to DEPUI!
- DEPUI uses #define flags to determine which modules to use. This guarantees that only the portions of DEPUI that you
actually use get included in your executable.
- All platform dependant code in a single file for platform/theme code
- Runs on almost any hardware, even my 40 MHz 386 test machine
- Compiles with no changes on MSB first or LSB first hardware
- Open source and GPL licence
(../include/depui/depui.h)modules:
documented objects:
- MX_ALERT
Basic alert window
- # define mx_alert(id)
Create a basic alert window.
- MX_EVENT
Event types
- # define mx_event(o,t,d,l)
Send an event
- # define mx_eventmatch(e,o)
Check if two events match with type and destination
- # define mx_dirty(o,c)
Mark an object for later redraw
- # define MXOBJ(o)
Convert to base MX_OBJ class
- # define MXID(o)
Get an objects ID number
- # 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
- MX_RECT* mx_defaultrect_data(void)
Get default rect informatoin
- # define mx_defaultrect(o,r)
Find out what size/position and object wants to have
- # 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
- # 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
- 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
- MX_WIN
A window object
- # define MXWIN(o)
Convert to base MX_WIN class
- void mx_win_class(void)
Class function for MX_WIN
- void mx_win_handler(MX_WIN* win)
The default window handler function
- void mx_default_handler(void)
The default window handler function
- # 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?
- # define mx_win_dirty(w)
Mark a window for later redraw
- # define mx_modal(w)
Make a window modal
- 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
- unsigned int mx_inform(MX_EVENT event, const void* data, unsigned int datalen)
Inform parent window of event
- void mx_answer(unsigned int answer)
Set the answer to an event
- void mx_theme_set(const MX_THEME* theme)
Set the current theme
- MX_GUIFONT* mx_guifont_load(const char* filename, const char* text)
Load a gui font from a file
- MX_GUIFONT* mx_guifont_index(int i)
Returns the available gui fonts.
- const char* mx_guifont_text(const MX_GUIFONT* guifont)
Get font desriptive text
- void mx_guifont_default(MX_GUIFONT* guifont)
Set the default gui font
- const MX_POINTER_INFO* mx_pointer_info(void)
Returns pointer information
- unsigned mx_pointer_hold(void)
Hold the pointer
- unsigned mx_pointer_release(void)
Release the pointer
- const MX_KEY_INFO* mx_key_info(void)
Return keypress information.
- static void mx__destroy(void* atom)
- const MX_RECT* mx_expose_rect(void)
- unsigned mx_exposing(void)
- static void mx__expose(MX_OBJ_DATA* obj, const MX_RECT* rect)
- void mx_expose_background(const MX_RECT* rect)
- unsigned mx_start(void)
The initialization function for DEPUI.
- int mx_execute(void)
The main gui loop for DEPUI
- MX_EDITTEXT
An editable text object
- # define MXEDITTEXT(o)
Convert to base MX_EDITTEXT object
- # define mx_edittext(m,s,p,i)
Create an editable text object
- # define mx_edittext_zeroterminate(e)
Force zero termination if internal string
- # define mx_edittext_cursorpos(e,p)
Set cursor position
- # define mx_edittext_cursorscroll(e)
Make the MX_EDITTEXT request a scroll to make the cursor visible
- void mx__edittext_cursorpos(MX_EDITTEXT_DATA* edit, int newpos)
- void mx_edittext_class(void)
- MX_FILESEL
File selector window
- # define mx_filesel(id)
Create a file selector window
- void mx_filesel_refresh(MX_FILESEL* sel)
Refresh file selector contents
- void mx_filesel_handler(MX_WIN* win)
- MX_FILESEL* mx_fileselwin(MX_FILESEL* sel, size_t size, MX_HANDLER handler, int theid)
Create file selector
- MX_FONTSEL
A font seletion window
- # define mx_fontsel(id)
Create a font selector window
- void mx_fontsel_refresh(MX_FONTSEL* fsel)
- MX_FONTSEL* mx_fontselwin(MX_FONTSEL* fsel, size_t size, MX_HANDLER handler, int theid)
- MX_GUIFONT* mx_fontsel_info(const int idnum)
Font selection information
- MX_GFXSEL
Graphics mode selector
- # define mx_gfxsel(id)
Create a graphics mode and theme selector.
- MX_GFXSEL_INFO
Graphics mode selector information
- void mx_gfxsel_handler(MX_WIN* win)
- MX_GFXSEL* mx_gfxselwin(MX_GFXSEL* sel, size_t size, MX_HANDLER handler, int theid)
- MX_GFXSEL_INFO* mx_gfxsel_info(const int idnum)
- MX_LISTELEM
A list element type
- # define MXLISTELEM(o)
Convert to MX_LISTELEM base object
- void mx_listelem_class(void)
Class function for MX_LISTELEM
- # define mx_listelem(l,s,p,i)
Construct a list element
- MX_LIST
A scrollable list object
- # define MXLIST(o)
Convert to MX_LIST base class
- void mx_list_class(void)
Class function for MX_LIST
- # define mx_list(m,s,p,i)
Create a MX_LIST object
- # define mx_list_append(l,t,le,f,id)
Append list element from text
- # define mx_list_multiple(l,m)
Determine if a list allows multiple selected items
- # define mx_list_select_id(l,i,d)
Select list elements with a given ID number
- # define mx_list_selected(l,p)
Return first selection in list
- # define mx_list_selected_id(l)
Return the ID number of the first selection
- # define mx_list_first(l)
Return the first list element
- # define mx_list_last(l)
Return the last list element
- # define mx_list_empty(l)
Remove all list elements
- # define mx_list_next(l)
Return the following list element
- # define mx_list_prev(l)
Return the previous list element
- unsigned int mx_platform_font_width(void* pfont, const char* text, int len)
- MX_SCROLL
Scrollable area
- # define MXSCROLL(o)
Convert to MX_SCROLL base object
- void mx_scroll_class(void)
Class function for MX_SCROLL
- # define mx_scroll(s,si,p,i)
Create scrollable area
- # define mx_scroll_reset(s)
Reset a MX_SCROLL area
- MX_SCROLL2
Scrollable area with title
- # define MXSCROLL2(o)
Convert to MX_SCROLL2 base object
- MX_SLIDER
Slider type
- # define MXSLIDER(o)
Convert to MX_SLIDER base object
- # define mx_slider_set(s,r,si,v)
Set the slider range size and value
- # define mx_slider_to(s,v)
Move slider to a given position
- # define mx_slider_value(s)
Return the slider value
- void mx_vslider_class(void)
Class function for vertical MX_SLIDER
- # define mx_vslider(s,si,p,i)
Create vertical slider
- void mx_hslider_class(void)
Class function for horizontal MX_SLIDER
- # define mx_hslider(s,si,p,i)
Create horizontal slider
- void mx__slider_set(MX_SLIDER_DATA* slider, int range, int size, int value)
- void mx__slider_to(MX_SLIDER_DATA* slider, int value)
- static void mx__sysmenu_popup(void)
- void mx_sysmenu(void)
Create a system menu
- MX_TEXTEDITOR
Text editor
- # define mx_texteditor(id)
Create a text editor window.
- MX_THEMESEL
A theme seletion window
- # define mx_themesel(id)
Create a theme selector window
- void mx_themesel_refresh(MX_THEMESEL* sel)
- void mx_themesel_handler(MX_WIN* win)
- MX_THEMESEL* mx_themeselwin(MX_THEMESEL* sel, size_t size, MX_HANDLER handler, int theid)
- const MX_THEME* mx_themesel_info(const int idnum)
theme selection information
Generated by MXDOC 2.2 on Sun Feb 4 15:16:27 2007