gattrib

gattrib.c File Reference

#include <config.h>
#include <version.h>
#include <stdio.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
#include <glib.h>
#include <glib-object.h>
#include <libgeda/libgeda.h>
#include "../include/struct.h"
#include "../include/prototype.h"
#include "../include/globals.h"
Include dependency graph for gattrib.c:

Go to the source code of this file.

Functions

gboolean gattrib_really_quit (void)
 GTK callback to quit the program.
gint gattrib_quit (gint return_code)
 Quit the program.
void gattrib_main (void *closure, int argc, char *argv[])
 The "real" main for gattrib.
int main (int argc, char *argv[])
 Entry point to gattrib.

Function Documentation

gboolean gattrib_really_quit ( void  )

This is called when the user quits the program using the UI. The callback is attached to the GTK window_delete event in x_window_init() and attached to the File->Quit menu item in x_window_create_menu(). On execution, the function checks for unsaved changes before calling gattrib_quit() to quit the program.

Returns:
value 0 to the shell to denote a successful quit.

Definition at line 149 of file gattrib.c.

Here is the call graph for this function:

gint gattrib_quit ( gint  return_code)

Unconditionally quit gattrib. Flushes caches and I/O channels, calls the GTK function to quit the application then calls exit() with the appropriate return code.

Parameters:
return_codeValue to pass to the exit() system call.

Definition at line 168 of file gattrib.c.

void gattrib_main ( void *  closure,
int  argc,
char *  argv[] 
)

This is the main program body for gattrib. A pointer to this function is passed to scm_boot_guile() at startup.

This function:

  • initialises threading, if the underlying GTK library is threaded. However, gattrib itself isn't threaded.
  • initialises libgeda;
  • parses the command line;
  • starts logging;
  • registers the Scheme functions with Guile;
  • parses the RC files;
  • initialises the GTK UI;
  • populates the spreadsheet data structure;
  • calls gtk_main() to start the event loop.
Parameters:
closure
argcNumber of command line arguments
argvCommand line arguments

Definition at line 205 of file gattrib.c.

Here is the call graph for this function:

int main ( int  argc,
char *  argv[] 
)

This is just a wrapper which invokes the guile stuff, and points to the real main program, gattrib_main(). Note that I still need some vestigial guile stuff in order to read the rc files.

Parameters:
argcNumber of command line arguments
argvCommand line arguments

Definition at line 306 of file gattrib.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines