unsigned mx_unlock(MX_LOCK* lock)
Destruct a MX_LOCK
This function destroys a MX_LOCK and removes it from it's associated MX_ATOM object. If the object has been flagged for deletion (with the mx_delete() macro) then removal of the last lock caused the MX_ATOM destructor to be called and (if necessary) memory returned to the operating system.
If the release of the lock triggered calling of the object destructor then the function returns non-zero. If this occurs then it is not safe to access the object anymore. If this function returns false then either:
unsigned mx_lastlock(const MX_LOCK* lock)
Find out if a lock is the last one of an object
(../include/deds/atom.h)
(library deds : module atom)
void* mx__atom(MX_ATOM* atom, MX__ATOM_DESTRUCT destruct, size_t datasize)
Construct an MX_ATOM
This internal function constructs an MX_ATOM and registers a destructor to call when the object gets deleted. (../include/deds/atom.c)
If insufficient object size is suggested then the actually allocated memory is increased to safely contain an MX_ATOM. Passing 0 for datasize is safe. (../include/deds/atom.c)
If no existing MX_ATOM memory is given then memory will be allocated. (../include/deds/atom.c)
The address of the newly constructed MX_ATOM is returned.
(../include/deds/atom.c)
(library deds : module atom)
void mx_rect_move(MX_RECT* rrect, int x, int y)
Move a MX_RECT
This function moves a MX_REXT so that the upper left of the rectangle
is at a given x,y, position. The size of the rectangle is not changed.
(../include/deds/rect.c)
(library deds : module rect)
void mx_rect_resize(MX_RECT* rrect, int w, int h)
Resize a MX_RECT
This function resizes a MX_REXT to a given size. The upper left point
of the rectangle does not change.
(../include/deds/rect.c)
(library deds : module rect)
void* mx__rectatom(MX_RECTATOM_DATA* rectatom, MX__ATOM_DESTRUCT destruct, size_t size)
Construct a MX_RECTATOM.
(../include/deds/rectatom.c)
(library deds : module rectatom)
void mx__rectatom_place(MX_RECTATOM_DATA* rectatom, const MX_RECT* rrect)
Place a MX_RECTATOM
This function places a MX_RECTATOM at a specified area.
(../include/deds/rectatom.c)
(library deds : module rectatom)
void mx_string_realloc(MX_STRING* string, const MX_ALLOC alloc, const MX_FREE dfree)
Reallocate a MX_STRING
This function changes the memory allocation of the text inside a
MX_STRING to the ones in the argumnets. Memory is allocated using the alloc
function and the current contents of the string is copied to the newly
allocated memory. The free function will be called when the memory
associated with the text needs to be freed.
(../include/deds/string/realloc.c)
(library deds : module string)
void mx_string_set(MX_STRING* string, const char* text, int len, const MX_FREE dfree)
Set MX_STRING text and length
This function sets the text, length and free function of a MX_STRING object. When mx_string_free() is called the free function will be called to release the memory associated with the text. The free parameter may be 0 in which case no function will be called to release the text memory. (../include/deds/string/set.c)
If the len parameter is less than 0 (usually -1) then the string
is assumed to be zero terminated.
(../include/deds/string/set.c)
(library deds : module string)
void mx_string(MX_STRING* string)
Construct a MX_STRING
This function initializes a MX_STRING object. It writes the memory full with 0 values. (../include/deds/string/string.c)
Since a MX_STRING filled with 0 is correctly constructed then
static instances dont necessarily have to be constructed before use.
(../include/deds/string/string.c)
(library deds : module string)
void mx_string_free(MX_STRING* string)
Destruct a MX_STRING
This function frees a MX_STRING object. If the associated free
will be called to release any internal memory.
(../include/deds/string/string.c)
(library deds : module string)
const char* mx_string_text(const MX_STRING* string, int* len)
Get MX_STRING text and length
This function return the text of the string along with the length of the text segment. (../include/deds/string/text.c)
The len argument can be 0 in which case the length is not returned.
(../include/deds/string/text.c)
(library deds : module string)
int mx_string_len(const MX_STRING* string)
Get MX_STRING length
This function return the length of the text segment.
(../include/deds/string/text.c)
(library deds : module string)
size_t mx__vector_makeroom(MX__VECTOR_DATA* vect, const size_t num, const size_t place, const size_t sizeofdata)
During appending we expand vectors by doubling thier size with a
minimum of 16 but a different value might be better in some applications.
Can a reasonable API be made for this?
(../include/deds/vector/makeroom.c)
(library deds : module vector)
MX_BITMAP* mx_bitmap(int x2, int y2)
Create a bitmap
(../include/degfx/bitmap.h)
Bitmap is derived from MX_ATOM so it must be destroyed with mx_delete().
(../include/degfx/bitmap/bitmap.c)
(library degfx : module bitmap)
MX_BITMAP* mx_bitmap_tga(const char* filename)
Load a bitmap from a TGA file
(../include/degfx/bitmap.h)
Source taken from the TGA reader from Allegro and extensively modified.
(../include/degfx/bitmap/loadtga.c)
(library degfx : module bitmap)
MX_BITMAP* mx_bitmap_gif(const char* filename)
Load a bitmap from a GIF file
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
MX_BITMAP* mx_bitmap_pcx(const char* filename)
Load a bitmap from a PCX file
(../include/degfx/bitmap.h)
PCX loading source taken from Allegro source and extensively modified.
(../include/degfx/bitmap/loadpcx.c)
(library degfx : module bitmap)
MX_BITMAP* mx_bitmap_pcx_greyscale(const char* filename)
Load a bitmap from a PCX file and convert it to greyscale
(../include/degfx/bitmap.h)
This function is primarily intended as a helper by font loading.
(../include/degfx/bitmap/loadpcx.c)
(library degfx : module bitmap)
MX_BITMAP* mx_bitmap_clone(const MX_BITMAP* other)
Make a complete copy of a bitmap
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
unsigned mx_bitmap_clip(MX_BITMAP* bitmap, const MX_RECT* newclip)
Set a bitmaps clipping area
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
const MX_RECT* mx_bitmap_clip_get(const MX_BITMAP* bitmap)
Return a bitmaps clipping area
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
void mx_bitmap_offset(MX_BITMAP* bitmap, int x1, int y1)
Offset a bitmap
Subsequent drawing on the bitmap will be offset.
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
MX_BITMAP_ITER mx_bitmap_iter(const MX_BITMAP* bitmap, int x1, int y1)
Return pixel-level iterator at a given position
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
MX_BITMAP_ITER mx_bitmap_begin(const MX_BITMAP* bitmap)
Return pixel-level iterator at the top left position
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
MX_BITMAP_ITER mx_bitmap_end(const MX_BITMAP* bitmap)
Return pixel-level iterator at the lower right position
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
MX_PIXEL mx_bitmap_getpixel(const MX_BITMAP* bitmap, int x1, int y1)
Return pixel a a given position
(../include/degfx/bitmap.h)
If the coordinates are outside the bitmap area then 0 is returned.
(../include/degfx/bitmap/getpixel.c)
(library degfx : module bitmap)
void mx_bitmap_pixel(MX_BITMAP* bitmap, int x1, int y1, MX_PIXEL color)
Draw a pixel on a bitmap
(../include/degfx/bitmap.h)
If the specified coordinates are outside the area of the bitmap then
this function does nothing.
(../include/degfx/bitmap/pixel.c)
(library degfx : module bitmap)
void mx_bitmap_vline(MX_BITMAP* bitmap, int x1, int y1, int y2, MX_PIXEL color)
Draw a vertical line on a bitmap
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
void mx_bitmap_hline(MX_BITMAP* bitmap, int x1, int y1, int x2, MX_PIXEL color)
Draw a horizontal line on a bitmap
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
void mx_bitmap_line(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, MX_PIXEL color)
Draw a line on a bitmap
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
void mx_bitmap_rectfill(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, MX_PIXEL color)
Draw a filled rectangle on a bitmap
(../include/degfx/bitmap.h)
The current implementation uses horizontal lines to fill the rectangle.
(../include/degfx/bitmap/rectfill.c)
(library degfx : module bitmap)
void mx_bitmap_clear(MX_BITMAP* bitmap, MX_PIXEL color)
Clear a bitmap to a solid color
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
void mx_bitmap_blit(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int dx, int dy, int w, int h)
Blit a bitmap onto another bitmap
This function uses the pixel transparency of the source bitmap
(../include/degfx/bitmap.h)
If the w or h parameter is set to MXDEFAULT the source bitmap width
(or height) will be used.
(../include/degfx/bitmap/blit.c)
The curent implementation requires that the source and destination bitmaps be different. (../include/degfx/bitmap/blit.c)
If either of the w or h parameters is less than zer this function does nothing. (../include/degfx/bitmap/blit.c)
The transparency is handeled per pixel and the source determines
the transparency.
(../include/degfx/bitmap/blit.c)
(library degfx : module bitmap)
void mx_bitmap_blitcopy(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int dx, int dy, int w, int h)
Blit a bitmap onto another bitmap
This function uses no transparency
(../include/degfx/bitmap.h)
The curent implementation requires that the source and destination
bitmaps be different.
(../include/degfx/bitmap/blitcopy.c)
If the w or h parameter is set to MXDEFAULT the source bitmap width
(or height) will be used.
(../include/degfx/bitmap/blitcopy.c)
(library degfx : module bitmap)
void mx_bitmap_blittrans(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int dx, int dy, int w, int h, unsigned long trans)
Blit a bitmap onto another bitmap
This function uses the a single transparency level
(../include/degfx/bitmap.h)
The w and h parameters may be MXDEFAULT and the width of the source
bitmap will be used.
(../include/degfx/bitmap/trans.c)
The current implementation requires that the source and destination
bitmaps not refer to the same bitmap.
(../include/degfx/bitmap/trans.c)
(library degfx : module bitmap)
void mx_bitmap_blitstretch(const MX_BITMAP* src, MX_BITMAP* dest, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh)
Stretch-blit a bitmap onto another bitmap
This function uses the pixel transparency of the source bitmap
(../include/degfx/bitmap.h)
The default source poisition is 0,0.
(../include/degfx/bitmap/stretch.c)
The default source height and width is the height and width of the source bitmap. (../include/degfx/bitmap/stretch.c)
The default destination poisition is 0,0. (../include/degfx/bitmap/stretch.c)
The default destinantion height and width is the height and width of the destination bitmap. (../include/degfx/bitmap/stretch.c)
Bitmap stretch algorithm is very simple and could definetly be improved.
(../include/degfx/bitmap/stretch.c)
(library degfx : module bitmap)
void mx_bitmap_box(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, int width, MX_PIXEL light, MX_PIXEL dark)
Draw a box on a bitmap
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
void mx_bitmap_frame(MX_BITMAP* bitmap, int x1, int y1, int x2, int y2, int width, MX_PIXEL light, MX_PIXEL dark, MX_PIXEL fill)
Draw a frame on a bitmap
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
void mx_bitmap_decorate(const MX_BITMAP* src, MX_BITMAP* dest, int x, int y, int x1, int y1, int x2, int y2)
Blitting function for drawing gui objects
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
unsigned mx_bitmap_collision(const MX_BITMAP* src, const MX_BITMAP* dest, int sx, int sy, int dx, int dy, unsigned int thresh)
Check if two bitmaps overlap on any pixels
Pixel level transparency is taken into account
(../include/degfx/bitmap.h)
(library degfx : module bitmap)
bitmap.h" unsigned mx_bitmap_collision(const MX_BITMAP* src, const MX_BITMAP* dest, int sx, int sy, int dx, int dy, unsigned int thresh)
Collision is defined by both bitmaps having a transparency
less than the threshold on overlapping pixels.
(../include/degfx/bitmap/collisio.c)
(library degfx : module bitmap)
bitmap.h" void mx_bitmap_decorate(const MX_BITMAP* src, MX_BITMAP* dest, int x, int y, int x1, int y1, int x2, int y2)
The corners of the source bitmap are copied as normal.
(../include/degfx/bitmap/decorate.c)
(library degfx : module bitmap)
bitmap.h" MX_BITMAP_ITER mx_bitmap_iter(const MX_BITMAP* bitmap, int x1, int y1)
If the pixel position is outside the area of the bitmap then 0 is
returned.
(../include/degfx/bitmap/iter.c)
(library degfx : module bitmap)
void mx_font_default(MX_FONT* font)
The DEGFX system takes over ownership of the specified font. This is
done by creating a reference to the specified font marking the font
for deletion. So the font is guaranteed to be deleted as necessary
whevener no objects have references to the font and a new default font
is set.
(../include/degfx/coregfx.c)
(library degfx : module coregfx)
unsigned mx_gfx_start(MX_GFX_ARGS* userargs)
Start DEGFX and set the graphics mode
If the requested mode has same size, depth, title and driver as the previous one then the graphics mode is not changed. (../include/degfx/coregfx.c)
If the arguments are 0 then default values are used. (../include/degfx/coregfx.c)
A NULL driver means use the current driver or if there is none, then use the default driver. (../include/degfx/coregfx.c)
Function returns 0 if gfx mode set failed. (../include/degfx/coregfx.c)
After successful mode set the screen area contains the screen dimensions. (../include/degfx/coregfx.c)
If a redraw buffer is specified any previous redraw buffer that was allocated will be deleted. (../include/degfx/coregfx.c)
If no redraw buffer specified then one will be allocated and locked. (../include/degfx/coregfx.c)
The session is incremented after every successfull mode set. (../include/degfx/coregfx.c)
The MX_GFX_ARGS struct (if present) is modified to the mode information
actually set by the underlying driver.
(../include/degfx/coregfx.c)
(library degfx : module coregfx)
void mx_gfx_stop(void)
Stop DEGFX
This function stops the graphics mode and (depending on the driver) probably returns to a text mode. It can be called before the program return to the operating system however if the user does not do this it will be done automatically. (../include/degfx/coregfx.c)
The internal graphics redraw buffer is released.
(../include/degfx/coregfx.c)
(library degfx : module coregfx)
const MX_GFX_ARGS* mx_gfx_info(void)
This function returns information about the current graphics mode.
(../include/degfx/coregfx.c)
(library degfx : module coregfx)
void mx_gfx_redraw(MX_REDRAW_FUNC redraw)
This function sets the redraw callback.
(../include/degfx/coregfx.c)
(library degfx : module coregfx)
void mx_gfx_dirty(const MX_RECT* rect)
Mark part of the screen as dirty
This function marks a portion of the screen as dirty.
(../include/degfx/coregfx.c)
(library degfx : module coregfx)
unsigned mx_gfx_poll(void)
Poll the DEGFX grpahics/keyboard/mouse system
This function causes the conditions of the keyboard and mose to be read
from the system. This should be done every time you want to read the keyboard
of the mouse. Most drivers also redraw the screen during the poll.
(../include/degfx/coregfx.c)
(library degfx : module coregfx)
unsigned mx_gfx_pointer(int* x, int* y, int* b)
Get the mouse position and state
This function reads the mouse pointer position and button state. The function return non-zero if a new position has been read. (../include/degfx/coregfx.c)
If arguments are 0 then they are ignored.
(../include/degfx/coregfx.c)
(library degfx : module coregfx)
unsigned mx_gfx_hidepointer(unsigned hide)
Hide the pointer
This only works if DEGFX draws the pointer. This function does nothing on platforms that draw thier own pointer i.e. Win32GDI. (../include/degfx/coregfx.c)
Unlike many other graphics libraries you dont have to hide the pointer
when drawing on the screen. This is not necessary with DEGFX because drawing
takes place on an internal redraw buffer and the mouse is only added when
blitting the innternal redraw buffer to the screen.
(../include/degfx/coregfx.c)
(library degfx : module coregfx)
unsigned mx_gfx_key(int* scan, int* ascii)
Return keypress information
If new keypress information is available the function return non-zero, otherwise no key has been pressed. (../include/degfx/coregfx.c)
If arguments are 0 then they are ignored.
(../include/degfx/coregfx.c)
(library degfx : module coregfx)
void mx_font_default(MX_FONT* font)
Set the default font
(../include/degfx/font.h)
(library degfx : module font)
void mx_font_bitmap_draw(const MX_FONT* font, struct MX_BITMAP* bitmap, const char* text, int len, int x, const int y, const MX_PIXEL fore)
Draw text onto a bitmap
(../include/degfx/font.h)
(library degfx : module font)
void mx_font_bitmap_drawblock(const MX_FONT* font, struct MX_BITMAP* bitmap, const char* text, int len, int x, int y, const MX_PIXEL fore)
Draw a block of text onto a bitmap
(../include/degfx/font.h)
(library degfx : module font)
unsigned int mx_font_height(const MX_FONT* font)
Return the height of a font
(../include/degfx/font.h)
!The height in pixels of a font
This function return the height of a font in pixels.
(../include/degfx/font/fontsize.c)
If the font argument is 0 then the default font be used.
(../include/degfx/font/fontsize.c)
(library degfx : module font)
unsigned int mx_font_width(const MX_FONT* font, const char* text, int len)
Return the width of a portion of text
(../include/degfx/font.h)
(library degfx : module font)
void mx_font_blocksize(const MX_FONT* font, const char* text, int len, int* tw, int* th, int* last)
Return the size of a block for a portion of text
(../include/degfx/font.h)
The size in pixels of multi-line text
This function determines the area in pixels required to draw text on
a bitamp using mx_font_bitmap_drawblock().
(../include/degfx/font/block.c)
If the font argument is 0 then the default font be used.
(../include/degfx/font/block.c)
(library degfx : module font)
void mx_font_bitmap_drawblock(const MX_FONT* font, MX_BITMAP* bitmap, const char* text, int len, int x, int y, const MX_PIXEL fore)
Draw multi-line text onto a bitmap
This function draws text on a bitamp. Newline characters (\r or \r\n) cause the following text to be placed on the following line. (../include/degfx/font/block.c)
If the font argument is 0 then the default font be used. (../include/degfx/font/block.c)
The function mx_font_bitmap_draw() function is used internally
to draw the individual text lines.
(../include/degfx/font/block.c)
(library degfx : module font)
void mx_font_bitmap_draw(const MX_FONT* font, MX_BITMAP* bitmap, const char* text, int len, int x, const int y, const MX_PIXEL fore)
Draw text onto a bitmap
This function draws text on a bitmap at a specific position using a specified font and color. Only the foreground color is drawn, the pixels 'behind' the text are not drawn. (../include/degfx/font/fontdraw.c)
If the font argument is 0 then the default font is used. (../include/degfx/font/fontdraw.c)
If the length argument is less than zero then the string is assumed to be zero terminated (../include/degfx/font/fontdraw.c)
The text drawing is made efficient by skipping text, or portions of
text that will be clipped.
(../include/degfx/font/fontdraw.c)
(library degfx : module font)
unsigned int mx_font_width(const MX_FONT* font, const char* text, int num)
The width in pixels of some text
This function return the width of a portion of text in pixels. (../include/degfx/font/fontsize.c)
If the font argument is 0 then the default font be used. (../include/degfx/font/fontsize.c)
If the length of characters is less than 0 then the text is assumed
to be zero terminated.
(../include/degfx/font/fontsize.c)
(library degfx : module font)
MX_FONT* mx_font_bitmap(const MX_BITMAP* bitmap, int start)
Load a font from a bitmap.
(../include/degfx/font/loadfont.c)
(library degfx : module font)
MX_FONT* mx_font_pcx(const char* filename, int start)
Load a font from a PCX file.
(../include/degfx/font/loadfont.c)
(library degfx : module font)
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)
(library depui : module corepui)
void mx_obj_class(void)
Class function for MX_OBJECT
(../include/depui/corepui.h)
(library depui : module corepui)
void mx_textual_class(void)
Class function for MX_TEXTUAL
(../include/depui/corepui.h)
(library depui : module corepui)
void mx_button_class(void)
Class function for MX_BUTTON
(../include/depui/corepui.h)
(library depui : module corepui)
void mx_win_class(void)
Class function for MX_WIN
(../include/depui/corepui.h)
(library depui : module corepui)
void mx_win_handler(MX_WIN* win)
The default window handler function
(../include/depui/corepui.h)
!The default window handler
(../include/depui/corepui.c)
(library depui : module corepui)
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)
(library depui : module corepui)
void mx_winborder_class(void)
Class function for MX_WINBORDER
(../include/depui/corepui.h)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
void mx_guifont_default(MX_GUIFONT* guifont)
Set the default gui font
(../include/depui/corepui.c)
(library depui : module corepui)
const MX_POINTER_INFO* mx_pointer_info(void)
Returns pointer information
It can be called at any time.
(../include/depui/corepui.c)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
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)
(library depui : module corepui)
void mx__edittext_cursorpos(MX_EDITTEXT_DATA* edit, int newpos)
MX_EDITTEXT needs pageup and page down keys
(../include/depui/edittext.c)
(library depui : module edittext)
void mx_edittext_class(void)
Add handling of other non-printing ascii keys (../include/depui/edittext.c)
Add handling of pageup/pagedown keys
(../include/depui/edittext.c)
(library depui : module edittext)
void mx_filesel_refresh(MX_FILESEL* sel)
Refresh file selector contents
This function refreshes the directory and file lists of the file selector. (../include/depui/filesel.c)
Can we add a list of drive letters to the directory list for DOS?
(../include/depui/filesel.c)
(library depui : module filesel)
void mx_filesel_handler(MX_WIN* win)
Pressing enter/return in the filename area causes the directory and file lists to be refreshed with the new pattern. (../include/depui/filesel.c)
Clicking on the directory list causes the directory and file lists to be refreshed. (../include/depui/filesel.c)
Clicking on the file list selects a file. (../include/depui/filesel.c)
Pressing OK causes a MX_FILESEL_OK event to be sent to the
parent window. WHen halding this event the parent window can call
mx_filesel_info() to get the selected filename. The file selector
widnow is destroyed afetr the MX_FILESEL_OK event.
(../include/depui/filesel.c)
(library depui : module filesel)
MX_FILESEL* mx_fileselwin(MX_FILESEL* sel, size_t size, MX_HANDLER handler, int theid)
Create file selector
This function creates a file selector object with a given handler and id number. (../include/depui/filesel.c)
mx_text_set(&sel->_dirs, "dir", -1, 0); (../include/depui/filesel.c)
mx_text_set(&sel->_files, "file", -1, 0); (../include/depui/filesel.c)
If the len parameter is less than 0 then the path is assumed to be zero terminated. (../include/depui/filesel.c)
!Allow a file selector to accept an existing (the default) or non-existing file (../include/depui/filesel.c)
!File selector information When a file has been selected with a file selector a MX_FILESEL_OK event is sent to the parent window. Then this function can be called to determine the filename selected. (../include/depui/filesel.c)
This function should only be called while handling a MX_FILESEL_OK event. (../include/depui/filesel.c)
The specified id number must match the one of the file selector. (../include/depui/filesel.c)
The returned filename is zero terminated.
(../include/depui/filesel.c)
(library depui : module filesel)
void mx_fontsel_refresh(MX_FONTSEL* fsel)
This function refreshes a font selector dialog with the currently
available fonts. This function should be called after creating the font
selector and before it gets displayed or gets an MX_GEOMETRY event.
(../include/depui/fontsel.c)
(library depui : module fontsel)
MX_FONTSEL* mx_fontselwin(MX_FONTSEL* fsel, size_t size, MX_HANDLER handler, int theid)
mx_text_set(&fsel->_fonts, "fonts", -1, 0);
(../include/depui/fontsel.c)
(library depui : module fontsel)
MX_GUIFONT* mx_fontsel_info(const int idnum)
Font selection information
When a font has been chosen from a font selector dialog the a MX_FONTSEL_OK event is sent to the parent window. This function can be called when handling that event to determine the font selected. (../include/depui/fontsel.c)
This function should only be called when handling an MX_FONTSEL_event. (../include/depui/fontsel.c)
The sepcified id number has to match the one with the selected font.
(../include/depui/fontsel.c)
(library depui : module fontsel)
void mx_gfxsel_handler(MX_WIN* win)
Pressing the OK button sends a MX_GFXSEL_OK event to the parent window and immediatly destroys the graphics mode window. (../include/depui/gfxsel.c)
Pressing the APPLY button sends a MX_GFXSEL_OK event to the
parent window.
(../include/depui/gfxsel.c)
(library depui : module gfxsel)
MX_GFXSEL* mx_gfxselwin(MX_GFXSEL* sel, size_t size, MX_HANDLER handler, int theid)
mx_text_set(&sel->_res, "Resolution", -1, 0); (../include/depui/gfxsel.c)
mx_text_set(&sel->_depth, "Depth", -1, 0); (../include/depui/gfxsel.c)
mx_text_set(&sel->_driver, "Driver", -1, 0);
(../include/depui/gfxsel.c)
(library depui : module gfxsel)
MX_GFXSEL_INFO* mx_gfxsel_info(const int idnum)
When handling a MX_GFXSEL_OK event this function can be called to get information about the graphics mode selected. (../include/depui/gfxsel.c)
This function should only be called while handling a MX_GFXSEL_OK event. (../include/depui/gfxsel.c)
The specified id number must match the one of the gfxsel selector.
(../include/depui/gfxsel.c)
(library depui : module gfxsel)
void mx_listelem_class(void)
Class function for MX_LISTELEM
(../include/depui/list.h)
(library depui : module list)
void mx_list_class(void)
Class function for MX_LIST
(../include/depui/list.h)
(library depui : module list)
unsigned int mx_platform_font_width(void* pfont, const char* text, int len)
Allegros font witdth should be able to take more than 1024 chars
(../include/depui/platform/allegro.c)
(library depui : module platform)
void mx_scroll_class(void)
Class function for MX_SCROLL
(../include/depui/scroll.h)
(library depui : module scroll)
void mx_vslider_class(void)
Class function for vertical MX_SLIDER
(../include/depui/slider.h)
(library depui : module slider)
void mx_hslider_class(void)
Class function for horizontal MX_SLIDER
(../include/depui/slider.h)
(library depui : module slider)
void mx__slider_set(MX_SLIDER_DATA* slider, int range, int size, int value)
If the range, size or value is MXDEFAULT then the previous value
is used.
(../include/depui/slider.c)
(library depui : module slider)
void mx__slider_to(MX_SLIDER_DATA* slider, int value)
If the slider position is changed then a MX_HSCROLL or a MX_VSCROLL
event is passed to the sliders parent.
(../include/depui/slider.c)
(library depui : module slider)
static void mx__sysmenu_popup(void)
Kind of dangerous to maintain pointers to the entry text
of the main menu, maybe make a copy here?
(../include/depui/sysmenu.c)
(library depui : module sysmenu)
void mx_sysmenu(void)
Create a system menu
(../include/depui/sysmenu.c)
(library depui : module sysmenu)
void mx_themesel_refresh(MX_THEMESEL* sel)
This function refreshes a theme selector dialog with the currently
available themes. This function should be called after creating the theme
selector and before it gets displayed or gets an MX_GEOMETRY event.
(../include/depui/themesel.c)
(library depui : module themesel)
void mx_themesel_handler(MX_WIN* win)
Error handling could be better here
(../include/depui/themesel.c)
(library depui : module themesel)
MX_THEMESEL* mx_themeselwin(MX_THEMESEL* sel, size_t size, MX_HANDLER handler, int theid)
mx_text_set(&sel->_themes, "themes", -1, 0);
(../include/depui/themesel.c)
(library depui : module themesel)
const MX_THEME* mx_themesel_info(const int idnum)
theme selection information
When a theme has been chosen from a theme selector dialog the a MX_THEMESEL_OK event is sent to the parent window. This function can be called when handling that event to determine the theme selected. (../include/depui/themesel.c)
This function should only be called when handling an MX_THEMESEL_event. (../include/depui/themesel.c)
The sepcified id number has to match the one with the selected theme.
(../include/depui/themesel.c)
(library depui : module themesel)
void mx_drs_area(int w, int h)
Initialize dirty-rectangle system
This function initializes the dirty-rectangle updating system for a
screen of the given dimensions.
(../include/detk/drs.c)
(library detk : module drs)
unsigned mx_drs_dirtychanged(void)
Return if parts of the screen need updating
This function returns zero if there are no dirty areas of the screen.
If the function return false then a following call to mx_drs_update() will
not call the flush callback. This is useful to determine if a call to
mx_drs_update() could (potentially) update the screen. It is not guaranteed
that if this function returns true that mx_drs_update() will in fact call
the fluch callback function.
(../include/detk/drs.c)
(library detk : module drs)
unsigned mx_drs_update(MX_FLUSH_FUNC dflush)
Call the flush function with the parts of the screen needing updating
This function calls a user defined callback function with the areas of the screen marked as dirty by the mx_drs_dirty() function. (../include/detk/drs.c)
This functions return zero if no portion of the screen requires updating. (../include/detk/drs.c)
The updated areas (after possible modification in the callback) are guaranteed to bo non-overlapping. (../include/detk/drs.c)
The callback function may modify the area to indicate the area actually updated. (../include/detk/drs.c)
After this function returns the entire dirty area of the screen will have
been updated though the callback and the entire screen will be marked as
clean.
(../include/detk/drs.c)
(library detk : module drs)
void mx_drs_dirty(const MX_RECT* rrect, unsigned mark)
Mark a portion of the screen as needing updating
This function marks a portion of the screen as dirty or clean.
(../include/detk/drs.c)
(library detk : module drs)
const char* mx_basename(const char* fname)
This function returns a pointer to the base name of a file path. (../include/detk/file/basename.c)
basename taken from the DJGPP sources.
(../include/detk/file/basename.c)
(library detk : module file)
int mx_fgetw(FILE* f)
This function reads a binary word from a FILE using a (Intel? Motorola?) byte order. (../include/detk/file/fgetw.c)
fgetw taken from Allegro sources.
(../include/detk/file/fgetw.c)
(library detk : module file)
unsigned mx_filename_match(const char* p, const char* t)
This function return non-zero if a filename matches a given pattern. Patterns match '*' to one or more characters and '?' to a single character. (../include/detk/file/match.c)
Multiple patterns can be matched by sepaarating them with ';' characters. (../include/detk/file/match.c)
Filename matching code taken with permission from the very nice
webpage of Alessandro Cantaore
http://xoomer.virgilio.it/acantato/dev/wildcard/wildmatch.html
(../include/detk/file/match.c)
(library detk : module file)
void mx_path_fix(char* ptr)
This function corrects a path specifier by removing /./ directories and moving /../ to the start of the path. (../include/detk/file/pathfix.c)
On MSDOS platforms leading drive specs are ignored.
(../include/detk/file/pathfix.c)
(library detk : module file)
void mx_region_clip(MX_REGION* region, const MX_RECT* therect)
This function clips the rectangles in a region by another rectangle.
After the function returns the none of the rectangles in the region intersect
with the rectangle indicated.
(../include/detk/region.c)
(library detk : module region)
unsigned int mx_utf8_len(const char* s)
Return number of characters in a UTF-8 encoded character
This function return the number of bytes in an encoded UTF-8 character.
(../include/detk/utf8.c)
(library detk : module utf8)
long mx_utf8_char(const char* s, unsigned int len)
Read a UTF-8 character
This function interprets a number of bytes as a encoded UTF-8 character.
(../include/detk/utf8.c)
(library detk : module utf8)
Generated by MXDOC 2.2 on Sun Feb 4 15:16:26 2007