libgeda

scheme_page.c File Reference

Scheme API page manipulation procedures. More...

#include <config.h>
#include "libgeda_priv.h"
#include "libgedaguile_priv.h"
#include "scheme_page.x"
Include dependency graph for scheme_page.c:

Go to the source code of this file.

Functions

 SCM_SYMBOL (edascm_string_format_sym,"string-format")
 SCM_DEFINE (active_pages,"%active-pages", 0, 0, 0,(),"Retrieve a list of currently-opened pages")
 Get a of open pages.
 SCM_DEFINE (new_page,"%new-page", 1, 0, 0,(SCM filename_s),"Create a new page")
 Create a new page.
 SCM_DEFINE (close_page_x,"%close-page!", 1, 0, 0,(SCM page_s),"Close a page.")
 Close a page.
 SCM_DEFINE (page_filename,"%page-filename", 1, 0, 0,(SCM page_s),"Get a page's associated filename")
 Get the filename associated with a page.
 SCM_DEFINE (set_page_filename_x,"%set-page-filename!", 2, 0, 0,(SCM page_s, SCM filename_s),"Set a page's associated filename")
 Change the filename associated with a page.
 SCM_DEFINE (page_contents,"%page-contents", 1, 0, 0,(SCM page_s),"Get a page's contents.")
 Get a list of objects in a page.
 SCM_DEFINE (object_page,"%object-page", 1, 0, 0,(SCM obj_s),"Get the page that an object smob belongs to")
 Get the page an object belongs to.
 SCM_DEFINE (page_append_x,"%page-append!", 2, 0, 0,(SCM page_s, SCM obj_s),"Add an object to a page.")
 Add an object to a page.
 SCM_DEFINE (page_remove_x,"%page-remove!", 2, 0, 0,(SCM page_s, SCM obj_s),"Remove an object from a page.")
 Remove an object from a page.
 SCM_DEFINE (page_dirty,"%page-dirty?", 1, 0, 0,(SCM page_s),"Check whether a page has been flagged as changed.")
 Check whether a page has been flagged as changed.
 SCM_DEFINE (set_page_dirty_x,"%set-page-dirty!", 2, 0, 0,(SCM page_s, SCM flag_s),"Set whether a page is flagged as changed.")
 Set a page's changed flag.
 SCM_DEFINE (page_to_string,"%page->string", 1, 0, 0,(SCM page_s),"Create a string representation of a page.")
 Create a string representation of a page.
 SCM_DEFINE (string_to_page,"%string->page", 2, 0, 0,(SCM filename_s, SCM str_s),"Create a new page from a string.")
 Create a page from a string representation.
static void init_module_geda_core_page ()
 Create the (geda core page) Scheme module.
void edascm_init_page ()
 Initialise the basic gEDA page manipulation procedures.

Detailed Description

Definition in file scheme_page.c.


Function Documentation

SCM_SYMBOL ( edascm_string_format_sym  ,
"string-format"   
)
SCM_DEFINE ( active_pages  ,
"%active-pages"  ,
,
,
,
()  ,
"Retrieve a list of currently-opened pages"   
)
Function Description
Retrieves a Scheme list of currently-opened pages.
Note:
Scheme API: Implements the active-pages procedure of the (geda core page) module.
Returns:
a Scheme list of PAGE smobs.

Definition at line 41 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( new_page  ,
"%new-page"  ,
,
,
,
(SCM filename_s)  ,
"Create a new page"   
)
Function Description
Creates and initialises a new PAGE structure associated with the filename filename_s. Note that this does not check that a file exists with that name, or attempt to load any data from it.
Note:
Scheme API: Implements the new-page procedure of the (geda core page) module.
Returns:
a newly-created PAGE smob.

Definition at line 70 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( close_page_x  ,
"%close-page!"  ,
,
,
,
(SCM page_s)  ,
"Close a page."   
)
Function Description

Destroys the PAGE structure page_s, freeing all of its resources. Attempting to use page_s after calling this function will cause an error.

Note:
Scheme API: Implements the close-page procedure of the (geda core page) module.
Parameters:
page_sThe page to close.
Returns:
SCM_UNDEFINED.

Definition at line 101 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( page_filename  ,
"%page-filename"  ,
,
,
,
(SCM page_s)  ,
"Get a page's associated filename"   
)
Function Description
Retrieves the filename associated with the PAGE smob page_s.
Note:
Scheme API: Implements the page-filename procedure of the (geda core page) module.
Returns:
a Scheme string containing the page filename.

