home *** CD-ROM | disk | FTP | other *** search
-
- // low-level.h.tboxobj
-
- // Dreamscape - C++ class library for RISC OS
- // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
- //
- // This library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Library General Public
- // License as published by the Free Software Foundation; either
- // version 2 of the License, or (at your option) any later version.
- // See the Dreamscape documentation for more information.
-
- #ifndef dreamscape_tboxobj_H
- #define dreamscape_tboxobj_H
-
- #include "coords.h"
- #include "tboxevent.h"
-
- typedef struct toolbox_o_ *toolbox_o;
- typedef unsigned toolbox_show_flags;
- typedef int toolbox_c;
- union toolbox_position;
-
- class ToolboxObject {
- static class Initialise {
- public:
- Initialise();
- } init;
- friend Initialise;
-
- static struct AutoCreated {
- toolbox_o id;
- void *handle;
- void (*deleter)(void *handle);
- AutoCreated *next;
- } *auto_created;
-
- static struct Type {
- unsigned id;
- void *(*create)(toolbox_o object);
- Type *next;
- } *types;
-
- static void object_deleted(const toolbox_action *event,
- const toolbox_block *ids);
-
- toolbox_o id;
- public:
- ToolboxObject(toolbox_o object, void *handle,
- void (*deleter)(void *object) = 0);
- ToolboxObject(const char *name, void *handle);
- virtual ~ToolboxObject();
-
- static void *get_object(toolbox_o object);
- static void register_type(unsigned id, void *(*create)(toolbox_o object));
-
- operator toolbox_o() const { return id; }
-
- void show(toolbox_show_flags flags, ToolboxObject *parent = 0,
- toolbox_c component = -1);
- void show_topleft(toolbox_show_flags flags, const ScrCoords &pos,
- ToolboxObject *parent = 0, toolbox_c component = -1);
- void show_full(toolbox_show_flags flags, const toolbox_position *pos,
- ToolboxObject *parent = 0, toolbox_c component = -1);
- void hide();
- };
-
- #endif
-