|
BB2 C port
API reference: Blitz libraries in C and the shared code
|
#include "blitzlib.h"#include "blitzexec.h"#include <graphics/rastport.h>#include <graphics/text.h>#include <intuition/intuition.h>#include <intuition/screens.h>#include <proto/graphics.h>#include <proto/intuition.h>Data Structures | |
| struct | pitem |
| struct | popup |
Macros | |
| #define | __NOLIBBASE__ |
| #define | GRAPHICS_BASE_NAME gfxbase |
| #define | INTUITION_BASE_NAME intuibase |
| #define | STRUCT_SIZEOF 64 |
Functions | |
| void | _popupinit (void) |
| void | _dopopup (void) |
| void | popupwinlib_libinit (void) |
| void | popupwinlib_libfinit (void) |
| static ULONG | strlen0 (const UBYTE *s) |
| static void | windowinit (void) |
| static void | flushwinevents (void) |
| static void | windowfinit (void) |
| static struct Window * | openwindow13 (struct Screen *scr, ULONG x, ULONG y, ULONG w, ULONG h, ULONG flags) |
| static struct Window * | openwindow (struct Screen *scr, ULONG x, ULONG y, ULONG w, ULONG h, ULONG flags, ULONG idcmp) |
| static ULONG | waitwinevent (void) |
| static void | closewin (struct Window *win) |
| static void | bevelbox (struct RastPort *rp, WORD x1, WORD y1, WORD x2, WORD y2) |
| static void | bevelwindow (struct Window *win) |
| static void | drawtextitem (struct popup *p, const struct pitem *item, struct RastPort *rp, WORD x, WORD y) |
| static void | drawitems (struct popup *p, struct Window *win) |
| static void | drawactiveitem (struct popup *p, ULONG pen) |
| static struct popup * | findmousewindow (struct popup *p) |
| static struct pitem * | findmouseitem (struct popup *p, UWORD *ypos) |
| static void | clearactive (struct popup *p) |
| static void | mousemove (struct popup *p) |
| static struct popup * | allocstruct (struct pitem *items, struct popup *parent) |
| static UWORD | calcwinsize (struct popup *p, UWORD *h) |
| static struct Window * | newpopupwin (WORD x, WORD y, UWORD w, UWORD h) |
| static ULONG | dopop (struct pitem *items, struct popup *parent, UWORD x, UWORD y) |
| static void | inittemprast (void) |
| static void | libinit_c (void) |
| init: opens intuition.library and graphics.library (any version; intuition's decides how the windows open) and builds the message port (fixed #1140: by hand, exec V33). | |
| static void | libfinit_c (void) |
| finit: replies what is still in the port, deletes it and closes the libraries. | |
| static void | popupinit_c (void) |
| PopUpInit: the message port for the menu windows, if there is none (init has made it; PopUpInit makes it after a failed port: no memory or no free signal). | |
| static ULONG | dopopup_c (struct Screen **scr, struct pitem *items) |
| PopUpWindow Screen#,*items: shows the menu items at 0,0 of the screen, waits until a mouse button is pressed and returns the item chosen; a statement and a function. | |
Variables | |
| static struct Library * | intuibase |
| static struct Library * | gfxbase |
| static struct MsgPort * | msgport |
| static struct Screen * | myscreen |
| static struct RastPort | myrast |
| static struct TextFont * | myfont |
| static UWORD | fontheight |
| static UWORD | baseline |
| static UBYTE | hassubs [2] |
| static ULONG | e_msg [8] |
| struct { | |
| struct TagItem left top width height title screen flags detailpen blockpen | |
| struct TagItem minwidth minheight maxwidth maxheight newlookmenus idcmp gadgets | |
| struct TagItem extra end | |
| } | wwtags |
| #define __NOLIBBASE__ |
| #define GRAPHICS_BASE_NAME gfxbase |
| #define INTUITION_BASE_NAME intuibase |
| #define STRUCT_SIZEOF 64 |
| void _dopopup | ( | void | ) |
| void _popupinit | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
PopUpWindow Screen#,*items: shows the menu items at 0,0 of the screen, waits until a mouse button is pressed and returns the item chosen; a statement and a function.
Each level is a borderless window with the screen's font; moving over an item highlights it, an item with a sub menu opens it to the right. Fixed (#471): the result is the item DoPop returns; the original returned selecteditem, which is only cleared (always 0), and was a statement only. Fixed (#467): a level without memory for its structure closes all levels. Fixed (#469): closing a level replies only the messages of its window, those for the other levels stay queued.
| scr | a0: the screen object (screenslib; first long = the Screen) |
| items | d1: the first item of the menu |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
finit: replies what is still in the port, deletes it and closes the libraries.
|
static |
init: opens intuition.library and graphics.library (any version; intuition's decides how the windows open) and builds the message port (fixed #1140: by hand, exec V33).
|
static |
|
static |
|
static |
|
static |
|
static |
PopUpInit: the message port for the menu windows, if there is none (init has made it; PopUpInit makes it after a failed port: no memory or no free signal).
Fixed (#470): the original created a new port each time and left the old one with its signal bit. (The word argument is not used.)
| void popupwinlib_libfinit | ( | void | ) |
| void popupwinlib_libinit | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| struct TagItem extra end |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
| struct { ... } wwtags |