#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include <time.h>
#include <sys/time.h>
#include "liqbase.h"
#include "liqcell.h"
#include "liqcell_prop.h"
Functions | |
char * | liqcell_local_lookup_getname (liqcell *self, char *name) |
char * | liqcell_local_lookup_getcaption (liqcell *self, char *name) |
liqcell * | liqcell_new () |
liqcell * | liqcell_hold (liqcell *self) |
void | liqcell_release (liqcell *self) |
void | liqcell_free (liqcell *self) |
void | liqcell_setpos (liqcell *self, int x, int y) |
void | liqcell_setsize (liqcell *self, int w, int h) |
void | liqcell_setsize_from_inner (liqcell *self) |
void | liqcell_setinnersize (liqcell *self, int w, int h) |
void | liqcell_setinnersize_from_outer (liqcell *self) |
void | liqcell_setrect (liqcell *self, int x, int y, int w, int h) |
int | liqcell_movetowardsrect (liqcell *self, int x, int y, int w, int h, float fraction) |
void | liqcell_setrect_autoscale (liqcell *self, int x, int y, int w, int h, float sx, float sy) |
void | liqcell_adjustpos (liqcell *self, int dx, int dy) |
void | liqcell_adjustsize (liqcell *self, int dw, int dh) |
void | liqcell_adjustinnersize (liqcell *self, int dw, int dh) |
void | liqcell_setdirtyhold (liqcell *self, int dirtyhold) |
int | liqcell_getdirtyhold (liqcell *self) |
void | liqcell_setdirty (liqcell *self, int dirty) |
int | liqcell_getdirty (liqcell *self) |
void | liqcell_setname (liqcell *self, char *name) |
void | liqcell_setcaption (liqcell *self, char *caption) |
void | liqcell_setclassname (liqcell *self, char *classname) |
void | liqcell_setcontext (liqcell *self, char *context) |
void | liqcell_setdata (liqcell *self, void *data) |
void | liqcell_setsketch (liqcell *self, liqsketch *sketch) |
void | liqcell_sketch_autoload (liqcell *self) |
void | liqcell_setimage (liqcell *self, liqimage *image) |
void | liqcell_setfont (liqcell *self, liqfont *font) |
void | liqcell_setcontent (liqcell *self, liqcell *content) |
void | liqcell_setselected (liqcell *self, int arg) |
int | liqcell_getselected (liqcell *self) |
void | liqcell_settag (liqcell *self, void *tag) |
void * | liqcell_gettag (liqcell *self) |
void | liqcell_setenabled (liqcell *self, int arg) |
int | liqcell_getenabled (liqcell *self) |
void | liqcell_setkinetic (liqcell *self, int kx, int ky) |
void | liqcell_setshown (liqcell *self, int arg) |
int | liqcell_getshown (liqcell *self) |
liqcell * | liqcell_getlinkparent (liqcell *self) |
liqcell * | liqcell_getlinkprev (liqcell *self) |
liqcell * | liqcell_getlinknext (liqcell *self) |
liqcell * | liqcell_getlinkprev_visual (liqcell *self) |
liqcell * | liqcell_getlinknext_visual (liqcell *self) |
liqcell * | liqcell_getlinkchild_visual (liqcell *self) |
liqcell * | liqcell_getlinkchild (liqcell *self) |
void * | liqcell_getdata (liqcell *self) |
int | liqcell_getflagwidget (liqcell *self) |
int | liqcell_getflagvisual (liqcell *self) |
int | liqcell_getvisible (liqcell *self) |
void | liqcell_setvisible (liqcell *self, int arg) |
char * | liqcell_getname (liqcell *self) |
int | liqcell_getqualifiedname (liqcell *self, char *buff, int buffmax) |
char * | liqcell_getclassname (liqcell *self) |
char * | liqcell_getcaption (liqcell *self) |
liqsketch * | liqcell_getsketch (liqcell *self) |
liqimage * | liqcell_getimage (liqcell *self) |
liqfont * | liqcell_getfont (liqcell *self) |
liqcell * | liqcell_getcontent (liqcell *self) |
int | liqcell_getx (liqcell *self) |
int | liqcell_gety (liqcell *self) |
int | liqcell_getw (liqcell *self) |
int | liqcell_geth (liqcell *self) |
int | liqcell_getinnerw (liqcell *self) |
int | liqcell_getinnerh (liqcell *self) |
liqcell * | liqcell_lastchild (liqcell *self) |
snprintf (cap, 30,"%s",(self->caption?self->caption:"")) | |
free (indent) | |
while (xx) | |
void | liqcell_print2 (liqcell *self) |
int | strcmpx (const char *s1, const char *s2) |
void * | liqcell_handlerfind (liqcell *self, char *handlername) |
liqcell * | liqcell_handleradd (liqcell *self, char *handlername, void *handler) |
liqcell * | liqcell_handleradd_withcontext (liqcell *self, char *handlername, void *handler, void *context) |
int | liqcell_handlerrun (liqcell *self, char *handlername, void *args) |
liqcell * | liqcell_getbasewidget (liqcell *self) |
int | liqcell_isclass (liqcell *self, char *classname) |
int | liqcell_ensurevisible (liqcell *self) |
int | liqcell_ensurevisible_centred (liqcell *self) |
void | liqcell_test () |
Variables | |
indent [recdep] = ' '0 | |
char | cap [32] = 0 |
char * | cc = cap |
liqcell * | xx = self->linkchild |
This program 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 this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
void liqcell_adjustinnersize | ( | liqcell * | self, | |
int | dw, | |||
int | dh | |||
) |
Increase or decrease the liqcell inner width and inner height
self | The liqcell to modify | |
dw | Change in the width | |
dh | Change in the height |
void liqcell_adjustpos | ( | liqcell * | self, | |
int | dx, | |||
int | dy | |||
) |
Increase or decrease the liqcell x, y-coordinates
self | The liqcell to modify | |
dx | Change in the x-coordinate | |
dy | Change in the y-coordinate |
References liqcell_handlerrun().
Referenced by liqcell_ensurevisible(), and liqcell_ensurevisible_centred().
void liqcell_adjustsize | ( | liqcell * | self, | |
int | dw, | |||
int | dh | |||
) |
Increase or decrease the liqcell width and height
self | The liqcell to modify | |
dw | Change in the width | |
dh | Change in the height |
References liqcell_handlerrun().
int liqcell_ensurevisible | ( | liqcell * | self | ) |
Adjust a position of a liqcell to ensure it is visible
self | The liqcell to adjusts |
References liqapp_log(), liqcell_adjustpos(), and liqcell_getlinkparent().
int liqcell_ensurevisible_centred | ( | liqcell * | self | ) |
Adjust a position of a liqcell to ensure it is visible and centered
self | The liqcell to adjusts |
References liqapp_log(), liqcell_adjustpos(), and liqcell_getlinkparent().
void liqcell_free | ( | liqcell * | self | ) |
Recursively free all liqcells of the parent liqcell provided and their items (font, image, etc..)
self | The parent will have all children freed |
References liqapp_log(), liqcell_release(), liqcell_setcaption(), liqcell_setclassname(), liqcell_setcontent(), liqcell_setcontext(), liqcell_setdata(), liqcell_setfont(), liqcell_setimage(), liqcell_setname(), and liqcell_setsketch().
Referenced by liqcell_release().
liqcell* liqcell_getbasewidget | ( | liqcell * | self | ) |
Get the base (top parent) of the provided liqcell
self | The provided liqcell |
References liqcell_getlinkparent().
char* liqcell_getcaption | ( | liqcell * | self | ) |
Return a liqcell caption
self | The liqcell to lookup |
Referenced by liqcell_easyrun().
char* liqcell_getclassname | ( | liqcell * | self | ) |
Return the classname
self | The liqcell to lookup |
liqcell* liqcell_getcontent | ( | liqcell * | self | ) |
Return the liqcell's content
self | The liqcell to lookup |
void* liqcell_getdata | ( | liqcell * | self | ) |
Get the data of the liqcell
self | The liqcell to lookup |
int liqcell_getdirty | ( | liqcell * | self | ) |
Get the dirty value of the liqcell
self | The liqcell to lookup |
int liqcell_getdirtyhold | ( | liqcell * | self | ) |
Get the dirtyhold value of the liqcell
self | The liqcell to lookup |
int liqcell_getenabled | ( | liqcell * | self | ) |
Return the enabled value
self | The liqcell to lookup |
liqfont* liqcell_getfont | ( | liqcell * | self | ) |
Return the liqcell's font
self | The liqcell to lookup |
int liqcell_geth | ( | liqcell * | self | ) |
Return the liqcell's height
self | The liqcell to lookup |
Referenced by liqcell_child_arrange_easycol(), liqcell_child_arrange_easyrow(), and liqcell_child_arrange_makegrid_internal().
liqimage* liqcell_getimage | ( | liqcell * | self | ) |
Return the liqcell's image
self | The liqcell to lookup |
int liqcell_getinnerh | ( | liqcell * | self | ) |
Return the liqcell's inner height
self | The liqcell to lookup |
int liqcell_getinnerw | ( | liqcell * | self | ) |
Return the liqcell's inner width
self | The liqcell to lookup |
liqcell* liqcell_getlinkchild | ( | liqcell * | self | ) |
Return the linked child of the parent provided.
self | The parent liqcell |
Referenced by liqcell_child_arrange_easycol(), liqcell_child_arrange_easyrow(), liqcell_child_arrange_easytile(), and liqcell_child_arrange_makegrid_internal().
liqcell* liqcell_getlinkchild_visual | ( | liqcell * | self | ) |
Get the linked child of the liqcell, the child link in the linked list that is VISIBLE
self | The liqcell to lookup |
liqcell* liqcell_getlinknext | ( | liqcell * | self | ) |
Get the linked next of the liqcell, the next link in the linked list
self | The liqcell to lookup |
Referenced by liqcell_child_arrange_easycol(), liqcell_child_arrange_easyrow(), liqcell_child_arrange_easytile(), liqcell_child_arrange_makegrid_internal(), liqcell_easyrun(), liqcell_handlerfind(), and liqcell_handlerrun().
liqcell* liqcell_getlinknext_visual | ( | liqcell * | self | ) |
Get the linked previous of the liqcell, the previous link in the linked list that is VISIBLE
self | The liqcell to lookup |
liqcell* liqcell_getlinkparent | ( | liqcell * | self | ) |
Get the linked parent of the liqcell
self | The liqcell to lookup |
Referenced by liqcell_easyrun(), liqcell_ensurevisible(), liqcell_ensurevisible_centred(), liqcell_getbasewidget(), and liqcell_getqualifiedname().
liqcell* liqcell_getlinkprev | ( | liqcell * | self | ) |
Get the linked previous of the liqcell, the previous link in the linked list
self | The liqcell to lookup |
Referenced by liqcell_easyrun().
liqcell* liqcell_getlinkprev_visual | ( | liqcell * | self | ) |
Get the linked previous of the liqcell, the previous link in the linked list that is VISIBLE
self | The liqcell to lookup |
char* liqcell_getname | ( | liqcell * | self | ) |
Return the name of the provided liqcell.
self | The liqcell |
Referenced by liqcell_easyrun().
int liqcell_getqualifiedname | ( | liqcell * | self, | |
char * | buff, | |||
int | buffmax | |||
) |
Get the name of a liqcell that includes all of the parent names
self | The liqcell to get the qualified name of | |
buff | Copy the qualified name into this buffer | |
buffmax | Maximum length of the buffer |
References liqcell_getlinkparent().
Referenced by liqcell_easyrun().
int liqcell_getselected | ( | liqcell * | self | ) |
Return the selected value
self | The liqcell to lookup |
int liqcell_getshown | ( | liqcell * | self | ) |
Get the shown value of the liqcell
self | The liqcell to lookup |
liqsketch* liqcell_getsketch | ( | liqcell * | self | ) |
Return the liqcell's sketch
self | The liqcell to lookup |
void* liqcell_gettag | ( | liqcell * | self | ) |
Get the tag value of the liqcell
self | The liqcell to lookup |
Referenced by liqcell_handlerrun().
int liqcell_getw | ( | liqcell * | self | ) |
Return the liqcell's width
self | The liqcell to lookup |
Referenced by liqcell_child_arrange_easycol(), liqcell_child_arrange_easyrow(), and liqcell_child_arrange_makegrid_internal().
int liqcell_getx | ( | liqcell * | self | ) |
Return the liqcell's x-coordinate
self | The liqcell to lookup |
int liqcell_gety | ( | liqcell * | self | ) |
Return the liqcell's y-coordinate
self | The liqcell to lookup |
liqcell* liqcell_handleradd | ( | liqcell * | self, | |
char * | handlername, | |||
void * | handler | |||
) |
Add a handler by creating a child liqcell for the provided parent. The nameclass must be called "handler" to be identified as a handler liqcell.
self | The liqcell to add a handler to | |
handlername | The name of the handler | |
handler | Function pointer to actual handler |
Referenced by textbox_create(), uiinfobar_create(), and uitextbox_create().
liqcell* liqcell_handleradd_withcontext | ( | liqcell * | self, | |
char * | handlername, | |||
void * | handler, | |||
void * | context | |||
) |
Add a handler by creating a child liqcell for the provided parent. The nameclass must be called "handler" to be identified as a handler liqcell.
self | The liqcell to add a handler to | |
handlername | The name of the handler | |
handler | Function pointer to actual handler |
References liqcell_settag().
void* liqcell_handlerfind | ( | liqcell * | self, | |
char * | handlername | |||
) |
Search for handler
self | The liqcell to search for a handler for | |
handlername | The name of the handler to find |
References liqcell_getlinknext().
Referenced by liqcell_easyrun().
int liqcell_handlerrun | ( | liqcell * | self, | |
char * | handlername, | |||
void * | args | |||
) |
Run/Execute the handler of the provided liqcell. This only executes the handler provided by "handlername".
self | The liqcell with the handler | |
handlername | The name of the handler to run |
References liqcell_getlinknext(), and liqcell_gettag().
Referenced by liqcell_adjustpos(), liqcell_adjustsize(), liqcell_easyrun(), liqcell_movetowardsrect(), liqcell_setcaption(), liqcell_setdirty(), liqcell_setpos(), liqcell_setrect(), liqcell_setrect_autoscale(), and liqcell_setsize().
liqcell* liqcell_hold | ( | liqcell * | self | ) |
Add to the usage count, hold onto an object which someone else created
self | The liqcell to modify |
Referenced by liqcell_setcontent().
int liqcell_isclass | ( | liqcell * | self, | |
char * | classname | |||
) |
Check if the string provided is a classname of the liqcell provided
self | The provided liqcell | |
classname | The string to cechk | |
int | True or False |
liqcell* liqcell_lastchild | ( | liqcell * | self | ) |
Get the last child of the parent provided
self | The parent liqcell |
int liqcell_movetowardsrect | ( | liqcell * | self, | |
int | x, | |||
int | y, | |||
int | w, | |||
int | h, | |||
float | fraction | |||
) |
Move and resize a liqcell
self | The liqcell to modify | |
x | New x-coordinate | |
y | New y-coordinate | |
w | New width | |
h | New height | |
fraction | Ratio to increase or decreases the liqcell position and size |
References liqcell_handlerrun().
Referenced by liqcell_child_arrange_makegrid_internal().
liqcell* liqcell_new | ( | ) |
Low level liqcell creation which allocates memory and sets the liqcell into use.
Referenced by liqcell_test().
void liqcell_print2 | ( | liqcell * | self | ) |
Print a tree of liqcells starting with the provided liqcell
self | The provided liqcell |
Referenced by liqcell_easyrun().
void liqcell_release | ( | liqcell * | self | ) |
Decrease the usage count, once this gets to 0, the liqcell is freed
self | The liqcell to modify |
References liqcell_free().
Referenced by liqcell_free(), liqcell_setcontent(), and liqcell_test().
void liqcell_setcaption | ( | liqcell * | self, | |
char * | caption | |||
) |
Set the caption of the liqcell
self | The liqcell to modify | |
caption | The caption of the liqcell |
References liqapp_log(), and liqcell_handlerrun().
Referenced by liqcell_free(), uiinfobar_create(), uinumberbox_create(), uipicturebox_create(), uitextbox_create(), and uititlebar_create().
void liqcell_setclassname | ( | liqcell * | self, | |
char * | classname | |||
) |
Set the classname of the liqcell
self | The liqcell to modify | |
classname | The classname of the liqcell |
Referenced by liqcell_free().
void liqcell_setcontent | ( | liqcell * | self, | |
liqcell * | content | |||
) |
Set the content of one liqcell to the content of the other liqcell.
self | The destination liqcell |
References liqcell_hold(), and liqcell_release().
Referenced by liqcell_free().
void liqcell_setcontext | ( | liqcell * | self, | |
char * | context | |||
) |
Set the context of the liqcell
self | The liqcell to modify | |
context | The context of the liqcell |
Referenced by liqcell_free().
void liqcell_setdata | ( | liqcell * | self, | |
void * | data | |||
) |
Set the data of the liqcell
self | The liqcell to modify | |
data | The data of the liqcell |
Referenced by liqcell_free().
void liqcell_setdirty | ( | liqcell * | self, | |
int | dirty | |||
) |
Set dirty in order to indicate that the liqcell has changed, and needs to be updated
self | The liqcell to modify | |
dirty | Set this to 1 to indicate that the liqcell needs to be updated |
References liqcell_handlerrun().
Referenced by liqcell_child_arrange_makegrid_internal(), liqcell_setdirtyhold(), and liqcell_setimage().
void liqcell_setdirtyhold | ( | liqcell * | self, | |
int | dirtyhold | |||
) |
Set the dirty hold to indicate whether a liqcell can be updated
self | The liqcell to modify | |
dirtyhold | Set this to 0 to indicate no hold, can be updated. |
References liqcell_setdirty().
void liqcell_setenabled | ( | liqcell * | self, | |
int | arg | |||
) |
Set the enabled value of the liqcell
self | The liqcell to modify | |
arg | The value to set enabled of the liqcell |
void liqcell_setfont | ( | liqcell * | self, | |
liqfont * | font | |||
) |
Set the font of the liqcell
self | The liqcell to modify | |
font | The liqcell's font |
Referenced by liqcell_free(), textbox_create(), uiinfobar_create(), uinumberbox_create(), uipicturebox_create(), uitextbox_create(), and uititlebar_create().
void liqcell_setimage | ( | liqcell * | self, | |
liqimage * | image | |||
) |
Set the provided liqcell's bakground image.
self | The liqcell | |
image | The liqimage to set |
References liqcell_setdirty().
Referenced by liqcell_free(), uipicturebox_create(), and uititlebar_create().
void liqcell_setinnersize | ( | liqcell * | self, | |
int | w, | |||
int | h | |||
) |
Set the inner sizes parameters of the liqcell
self | The liqcell to modify | |
w | Width | |
h | Height |
void liqcell_setinnersize_from_outer | ( | liqcell * | self | ) |
Set the inner size parameters using the width and height parameters of the liqcell
self | The liqcell to modify |
void liqcell_setkinetic | ( | liqcell * | self, | |
int | kx, | |||
int | ky | |||
) |
Set the liqcell's kinetic values int he x and y direction
self | The liqcell to modify | |
kx | The kinetic value in the x direction | |
ky | The kinetic value in the y direction |
void liqcell_setname | ( | liqcell * | self, | |
char * | name | |||
) |
Set the liqcell name
self | The liqcell to modify | |
name | The name of the liqcell |
References liqapp_errorandfail().
Referenced by liqcell_free().
void liqcell_setpos | ( | liqcell * | self, | |
int | x, | |||
int | y | |||
) |
Set the x, y coordinate position of the liqcell
self | Liqcell to set the position of | |
x | The x-coordinate | |
y | The y-coordinate |
References liqcell_handlerrun().
Referenced by liqcell_child_arrange_easycol(), liqcell_child_arrange_easyrow(), and liqcell_child_arrange_makegrid_internal().
void liqcell_setrect | ( | liqcell * | self, | |
int | x, | |||
int | y, | |||
int | w, | |||
int | h | |||
) |
Set the x, y-coordinates and height/width of a liqcell
self | The liqcell to modify | |
x | X-Coordinate | |
y | Y-Coordinate | |
w | Width | |
h | Height |
References liqcell_handlerrun().
void liqcell_setrect_autoscale | ( | liqcell * | self, | |
int | x, | |||
int | y, | |||
int | w, | |||
int | h, | |||
float | sx, | |||
float | sy | |||
) |
Set the rect, but use default original scaling to do it
self | The liqcell to modify | |
x | X-Coordinate | |
y | Y-Coordinate | |
w | Width | |
h | Height | |
sx | X Scaling fraction | |
sy | Y Scaling fraction |
References liqcell_handlerrun().
void liqcell_setselected | ( | liqcell * | self, | |
int | arg | |||
) |
Set the selection of the liqcell
self | The liqcell to | |
arg | The argument set to selected parameter of the liqcell |
void liqcell_setshown | ( | liqcell * | self, | |
int | arg | |||
) |
Set the shown value of the liqcell
self | The liqcell to modify | |
arg | The value to set shown |
void liqcell_setsize | ( | liqcell * | self, | |
int | w, | |||
int | h | |||
) |
Set the width and height of the liqcell
self | Liqcell to set dimensions of | |
w | The width | |
h | The height |
References liqcell_handlerrun().
Referenced by liqcell_child_arrange_easycol(), liqcell_child_arrange_easyrow(), liqcell_child_arrange_makegrid_internal(), and liqcell_setsize_from_inner().
void liqcell_setsize_from_inner | ( | liqcell * | self | ) |
Set the size of a liqcell by providing just the liqcell and using the inner width and inner height
self | The liqcell to set the size of |
References liqcell_setsize().
void liqcell_setsketch | ( | liqcell * | self, | |
liqsketch * | sketch | |||
) |
Set the sketch of the liqcell
self | The liqcell to modify | |
sketch | The sketch of the liqcell |
Referenced by liqcell_free(), and liqcell_sketch_autoload().
void liqcell_settag | ( | liqcell * | self, | |
void * | tag | |||
) |
Set the tag of the liqcell
self | The liqcell to modify | |
tag | The liqcell's tag |
Referenced by liqcell_handleradd_withcontext().
void liqcell_sketch_autoload | ( | liqcell * | self | ) |
Load the sketch of the liqcell
self | The liqcell to load the sketch of |
References liqapp_fileexists(), liqcell_propgets(), and liqcell_setsketch().
void liqcell_test | ( | ) |
Testing function
References liqcell_new(), and liqcell_release().