atomes 1.1.14
atomes: an atomic scale modeling tool box
Loading...
Searching...
No Matches
datab.c File Reference

Curve data edition window and associated callbacks. More...

#include <gtk/gtk.h>
#include <cairo.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include "global.h"
#include "interface.h"
#include "callbacks.h"
#include "project.h"
#include "curve.h"
+ Include dependency graph for datab.c:

Go to the source code of this file.

Functions

void get_tree_data (GtkWidget *tree)
 get information on location in a GtkTreeView
 
void save_row (gpointer data, gpointer user_data)
 save row data and udpate calculation result accordingly
 
void update_first_row (gpointer data, gpointer user_data)
 update row in the first column
 
void update_first_col ()
 update all rows in the first column
 
void add_to_last_row (gpointer data, gpointer user_data)
 add constant to last row
 
void add_to_last_col (double cte, gpointer data)
 add constant value to selected rows
 
void multiply_last_row (gpointer data, gpointer user_data)
 multiply last row by constant
 
void multiply_last_col (double cte, gpointer data)
 multiply last colum by constant value
 
void select_row (gpointer data, gpointer user_data)
 select row
 
void copy_row (gpointer data, gpointer user_data)
 copy row
 
void copy_content (gpointer data)
 copy selection
 
void add_row (gpointer data, gpointer user_data)
 add row
 
void delete_row (gpointer data, gpointer user_data)
 delete row
 
void insert_cell (gpointer data)
 insert row
 
void delete_cell (gpointer data)
 delete row
 
G_MODULE_EXPORT void edit_cell (GtkCellRendererText *cell, gchar *path_string, gchar *new_text, gpointer user_data)
 edit cell in the curve data edition tree model
 
G_MODULE_EXPORT void adjust_value (GtkEntry *res, gpointer data)
 adjust constant value entry callback
 
G_MODULE_EXPORT void run_add_to_column (GtkDialog *wind, gint response_id, gpointer data)
 add constant to column - running the dialog
 
void add_to_column (gpointer data)
 add constant to column - creating the dialog
 
G_MODULE_EXPORT void run_multiply_column (GtkDialog *wind, gint response_id, gpointer data)
 multiply column by constant - running the dialog
 
void multiply_column (gpointer data)
 multiply column by constant - creating dialog
 
GMenu * insert_place ()
 create the insertion submenu
 
GMenu * insert_data ()
 create the insert data submenu
 
GMenu * delete_data ()
 create the delete data submenu
 
GMenu * cell_actions ()
 create the cell actions submenu
 
GMenu * cell_title ()
 create the cell based operations subemu
 
GMenu * column_actions ()
 create the column actions submenu
 
GMenu * column_title ()
 create the column based operations submenu
 
GMenu * data_menu ()
 create the curve data edition popup menu elements
 
G_MODULE_EXPORT void data_pop_action (GSimpleAction *action, GVariant *parameter, gpointer data)
 curve data edition popup menu actions callbacks
 
void data_popup_menu (GtkWidget *top_level, GdkEvent *event, gpointer data)
 create curve data edition popup menu GTK3
 
void data_button_event (GtkWidget *data_tree, GdkEvent *event, guint event_button, guint event_type, gpointer data)
 curve data edition mouse button event GTK3
 
G_MODULE_EXPORT gboolean on_data_button_event (GtkWidget *widget, GdkEvent *event, gpointer data)
 on button event in the curve data edition window
 
GtkWidget * setview (project *this_proj, int b, int c)
 create the curve data tree store
 
void cancel_changes (GtkWidget *widg, gpointer data)
 cancel curve data edition
 
G_MODULE_EXPORT void cancel_but (GtkButton *but, gpointer data)
 cancel curve data edition button callback
 
G_MODULE_EXPORT gboolean cancel_win (GtkWidget *win, GdkEvent *event, gpointer data)
 cancel curve data edition callback GTK3
 
G_MODULE_EXPORT void validate_changes (GtkButton *but, gpointer data)
 apply data edition changes
 
void edit_data (gpointer data)
 create edit curve data dialog
 

Variables

int nrows
 
GtkTreeModel * curve_model
 
GList * lrows
 
GList * rows
 
GtkTreeSelection * sel
 
GtkTreePath * path
 
GtkTreeIter row
 
gchar * text
 
GtkWidget * col_entry
 

Detailed Description

Curve data edition window and associated callbacks.

Author
Sébastien Le Roux sebas.nosp@m.tien.nosp@m..lero.nosp@m.ux@i.nosp@m.pcms..nosp@m.unis.nosp@m.tra.f.nosp@m.r

