2007-12-30 17:41:49 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
2009-08-17 12:41:51 +02:00
|
|
|
gbx_component.h
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2009-08-17 12:41:51 +02:00
|
|
|
(c) 2000-2009 Benoît Minisini <gambas@users.sourceforge.net>
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2009-08-17 12:41:51 +02:00
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
2007-12-30 17:41:49 +01:00
|
|
|
any later version.
|
|
|
|
|
|
|
|
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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef __GBX_COMPONENT_H
|
|
|
|
#define __GBX_COMPONENT_H
|
|
|
|
|
|
|
|
#include "gambas.h"
|
|
|
|
#include "gb_list.h"
|
|
|
|
#include "gb_component.h"
|
|
|
|
|
|
|
|
#include "gbx_library.h"
|
|
|
|
#include "gbx_archive.h"
|
|
|
|
|
|
|
|
typedef
|
|
|
|
struct _COMPONENT {
|
|
|
|
void *class;
|
2008-01-17 22:39:26 +01:00
|
|
|
int ref;
|
2007-12-30 17:41:49 +01:00
|
|
|
LIST list;
|
|
|
|
char *name;
|
|
|
|
LIBRARY *library;
|
|
|
|
ARCHIVE *archive;
|
2010-01-10 14:40:48 +01:00
|
|
|
char order;
|
2007-12-30 17:41:49 +01:00
|
|
|
unsigned preload : 1;
|
|
|
|
unsigned loaded : 1;
|
|
|
|
unsigned user : 1;
|
|
|
|
unsigned warning : 1; // Set when the bytecode warning was displayed by the class loader for this component
|
2010-01-10 14:40:48 +01:00
|
|
|
unsigned _reserved : 20;
|
2007-12-30 17:41:49 +01:00
|
|
|
}
|
|
|
|
PACKED
|
|
|
|
COMPONENT;
|
|
|
|
|
|
|
|
#ifndef __GBX_COMPONENT_C
|
|
|
|
EXTERN char *COMPONENT_path;
|
|
|
|
EXTERN COMPONENT *COMPONENT_current;
|
|
|
|
EXTERN int COMPONENT_count;
|
|
|
|
EXTERN COMPONENT *COMPONENT_main;
|
|
|
|
#endif
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void COMPONENT_init(void);
|
|
|
|
void COMPONENT_exit(void);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
COMPONENT *COMPONENT_create(const char *name);
|
|
|
|
void COMPONENT_delete(COMPONENT *comp);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
COMPONENT *COMPONENT_find(const char *name);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void COMPONENT_load(COMPONENT *comp);
|
|
|
|
void COMPONENT_load_all(void);
|
|
|
|
void COMPONENT_unload(COMPONENT *comp);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
COMPONENT *COMPONENT_next(COMPONENT *comp);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void COMPONENT_translation_must_be_reloaded(void);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
void COMPONENT_signal(int signal, void *param);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
#define COMPONENT_is_library(comp) ((comp)->library != NULL)
|
|
|
|
|
2008-01-17 22:39:26 +01:00
|
|
|
bool COMPONENT_get_info(const char *key, void **value);
|
2007-12-30 17:41:49 +01:00
|
|
|
|
|
|
|
#endif
|