本文整理汇总了C++中dt_conf_get_string函数的典型用法代码示例。如果您正苦于以下问题:C++ dt_conf_get_string函数的具体用法?C++ dt_conf_get_string怎么用?C++ dt_conf_get_string使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dt_conf_get_string函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: export_button_clicked
static void
export_button_clicked (GtkWidget *widget, gpointer user_data)
{
char style[128];
// Let's get the max dimension restriction if any...
// TODO: pass the relevant values directly, not using the conf ...
int max_width = dt_conf_get_int ("plugins/lighttable/export/width");
int max_height = dt_conf_get_int ("plugins/lighttable/export/height");
char *format_name = dt_conf_get_string("plugins/lighttable/export/format_name");
char *storage_name = dt_conf_get_string("plugins/lighttable/export/storage_name");
int format_index = dt_imageio_get_index_of_format(dt_imageio_get_format_by_name(format_name));
int storage_index = dt_imageio_get_index_of_storage(dt_imageio_get_storage_by_name(storage_name));
g_free(format_name);
g_free(storage_name);
gboolean high_quality = dt_conf_get_bool("plugins/lighttable/export/high_quality_processing");
char* tmp = dt_conf_get_string("plugins/lighttable/export/style");
if (tmp)
{
g_strlcpy(style, tmp, sizeof(style));
g_free(tmp);
}
int imgid = dt_view_get_image_to_act_on();
GList *list = NULL;
if (imgid != -1)
list = g_list_append (list, GINT_TO_POINTER(imgid));
else
list = dt_collection_get_selected(darktable.collection, -1);
dt_control_export(list, max_width, max_height, format_index, storage_index, high_quality,style);
}
示例2: init
void init(dt_view_t *self)
{
self->data = malloc(sizeof(dt_capture_t));
memset(self->data,0,sizeof(dt_capture_t));
dt_capture_t *lib = (dt_capture_t *)self->data;
// initialize capture data struct
const int i = dt_conf_get_int("plugins/capture/mode");
lib->mode = i;
// Setup variable expanding, shares configuration as camera import uses...
dt_variables_params_init(&lib->vp);
lib->basedirectory = dt_conf_get_string("plugins/capture/storage/basedirectory");
lib->subdirectory = dt_conf_get_string("plugins/capture/storage/subpath");
lib->filenamepattern = dt_conf_get_string("plugins/capture/storage/namepattern");
// prefetch next few from first selected image on.
dt_view_filmstrip_prefetch();
/* setup the tethering view proxy */
darktable.view_manager->proxy.tethering.view = self;
darktable.view_manager->proxy.tethering.get_film_id = _capture_view_get_film_id;
darktable.view_manager->proxy.tethering.get_session_filename = _capture_view_get_session_filename;
darktable.view_manager->proxy.tethering.get_session_path = _capture_view_get_session_path;
darktable.view_manager->proxy.tethering.get_job_code = _capture_view_get_jobcode;
darktable.view_manager->proxy.tethering.set_job_code = _capture_view_set_jobcode;
darktable.view_manager->proxy.tethering.get_selected_imgid = _capture_view_get_selected_imgid;
}
示例3: gui_init
void gui_init(dt_imageio_module_storage_t *self)
{
latex_t *d = (latex_t *)malloc(sizeof(latex_t));
self->gui_data = (void *)d;
self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_PIXEL_APPLY_DPI(5));
GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, DT_PIXEL_APPLY_DPI(8));
gtk_box_pack_start(GTK_BOX(self->widget), hbox, TRUE, TRUE, 0);
GtkWidget *widget;
widget = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, 0);
gchar *dir = dt_conf_get_string("plugins/imageio/storage/latex/file_directory");
if(dir)
{
gtk_entry_set_text(GTK_ENTRY(widget), dir);
g_free(dir);
}
d->entry = GTK_ENTRY(widget);
dt_gui_key_accel_block_on_focus_connect(GTK_WIDGET(d->entry));
dt_gtkentry_setup_completion(GTK_ENTRY(widget), dt_gtkentry_get_default_path_compl_list());
char *tooltip_text = dt_gtkentry_build_completion_tooltip_text(
_("enter the path where to put exported images\nrecognized variables:"),
dt_gtkentry_get_default_path_compl_list());
gtk_widget_set_tooltip_text(widget, tooltip_text);
g_signal_connect(G_OBJECT(widget), "changed", G_CALLBACK(entry_changed_callback), self);
g_free(tooltip_text);
widget = dtgtk_button_new(dtgtk_cairo_paint_directory, CPF_DO_NOT_USE_BORDER);
gtk_widget_set_tooltip_text(widget, _("select directory"));
gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(button_clicked), self);
hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, DT_PIXEL_APPLY_DPI(10));
gtk_box_pack_start(GTK_BOX(self->widget), hbox, TRUE, TRUE, 0);
widget = gtk_label_new(_("title"));
gtk_widget_set_halign(widget, GTK_ALIGN_START);
g_object_set(G_OBJECT(widget), "xalign", 0.0, NULL);
gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, FALSE, 0);
d->title_entry = GTK_ENTRY(gtk_entry_new());
gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(d->title_entry), TRUE, TRUE, 0);
dt_gui_key_accel_block_on_focus_connect(GTK_WIDGET(d->title_entry));
// TODO: support title, author, subject, keywords (collect tags?)
gtk_widget_set_tooltip_text(GTK_WIDGET(d->title_entry), _("enter the title of the book"));
dir = dt_conf_get_string("plugins/imageio/storage/latex/title");
if(dir)
{
gtk_entry_set_text(GTK_ENTRY(d->title_entry), dir);
g_free(dir);
}
g_signal_connect(G_OBJECT(d->title_entry), "changed", G_CALLBACK(title_changed_callback), self);
}
示例4: gui_reset
void
gui_reset (dt_lib_module_t *self)
{
// make sure we don't do anything useless:
if(!dt_control_running()) return;
dt_lib_export_t *d = (dt_lib_export_t *)self->data;
gtk_spin_button_set_value(d->width, dt_conf_get_int("plugins/lighttable/export/width"));
gtk_spin_button_set_value(d->height, dt_conf_get_int("plugins/lighttable/export/height"));
// Set storage
gchar *storage_name = dt_conf_get_string("plugins/lighttable/export/storage_name");
int storage_index = dt_imageio_get_index_of_storage(dt_imageio_get_storage_by_name(storage_name));
g_free(storage_name);
gtk_combo_box_set_active(d->storage, storage_index);
gtk_combo_box_set_active(d->intent, (int)dt_conf_get_int("plugins/lighttable/export/iccintent") + 1);
// iccprofile
int iccfound = 0;
gchar *iccprofile = dt_conf_get_string("plugins/lighttable/export/iccprofile");
if(iccprofile)
{
GList *prof = d->profiles;
while(prof)
{
dt_lib_export_profile_t *pp = (dt_lib_export_profile_t *)prof->data;
if(!strcmp(pp->filename, iccprofile))
{
gtk_combo_box_set_active(d->profile, pp->pos);
iccfound = 1;
}
if(iccfound) break;
prof = g_list_next(prof);
}
g_free(iccprofile);
}
// style
// set it to none if the var is not set or the style doesn't exist anymore
gboolean rc = FALSE;
gchar *style = dt_conf_get_string("plugins/lighttable/export/style");
if (style != NULL)
{
rc = _combo_box_set_active_text(d->style, style);
if (rc == FALSE)
gtk_combo_box_set_active(d->style, 0);
g_free(style);
}
else
gtk_combo_box_set_active(d->style, 0);
if(!iccfound) gtk_combo_box_set_active(d->profile, 0);
dt_imageio_module_format_t *mformat = dt_imageio_get_format();
if(mformat) mformat->gui_reset(mformat);
dt_imageio_module_storage_t *mstorage = dt_imageio_get_storage();
if(mstorage) mstorage->gui_reset(mstorage);
}
示例5: curl_easy_init
static dt_gphoto_context_t *gphoto_api_init()
{
dt_gphoto_context_t *ctx = (dt_gphoto_context_t *)g_malloc0(sizeof(dt_gphoto_context_t));
ctx->curl_ctx = curl_easy_init();
ctx->errmsg = g_string_new("");
ctx->response = g_string_new("");
ctx->json_parser = json_parser_new();
ctx->google_client_id = dt_conf_get_string("plugins/imageio/storage/gphoto/id");
ctx->google_client_secret = dt_conf_get_string("plugins/imageio/storage/gphoto/secret");
return ctx;
}
示例6: memset
/** Creates a gconf widget. */
_camera_gconf_widget_t *_camera_import_gconf_widget(_camera_import_dialog_t *dlg,gchar *label,gchar *confstring)
{
_camera_gconf_widget_t *gcw=malloc(sizeof(_camera_gconf_widget_t));
memset(gcw,0,sizeof(_camera_gconf_widget_t));
GtkWidget *vbox,*hbox;
gcw->widget=vbox=GTK_WIDGET(gtk_vbox_new(FALSE,0));
hbox=GTK_WIDGET(gtk_hbox_new(FALSE,0));
g_object_set_data(G_OBJECT(vbox),"gconf:string",confstring);
gcw->dialog=dlg;
gcw->entry=gtk_entry_new();
char* value = NULL;
if((value = dt_conf_get_string (confstring)))
{
gtk_entry_set_text( GTK_ENTRY( gcw->entry ),dt_conf_get_string (confstring));
gcw->value=g_strdup(value);
g_free(value);
}
gtk_box_pack_start(GTK_BOX(hbox),GTK_WIDGET(gcw->entry),TRUE,TRUE,0);
GtkWidget *button=dtgtk_button_new(dtgtk_cairo_paint_store,CPF_STYLE_FLAT|CPF_DO_NOT_USE_BORDER);
g_object_set(button,"tooltip-text",_("store value as default"),(char *)NULL);
gtk_widget_set_size_request(button,13,13);
gtk_box_pack_start(GTK_BOX(hbox),button,FALSE,FALSE,0);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (_gcw_store_callback), gcw);
button=dtgtk_button_new(dtgtk_cairo_paint_reset,CPF_STYLE_FLAT|CPF_DO_NOT_USE_BORDER);
g_object_set(button,"tooltip-text",_("reset value to default"),(char *)NULL);
gtk_widget_set_size_request(button,13,13);
gtk_box_pack_start(GTK_BOX(hbox),button,FALSE,FALSE,0);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (_gcw_reset_callback), gcw);
GtkWidget *l=gtk_label_new(label);
gtk_misc_set_alignment(GTK_MISC(l), 0.0, 0.0);
gtk_box_pack_start(GTK_BOX(vbox),l,FALSE,FALSE,0);
gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(hbox),FALSE,FALSE,0);
g_signal_connect (G_OBJECT(gtk_entry_get_buffer(GTK_ENTRY(gcw->entry))), "inserted-text",
G_CALLBACK (entry_it_callback), gcw);
g_signal_connect (G_OBJECT(gtk_entry_get_buffer(GTK_ENTRY(gcw->entry))), "deleted-text",
G_CALLBACK (entry_dt_callback), gcw);
return gcw;
}
示例7: _lib_collect_update_params
/* Update the params struct with active ruleset */
static void _lib_collect_update_params(dt_lib_collect_t *d) {
/* reset params */
dt_lib_collect_params_t *p = d->params;
memset(p,0,sizeof(dt_lib_collect_params_t));
/* for each active rule set update params */
const int active = CLAMP(dt_conf_get_int("plugins/lighttable/collect/num_rules") - 1, 0, (MAX_RULES-1));
char confname[200];
for (int i=0; i<=active; i++) {
/* get item */
snprintf(confname, 200, "plugins/lighttable/collect/item%1d", i);
p->rule[i].item = dt_conf_get_int(confname);
/* get mode */
snprintf(confname, 200, "plugins/lighttable/collect/mode%1d", i);
p->rule[i].mode = dt_conf_get_int(confname);
/* get string */
snprintf(confname, 200, "plugins/lighttable/collect/string%1d", i);
gchar* string = dt_conf_get_string(confname);
if (string != NULL) {
snprintf(p->rule[i].string,PARAM_STRING_SIZE,"%s", string);
g_free(string);
}
fprintf(stderr,"[%i] %d,%d,%s\n",i, p->rule[i].item, p->rule[i].mode, p->rule[i].string);
}
p->rules = active+1;
}
示例8: enter
void enter(dt_view_t *self)
{
dt_capture_t *lib = (dt_capture_t *)self->data;
lib->mode = dt_conf_get_int("plugins/capture/mode");
/* connect signal for mipmap update for a redraw */
dt_control_signal_connect(darktable.signals, DT_SIGNAL_DEVELOP_MIPMAP_UPDATED,
G_CALLBACK(_capture_mipamps_updated_signal_callback),
(gpointer)self);
/* connect signal for fimlstrip image activate */
dt_control_signal_connect(darktable.signals,
DT_SIGNAL_VIEWMANAGER_FILMSTRIP_ACTIVATE,
G_CALLBACK(_view_capture_filmstrip_activate_callback),
self);
dt_view_filmstrip_scroll_to_image(darktable.view_manager, lib->image_id, TRUE);
// initialize a default session...
char* tmp = dt_conf_get_string("plugins/capture/jobcode");
_capture_view_set_jobcode(self, tmp);
g_free(tmp);
}
示例9: import_button_clicked
static void import_button_clicked(GtkButton *button, gpointer user_data)
{
char *last_dirname = dt_conf_get_string("plugins/lighttable/tagging/last_import_export_location");
if(!last_dirname || !*last_dirname)
{
g_free(last_dirname);
last_dirname = g_strdup(g_get_home_dir());
}
GtkWidget *win = dt_ui_main_window(darktable.gui->ui);
GtkWidget *filechooser = gtk_file_chooser_dialog_new(_("Select a keyword file"), GTK_WINDOW(win),
GTK_FILE_CHOOSER_ACTION_OPEN,
_("_cancel"), GTK_RESPONSE_CANCEL,
_("_import"), GTK_RESPONSE_ACCEPT, (char *)NULL);
gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(filechooser), last_dirname);
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(filechooser), FALSE);
if(gtk_dialog_run(GTK_DIALOG(filechooser)) == GTK_RESPONSE_ACCEPT)
{
char *filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(filechooser));
char *dirname = g_path_get_dirname(filename);
dt_conf_set_string("plugins/lighttable/tagging/last_import_export_location", dirname);
ssize_t count = dt_tag_import(filename);
if(count < 0)
dt_control_log(_("error importing tags"));
else
dt_control_log(_("%zd tags imported"), count);
g_free(filename);
g_free(dirname);
}
g_free(last_dirname);
gtk_widget_destroy(filechooser);
}
示例10: dt_dev_init
void dt_dev_init(dt_develop_t *dev, int32_t gui_attached)
{
memset(dev,0,sizeof(dt_develop_t));
dev->preview_downsampling = 1.0f;
dev->gui_module = NULL;
dev->timestamp = 0;
dev->average_delay = DT_DEV_AVERAGE_DELAY_START;
dev->preview_average_delay = DT_DEV_PREVIEW_AVERAGE_DELAY_START;
dev->gui_leaving = 0;
dev->gui_synch = 0;
dt_pthread_mutex_init(&dev->history_mutex, NULL);
dev->history_end = 0;
dev->history = NULL; // empty list
dev->gui_attached = gui_attached;
dev->width = -1;
dev->height = -1;
dt_image_init(&dev->image_storage);
dev->image_dirty = dev->preview_dirty = 1;
dev->image_loading = dev->preview_loading = 0;
dev->image_force_reload = 0;
dev->preview_input_changed = 0;
dev->pipe = dev->preview_pipe = NULL;
dev->histogram = NULL;
dev->histogram_pre_tonecurve = NULL;
dev->histogram_pre_levels = NULL;
if(g_strcmp0(dt_conf_get_string("plugins/darkroom/histogram/mode"), "linear") == 0)
dev->histogram_linear = TRUE;
else
dev->histogram_linear = FALSE;
if(dev->gui_attached)
{
dev->pipe = (dt_dev_pixelpipe_t *)malloc(sizeof(dt_dev_pixelpipe_t));
dev->preview_pipe = (dt_dev_pixelpipe_t *)malloc(sizeof(dt_dev_pixelpipe_t));
dt_dev_pixelpipe_init(dev->pipe);
dt_dev_pixelpipe_init_preview(dev->preview_pipe);
dev->histogram = (float *)malloc(sizeof(float)*4*256);
dev->histogram_pre_tonecurve = (float *)malloc(sizeof(float)*4*256);
dev->histogram_pre_levels = (float*)malloc(sizeof(float) * 4 * 256);
memset(dev->histogram, 0, sizeof(float)*256*4);
memset(dev->histogram_pre_tonecurve, 0, sizeof(float)*256*4);
memset(dev->histogram_pre_levels, 0, sizeof(float)*256*4);
dev->histogram_max = -1;
dev->histogram_pre_tonecurve_max = -1;
dev->histogram_pre_levels_max = -1;
}
dev->iop_instance = 0;
dev->iop = NULL;
dev->overexposed.enabled = FALSE;
dev->overexposed.colorscheme = dt_conf_get_int("darkroom/ui/overexposed/colorscheme");
dev->overexposed.lower = dt_conf_get_int("darkroom/ui/overexposed/lower");
dev->overexposed.upper = dt_conf_get_int("darkroom/ui/overexposed/upper");
}
示例11: enter
void enter(dt_view_t *self)
{
dt_capture_t *lib = (dt_capture_t *)self->data;
/* connect signal for mipmap update for a redraw */
dt_control_signal_connect(darktable.signals, DT_SIGNAL_DEVELOP_MIPMAP_UPDATED,
G_CALLBACK(_capture_mipmaps_updated_signal_callback), (gpointer)self);
/* connect signal for fimlstrip image activate */
dt_control_signal_connect(darktable.signals, DT_SIGNAL_VIEWMANAGER_FILMSTRIP_ACTIVATE,
G_CALLBACK(_view_capture_filmstrip_activate_callback), self);
dt_view_filmstrip_scroll_to_image(darktable.view_manager, lib->image_id, TRUE);
/* initialize a session */
lib->session = dt_import_session_new();
char *tmp = dt_conf_get_string("plugins/capture/jobcode");
if(tmp != NULL)
{
_capture_view_set_jobcode(self, tmp);
g_free(tmp);
}
// register listener
lib->listener = g_malloc0(sizeof(dt_camctl_listener_t));
lib->listener->data = lib;
lib->listener->image_downloaded = _camera_capture_image_downloaded;
lib->listener->request_image_path = _camera_request_image_path;
lib->listener->request_image_filename = _camera_request_image_filename;
dt_camctl_register_listener(darktable.camctl, lib->listener);
}
示例12: _camera_image_downloaded
/** Listener interface for import job */
void _camera_image_downloaded(const dt_camera_t *camera,const char *filename,void *data)
{
// Import downloaded image to import filmroll
dt_camera_import_t *t = (dt_camera_import_t *)data;
dt_film_image_import(t->film,filename, FALSE);
dt_control_log(_("%d/%d imported to %s"), t->import_count+1,g_list_length(t->images), g_path_get_basename(filename));
t->fraction+=1.0/g_list_length(t->images);
dt_control_backgroundjobs_progress(darktable.control, t->bgj, t->fraction );
if( dt_conf_get_bool("plugins/capture/camera/import/backup/enable") == TRUE )
{
// Backup is enable, let's initialize a backup job of imported image...
char *base=dt_conf_get_string("plugins/capture/storage/basedirectory");
char *fixed_base=dt_util_fix_path(base);
dt_variables_expand( t->vp, fixed_base, FALSE );
g_free(base);
const char *sdpart=dt_variables_get_result(t->vp);
if( sdpart )
{
// Initialize a image backup job of file
dt_job_t j;
dt_camera_import_backup_job_init(&j, filename,filename+strlen(sdpart));
dt_control_add_job(darktable.control, &j);
}
}
t->import_count++;
}
示例13: dt_collection_serialize
int
dt_collection_serialize(char *buf, int bufsize)
{
char confname[200];
int c;
const int num_rules = dt_conf_get_int("plugins/lighttable/collect/num_rules");
c = snprintf(buf, bufsize, "%d:", num_rules);
buf += c;
bufsize -= c;
for(int k=0; k<num_rules; k++)
{
snprintf(confname, sizeof(confname), "plugins/lighttable/collect/mode%1d", k);
const int mode = dt_conf_get_int(confname);
c = snprintf(buf, bufsize, "%d:", mode);
buf += c;
bufsize -= c;
snprintf(confname, sizeof(confname), "plugins/lighttable/collect/item%1d", k);
const int item = dt_conf_get_int(confname);
c = snprintf(buf, bufsize, "%d:", item);
buf += c;
bufsize -= c;
snprintf(confname, sizeof(confname), "plugins/lighttable/collect/string%1d", k);
gchar *str = dt_conf_get_string(confname);
if(str && (str[0] != '\0'))
c = snprintf(buf, bufsize, "%s$", str);
else
c = snprintf(buf, bufsize, "%%$");
buf += c;
bufsize -= c;
g_free(str);
}
return 0;
}
示例14: read_pref
static int read_pref(lua_State*L)
{
const char *script = luaL_checkstring(L,1);
const char *name = luaL_checkstring(L,2);
const char* type_name = luaL_checkstring(L,3);
int i;
for (i=0; pref_type_name[i]; i++)
if (strcmp(pref_type_name[i], type_name) == 0)
{
break;
}
if(!pref_type_name[i]) luaL_argerror(L,3,NULL);
char pref_name[1024];
get_pref_name(pref_name,1024,script,name);
switch(i)
{
case pref_string:
lua_pushstring(L,dt_conf_get_string(pref_name));
break;
case pref_bool:
lua_pushboolean(L,dt_conf_get_bool(pref_name));
break;
case pref_int:
lua_pushnumber(L,dt_conf_get_int(pref_name));
break;
}
return 1;
}
示例15: gui_init
void
gui_init (dt_imageio_module_storage_t *self)
{
disk_t *d = (disk_t *)malloc(sizeof(disk_t));
self->gui_data = (void *)d;
self->widget = gtk_hbox_new(FALSE, 5);
GtkWidget *widget;
widget = gtk_entry_new();
gtk_box_pack_start(GTK_BOX(self->widget), widget, TRUE, TRUE, 0);
gchar *dir = dt_conf_get_string("plugins/imageio/storage/disk/file_directory");
if(dir)
{
gtk_entry_set_text(GTK_ENTRY(widget), dir);
g_free(dir);
}
dt_gtkentry_setup_completion(GTK_ENTRY(widget), dt_gtkentry_get_default_path_compl_list());
char *tooltip_text = dt_gtkentry_build_completion_tooltip_text (
_("enter the path where to put exported images\nrecognized variables:"),
dt_gtkentry_get_default_path_compl_list());
d->entry = GTK_ENTRY(widget);
dt_gui_key_accel_block_on_focus (GTK_WIDGET (d->entry));
g_object_set(G_OBJECT(widget), "tooltip-text", tooltip_text, (char *)NULL);
widget = dtgtk_button_new(dtgtk_cairo_paint_directory, 0);
gtk_widget_set_size_request(widget, 18, 18);
g_object_set(G_OBJECT(widget), "tooltip-text", _("select directory"), (char *)NULL);
gtk_box_pack_start(GTK_BOX(self->widget), widget, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(widget), "clicked", G_CALLBACK(button_clicked), self);
g_free(tooltip_text);
}