Definition in file datab.c.

Function Documentation

◆ add_row()

void add_row ( gpointer data,
gpointer user_data )

add row

Parameters
datathe path in the tree model
user_datathe associated data pointer

Definition at line 331 of file datab.c.

◆ add_to_column()

void add_to_column ( gpointer data)

add constant to column - creating the dialog

Parameters
datathe associated data pointer

Definition at line 464 of file datab.c.

◆ add_to_last_col()

void add_to_last_col ( double cte,
gpointer data )

add constant value to selected rows

Parameters
ctethe constant to add
datathe associated data pointer

Definition at line 204 of file datab.c.

◆ add_to_last_row()

void add_to_last_row ( gpointer data,
gpointer user_data )

add constant to last row

Parameters
datathe path in the tree model
user_datathe constant

Definition at line 184 of file datab.c.

◆ adjust_value()

G_MODULE_EXPORT void adjust_value ( GtkEntry * res,
gpointer data )

adjust constant value entry callback

Parameters
resthe GtkEntry sending the signal
datathe associated data pointer

Definition at line 429 of file datab.c.

◆ cancel_but()

G_MODULE_EXPORT void cancel_but ( GtkButton * but,
gpointer data )

cancel curve data edition button callback

Parameters
butthe GtkButton sending the signal
datathe associated data pointer

Definition at line 968 of file datab.c.

◆ cancel_changes()

void cancel_changes ( GtkWidget * widg,
gpointer data )

cancel curve data edition

Parameters
widgthe GtkWidget sending the signal
datathe associated data pointer

Definition at line 953 of file datab.c.

◆ cancel_win()

G_MODULE_EXPORT gboolean cancel_win ( GtkWidget * win,
GdkEvent * event,
gpointer data )

cancel curve data edition callback GTK3

Parameters
winthe GtkWidget sending the signal
eventthe GdkEvent triggering the signal
datathe associated data pointer

Definition at line 993 of file datab.c.

◆ cell_actions()

GMenu * cell_actions ( )

create the cell actions submenu

Definition at line 584 of file datab.c.

◆ cell_title()

GMenu * cell_title ( )

create the cell based operations subemu

Definition at line 598 of file datab.c.

◆ column_actions()

GMenu * column_actions ( )

create the column actions submenu

Definition at line 610 of file datab.c.

◆ column_title()

GMenu * column_title ( )

create the column based operations submenu

Definition at line 623 of file datab.c.

◆ copy_content()

void copy_content ( gpointer data)

copy selection

Parameters
datathe associated data pointer

Definition at line 312 of file datab.c.

◆ copy_row()

void copy_row ( gpointer data,
gpointer user_data )

copy row

Parameters
datathe path in the tree model
user_datathe associated data pointer

Definition at line 281 of file datab.c.

◆ data_button_event()

void data_button_event ( GtkWidget * data_tree,
GdkEvent * event,
guint event_button,
guint event_type,
gpointer data )

curve data edition mouse button event GTK3

Parameters
data_treethe GtkWidget sending the signal
eventthe GdkEvent triggering the signal
event_buttonevent button
event_typeevent type
datathe associated data pointer

Definition at line 770 of file datab.c.

◆ data_menu()

GMenu * data_menu ( )

create the curve data edition popup menu elements

Definition at line 635 of file datab.c.

◆ data_pop_action()

G_MODULE_EXPORT void data_pop_action ( GSimpleAction * action,
GVariant * parameter,
gpointer data )

curve data edition popup menu actions callbacks

Parameters
actionthe GAction sending the signal
parameterGVariant parameter of the GAction
datathe associated data pointer

Definition at line 654 of file datab.c.

◆ data_popup_menu()

void data_popup_menu ( GtkWidget * top_level,
GdkEvent * event,
gpointer data )

create curve data edition popup menu GTK3

Parameters
top_levelthe top level widget
eventthe GdkEvent triggering the signal
datathe associated data pointer

Definition at line 705 of file datab.c.

◆ delete_cell()

void delete_cell ( gpointer data)

delete row

Parameters
datathe associated data pointer

Definition at line 393 of file datab.c.

◆ delete_data()

GMenu * delete_data ( )

create the delete data submenu

Definition at line 572 of file datab.c.

◆ delete_row()

void delete_row ( gpointer data,
gpointer user_data )

delete row

Parameters
datathe path in the tree model
user_datathe associated data pointer

Definition at line 356 of file datab.c.

◆ edit_cell()

