vworld/liqwidget.c File Reference

This file is the master file which loads and manages all dynamic widgets in the subdirectory. More...

#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
#include <elf.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <dirent.h>
#include <pthread.h>
#include "vcell.h"
#include "vcell_prop.h"

Functions

int liqcell_classfactory_so_free (vcell *self)
vcell * liqcell_classfactory_so_init (char *filename)
vcell * liqcell_classfactory_create_binding (vcell *self)
vcell * liqcell_classfactory_so_call_create (vcell *self)
vcell * liqcell_classfactory_masterinit (char *widgetpath)


Detailed Description

This file is the master file which loads and manages all dynamic widgets in the subdirectory.

Author:
Gary Birkett
Copyright (C) 2008 Gary Birkett

LICENSE

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

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


Function Documentation

vcell* liqcell_classfactory_create_binding ( vcell *  self  ) 

Takes the previously opened dynamic library and bind the main widget function. It is expected that the "main" function of the widget be named in the form <filetitlenoext>_create. This gets the widget function of that form so that it can be executed.

Parameters:
self The widget's vcell
Returns:
vcell The created function with the .tag of the binded widget creating function.

vcell* liqcell_classfactory_masterinit ( char *  widgetpath  ) 

Load all of the widgets. Open the widgetpath directory and stat each file checking for integrity. Make sure the file is a .so file and then create a vcell and insert it into the parent widgets vcell. The parent widgets vcell has many children.

Parameters:
widgetpath The directory path to the widgets
Returns:
vcell The master widget vcell that holds all of the child widgets

vcell* liqcell_classfactory_so_call_create ( vcell *  self  ) 

Execute the "constructor" for the provided widget vcell. This runs the code of the widget stored in the .so file.

Parameters:
self The widget's vcell
Returns:
vcell Execute the function and return the vcell that the widget create function must return.

int liqcell_classfactory_so_free ( vcell *  self  ) 

Shutdown a widget by closing the dynamic library.

Parameters:
self The widget's vcell to close
Returns:
int Success

vcell* liqcell_classfactory_so_init ( char *  filename  ) 

For each widget, use dlopen() to open the library for the widget, create the initial empty vcell and store the dl handler in the vcell's .tag. Do not bind the init function yet though!

Parameters:
filename File name of the widget to initiate
Returns:
vcell* The newly created widget vcell


Generated on Mon Apr 13 15:09:27 2009 for libliqbase by  doxygen 1.5.1