gschem

gschem_dialog.c File Reference

#include <config.h>
#include <glib.h>
#include <glib-object.h>
#include <glib/gstdio.h>
#include "gschem.h"
#include <gdk/gdkkeysyms.h>
#include "../include/gschem_dialog.h"
Include dependency graph for gschem_dialog.c:

Go to the source code of this file.

Defines

#define DIALOG_GEOMETRY_STORE   "gschem-dialog-geometry"

Enumerations

enum  { PROP_SETTINGS_NAME = 1, PROP_GSCHEM_TOPLEVEL }
enum  { GEOMETRY_SAVE, GEOMETRY_RESTORE, LAST_SIGNAL }

Functions

static void gschem_marshal_VOID__POINTER_STRING (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data)
static void save_geometry_to_file (gpointer user_data)
 Save all geometry data into a file.
static void geometry_save (GschemDialog *dialog, GKeyFile *key_file, gchar *group_name)
 GschemDialog "geometry_save" class method handler.
static void geometry_restore (GschemDialog *dialog, GKeyFile *key_file, gchar *group_name)
 GschemDialog "geometry_restore" class method handler.
static void setup_keyfile ()
 Setup the GKeyFile for saving / restoring geometry.
static void show_handler (GtkWidget *widget)
 GtkWidget show signal handler.
static void unmap_handler (GtkWidget *widget)
 GtkWidget unmap signal handler.
static void gschem_dialog_finalize (GObject *object)
 GObject finalise handler.
static void gschem_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
 GObject property setter function.
static void gschem_dialog_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec)
 GObject property getter function.
static void gschem_dialog_class_init (GschemDialogClass *klass)
 GType class initialiser for GschemDialog.
GType gschem_dialog_get_type ()
 Function to retrieve GschemDialog's GType identifier.
static void gschem_dialog_add_buttons_valist (GtkDialog *dialog, const gchar *first_button_text, va_list args)
 Internal GTK function modified from GTK+-2.4.14 gtkdialog.c to support gschem_dialog_new_with_buttons(...)
static GtkWidget * gschem_dialog_new_empty (const gchar *title, GtkWindow *parent, GtkDialogFlags flags, const gchar *settings_name, GSCHEM_TOPLEVEL *w_current)
 Internal GTK function modified from GTK+-2.4.14 gtkdialog.c to support gschem_dialog_new_with_buttons(...)
GtkWidget * gschem_dialog_new_with_buttons (const gchar *title, GtkWindow *parent, GtkDialogFlags flags, const gchar *settings_name, GSCHEM_TOPLEVEL *w_current, const gchar *first_button_text,...)
 GTK function modified from GTK+-2.4.14 gtkdialog.c to provide a GschemDialog equivelant of the convenience function gtk_dialog_new_with_buttons(...)

Variables

static guint gschem_dialog_signals [LAST_SIGNAL] = { 0 }
static GObjectClass * gschem_dialog_parent_class = NULL
static GKeyFile * dialog_geometry = NULL

Define Documentation

#define DIALOG_GEOMETRY_STORE   "gschem-dialog-geometry"

Definition at line 90 of file gschem_dialog.c.


Enumeration Type Documentation

anonymous enum
Enumerator:
PROP_SETTINGS_NAME 
PROP_GSCHEM_TOPLEVEL 

Definition at line 73 of file gschem_dialog.c.

anonymous enum
Enumerator:
GEOMETRY_SAVE 
GEOMETRY_RESTORE 
LAST_SIGNAL 

Definition at line 79 of file gschem_dialog.c.


Function Documentation

static void gschem_marshal_VOID__POINTER_STRING ( GClosure *  closure,
GValue *  return_value,
guint  n_param_values,
const GValue *  param_values,
gpointer  invocation_hint,
gpointer  marshal_data 
) [static]

Definition at line 39 of file gschem_dialog.c.

static void save_geometry_to_file ( gpointer  user_data) [static]
Function Description
This is called at program exit to save all window geometry data into a file
Parameters:
[in]user_dataunused

Definition at line 100 of file gschem_dialog.c.

static void geometry_save ( GschemDialog dialog,
GKeyFile *  key_file,
gchar *  group_name 
) [static]
Function Description
Save the dialog's current position and size to the passed GKeyFile
Parameters:
[in]dialogThe GschemDialog to save the position and size of.
[in]key_fileThe GKeyFile to save the geometry data to.
[in]group_nameThe group name in the key file to store the data under.

Definition at line 124 of file gschem_dialog.c.

static void geometry_restore ( GschemDialog dialog,
GKeyFile *  key_file,
gchar *  group_name 
) [static]
Function Description
Restore dialog's last position and size from the passed GKeyFile
Parameters:
[in]dialogThe GschemDialog to restore the position and size of.
[in]key_fileThe GKeyFile to load the geometry data from.
[in]group_nameThe group name in the key file to find the data under.

Definition at line 147 of file gschem_dialog.c.

static void setup_keyfile ( ) [static]
Function Description
Check if the GKeyFile for saving / restoring geometry is open. If it doesn't exist, we create it here, and also install a hook to ensure its contents are saved at program exit.