G_MODULE_EXPORT void edit_cell ( GtkCellRendererText * cell,
gchar * path_string,
gchar * new_text,
gpointer user_data )

edit cell in the curve data edition tree model

Parameters
cellthe GtkCellRendererText sending the signal
path_stringthe path in the tree model
new_textthe string describing the new value
user_datathe associated data pointer

Definition at line 409 of file datab.c.

◆ edit_data()

void edit_data ( gpointer data)

create edit curve data dialog

Parameters
datathe associated data pointer

Definition at line 1037 of file datab.c.

◆ get_tree_data()

void get_tree_data ( GtkWidget * tree)

get information on location in a GtkTreeView

Parameters
treethe GtkTreeView

Definition at line 114 of file datab.c.

◆ insert_cell()

void insert_cell ( gpointer data)

insert row

Parameters
datathe associated data pointer

Definition at line 372 of file datab.c.

◆ insert_data()

GMenu * insert_data ( )

create the insert data submenu

Definition at line 560 of file datab.c.

◆ insert_place()

GMenu * insert_place ( )

create the insertion submenu

Definition at line 547 of file datab.c.

◆ multiply_column()

void multiply_column ( gpointer data)

multiply column by constant - creating dialog

Parameters
datathe associated data pointer

Definition at line 517 of file datab.c.

◆ multiply_last_col()

void multiply_last_col ( double cte,
gpointer data )

multiply last colum by constant value

Parameters
ctethe constant value
datathe associated data pointer

Definition at line 244 of file datab.c.

◆ multiply_last_row()

void multiply_last_row ( gpointer data,
gpointer user_data )

multiply last row by constant

Parameters
datathe path in the tree model
user_datathe constant

Definition at line 224 of file datab.c.

◆ on_data_button_event()

G_MODULE_EXPORT gboolean on_data_button_event ( GtkWidget * widget,
GdkEvent * event,
gpointer data )

on button event in the curve data edition window

Parameters
widgetthe GtkWidget sending the signal
event
data

Definition at line 836 of file datab.c.

◆ run_add_to_column()

G_MODULE_EXPORT void run_add_to_column ( GtkDialog * wind,
gint response_id,
gpointer data )

add constant to column - running the dialog

Parameters
windthe GtkDialog sending the signal
response_idthe response id
datathe associated data pointer

Definition at line 445 of file datab.c.

◆ run_multiply_column()

G_MODULE_EXPORT void run_multiply_column ( GtkDialog * wind,
gint response_id,
gpointer data )

multiply column by constant - running the dialog

Parameters
windthe GtkDialog sending the signal
response_idthe response id
datathe associated data pointer

Definition at line 498 of file datab.c.

◆ save_row()

void save_row ( gpointer data,
gpointer user_data )

save row data and udpate calculation result accordingly

Parameters
datathe path in the tree model
user_datathe associated data pointer

Definition at line 130 of file datab.c.

◆ select_row()

void select_row ( gpointer data,
gpointer user_data )

select row

Parameters
datathe path in the tree model
user_datathe associated data pointer

Definition at line 264 of file datab.c.

◆ setview()

GtkWidget * setview ( project * this_proj,
int b,
int c )

create the curve data tree store

Parameters
this_projthe target project
bthe target calculation
cthe target curve

Definition at line 877 of file datab.c.

◆ update_first_col()

void update_first_col ( )

update all rows in the first column

Definition at line 167 of file datab.c.

◆ update_first_row()

void update_first_row ( gpointer data,
gpointer user_data )

update row in the first column

Parameters
datathe path in the tree model
user_datathe associated data pointer

Definition at line 151 of file datab.c.

◆ validate_changes()

G_MODULE_EXPORT void validate_changes ( GtkButton * but,
gpointer data )

apply data edition changes

Parameters
butthe GtkButton sending the signal
datathe associated data pointer

Definition at line 1008 of file datab.c.

Variable Documentation

◆ col_entry

GtkWidget* col_entry

Definition at line 419 of file datab.c.

◆ curve_model

GtkTreeModel* curve_model

Definition at line 99 of file datab.c.

◆ lrows

GList* lrows

Definition at line 100 of file datab.c.

◆ nrows

int nrows

Definition at line 98 of file datab.c.

◆ path

GtkTreePath* path

Definition at line 103 of file datab.c.

◆ row

GtkTreeIter row

Definition at line 104 of file datab.c.

◆ rows

GList* rows

Definition at line 101 of file datab.c.

◆ sel

GtkTreeSelection* sel

Definition at line 102 of file datab.c.

◆ text

gchar* text

Definition at line 105 of file datab.c.