void _view_map_collection_changed(gpointer instance, gpointer user_data) { dt_view_t *self = (dt_view_t *)user_data; dt_map_t *lib = (dt_map_t *)self->data; /* check if we can get a query from collection */ const gchar *query = dt_collection_get_query (darktable.collection); if(!query) return; /* if we have a statment lets clean it */ if(lib->statements.main_query) sqlite3_finalize(lib->statements.main_query); /* build the new query string */ char *geo_query = g_strdup("select id from images where \ longitude >= ?1 and longitude <= ?2 and latitude <= ?3 and latitude >= ?4\ and longitude not NULL and latitude not NULL limit 0, 100"); /* prepare a new main query statement for collection */ DT_DEBUG_SQLITE3_PREPARE_V2(dt_database_get(darktable.db), geo_query, -1, &lib->statements.main_query, NULL); dt_control_queue_redraw_widget(GTK_WIDGET(lib->map)); g_free(geo_query); }
void _iop_zonesystem_redraw_preview_callback(gpointer instance, gpointer user_data) { dt_iop_module_t *self = (dt_iop_module_t *)user_data; dt_iop_zonesystem_gui_data_t *g = (dt_iop_zonesystem_gui_data_t *)self->gui_data; dt_control_queue_redraw_widget(g->preview); }
void commit_params (struct dt_iop_module_t *self, dt_iop_params_t *p1, dt_dev_pixelpipe_t *pipe, dt_dev_pixelpipe_iop_t *piece) { dt_iop_colortransfer_params_t *p = (dt_iop_colortransfer_params_t *)p1; dt_iop_colortransfer_data_t *d = (dt_iop_colortransfer_data_t *)piece->data; if(p->flag == ACQUIRE3 && d->flag == ACQUIRED) { // if data is flagged ACQUIRED, actually copy data back from pipe! d->flag = NEUTRAL; p->flag = ACQUIRED; // let gui know the data is there. if(self->dev == darktable.develop && self->gui_data) { dt_iop_colortransfer_gui_data_t *g = (dt_iop_colortransfer_gui_data_t *)self->gui_data; memcpy (&g->flowback, d, self->params_size); g->flowback_set = 1; FILE *f = g_fopen("/tmp/dt_colortransfer_loaded", "wb"); if(f) { if(fwrite(&g->flowback, self->params_size, 1, f) > 0) g->flowback.flag = APPLY; fclose(f); } dt_control_queue_redraw_widget(self->widget); } } else { // dt_iop_colortransfer_flag_t flag = d->flag; memcpy(d, p, self->params_size); // only allow apply and acquire commands from gui. // if(p->flag != APPLY && p->flag != ACQUIRE && p->flag != NEUTRAL) d->flag = flag; if(p->flag == ACQUIRE2) d->flag = ACQUIRE; if(p->flag == ACQUIRE3) d->flag = NEUTRAL; if(p->flag == ACQUIRED) d->flag = NEUTRAL; // if(p->flag == ACQUIRE) p->flag = ACQUIRE2; } }
void gui_update(struct dt_iop_module_t *self) { dt_iop_colortransfer_params_t *p = (dt_iop_colortransfer_params_t *)self->params; dt_iop_colortransfer_gui_data_t *g = (dt_iop_colortransfer_gui_data_t *)self->gui_data; gtk_spin_button_set_value(g->spinbutton, p->n); //gtk_widget_set_size_request(g->area, 300, MIN(100, 300/p->n)); // redraw color cluster preview dt_control_queue_redraw_widget(self->widget); }
static gboolean _lib_histogram_button_press_callback(GtkWidget *widget, GdkEventButton *event, gpointer user_data) { dt_lib_module_t *self = (dt_lib_module_t *)user_data; dt_lib_histogram_t *d = (dt_lib_histogram_t *)self->data; /* check if exposure hooks are available */ gboolean hooks_available = dt_dev_exposure_hooks_available(darktable.develop); if(!hooks_available) return TRUE; if(event->type == GDK_2BUTTON_PRESS) { dt_dev_exposure_reset_defaults(darktable.develop); } else { if(d->highlight == 3) // mode button { darktable.develop->histogram_type = (darktable.develop->histogram_type + 1) % DT_DEV_HISTOGRAM_N; dt_conf_set_string("plugins/darkroom/histogram/mode", dt_dev_histogram_type_names[darktable.develop->histogram_type]); } else if(d->highlight == 4) // red button { d->red = !d->red; dt_conf_set_bool("plugins/darkroom/histogram/show_red", d->red); } else if(d->highlight == 5) // green button { d->green = !d->green; dt_conf_set_bool("plugins/darkroom/histogram/show_green", d->green); } else if(d->highlight == 6) // blue button { d->blue = !d->blue; dt_conf_set_bool("plugins/darkroom/histogram/show_blue", d->blue); } else { d->dragging = 1; if(d->highlight == 2) d->white = dt_dev_exposure_get_white(darktable.develop); if(d->highlight == 1) d->black = dt_dev_exposure_get_black(darktable.develop); d->button_down_x = event->x; d->button_down_y = event->y; } } // update for good measure dt_control_queue_redraw_widget(self->widget); return TRUE; }
static void spinbutton_changed (GtkSpinButton *button, dt_iop_module_t *self) { if(darktable.gui->reset) return; dt_iop_colortransfer_params_t *p = (dt_iop_colortransfer_params_t *)self->params; // dt_iop_colortransfer_gui_data_t *g = (dt_iop_colortransfer_gui_data_t *)self->gui_data; p->n = gtk_spin_button_get_value(button); memset(p->hist,0, sizeof(float)*HISTN); memset(p->mean,0, sizeof(float)*MAXN*2); memset(p->var,0, sizeof(float)*MAXN*2); dt_control_queue_redraw_widget(self->widget); }
static void _lib_filmstrip_scroll_to_image(dt_lib_module_t *self, gint imgid, gboolean activate) { dt_lib_filmstrip_t *strip = (dt_lib_filmstrip_t *)self->data; /* if no imgid just bail out */ if(imgid <= 0) return; strip->activated_image = imgid; strip->offset = dt_collection_image_offset(imgid); dt_control_set_mouse_over_id(strip->activated_image); /* activate the image if requested */ if(activate) { strip->activated_image = imgid; dt_control_signal_raise(darktable.signals, DT_SIGNAL_VIEWMANAGER_FILMSTRIP_ACTIVATE); } /* redraw filmstrip. since this is a proxy function it could be used from another thread */ dt_control_queue_redraw_widget(self->widget); }
static void _lib_histogram_change_callback(gpointer instance, gpointer user_data) { dt_lib_module_t *self = (dt_lib_module_t *)user_data; dt_control_queue_redraw_widget(self->widget); }
static void _lib_navigation_control_redraw_callback(gpointer instance, gpointer user_data) { dt_lib_module_t *self = (dt_lib_module_t *)user_data; dt_control_queue_redraw_widget(self->widget); }
static void _lib_filmstrip_collection_changed_callback(gpointer instance, gpointer user_data) { dt_lib_module_t *self = (dt_lib_module_t *)user_data; dt_control_queue_redraw_widget(self->widget); }