Definition at line 168 of file gschem_dialog.c.

Here is the call graph for this function:

static void show_handler ( GtkWidget *  widget) [static]
Function Description
Just before the dialog widget is shown, call the hook to restore its previously saved position and size.
Parameters:
[in]widgetThe GtkWidget being shown.

Definition at line 207 of file gschem_dialog.c.

Here is the call graph for this function:

static void unmap_handler ( GtkWidget *  widget) [static]
Function Description
Just before the dialog widget is unmapped, call the hook to save its current position and size.

This typically happens when you call gtk_widget_destroy().

Parameters:
[in]widgetThe GtkWidget being unmapped.

Definition at line 238 of file gschem_dialog.c.

static void gschem_dialog_finalize ( GObject *  object) [static]
Function Description
Just before the GschemDialog GObject is finalized, free our allocated data, and then chain up to the parent's finalize handler.
Parameters:
[in]objectThe GObject being finalized.

Definition at line 264 of file gschem_dialog.c.

static void gschem_dialog_set_property ( GObject *  object,
guint  property_id,
const GValue *  value,
GParamSpec *  pspec 
) [static]
Function Description
Setter function for GschemDialog's GObject properties, "settings-name" and "toplevel".
Parameters:
[in]objectThe GObject whose properties we are setting
[in]property_idThe numeric id. under which the property was registered with g_object_class_install_property()
[in]valueThe GValue the property is being set from
[in]pspecA GParamSpec describing the property being set

Definition at line 286 of file gschem_dialog.c.

static void gschem_dialog_get_property ( GObject *  object,
guint  property_id,
GValue *  value,
GParamSpec *  pspec 
) [static]
Function Description
Getter function for GschemDialog's GObject properties, "settings-name" and "toplevel".
Parameters:
[in]objectThe GObject whose properties we are getting
[in]property_idThe numeric id. under which the property was registered with g_object_class_install_property()
[out]valueThe GValue in which to return the value of the property
[in]pspecA GParamSpec describing the property being got

Definition at line 317 of file gschem_dialog.c.

static void gschem_dialog_class_init ( GschemDialogClass klass) [static]
Function Description
GType class initialiser for GschemDialog. We override our parent virtual class methods as needed and register our GObject properties.
Parameters:
[in]klassThe GschemDialogClass we are initialising

Definition at line 343 of file gschem_dialog.c.

Here is the call graph for this function:

GType gschem_dialog_get_type ( void  )
Function Description
Function to retrieve GschemDialog's GType identifier. Upon first call, this registers the GschemDialog in the GType system. Subsequently it returns the saved value from its first execution.
Returns:
the GType identifier associated with GschemDialog.

Definition at line 413 of file gschem_dialog.c.

Here is the call graph for this function:

static void gschem_dialog_add_buttons_valist ( GtkDialog *  dialog,
const gchar *  first_button_text,
va_list  args 
) [static]
Function Description
Convenience function which adds buttons to a pre-existing GtkDialog
Parameters:
[in]dialogThe GtkDialog buttons are being added to
[in]first_button_textThe text string for the first button
[in]argsThe va_list containging the remaining button strings

Definition at line 449 of file gschem_dialog.c.

static GtkWidget* gschem_dialog_new_empty ( const gchar *  title,
GtkWindow *  parent,
GtkDialogFlags  flags,
const gchar *  settings_name,
GSCHEM_TOPLEVEL w_current 
) [static]
Function Description
Convenience function which creates a blank GschemDialog with various options.
Parameters:
[in]titleThe title text of the dialog
[in]parentThe GtkWindow which will parent this dialog
[in]flagsThe GtkDialogFlags to use when setting up the dialog
[in]settings_nameThe name gschem should use to store this dialog's settings
[in]w_currentThe GSCHEM_TOPLEVEL object this dialog is associated with
Returns:
The GschemDialog created.

Definition at line 490 of file gschem_dialog.c.

GtkWidget* gschem_dialog_new_with_buttons ( const gchar *  title,
GtkWindow *  parent,
GtkDialogFlags  flags,
const gchar *  settings_name,
GSCHEM_TOPLEVEL w_current,
const gchar *  first_button_text,
  ... 
)
Function Description
Convenience function which creates a GschemDialog with buttons and options.
Parameters:
[in]titleThe title text of the dialog
[in]parentThe GtkWindow which will parent this dialog
[in]flagsThe GtkDialogFlags to use when setting up the dialog
[in]settings_nameThe name gschem should use to store this dialog's settings
[in]w_currentThe GSCHEM_TOPLEVEL object this dialog is associated with
[in]first_button_textThe text string for the first button
[in]...A variable number of arguments with the remaining button strings
Returns:
The GschemDialog created.

Definition at line 539 of file gschem_dialog.c.

Here is the call graph for this function:


Variable Documentation

guint gschem_dialog_signals[LAST_SIGNAL] = { 0 } [static]

Definition at line 85 of file gschem_dialog.c.

GObjectClass* gschem_dialog_parent_class = NULL [static]

Definition at line 86 of file gschem_dialog.c.

GKeyFile* dialog_geometry = NULL [static]

Definition at line 88 of file gschem_dialog.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines