60void pix_info_ (
int * na,
int * nb,
int * nc)
77void send_pix_info_ (
int * p,
int listp[27],
int * ngb)
80 for (i=0;
i<* ngb;
i++)
94GtkWidget * create_css_label (gchar * str,
int id)
96 gchar * colo[2] = {
"white",
"yellow"};
100 backcol = g_strdup_printf (
"label#icolor {\n"
101 " background-color: red;\n"
102 " color: %s;\n}", colo[
id]);
106 backcol = g_strdup_printf (
"label#color {\n"
107 " background-color: blue;\n"
108 " color: %s;\n}", colo[
id]);
114 gtk_widget_set_name (
lab, (
id) ?
"icolor" :
"color");
127GtkWidget * attach_grid (
project * this_proj,
int init)
129 GtkWidget * table = gtk_grid_new ();
134 for (i=0;
i<this_proj ->
pix[1];
i++)
136 for (j=0;
j<this_proj ->
pix[0];
j++)
141 if (l == this_proj -> pixels[this_proj -> actif_pix-1][k])
146 if (l == this_proj -> actif_pix)
148 str = g_strdup_printf (
"<b>%d</b>", l);
153 str = g_strdup_printf (
"%d", l);
159 gtk_grid_attach (GTK_GRID (table), create_css_label(str, m), j, i, 1, 1);
163 gtk_grid_attach (GTK_GRID (table),
markup_label(str, 50, 50, 0.5, 0.5), j, i, 1, 1);
168 gtk_widget_set_size_request (table, this_proj ->
pix[0]*50, this_proj ->
pix[1]*50);
179void update_pix_table (
project * this_proj)
190 if (this_proj -> actif_pix <= this_proj ->
pix[0]*this_proj ->
pix[1])
192 pix[0] = this_proj ->
pix[0]*this_proj ->
pix[1]*(this_proj ->
pix[2]-1);
196 pix[0] = (this_proj -> actif_pix-1)/(this_proj ->
pix[0]*this_proj ->
pix[1]);
198 pix[0] *= (this_proj ->
pix[0]*this_proj ->
pix[1]);
202 pix[1] = (this_proj -> actif_pix-1)/(this_proj ->
pix[0]*this_proj ->
pix[1]);
203 pix[1] *= (this_proj ->
pix[0]*this_proj ->
pix[1]);
206 if (this_proj -> actif_pix > this_proj ->
pix[0]*this_proj ->
pix[1]*(this_proj ->
pix[2]-1))
212 pix[2] = (this_proj -> actif_pix-1)/(this_proj ->
pix[0]*this_proj ->
pix[1]);
214 pix[2] *= (this_proj ->
pix[0]*this_proj ->
pix[1]);
218 this_proj -> pix_tab[
i] = attach_grid (this_proj,
pix[i]);
219 add_box_child_start (GTK_ORIENTATION_VERTICAL, this_proj -> pix_box, this_proj -> pix_tab[i], FALSE, FALSE, 20);
232G_MODULE_EXPORT
void set_pix (GtkEntry *
res, gpointer data)
234 int id = GPOINTER_TO_INT (data);
239 int n = this_proj->
pix[0] * this_proj ->
pix[1] * this_proj ->
pix[2];
242 this_proj -> actif_pix =
p;
245 update_pix_table (this_proj);
259 gchar * str = g_strdup_printf (
"\tSelect pixel to check, from 1 to %d:", this_proj ->
pix[0]*this_proj ->
pix[1]*this_proj->pix[2]);
265 this_proj -> actif_pix = 1;
267 this_proj -> pix_tab[0] = this_proj -> pix_tab[1] = this_proj -> pix_tab[2] = NULL;
268 update_pix_table (this_proj);
Function declarations for the cell edition window.
GtkWidget * pixels_tab(project *this_proj)
int ** allocdint(int xal, int yal)
allocate an int ** pointer
double string_to_double(gpointer string)
convert string to double
GtkWidget * create_entry(GCallback handler, int dim, int cdim, gboolean key_release, gpointer data)
Create a GtkEntry.
GtkWidget * create_scroll(GtkWidget *box, int dimx, int dimy, int shadow)
create a scroll window
const gchar * entry_get_text(GtkEntry *entry)
get the text in a GtkEntry
void update_entry_int(GtkEntry *entry, int intval)
update the content of a GtkEntry as int
GtkWidget * markup_label(gchar *text, int dimx, int dimy, float ax, float ay)
void add_box_child_start(int orientation, GtkWidget *widg, GtkWidget *child, gboolean expand, gboolean fill, int padding)
Add a GtkWidget in a GtkBox at the initial position.
GtkWidget * create_hbox(int spacing)
create a GtkBox with horizontal orientation
GtkWidget * destroy_this_widget(GtkWidget *widg)
destroy a GtkWidget
void provide_gtk_css(gchar *css)
create a css provider based on the css data
void add_container_child(int type, GtkWidget *widg, GtkWidget *child)
Add a GtkWidget into another GtkWidget.
GtkWidget * create_vbox(int spacing)
create a GtkBox with vertical orientation
void show_the_widgets(GtkWidget *widg)
show GtkWidget
project * get_project_by_id(int p)
get project pointer using id number