gschem
|
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include "gschem.h"
#include <gdk/gdkkeysyms.h>
#include "../include/gschem_dialog.h"
#include "../include/x_preview.h"
#include "../include/x_compselect.h"
Go to the source code of this file.
Defines | |
#define | COMPSELECT_FILTER_INTERVAL 200 |
The time interval between request and actual filtering. | |
Enumerations | |
enum | compselect_view { VIEW_INUSE = 0, VIEW_CLIB } |
enum | { PROP_SYMBOL = 1, PROP_BEHAVIOR, PROP_HIDDEN } |
enum | { ATTRIBUTE_COLUMN_NAME = 0, ATTRIBUTE_COLUMN_VALUE, NUM_ATTRIBUTE_COLUMNS } |
Functions | |
static enum compselect_view | compselect_get_view (Compselect *compselect) |
Return currently active component-selector view. | |
static void | x_compselect_callback_response (GtkDialog *dialog, gint arg1, gpointer user_data) |
Process the response returned by the component selection dialog. | |
void | x_compselect_open (GSCHEM_TOPLEVEL *w_current) |
Opens a component selection dialog. | |
void | x_compselect_close (GSCHEM_TOPLEVEL *w_current) |
Closes the component selection dialog. | |
void | x_compselect_deselect (GSCHEM_TOPLEVEL *w_current) |
static void | compselect_class_init (CompselectClass *class) |
static GObject * | compselect_constructor (GType type, guint n_construct_properties, GObjectConstructParam *construct_params) |
static void | compselect_finalize (GObject *object) |
static void | compselect_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) |
static void | compselect_get_property (GObject *object, guint property_id, GValue *value, GParamSpec *pspec) |
static void | inuse_treeview_set_cell_data (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) |
Sets data for a particular cell of the in use treeview. | |
static void | lib_treeview_set_cell_data (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data) |
Sets data for a particular cell of the library treeview. | |
static gboolean | lib_model_filter_visible_func (GtkTreeModel *model, GtkTreeIter *iter, gpointer data) |
Determines visibility of items of the library treeview. | |
static void | tree_row_activated (GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data) |
Handles activation (e.g. double-clicking) of a component row. | |
static gint | sort_object_text (OBJECT *a, OBJECT *b) |
GCompareFunc to sort an text object list by the object strings. | |
void | update_attributes_model (Compselect *compselect, TOPLEVEL *preview_toplevel) |
Update the model of the attributes treeview. | |
static void | compselect_callback_tree_selection_changed (GtkTreeSelection *selection, gpointer user_data) |
Handles changes in the treeview selection. | |
static gboolean | compselect_filter_timeout (gpointer data) |
Requests re-evaluation of the filter. | |
static void | compselect_callback_filter_entry_changed (GtkEditable *editable, gpointer user_data) |
Callback function for the changed signal of the filter entry. | |
static void | compselect_callback_filter_button_clicked (GtkButton *button, gpointer user_data) |
Handles a click on the clear button. | |
static void | compselect_callback_behavior_changed (GtkOptionMenu *optionmenu, gpointer user_data) |
Handles changes of behavior. | |
static GtkTreeModel * | create_inuse_tree_model (Compselect *compselect) |
static GtkTreeModel * | create_lib_tree_model (Compselect *compselect) |
static void | compselect_callback_refresh_library (GtkButton *button, gpointer user_data) |
static GtkWidget * | create_inuse_treeview (Compselect *compselect) |
Creates the treeview for the "In Use" view. | |
static GtkWidget * | create_lib_treeview (Compselect *compselect) |
Creates the treeview for the "Library" view. | |
static GtkWidget * | create_attributes_treeview (Compselect *compselect) |
Creates the treeview widget for the attributes. | |
static GtkWidget * | create_behaviors_combo_box (void) |
Create the combo box for behaviors. | |
GType | compselect_get_type () |
static void | compselect_geometry_save (GschemDialog *dialog, GKeyFile *key_file, gchar *group_name) |
GschemDialog "geometry_save" class method handler. | |
static void | compselect_geometry_restore (GschemDialog *dialog, GKeyFile *key_file, gchar *group_name) |
GschemDialog "geometry_restore" class method handler. | |
GType | compselect_behavior_get_type (void) |
Variables | |
static GObjectClass * | compselect_parent_class = NULL |
#define COMPSELECT_FILTER_INTERVAL 200 |
This constant is the time-lag between user modifications in the filter entry and the actual evaluation of the filter which ultimately update the display. It helps reduce the frequency of evaluation of the filter as user types.
Unit is milliseconds.
Definition at line 57 of file x_compselect.c.
enum compselect_view |
Definition at line 60 of file x_compselect.c.
anonymous enum |
Definition at line 287 of file x_compselect.c.
anonymous enum |
Definition at line 471 of file x_compselect.c.
static enum compselect_view compselect_get_view | ( | Compselect * | compselect | ) | [static] |
[in] | compselect | The component selection dialog. |
Definition at line 80 of file x_compselect.c.
static void x_compselect_callback_response | ( | GtkDialog * | dialog, |
gint | arg1, | ||
gpointer | user_data | ||
) | [static] |
Parameter user_data is a pointer on the relevant toplevel structure.
[in] | dialog | The component selection dialog. |
[in] | arg1 | The response ID. |
[in] | user_data | A pointer on the GSCHEM_TOPLEVEL environment. |
Definition at line 105 of file x_compselect.c.
void x_compselect_open | ( | GSCHEM_TOPLEVEL * | w_current | ) |
[in] | w_current | The GSCHEM_TOPLEVEL environment. |
Definition at line 207 of file x_compselect.c.
void x_compselect_close | ( | GSCHEM_TOPLEVEL * | w_current | ) |
[in] | w_current | The GSCHEM_TOPLEVEL environment. |
Definition at line 254 of file x_compselect.c.
void x_compselect_deselect | ( | GSCHEM_TOPLEVEL * | w_current | ) |
static void compselect_class_init | ( | CompselectClass * | class | ) | [static] |
static GObject * compselect_constructor | ( | GType | type, |
guint | n_construct_properties, | ||
GObjectConstructParam * | construct_params | ||
) | [static] |
static void compselect_finalize | ( | GObject * | object | ) | [static] |
Definition at line 1491 of file x_compselect.c.
static void compselect_set_property | ( | GObject * | object, |
guint | property_id, | ||
const GValue * | value, | ||
GParamSpec * | pspec | ||
) | [static] |
Definition at line 1504 of file x_compselect.c.
static void compselect_get_property | ( | GObject * | object, |
guint | property_id, | ||
GValue * | value, | ||
GParamSpec * | pspec | ||
) | [static] |
static void inuse_treeview_set_cell_data | ( | GtkTreeViewColumn * | tree_column, |
GtkCellRenderer * | cell, | ||
GtkTreeModel * | tree_model, | ||
GtkTreeIter * | iter, | ||
gpointer | data | ||
) | [static] |
The model is a list of symbols. s_clib_symbol_get_name() is called to get the text to display.
Definition at line 321 of file x_compselect.c.
static void lib_treeview_set_cell_data | ( | GtkTreeViewColumn * | tree_column, |
GtkCellRenderer * | cell, | ||
GtkTreeModel * | tree_model, | ||
GtkTreeIter * | iter, | ||
gpointer | data | ||
) | [static] |
The top level of the model contains sources, and the next symbols. s_clib_source_get_name() or s_clib_symbol_get_name() as appropriate is called to get the text to display.
Definition at line 343 of file x_compselect.c.
static gboolean lib_model_filter_visible_func | ( | GtkTreeModel * | model, |
GtkTreeIter * | iter, | ||
gpointer | data | ||
) | [static] |
[in] | model | The current selection in the treeview. |
[in] | iter | An iterator on a component or folder in the tree. |
[in] | data | The component selection dialog. |
Definition at line 377 of file x_compselect.c.
static void tree_row_activated | ( | GtkTreeView * | tree_view, |
GtkTreePath * | path, | ||
GtkTreeViewColumn * | column, | ||
gpointer | user_data | ||
) | [static] |
[in] | tree_view | The component treeview. |
[in] | path | The GtkTreePath to the activated row. |
[in] | column | The GtkTreeViewColumn in which the activation occurred. |
[in] | user_data | The component selection dialog. |
Definition at line 439 of file x_compselect.c.
static gint sort_object_text | ( | OBJECT * | a, |
OBJECT * | b | ||
) | [static] |
Definition at line 466 of file x_compselect.c.
void update_attributes_model | ( | Compselect * | compselect, |
TOPLEVEL * | preview_toplevel | ||
) |
[in] | compselect | The dialog compselect |
[in] | preview_toplevel | The toplevel of the preview widget |
Definition at line 485 of file x_compselect.c.
static void compselect_callback_tree_selection_changed | ( | GtkTreeSelection * | selection, |
gpointer | user_data | ||
) | [static] |
If the selection is not a selection of a component (a directory name), it does nothing. Otherwise it retrieves the #CLibSymbol from the model.
It then emits the dialog's apply signal to let its parent know that a component has been selected.
[in] | selection | The current selection in the treeview. |
[in] | user_data | The component selection dialog. |
Definition at line 569 of file x_compselect.c.
static gboolean compselect_filter_timeout | ( | gpointer | data | ) | [static] |
The timeout this callback is attached to is removed after the function.
[in] | data | The component selection dialog. |
Definition at line 625 of file x_compselect.c.
static void compselect_callback_filter_entry_changed | ( | GtkEditable * | editable, |
gpointer | user_data | ||
) | [static] |
It specifically manages the sensitivity of the clear button of the entry depending on its contents. It also requests an update of the component list by re-evaluating filter at every changes.
[in] | editable | The filter text entry. |
[in] | user_data | The component selection dialog. |
Definition at line 663 of file x_compselect.c.
static void compselect_callback_filter_button_clicked | ( | GtkButton * | button, |
gpointer | user_data | ||
) | [static] |
It resets the filter entry, indirectly causing re-evaluation of the filter on the list of symbols to update the display.
[in] | button | The clear button |
[in] | user_data | The component selection dialog. |
Definition at line 704 of file x_compselect.c.
static void compselect_callback_behavior_changed | ( | GtkOptionMenu * | optionmenu, |
gpointer | user_data | ||
) | [static] |
It emits the dialog's apply signal to let the parent know that the requested behavior for the next adding of a component has been changed.
[in] | optionmenu | The behavior option menu. |
[in] | user_data | The component selection dialog. |
Definition at line 727 of file x_compselect.c.
static GtkTreeModel* create_inuse_tree_model | ( | Compselect * | compselect | ) | [static] |
Definition at line 744 of file x_compselect.c.
static GtkTreeModel* create_lib_tree_model | ( | Compselect * | compselect | ) | [static] |
Definition at line 776 of file x_compselect.c.
static void compselect_callback_refresh_library | ( | GtkButton * | button, |
gpointer | user_data | ||
) | [static] |
static GtkWidget* create_inuse_treeview | ( | Compselect * | compselect | ) | [static] |
static GtkWidget* create_lib_treeview | ( | Compselect * | compselect | ) | [static] |
static GtkWidget* create_attributes_treeview | ( | Compselect * | compselect | ) | [static] |
Definition at line 1146 of file x_compselect.c.
static GtkWidget* create_behaviors_combo_box | ( | void | ) | [static] |
Definition at line 1208 of file x_compselect.c.
GType compselect_get_type | ( | void | ) |
static void compselect_geometry_save | ( | GschemDialog * | dialog, |
GKeyFile * | key_file, | ||
gchar * | group_name | ||
) | [static] |
[in] | dialog | The GschemDialog to save the geometry of. |
[in] | key_file | The GKeyFile to save the geometry data to. |
[in] | group_name | The group name in the key file to store the data under. |
Definition at line 1268 of file x_compselect.c.
static void compselect_geometry_restore | ( | GschemDialog * | dialog, |
GKeyFile * | key_file, | ||
gchar * | group_name | ||
) | [static] |
[in] | dialog | The GschemDialog to restore the geometry of. |
[in] | key_file | The GKeyFile to save the geometry data to. |
[in] | group_name | The group name in the key file to store the data under. |
Definition at line 1298 of file x_compselect.c.
GType compselect_behavior_get_type | ( | void | ) |
Definition at line 1586 of file x_compselect.c.
GObjectClass* compselect_parent_class = NULL [static] |
Definition at line 293 of file x_compselect.c.