BB2 C port
API reference: Blitz libraries in C and the shared code
Loading...
Searching...
No Matches
rilvcallhooklib.c File Reference
#include "blitzlib.h"
#include <graphics/rastport.h>
#include <graphics/text.h>
#include <graphics/gfx.h>
#include <graphics/gfxmacros.h>
#include <libraries/gadtools.h>
#include <utility/hooks.h>
#include <proto/graphics.h>

Data Structures

struct  field
struct  fieldtable
struct  pens

Macros

#define __NOLIBBASE__
#define GRAPHICS_BASE_NAME   gfx
#define LVR_NORMALDISABLED_   2
#define LVR_SELECTEDDISABLED_   8
#define RIGHTALIGN   1
#define WAT(p, off)
#define LAT(p, off)

Functions

void _retrievecallhook (void)
void rilvcallhooklib_libinit (void)
void rilvcallhooklib_libfinit (void)
static void libinit_c (void)
 init and finit: RTS (nothing to do).
void hookfunc (void)
static void * retrievecallhook_c (struct Library *gfx)
 RetrieveCallHook: the address of the listview render hook (for h_Entry).
static void filloldextent (struct Library *gfx, struct RastPort *rp, const struct Rectangle *o, const struct Rectangle *n)
static void place (WORD *px, WORD *py)
static void displayfield (struct Library *gfx)
static void clearindent (struct Library *gfx, struct RastPort *rp, const UBYTE *node, UWORD indentoff)
static void drawdisabled (struct Library *gfx, const struct Rectangle *b, struct RastPort *rp, UWORD pen)
static ULONG hookfunc_c (struct Hook *hook, struct LVDrawMsg *msg, const UBYTE *node)
 The render hook (GTLV_CallBack): draws a listview item as fields of text or bitmaps, with an optional tree indent.

Variables

static struct Library * gfxbase
static const UWORD ghostpattern [2] = { 0x4444, 0x1111 }
static struct RastPort * msgrastport
static struct LVDrawMsg * lvdrawmsg
static ULONG text
static UWORD strlen_
static UWORD apen
static UWORD bpen
static WORD alignment
static WORD maxXboundary
static struct Rectangle ob
static struct TextExtent extent
static WORD indent
static WORD isbitmap
static const struct field * dispaddress
static const UWORD dispend = 0

Macro Definition Documentation

◆ __NOLIBBASE__

#define __NOLIBBASE__

◆ GRAPHICS_BASE_NAME

#define GRAPHICS_BASE_NAME   gfx

◆ LAT

#define LAT ( p,
off )
Value:
(*(const ULONG *)((const UBYTE *)(p) + (WORD)(off)))

◆ LVR_NORMALDISABLED_

#define LVR_NORMALDISABLED_   2

◆ LVR_SELECTEDDISABLED_

#define LVR_SELECTEDDISABLED_   8

◆ RIGHTALIGN

#define RIGHTALIGN   1

◆ WAT

#define WAT ( p,
off )
Value:
(*(const WORD *)((const UBYTE *)(p) + (WORD)(off)))

Function Documentation

◆ _retrievecallhook()

void _retrievecallhook ( void )

◆ clearindent()

void clearindent ( struct Library * gfx,
struct RastPort * rp,
const UBYTE * node,
UWORD indentoff )
static

◆ displayfield()

void displayfield ( struct Library * gfx)
static

◆ drawdisabled()

void drawdisabled ( struct Library * gfx,
const struct Rectangle * b,
struct RastPort * rp,
UWORD pen )
static

◆ filloldextent()

void filloldextent ( struct Library * gfx,
struct RastPort * rp,
const struct Rectangle * o,
const struct Rectangle * n )
static

◆ hookfunc()

void hookfunc ( void )

◆ hookfunc_c()

ULONG hookfunc_c ( struct Hook * hook,
struct LVDrawMsg * msg,
const UBYTE * node )
static

The render hook (GTLV_CallBack): draws a listview item as fields of text or bitmaps, with an optional tree indent.

Only LV_DRAW: the pens from the colour table (normal / normal disabled or the other states), the indent cleared with dotted tree lines, the fields drawn left to right (the last one cut at the right edge), a disabled item ghosted in apen. Not reentrant (static state, as the original's). Fixed: the tree line count is a word (#737); the last tree line tests the next node's indent at the indent offset (#739); a right aligned BitMap is placed in its field (#740); a text pointer 0 is an empty text (#742); the line pattern is set as SetDrPt does and put back with its flag and count (#738). TextFit's width is a word (kind K, #741).

Parameters
hooka0: the Hook, h_Data = the field table
msga1: the LVDrawMsg
nodea2: the node
Returns
d0: LVCB_OK after drawing, LVCB_UNKNOWN for other messages

◆ libinit_c()

void libinit_c ( void )
static

init and finit: RTS (nothing to do).

◆ place()

void place ( WORD * px,
WORD * py )
static

◆ retrievecallhook_c()

void * retrievecallhook_c ( struct Library * gfx)
static

RetrieveCallHook: the address of the listview render hook (for h_Entry).

Keeps graphics.library's base for the hook; it must be called before the hook is used (the base is 0 before: documented usage, not a defect).

Parameters
gfxa6: graphics.library (!libs graphicslib,la6)
Returns
d0: the hook function

◆ rilvcallhooklib_libfinit()

void rilvcallhooklib_libfinit ( void )

◆ rilvcallhooklib_libinit()

void rilvcallhooklib_libinit ( void )

Variable Documentation

◆ alignment

WORD alignment
static

◆ apen

UWORD apen
static

◆ bpen

UWORD bpen
static

◆ dispaddress

const struct field* dispaddress
static

◆ dispend

const UWORD dispend = 0
static

◆ extent

struct TextExtent extent
static

◆ gfxbase

struct Library* gfxbase
static

◆ ghostpattern

const UWORD ghostpattern[2] = { 0x4444, 0x1111 }
static

◆ indent

WORD indent
static

◆ isbitmap

WORD isbitmap
static

◆ lvdrawmsg

struct LVDrawMsg* lvdrawmsg
static

◆ maxXboundary

WORD maxXboundary
static

◆ msgrastport

struct RastPort* msgrastport
static

◆ ob

struct Rectangle ob
static

◆ strlen_

UWORD strlen_
static

◆ text

ULONG text
static