Definition at line 125 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( set_page_filename_x  ,
"%set-page-filename!"  ,
,
,
,
(SCM page_s, SCM filename_s)  ,
"Set a page's associated filename"   
)
Function Description
Sets the filename associated with the PAGE smob page_s.
Note:
Scheme API: Implements the set-page-filename! procedure of the (geda core page) module.
Parameters:
page_spage to set filename for.
filename_snew filename for page.
Returns:
page.

Definition at line 150 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( page_contents  ,
"%page-contents"  ,
,
,
,
(SCM page_s)  ,
"Get a page's contents."   
)
Function Description
Retrieves the contents of a the PAGE smob page_s as a Scheme list of OBJECT smobs.
Note:
Scheme API: Implements the page-contents procedure of the (geda core page) module.
Returns:
a list of OBJECT smobs.

Definition at line 179 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( object_page  ,
"%object-page"  ,
,
,
,
(SCM obj_s)  ,
"Get the page that an object smob belongs to"   
)
Function Description
Returns a smob for the PAGE that obj_s belongs to. If obj_s does not belong to a PAGE, returns SCM_BOOL_F.
Note:
Scheme API: Implements the object-page procedure in the (geda core page) module.
Parameters:
[in]obj_san OBJECT smob.
Returns:
a PAGE smob or SCM_BOOL_F.

Definition at line 204 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( page_append_x  ,
"%page-append!"  ,
,
,
,
(SCM page_s, SCM obj_s)  ,
"Add an object to a page."   
)
Function Description
Adds obj_s to page_s. If obj_s is already attached to a PAGE or to a complex OBJECT, throws a Scheme error.
Note:
Scheme API: Implements the page-append! procedure of the (geda core page) module.
Returns:
page_s.

Definition at line 231 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( page_remove_x  ,
"%page-remove!"  ,
,
,
,
(SCM page_s, SCM obj_s)  ,
"Remove an object from a page."   
)
Function Description
Removes obj_s from page_s. If obj_s is attached to a PAGE other than page_s, or to a complex OBJECT, throws a Scheme error. If obj_s is not attached to a page, does nothing.
Note:
Scheme API: Implements the page-remove! procedure of the (geda core page) module.
Returns:
page_s.

Definition at line 276 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( page_dirty  ,
"%page-dirty?"  ,
,
,
,
(SCM page_s)  ,
"Check whether a page has been flagged as changed."   
)
Function Description
Returns SCM_BOOL_T if page_s has been flagged as having been modified.
Note:
Scheme API: Implements the page-dirty? procedure of the (geda core page) module.
Parameters:
page_spage to inspect.
Returns:
SCM_BOOL_T if page is dirtied, otherwise SCM_BOOL_F.

Definition at line 337 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( set_page_dirty_x  ,
"%set-page-dirty!"  ,
,
,
,
(SCM page_s, SCM flag_s)  ,
"Set whether a page is flagged as changed."   
)
Function Description
If flag_s is true, flag page_s as having been modified. Otherwise, clears the change flag.
Note:
Scheme API: Implements the set-page-dirty! procedure of the (geda core page) module.
Parameters:
page_spage to modify.
flag_snew flag setting.
Returns:
page_s

Definition at line 360 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( page_to_string  ,
"%page->string"  ,
,
,
,
(SCM page_s)  ,
"Create a string representation of a page."   
)
Function Description
Returns a string representation of the contents of page_s.
Note:
Scheme API: Implements the page->string procedure of the (geda core page) module.
Parameters:
page_spage to convert to a string.
Returns:
a string representation of page_s.

Definition at line 383 of file scheme_page.c.

Here is the call graph for this function:

SCM_DEFINE ( string_to_page  ,
"%string->page"  ,
,
,
,
(SCM filename_s, SCM str_s)  ,
"Create a new page from a string."   
)
Function Description
Returns a page with filename filename_s created by parsing str_s. Throws an error if str_s contains invalid gEDA file format syntax.
Note:
Scheme API: Implements the string->page procedure of the (geda core page) module.
Parameters:
filename_sFilename for new page.
str_sString to parse to create page.
Returns:
a new page created by parsing str_s.

Definition at line 415 of file scheme_page.c.

Here is the call graph for this function:

static void init_module_geda_core_page ( ) [static]
Function Description
Defines procedures in the (geda core page) module. The module can be accessed using (use-modules (geda core page)).

Definition at line 457 of file scheme_page.c.

void edascm_init_page ( )
Function Description
Registers some Scheme procedures for working with PAGE smobs. Should only be called by scheme_api_init().

Definition at line 477 of file scheme_page.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines