BRL-CAD
if_TEMPLATE.c File Reference
#include "common.h"
#include <stdio.h>
#include "fb.h"
Include dependency graph for if_TEMPLATE.c:

Go to the source code of this file.

Functions

HIDDEN int DEVNAME_open (fb *ifp, const char *file, int width, int height)
 
HIDDEN int DEVNAME_close (fb *ifp)
 
HIDDEN int DEVNAME_clear (fb *ifp, unsigned char *pp)
 
HIDDEN int DEVNAME_read (fb *ifp, int x, int y, unsigned char *pixelp, size_t count)
 
HIDDEN int DEVNAME_write (fb *ifp, int x, int y, const unsigned char *pixelp, size_t count)
 
HIDDEN int DEVNAME_rmap (fb *ifp, ColorMap *cmp)
 
HIDDEN int DEVNAME_wmap (fb *ifp, const ColorMap *cmp)
 
HIDDEN int DEVNAME_view (fb *ifp, int xcenter, int ycenter, int xzoom, int yzoom)
 
HIDDEN int DEVNAME_getview (fb *ifp, int *xcenter, int *ycenter, int *xzoom, int *yzoom)
 
HIDDEN int DEVNAME_setcursor (fb *ifp, const unsigned char *bits, int xbits, int ybits, int xorig, int yorig)
 
HIDDEN int DEVNAME_cursor (fb *ifp, int mode, int x, int y)
 
HIDDEN int DEVNAME_getcursor (fb *ifp, int *mode, int *x, int *y)
 
HIDDEN int DEVNAME_readrect (fb *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
 
HIDDEN int DEVNAME_writerect (fb *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
 
HIDDEN int DEVNAME_poll (fb *ifp)
 
HIDDEN int DEVNAME_flush (fb *ifp)
 
HIDDEN int DEVNAME_free (fb *ifp)
 
HIDDEN int DEVNAME_help (fb *ifp)
 

Variables

fb DEVNAME_interface
 

Detailed Description

How to add a new device interface:

Copy this file to if_devname.c

Do a global replace of DEVNAME with your devname. (In the interest of non-flexnames, DEVNAME should be no more than three characters; except perhaps for DEVNAME_interface)

Fill in the device description, max width and height, default width and height, and shortname (what you will look it up as).

Set the unimplemented functions to "fb_null" (and remove the skeletons if you're tidy).

Set DEVNAME_readrect to fb_sim_readrect, and DEVNAME_writerect to fb_sim_writerect, if not implemented.

Make DEVNAME_free call DEVNAME_close if not implemented.

Go add an "ifdef IF_DEVNAME" to fb_generic.c (two places).

Add defines to CMakeLists.txt

Replace this header.

Definition in file if_TEMPLATE.c.

Function Documentation

HIDDEN int DEVNAME_open ( fb ifp,
const char *  file,
int  width,
int  height 
)

Definition at line 59 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_close ( fb ifp)

Definition at line 67 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_clear ( fb ifp,
unsigned char *  pp 
)

Definition at line 74 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_read ( fb ifp,
int  x,
int  y,
unsigned char *  pixelp,
size_t  count 
)

Definition at line 81 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_write ( fb ifp,
int  x,
int  y,
const unsigned char *  pixelp,
size_t  count 
)

Definition at line 88 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_rmap ( fb ifp,
ColorMap cmp 
)

Definition at line 95 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_wmap ( fb ifp,
const ColorMap cmp 
)

Definition at line 102 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_view ( fb ifp,
int  xcenter,
int  ycenter,
int  xzoom,
int  yzoom 
)

Definition at line 109 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_getview ( fb ifp,
int *  xcenter,
int *  ycenter,
int *  xzoom,
int *  yzoom 
)

Definition at line 116 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_setcursor ( fb ifp,
const unsigned char *  bits,
int  xbits,
int  ybits,
int  xorig,
int  yorig 
)

Definition at line 123 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_cursor ( fb ifp,
int  mode,
int  x,
int  y 
)

Definition at line 130 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_getcursor ( fb ifp,
int *  mode,
int *  x,
int *  y 
)

Definition at line 137 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_readrect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
unsigned char *  pp 
)

Definition at line 144 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_writerect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
const unsigned char *  pp 
)

Definition at line 151 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_poll ( fb ifp)

Definition at line 158 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_flush ( fb ifp)

Definition at line 165 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_free ( fb ifp)

Definition at line 172 of file if_TEMPLATE.c.

HIDDEN int DEVNAME_help ( fb ifp)

Definition at line 179 of file if_TEMPLATE.c.

References DEVNAME_interface, fb_log(), fb_internal::if_height, fb_internal::if_max_height, fb_internal::if_max_width, fb_internal::if_name, fb_internal::if_type, and fb_internal::if_width.

Here is the call graph for this function:

Variable Documentation

fb DEVNAME_interface

Definition at line 194 of file if_TEMPLATE.c.

Referenced by DEVNAME_help().