gschem

g_window.c File Reference

#include <config.h>
#include "gschem.h"
#include "g_window.x"
Include dependency graph for g_window.c:

Go to the source code of this file.

Functions

static size_t smob_free (SCM smob)
 Free a GSCHEM_TOPLEVEL smob.
static int smob_print (SCM smob, SCM port, scm_print_state *pstate)
 Print a representation of a GSCHEM_TOPLEVEL smob.
SCM g_scm_from_window (GSCHEM_TOPLEVEL *w_current)
 Get the smob for a GSCHEM_TOPLEVEL.
void g_dynwind_window (GSCHEM_TOPLEVEL *w_current)
 Set the GSCHEM_TOPLEVEL fluid in the current dynamic context.
 SCM_DEFINE (current_window,"%current-window", 0, 0, 0,(),"Get the GSCHEM_TOPLEVEL for the current dynamic context.")
 Get the value of the GSCHEM_TOPLEVEL fluid.
GSCHEM_TOPLEVELg_current_window ()
 Get the value of the GSCHEM_TOPLEVEL fluid.
 SCM_DEFINE (active_page,"%active-page", 0, 0, 0,(),"Get the active page.")
 Get the active page.
 SCM_DEFINE (set_active_page_x,"%set-active-page!", 1, 0, 0,(SCM page_s),"Set the active page.")
 Set the active page.
 SCM_DEFINE (override_close_page_x,"%close-page!", 1, 0, 0,(SCM page_s),"Close a page.")
 Close a page.
 SCM_DEFINE (pointer_position,"%pointer-position", 0, 0, 0,(),"Get the current pointer position.")
 Get the current pointer position.
 SCM_DEFINE (snap_point,"%snap-point", 2, 0, 0,(SCM x_s, SCM y_s),"Get the current snap grid size.")
 Snap a point to the snap grid.
static void init_module_gschem_core_window ()
 Create the (gschem core window) Scheme module.
void g_init_window ()
 Initialise the GSCHEM_TOPLEVEL manipulation procedures.

Variables

SCM scheme_window_fluid = SCM_UNDEFINED
scm_t_bits window_smob_tag

Function Documentation

static size_t smob_free ( SCM  smob) [static]
Function Description
Finalizes a window smob for deletion.

Used internally to Guile

Definition at line 34 of file g_window.c.

static int smob_print ( SCM  smob,
SCM  port,
scm_print_state *  pstate 
) [static]
Function Description
Outputs a string representing the smob to a Scheme output port. The format used is "#<gschem-window b7ef65d0>".

Used internally to Guile.

Definition at line 55 of file g_window.c.

SCM g_scm_from_window ( GSCHEM_TOPLEVEL w_current)
Function Description
Return a smob representing window.
Parameters:
windowGSCHEM_TOPLEVEL to obtain a smob for.
asmob representing window.

Definition at line 81 of file g_window.c.

void g_dynwind_window ( GSCHEM_TOPLEVEL w_current)
Function Description

This function must be used inside a pair of calls to scm_dynwind_begin() and scm_dynwind_end(). During the dynwind context, the GSCHEM_TOPLEVEL fluid is set to w_current.

Parameters:
[in]w_currentThe new GSCHEM_TOPLEVEL pointer.

Definition at line 103 of file g_window.c.

Here is the call graph for this function:

SCM_DEFINE ( current_window  ,
"%current-window"  ,
,
,
,
()  ,
"Get the GSCHEM_TOPLEVEL for the current dynamic context."   
)
Function Description
Return the value of the GSCHEM_TOPLEVEL fluid in the current dynamic context.

Definition at line 116 of file g_window.c.

GSCHEM_TOPLEVEL* g_current_window ( )
Function Description
Return the value of the GSCHEM_TOPLEVEL fluid in the current dynamic context.

Definition at line 130 of file g_window.c.

SCM_DEFINE ( active_page  ,
"%active-page"  ,
,
,
,
()  ,
"Get the active page."   
)
Function Description
Returns the page which is active in the current gschem window. If there is no active page, returns SCM_BOOL_F.
Note:
Scheme API: Implements the active-page procedure in the (gschem core window) module.
Returns:
the active page.

Definition at line 154 of file g_window.c.

SCM_DEFINE ( set_active_page_x  ,
"%set-active-page!"  ,
,
,
,
(SCM page_s)  ,
"Set the active page."   
)
Function Description
Sets the page which is active in the current gschem window to page_s.
Note:
Scheme API: Implements the set-active-page! procedure in the (gschem core window) module.
Parameters:
page_sPage to switch to.
Returns:
page_s.

Definition at line 177 of file g_window.c.

Here is the call graph for this function:

SCM_DEFINE ( override_close_page_x  ,
"%close-page!"  ,
,
,
,
(SCM page_s)  ,
"Close a page."   
)
Function Description
Closes the page page_s.
Note:
Scheme API: Implements the close-page! procedure in the (gschem core window) module. Overrides the close-page! procedure in the (geda core page) module.
Parameters:
page_sPage to close.
Returns:
SCM_UNDEFINED

Definition at line 200 of file g_window.c.

Here is the call graph for this function:

SCM_DEFINE ( pointer_position  ,
"%pointer-position"  ,
,
,
,
()  ,
"Get the current pointer position."   
)
Function Description
Returns the current mouse pointer position, expressed in world coordinates. If the pointer is outside the schematic drawing area, returns SCM_BOOL_F.

The coordinates are returned as a cons:

(x . y)

Note:
Scheme API: Implements the pointer-position procedure in the (gschem core window) module.
Returns:
The current pointer position, or SCM_BOOL_F.

Definition at line 242 of file g_window.c.

Here is the call graph for this function:

SCM_DEFINE ( snap_point  ,
"%snap-point"  ,
,
,
,
(SCM x_s, SCM y_s)  ,
"Get the current snap grid size."   
)
Function Description
Snaps the point (x_s, y_s) to the snap grid, returning the snapped point position as a cons in the form:

(x . y)

This always snaps the given point to the grid, disregarding the current user snap settings.

Note:
Scheme API: Implements the snap-point procedure in the (gschem core window) module.
Parameters:
x_sthe x-coordinate of the point to be snapped to grid.
y_sthe y-coordinate of the point to be snapped to grid.
Returns:
the snapped coordinates.

Definition at line 271 of file g_window.c.

Here is the call graph for this function:

static void init_module_gschem_core_window ( ) [static]
Function Description
Defines procedures in the (gschem core window) module. The module can be accessed using (use-modules (gschem core window)).

Definition at line 296 of file g_window.c.

void g_init_window ( )
Function Description

Registers some Scheme procedures for working with GSCHEM_TOPLEVEL smobs and creates the GSCHEM_TOPLEVEL fluid. Should only be called by main_prog().

Definition at line 324 of file g_window.c.

Here is the call graph for this function:


Variable Documentation

SCM scheme_window_fluid = SCM_UNDEFINED

Definition at line 23 of file g_window.c.

scm_t_bits window_smob_tag

Definition at line 25 of file g_window.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines