jpatcherview

A view of a patcher. More...

+ Collaboration diagram for jpatcherview:

Functions

t_objectpatcherview_findpatcherview (int x, int y)
 Find a patcherview at the given screen coords. More...
 
char patcherview_get_visible (t_object *pv)
 Query a patcherview to determine whether it is visible. More...
 
t_max_err patcherview_set_visible (t_object *pv, char c)
 Set the 'visible' attribute of a patcherview. More...
 
t_max_err patcherview_get_rect (t_object *pv, t_rect *pr)
 Get the value of the rect attribute for a patcherview. More...
 
t_max_err patcherview_set_rect (t_object *pv, t_rect *pr)
 Set the value of the rect attribute for a patcherview. More...
 
void patcherview_canvas_to_screen (t_object *pv, double cx, double cy, long *sx, long *sy)
 Convert the point cx, cy in canvas coordinates to screen coordinates. More...
 
void patcherview_screen_to_canvas (t_object *pv, long sx, long sy, double *cx, double *cy)
 Convert the point cx, cy in canvas coordinates to screen coordinates. More...
 
char patcherview_get_locked (t_object *p)
 Find out if a patcherview is locked. More...
 
t_max_err patcherview_set_locked (t_object *p, char c)
 Lock or unlock a patcherview. More...
 
char patcherview_get_presentation (t_object *pv)
 Find out if a patcherview is a presentation view. More...
 
t_max_err patcherview_set_presentation (t_object *p, char c)
 Set whether or not a patcherview is a presentation view. More...
 
double patcherview_get_zoomfactor (t_object *pv)
 Fetch the zoom-factor of a patcherview. More...
 
t_max_err patcherview_set_zoomfactor (t_object *pv, double d)
 Set the zoom-factor of a patcherview. More...
 
t_objectpatcherview_get_nextview (t_object *pv)
 Given a patcherview, find the next patcherview. More...
 
t_objectpatcherview_get_jgraphics (t_object *pv)
 Given a patcherview, return the t_jgraphics context for that view. More...
 
t_objectpatcherview_get_patcher (t_object *pv)
 Given a patcherview, return its patcher. More...
 
t_objectpatcherview_get_topview (t_object *pv)
 Given a patcherview, return the top patcherview (possibly itself). More...
 

Detailed Description

A view of a patcher.

Function Documentation

void patcherview_canvas_to_screen ( t_object pv,
double  cx,
double  cy,
long *  sx,
long *  sy 
)

Convert the point cx, cy in canvas coordinates to screen coordinates.

Parameters
pvThe patcherview instance the canvas coords are relative to.
cxThe x dimension of the canvas coordinate relative to the patcherview.
cyThe y dimension of the canvas coordinate relative to the patcherview.
sxA pointer to a long to receive the screen coordinate x dimension.
syA pointer to a long to receive the screen coordinate y dimension.
t_object* patcherview_findpatcherview ( int  x,
int  y 
)

Find a patcherview at the given screen coords.

Parameters
xThe horizontal coordinate at which to find a patcherview.
yThe vertical coordinate at which to find a patcherview.
Returns
A pointer to the patcherview at the specified location, or NULL if no patcherview exists at that location.
t_object* patcherview_get_jgraphics ( t_object pv)

Given a patcherview, return the t_jgraphics context for that view.

Parameters
pvThe patcherview instance.
Returns
The t_jgraphics context for the view.
char patcherview_get_locked ( t_object p)

Find out if a patcherview is locked.

Parameters
pThe patcherview instance whose attribute value will be fetched.
Returns
Returns 0 if unlocked, otherwise returns non-zero.
t_object* patcherview_get_nextview ( t_object pv)

Given a patcherview, find the next patcherview.

The views of a patcher are maintained internally as a t_linklist, and so the views can be traversed should you need to perform operations on all of a patcher's patcherviews.

Parameters
pvThe patcherview instance from which to find the next patcherview.
Returns
The next patcherview in the list, or NULL if the patcherview passed in pv is the tail.
t_object* patcherview_get_patcher ( t_object pv)

Given a patcherview, return its patcher.

Parameters
pvThe patcherview instance for which to fetch the patcher.
Returns
The patcher.
char patcherview_get_presentation ( t_object pv)

Find out if a patcherview is a presentation view.

Parameters
pvThe patcherview instance whose attribute value will be fetched.
Returns
Returns 0 if the view is not a presentation view, otherwise returns non-zero.
t_max_err patcherview_get_rect ( t_object pv,
t_rect pr 
)

Get the value of the rect attribute for a patcherview.

Parameters
pvThe patcherview instance whose attribute value will be fetched.
prThe address of a valid t_rect struct, whose contents will be filled upon return.
Returns
An error code.
t_object* patcherview_get_topview ( t_object pv)

Given a patcherview, return the top patcherview (possibly itself).

If the patcherview is inside a bpatcher which is in a patcher then this will give you the view the bpatcher view is inside of.

Parameters
pvThe patcherview instance whose top view you want to get.
Returns
The top patcherview.
char patcherview_get_visible ( t_object pv)

Query a patcherview to determine whether it is visible.

Parameters
pvThe patcherview instance to query.
Returns
Returns zero if the patcherview is invisible, otherwise returns non-zero.
double patcherview_get_zoomfactor ( t_object pv)

Fetch the zoom-factor of a patcherview.

Parameters
pvThe patcherview instance whose attribute value will be fetched.
Returns
The factor by which the view is zoomed.
void patcherview_screen_to_canvas ( t_object pv,
long  sx,
long  sy,
double *  cx,
double *  cy 
)

Convert the point cx, cy in canvas coordinates to screen coordinates.

Parameters
pvThe patcherview instance the canvas coords are relative to.
sxThe screen position x coordinate.
syThe screen position y coordinate
cxA pointer to a double to receive the canvas coordinate for the given screen x position.
cyA pointer to a double to receive the canvas coordinate for the given screen y position.
t_max_err patcherview_set_locked ( t_object p,
char  c 
)

Lock or unlock a patcherview.

Parameters
pThe patcherview instance whose attribute value will be set.
cSet this value to zero to unlock the patcherview, otherwise pass a non-zero value.
Returns
An error code.
t_max_err patcherview_set_presentation ( t_object p,
char  c 
)

Set whether or not a patcherview is a presentation view.

Parameters
pThe patcherview instance whose attribute value will be set.
cSet this value to non-zero to make the patcherview a presentation view, otherwise pass zero.
Returns
An error code.
t_max_err patcherview_set_rect ( t_object pv,
t_rect pr 
)

Set the value of the rect attribute for a patcherview.

Parameters
pvThe patcherview instance whose attribute value will be set.
prThe address of a valid t_rect struct.
Returns
An error code.
t_max_err patcherview_set_visible ( t_object pv,
char  c 
)

Set the 'visible' attribute of a patcherview.

Parameters
pvThe patcherview instance whose attribute will be set.
cWhether or not the patcherview should be made visible.
Returns
An error code.
t_max_err patcherview_set_zoomfactor ( t_object pv,
double  d 
)

Set the zoom-factor of a patcherview.

Parameters
pvThe patcherview instance whose attribute value will be set.
dThe zoom-factor at which the patcherview should display the patcher.
Returns
An error code.
  Copyright © 2015, Cycling '74