当前位置: 首页>>代码示例>>C++>>正文


C++ dt_bauhaus_combobox_add函数代码示例

本文整理汇总了C++中dt_bauhaus_combobox_add函数的典型用法代码示例。如果您正苦于以下问题:C++ dt_bauhaus_combobox_add函数的具体用法?C++ dt_bauhaus_combobox_add怎么用?C++ dt_bauhaus_combobox_add使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dt_bauhaus_combobox_add函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: gui_init

void gui_init(struct dt_iop_module_t *self)
{
  self->gui_data = malloc(sizeof(dt_iop_lowpass_gui_data_t));
  dt_iop_lowpass_gui_data_t *g = (dt_iop_lowpass_gui_data_t *)self->gui_data;
  dt_iop_lowpass_params_t *p = (dt_iop_lowpass_params_t *)self->params;

  self->widget = gtk_vbox_new(TRUE, DT_BAUHAUS_SPACE);

#if 0 // gaussian is order not user selectable here, as it does not make much sense for a lowpass filter
  GtkBox *hbox  = GTK_BOX(gtk_hbox_new(FALSE, 5));
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(hbox), FALSE, FALSE, 0);
  GtkWidget *label = dtgtk_reset_label_new(_("filter order"), self, &p->order, sizeof(float));
  gtk_box_pack_start(hbox, label, FALSE, FALSE, 0);
  g->order = GTK_COMBO_BOX(gtk_combo_box_new_text());
  gtk_combo_box_append_text(g->order, _("0th order"));
  gtk_combo_box_append_text(g->order, _("1st order"));
  gtk_combo_box_append_text(g->order, _("2nd order"));
  gtk_object_set(GTK_OBJECT(g->order), "tooltip-text", _("filter order of gaussian blur"), (char *)NULL);
  gtk_box_pack_start(hbox, GTK_WIDGET(g->order), TRUE, TRUE, 0);
#endif

  g->scale1 = dt_bauhaus_slider_new_with_range(self,0.1, 200.0, 0.1, p->radius, 2);
  g->scale2 = dt_bauhaus_slider_new_with_range(self,-3.0, 3.0, 0.01, p->contrast, 2);
  g->scale3 = dt_bauhaus_slider_new_with_range(self,-3.0, 3.0, 0.01, p->saturation, 2);

  dt_bauhaus_widget_set_label(g->scale1,_("radius"));
  dt_bauhaus_widget_set_label(g->scale2,_("contrast"));
  dt_bauhaus_widget_set_label(g->scale3,_("saturation"));

  g->bilat  = dt_bauhaus_combobox_new(self);
  dt_bauhaus_widget_set_label(g->bilat, _("soften with"));
  dt_bauhaus_combobox_add(g->bilat, _("gaussian"));
  dt_bauhaus_combobox_add(g->bilat, _("bilateral filter"));

  gtk_box_pack_start(GTK_BOX(self->widget), g->scale1, TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(self->widget), g->bilat,  TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(self->widget), g->scale2, TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(self->widget), g->scale3, TRUE, TRUE, 0);
  gtk_object_set(GTK_OBJECT(g->scale1), "tooltip-text", _("radius of gaussian/bilateral blur"), (char *)NULL);
  gtk_object_set(GTK_OBJECT(g->scale2), "tooltip-text", _("contrast of lowpass filter"), (char *)NULL);
  gtk_object_set(GTK_OBJECT(g->scale3), "tooltip-text", _("color saturation of lowpass filter"), (char *)NULL);
  gtk_object_set(GTK_OBJECT(g->bilat),  "tooltip-text", _("which filter to use for blurring"), (char *)NULL);

  g_signal_connect (G_OBJECT (g->scale1), "value-changed",
                    G_CALLBACK (radius_callback), self);
  g_signal_connect (G_OBJECT (g->bilat), "value-changed",
                    G_CALLBACK (bilat_callback), self);
  g_signal_connect (G_OBJECT (g->scale2), "value-changed",
                    G_CALLBACK (contrast_callback), self);
  g_signal_connect (G_OBJECT (g->scale3), "value-changed",
                    G_CALLBACK (saturation_callback), self);
#if 0 // gaussian order not user selectable
  g_signal_connect (G_OBJECT (g->order), "changed",
                    G_CALLBACK (order_changed), self);
#endif
}
开发者ID:ealasu,项目名称:darktable,代码行数:56,代码来源:lowpass.c

示例2: gui_init

void gui_init(struct dt_iop_module_t *self)
{
  const int force_lcms2 = dt_conf_get_bool("plugins/lighttable/export/force_lcms2");

  self->gui_data = calloc(1, sizeof(dt_iop_colorout_gui_data_t));
  dt_iop_colorout_gui_data_t *g = (dt_iop_colorout_gui_data_t *)self->gui_data;

  char datadir[PATH_MAX] = { 0 };
  char confdir[PATH_MAX] = { 0 };
  dt_loc_get_datadir(datadir, sizeof(datadir));
  dt_loc_get_user_config_dir(confdir, sizeof(confdir));

  self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);

  // TODO:
  g->output_intent = dt_bauhaus_combobox_new(self);
  gtk_box_pack_start(GTK_BOX(self->widget), g->output_intent, TRUE, TRUE, 0);
  dt_bauhaus_widget_set_label(g->output_intent, NULL, _("output intent"));
  dt_bauhaus_combobox_add(g->output_intent, _("perceptual"));
  dt_bauhaus_combobox_add(g->output_intent, _("relative colorimetric"));
  dt_bauhaus_combobox_add(g->output_intent, C_("rendering intent", "saturation"));
  dt_bauhaus_combobox_add(g->output_intent, _("absolute colorimetric"));

  if(!force_lcms2)
  {
    gtk_widget_set_no_show_all(g->output_intent, TRUE);
    gtk_widget_set_visible(g->output_intent, FALSE);
  }

  g->output_profile = dt_bauhaus_combobox_new(self);
  dt_bauhaus_widget_set_label(g->output_profile, NULL, _("output profile"));
  gtk_box_pack_start(GTK_BOX(self->widget), g->output_profile, TRUE, TRUE, 0);
  for(GList *l = darktable.color_profiles->profiles; l; l = g_list_next(l))
  {
    dt_colorspaces_color_profile_t *prof = (dt_colorspaces_color_profile_t *)l->data;
    if(prof->out_pos > -1) dt_bauhaus_combobox_add(g->output_profile, prof->name);
  }

  char tooltip[1024];
  g_object_set(G_OBJECT(g->output_intent), "tooltip-text", _("rendering intent"), (char *)NULL);
  snprintf(tooltip, sizeof(tooltip), _("ICC profiles in %s/color/out or %s/color/out"), confdir, datadir);
  g_object_set(G_OBJECT(g->output_profile), "tooltip-text", tooltip, (char *)NULL);

  g_signal_connect(G_OBJECT(g->output_intent), "value-changed", G_CALLBACK(intent_changed), (gpointer)self);
  g_signal_connect(G_OBJECT(g->output_profile), "value-changed", G_CALLBACK(output_profile_changed), (gpointer)self);

  // reload the profiles when the display or softproof profile changed!
  dt_control_signal_connect(darktable.signals, DT_SIGNAL_CONTROL_PROFILE_CHANGED,
                            G_CALLBACK(_signal_profile_changed), self->dev);
  // update the gui when the preferences changed (i.e. show intent when using lcms2)
  dt_control_signal_connect(darktable.signals, DT_SIGNAL_PREFERENCES_CHANGE,
                            G_CALLBACK(_preference_changed), (gpointer)self);
}
开发者ID:dirkbr,项目名称:darktable,代码行数:53,代码来源:colorout.c

示例3: refresh_albums

/** Refresh albums */
static void refresh_albums(dt_storage_flickr_gui_data_t *ui)
{
    int i;
    gtk_widget_set_sensitive(GTK_WIDGET(ui->album_list), FALSE);

    if(ui->flickr_api == NULL || ui->flickr_api->needsReauthentication == TRUE)
    {
        if(ui->flickr_api != NULL) _flickr_api_free(ui->flickr_api);
        ui->flickr_api = _flickr_api_authenticate(ui);
        if(ui->flickr_api != NULL)
        {
            set_status(ui, _("authenticated"), "#7fe07f");
        }
        else
        {
            set_status(ui, _("not authenticated"), "#e07f7f");
            gtk_widget_set_sensitive(GTK_WIDGET(ui->album_list), FALSE);
            return;
        }
    }

    // First clear the cobobox except first 2 items (none / create new album)
    dt_bauhaus_combobox_clear(ui->album_list);

    ui->albums = _flickr_api_photosets(ui->flickr_api, gtk_entry_get_text(ui->user_entry));
    if(ui->albums)
    {

        // Add standard action
        dt_bauhaus_combobox_add(ui->album_list, _("without album"));
        dt_bauhaus_combobox_add(ui->album_list, _("create new album"));
//     dt_bauhaus_combobox_add(ui->album_list, ""); // Separator // FIXME: bauhaus doesn't support separators

        // Then add albums from list...
        for(i = 0; ui->albums[i]; i++)
        {
            char data[512] = { 0 };
            snprintf(data, sizeof(data), "%s (%i)", ui->albums[i]->title, ui->albums[i]->photos_count);
            dt_bauhaus_combobox_add(ui->album_list, data);
        }
        dt_bauhaus_combobox_set(ui->album_list, 2);
        gtk_widget_hide(GTK_WIDGET(ui->create_box)); // Hide create album box...
    }
    else
    {
        // Failed to parse feed of album...
        // Lets notify somehow...
        dt_bauhaus_combobox_set(ui->album_list, 0);
    }
    gtk_widget_set_sensitive(GTK_WIDGET(ui->album_list), TRUE);
}
开发者ID:nlannuzel,项目名称:darktable,代码行数:52,代码来源:flickr.c

示例4: gui_update

void gui_update (struct dt_iop_module_t *self)
{
    dt_iop_module_t *module = (dt_iop_module_t *)self;
    self->request_color_pick = 0;
    self->color_picker_box[0] = self->color_picker_box[1] = .25f;
    self->color_picker_box[2] = self->color_picker_box[3] = .75f;
    self->color_picker_point[0] = self->color_picker_point[1] = 0.5f;
    dt_iop_temperature_gui_data_t *g = (dt_iop_temperature_gui_data_t *)self->gui_data;
    dt_iop_temperature_params_t *p  = (dt_iop_temperature_params_t *)module->params;
    dt_iop_temperature_params_t *fp = (dt_iop_temperature_params_t *)module->default_params;
    float temp, tint, mul[3];
    for(int k=0; k<3; k++) mul[k] = g->daylight_wb[k]/p->coeffs[k];
    convert_rgb_to_k(mul, &temp, &tint);

    dt_bauhaus_slider_set(g->scale_r, p->coeffs[0]);
    dt_bauhaus_slider_set(g->scale_g, p->coeffs[1]);
    dt_bauhaus_slider_set(g->scale_b, p->coeffs[2]);
    dt_bauhaus_slider_set(g->scale_k, temp);
    dt_bauhaus_slider_set(g->scale_tint, tint);

    dt_bauhaus_combobox_clear(g->presets);
    dt_bauhaus_combobox_add(g->presets, _("camera white balance"));
    dt_bauhaus_combobox_add(g->presets, _("spot white balance"));
    dt_bauhaus_combobox_add(g->presets, _("passthrough"));
    g->preset_cnt = 3;
    const char *wb_name = NULL;
    char makermodel[1024];
    char *model = makermodel;
    dt_colorspaces_get_makermodel_split(makermodel, 1024, &model, self->dev->image_storage.exif_maker, self->dev->image_storage.exif_model);
    if(!dt_image_is_ldr(&self->dev->image_storage)) for(int i=0; i<wb_preset_count; i++)
        {
            if(g->preset_cnt >= 50) break;
            if(!strcmp(wb_preset[i].make,  makermodel) &&
                    !strcmp(wb_preset[i].model, model))
            {
                if(!wb_name || strcmp(wb_name, wb_preset[i].name))
                {
                    wb_name = wb_preset[i].name;
                    dt_bauhaus_combobox_add(g->presets, _(wb_preset[i].name));
                    g->preset_num[g->preset_cnt++] = i;
                }
            }
        }

    if(fabsf(p->coeffs[0]-fp->coeffs[0]) + fabsf(p->coeffs[1]-fp->coeffs[1]) + fabsf(p->coeffs[2]-fp->coeffs[2]) < 0.01)
        dt_bauhaus_combobox_set(g->presets, 0);
    else
        dt_bauhaus_combobox_set(g->presets, -1);
    dt_bauhaus_slider_set(g->finetune, 0);
    gtk_widget_set_sensitive(g->finetune, 0);
}
开发者ID:rharrison10,项目名称:darktable,代码行数:51,代码来源:temperature.c

示例5: refresh_watermarks

static void refresh_watermarks(dt_iop_module_t *self)
{
  dt_iop_watermark_gui_data_t *g = (dt_iop_watermark_gui_data_t *)self->gui_data;
  dt_iop_watermark_params_t *p = (dt_iop_watermark_params_t *)self->params;

  g_signal_handlers_block_by_func(g->watermarks, watermark_callback, self);

  // Clear combobox...
  dt_bauhaus_combobox_clear(g->watermarks);

  // check watermarkdir and update combo with entries...
  int count = 0;
  const gchar *d_name = NULL;
  gchar configdir[PATH_MAX] = { 0 };
  gchar datadir[PATH_MAX] = { 0 };
  gchar filename[PATH_MAX] = { 0 };
  dt_loc_get_datadir(datadir, sizeof(datadir));
  dt_loc_get_user_config_dir(configdir, sizeof(configdir));
  g_strlcat(datadir, "/watermarks", sizeof(datadir));
  g_strlcat(configdir, "/watermarks", sizeof(configdir));

  /* read watermarks from datadir */
  GDir *dir = g_dir_open(datadir, 0, NULL);
  if(dir)
  {
    while((d_name = g_dir_read_name(dir)))
    {
      snprintf(filename, sizeof(filename), "%s/%s", datadir, d_name);
      dt_bauhaus_combobox_add(g->watermarks, d_name);
      count++;
    }
    g_dir_close(dir);
  }

  /* read watermarks from user config dir*/
  dir = g_dir_open(configdir, 0, NULL);
  if(dir)
  {
    while((d_name = g_dir_read_name(dir)))
    {
      snprintf(filename, sizeof(filename), "%s/%s", configdir, d_name);
      dt_bauhaus_combobox_add(g->watermarks, d_name);
      count++;
    }
    g_dir_close(dir);
  }

  _combo_box_set_active_text(g->watermarks, p->filename);

  g_signal_handlers_unblock_by_func(g->watermarks, watermark_callback, self);
}
开发者ID:edgomez,项目名称:darktable,代码行数:51,代码来源:watermark.c

示例6: dt_bauhaus_combobox_new

static GtkWidget *_guides_gui_golden_mean(dt_iop_module_t *self, void *user_data)
{
  _golden_mean_t *data = (_golden_mean_t *)user_data;
  GtkWidget *golden_extras = dt_bauhaus_combobox_new(self);
  dt_bauhaus_widget_set_label(golden_extras, NULL, _("extra"));
  dt_bauhaus_combobox_add(golden_extras, _("golden sections"));
  dt_bauhaus_combobox_add(golden_extras, _("golden spiral sections"));
  dt_bauhaus_combobox_add(golden_extras, _("golden spiral"));
  dt_bauhaus_combobox_add(golden_extras, _("all"));
  gtk_widget_set_tooltip_text(golden_extras, _("show some extra guides"));
  dt_bauhaus_combobox_set(golden_extras, data->which);
  g_signal_connect(G_OBJECT(golden_extras), "value-changed", G_CALLBACK(_golden_mean_changed), user_data);

  return golden_extras;
}
开发者ID:CarVac,项目名称:darktable,代码行数:15,代码来源:guides.c

示例7: gui_init

void gui_init(struct dt_iop_module_t *self)
{
  self->gui_data = malloc(sizeof(dt_iop_basecurve_gui_data_t));
  dt_iop_basecurve_gui_data_t *c = (dt_iop_basecurve_gui_data_t *)self->gui_data;
  dt_iop_basecurve_params_t *p = (dt_iop_basecurve_params_t *)self->params;

  c->minmax_curve = dt_draw_curve_new(0.0, 1.0, p->basecurve_type[0]);
  c->minmax_curve_type = p->basecurve_type[0];
  c->minmax_curve_nodes = p->basecurve_nodes[0];
  for(int k=0; k<p->basecurve_nodes[0]; k++) (void)dt_draw_curve_add_point(c->minmax_curve, p->basecurve[0][k].x, p->basecurve[0][k].y);
  c->mouse_x = c->mouse_y = -1.0;
  c->selected = -1;
  c->loglogscale = 0;

  self->widget = gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);
  c->area = GTK_DRAWING_AREA(gtk_drawing_area_new());
  g_object_set (GTK_OBJECT(c->area), "tooltip-text", _("abscissa: input, ordinate: output. works on RGB channels"), (char *)NULL);
  // GtkWidget *asp = gtk_aspect_frame_new(NULL, 0.5, 0.5, 1.0, TRUE);
  // gtk_box_pack_start(GTK_BOX(self->widget), asp, TRUE, TRUE, 0);
  // gtk_container_add(GTK_CONTAINER(asp), GTK_WIDGET(c->area));
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(c->area), TRUE, TRUE, 0);
  gtk_widget_set_size_request(GTK_WIDGET(c->area), 0, 258);

  c->scale = dt_bauhaus_combobox_new(self);
  dt_bauhaus_widget_set_label(c->scale, NULL, _("scale"));
  dt_bauhaus_combobox_add(c->scale, _("linear"));
  dt_bauhaus_combobox_add(c->scale, _("logarithmic"));
  g_object_set(c->scale, "tooltip-text", _("scale to use in the graph. use logarithmic scale for more precise control near the blacks"), (char *)NULL);
  gtk_box_pack_start(GTK_BOX(self->widget), c->scale,  TRUE, TRUE, 0);
  g_signal_connect (G_OBJECT (c->scale), "value-changed",
                    G_CALLBACK (scale_callback), self);

  gtk_widget_add_events(GTK_WIDGET(c->area), GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK);
  g_signal_connect (G_OBJECT (c->area), "expose-event",
                    G_CALLBACK (dt_iop_basecurve_expose), self);
  g_signal_connect (G_OBJECT (c->area), "button-press-event",
                    G_CALLBACK (dt_iop_basecurve_button_press), self);
  g_signal_connect (G_OBJECT (c->area), "motion-notify-event",
                    G_CALLBACK (dt_iop_basecurve_motion_notify), self);
  g_signal_connect (G_OBJECT (c->area), "leave-notify-event",
                    G_CALLBACK (dt_iop_basecurve_leave_notify), self);
  g_signal_connect (G_OBJECT (c->area), "enter-notify-event",
                    G_CALLBACK (dt_iop_basecurve_enter_notify), self);
  g_signal_connect (G_OBJECT (c->area), "configure-event",
                    G_CALLBACK (area_resized), self);
  g_signal_connect (G_OBJECT (c->area), "scroll-event",
                    G_CALLBACK (scrolled), self);
}
开发者ID:angryziber,项目名称:darktable,代码行数:48,代码来源:basecurve.c

示例8: 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_box_new(GTK_ORIENTATION_VERTICAL, DT_PIXEL_APPLY_DPI(5));
  GtkWidget *widget;

  GtkWidget *hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, DT_PIXEL_APPLY_DPI(8));
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(hbox), TRUE, FALSE, 0);

  widget = gtk_entry_new();
  gtk_box_pack_start(GTK_BOX(hbox), 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\nvariables support bash like string manipulation\n"
        "recognized variables:"),
      dt_gtkentry_get_default_path_compl_list());

  d->entry = GTK_ENTRY(widget);
  dt_gui_key_accel_block_on_focus_connect(GTK_WIDGET(d->entry));
  gtk_entry_set_width_chars(GTK_ENTRY(widget), 0);
  gtk_widget_set_tooltip_text(widget, tooltip_text);
  g_signal_connect(G_OBJECT(widget), "changed", G_CALLBACK(entry_changed_callback), self);

  widget = dtgtk_button_new(dtgtk_cairo_paint_directory, CPF_DO_NOT_USE_BORDER, NULL);
  gtk_widget_set_size_request(widget, DT_PIXEL_APPLY_DPI(18), DT_PIXEL_APPLY_DPI(18));
  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);

  d->overwrite = dt_bauhaus_combobox_new(NULL);
  dt_bauhaus_widget_set_label(d->overwrite, NULL, _("on conflict"));
  dt_bauhaus_combobox_add(d->overwrite, _("create unique filename"));
  dt_bauhaus_combobox_add(d->overwrite, _("overwrite"));
  gtk_box_pack_start(GTK_BOX(self->widget), d->overwrite, TRUE, TRUE, 0);
  g_signal_connect(G_OBJECT(d->overwrite), "value-changed", G_CALLBACK(overwrite_toggle_callback), self);
  dt_bauhaus_combobox_set(d->overwrite, 0);

  g_free(tooltip_text);
}
开发者ID:CChiappa,项目名称:darktable,代码行数:48,代码来源:disk.c

示例9: gui_init

void gui_init(struct dt_iop_module_t *self)
{
  self->gui_data = malloc(sizeof(dt_iop_global_tonemap_gui_data_t));
  dt_iop_global_tonemap_gui_data_t *g = (dt_iop_global_tonemap_gui_data_t *)self->gui_data;
  dt_iop_global_tonemap_params_t *p = (dt_iop_global_tonemap_params_t *)self->params;

  dt_pthread_mutex_init(&g->lock, NULL);
  g->lwmax = NAN;
  g->hash = 0;

  self->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);
  dt_gui_add_help_link(self->widget, dt_get_help_url(self->op));

  /* operator */
  g->operator= dt_bauhaus_combobox_new(self);
  dt_bauhaus_widget_set_label(g->operator, NULL, _("operator"));

  dt_bauhaus_combobox_add(g->operator, "reinhard");
  dt_bauhaus_combobox_add(g->operator, "filmic");
  dt_bauhaus_combobox_add(g->operator, "drago");

  gtk_widget_set_tooltip_text(g->operator, _("the global tonemap operator"));
  g_signal_connect(G_OBJECT(g->operator), "value-changed", G_CALLBACK(operator_callback), self);
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->operator), TRUE, TRUE, 0);

  /* drago bias */
  g->drago.bias = dt_bauhaus_slider_new_with_range(self, 0.5, 1.0, 0.05, p->drago.bias, 2);
  dt_bauhaus_widget_set_label(g->drago.bias, NULL, _("bias"));
  gtk_widget_set_tooltip_text(g->drago.bias, _("the bias for tonemapper controls the linearity, "
                                               "the higher the more details in blacks"));
  g_signal_connect(G_OBJECT(g->drago.bias), "value-changed", G_CALLBACK(_drago_bias_callback), self);
  gtk_box_pack_start(GTK_BOX(self->widget), g->drago.bias, TRUE, TRUE, 0);


  /* drago bias */
  g->drago.max_light = dt_bauhaus_slider_new_with_range(self, 1, 500, 10, p->drago.max_light, 2);
  dt_bauhaus_widget_set_label(g->drago.max_light, NULL, _("target"));
  gtk_widget_set_tooltip_text(g->drago.max_light, _("the target light for tonemapper specified as cd/m2"));
  g_signal_connect(G_OBJECT(g->drago.max_light), "value-changed", G_CALLBACK(_drago_max_light_callback), self);
  gtk_box_pack_start(GTK_BOX(self->widget), g->drago.max_light, TRUE, TRUE, 0);

  /* detail */
  g->detail = dt_bauhaus_slider_new_with_range(self, -1.0, 1.0, 0.01, 0.0, 3);
  gtk_box_pack_start(GTK_BOX(self->widget), g->detail, TRUE, TRUE, 0);
  dt_bauhaus_widget_set_label(g->detail, NULL, _("detail"));

  g_signal_connect(G_OBJECT(g->detail), "value-changed", G_CALLBACK(detail_callback), self);
}
开发者ID:a3novy,项目名称:darktable,代码行数:48,代码来源:globaltonemap.c

示例10: gui_init

void gui_init(struct dt_iop_module_t *self)
{
  self->gui_data = malloc(sizeof(dt_iop_highlights_gui_data_t));
  dt_iop_highlights_gui_data_t *g = (dt_iop_highlights_gui_data_t *)self->gui_data;
  dt_iop_highlights_params_t *p = (dt_iop_highlights_params_t *)self->params;

  self->widget = gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);

  g->clip = dt_bauhaus_slider_new_with_range(self, 0.0, 2.0, 0.01, p->clip, 3);
  g_object_set(G_OBJECT(g->clip), "tooltip-text", _("manually adjust the clipping threshold against magenta highlights"), (char *)NULL);
  dt_bauhaus_widget_set_label(g->clip, _("clipping threshold"));
  gtk_box_pack_start(GTK_BOX(self->widget), g->clip, TRUE, TRUE, 0);

  g->mode = dt_bauhaus_combobox_new(self);
  gtk_box_pack_start(GTK_BOX(self->widget), g->mode, TRUE, TRUE, 0);
  dt_bauhaus_widget_set_label(g->mode, _("method"));
  dt_bauhaus_combobox_add(g->mode, _("clip highlights"));
  dt_bauhaus_combobox_add(g->mode, _("reconstruct in LCh"));
  g_object_set(G_OBJECT(g->mode), "tooltip-text", _("highlight reconstruction method"), (char *)NULL);

  g->slider_box = GTK_BOX(gtk_vbox_new(TRUE, DT_BAUHAUS_SPACE));
  gtk_widget_set_no_show_all(GTK_WIDGET(g->slider_box), TRUE);
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->slider_box), FALSE, FALSE, 0);

  g->blendL = dt_bauhaus_slider_new_with_range(self,0.0, 1.0, 0.01, p->blendL, 3);
  g->blendC = dt_bauhaus_slider_new_with_range(self,0.0, 1.0, 0.01, p->blendC, 3);
  g->blendh = dt_bauhaus_slider_new_with_range(self,0.0, 1.0, 0.01, p->blendh, 3);
  g_object_set(G_OBJECT(g->blendL), "tooltip-text", _("blend lightness (0 is same as clipping)"), (char *)NULL);
  g_object_set(G_OBJECT(g->blendC), "tooltip-text", _("blend colorness (0 is same as clipping)"), (char *)NULL);
  g_object_set(G_OBJECT(g->blendh), "tooltip-text", _("blend hue (0 is same as clipping)"), (char *)NULL);
  dt_bauhaus_widget_set_label(g->blendL,_("blend L"));
  dt_bauhaus_widget_set_label(g->blendC,_("blend C"));
  dt_bauhaus_widget_set_label(g->blendh,_("blend h"));
  gtk_box_pack_start(g->slider_box, g->blendL, TRUE, TRUE, 0);
  gtk_box_pack_start(g->slider_box, g->blendC, TRUE, TRUE, 0);
  gtk_box_pack_start(g->slider_box, g->blendh, TRUE, TRUE, 0);

  g_signal_connect (G_OBJECT (g->clip), "value-changed",
                    G_CALLBACK (clip_callback), self);
  g_signal_connect (G_OBJECT (g->blendL), "value-changed",
                    G_CALLBACK (blend_callback), self);
  g_signal_connect (G_OBJECT (g->blendC), "value-changed",
                    G_CALLBACK (blend_callback), self);
  g_signal_connect (G_OBJECT (g->blendh), "value-changed",
                    G_CALLBACK (blend_callback), self);
  g_signal_connect (G_OBJECT (g->mode), "value-changed",
                    G_CALLBACK (mode_changed), self);
}
开发者ID:amitkr,项目名称:darktable,代码行数:48,代码来源:highlights.c

示例11: gui_update

void gui_update(struct dt_iop_module_t *self)
{
  dt_iop_module_t *module = (dt_iop_module_t *)self;
  dt_iop_colorchecker_gui_data_t *g = (dt_iop_colorchecker_gui_data_t *)self->gui_data;
  dt_iop_colorchecker_params_t *p = (dt_iop_colorchecker_params_t *)module->params;
  if(g->patch >= p->num_patches || g->patch < 0) return;
  if(dt_bauhaus_combobox_length(g->combobox_patch) != p->num_patches)
  {
    dt_bauhaus_combobox_clear(g->combobox_patch);
    char cboxentry[1024];
    for(int k=0;k<p->num_patches;k++)
    {
      snprintf(cboxentry, sizeof(cboxentry), _("patch #%d"), k);
      dt_bauhaus_combobox_add(g->combobox_patch, cboxentry);
    }
    if(p->num_patches <= 24)
      dtgtk_drawing_area_set_aspect_ratio(g->area, 2.0/3.0);
    else
      dtgtk_drawing_area_set_aspect_ratio(g->area, 1.0);
  }
  dt_bauhaus_slider_set(g->scale_L, p->target_L[g->patch] - p->source_L[g->patch]);
  dt_bauhaus_slider_set(g->scale_a, p->target_a[g->patch] - p->source_a[g->patch]);
  dt_bauhaus_slider_set(g->scale_b, p->target_b[g->patch] - p->source_b[g->patch]);
  const float Cin = sqrtf(
      p->source_a[g->patch]*p->source_a[g->patch] +
      p->source_b[g->patch]*p->source_b[g->patch]);
  const float Cout = sqrtf(
      p->target_a[g->patch]*p->target_a[g->patch]+
      p->target_b[g->patch]*p->target_b[g->patch]);
  dt_bauhaus_slider_set(g->scale_C, Cout-Cin);
  if(g->patch != g->drawn_patch) gtk_widget_queue_draw(g->area);
}
开发者ID:PkmX,项目名称:darktable,代码行数:32,代码来源:colorchecker.c

示例12: combobox_numindex

static int combobox_numindex(lua_State*L)
{
  lua_combobox combobox;
  luaA_to(L,lua_combobox,&combobox,1);
  int key = lua_tointeger(L,2);
  int length = dt_bauhaus_combobox_length(combobox->widget);
  if(lua_gettop(L) > 2) {
    if(key <= 0 || key > length +1) {
      return luaL_error(L,"Invalid index for combobox : %d\n",key);
    } else if(key == length +1) {
      const char * string = luaL_checkstring(L,3);
      dt_bauhaus_combobox_add(combobox->widget,string);
    } else if(lua_isnil(L,3)){
      dt_bauhaus_combobox_remove_at(combobox->widget,key-1);
    } else {
      const char * string = luaL_checkstring(L,3);
      dt_bauhaus_combobox_remove_at(combobox->widget,key-1);
      dt_bauhaus_combobox_insert(combobox->widget,string,key-1);
    }
    return 0;
  }
  if(key <= 0 || key > length) {
    return luaL_error(L,"Invalid index for combo box : %d\n",key);
  } else if (key > length) {
    lua_pushnil(L);
    return 1;
  }
  const GList *labels = dt_bauhaus_combobox_get_labels(combobox->widget);
  lua_pushstring(L,g_list_nth_data((GList*)labels,key-1));
  return 1;
}
开发者ID:CChiappa,项目名称:darktable,代码行数:31,代码来源:combobox.c

示例13: gui_init

void gui_init(dt_iop_module_t *module)
{
  module->gui_data = malloc(sizeof(dt_iop_defringe_gui_data_t));
  dt_iop_defringe_gui_data_t *g = (dt_iop_defringe_gui_data_t *)module->gui_data;
  dt_iop_defringe_params_t *p = (dt_iop_defringe_params_t *)module->params;

  module->widget = gtk_box_new(GTK_ORIENTATION_VERTICAL, DT_BAUHAUS_SPACE);

  /* mode selection */
  g->mode_select = dt_bauhaus_combobox_new(module);
  gtk_box_pack_start(GTK_BOX(module->widget), g->mode_select, TRUE, TRUE, 0);
  dt_bauhaus_widget_set_label(g->mode_select, NULL, _("operation mode"));
  dt_bauhaus_combobox_add(g->mode_select, _("global average (fast)"));   // 0
  dt_bauhaus_combobox_add(g->mode_select, _("local average (slow)"));    // 1
  dt_bauhaus_combobox_add(g->mode_select, _("static threshold (fast)")); // 2
  g_object_set(
      G_OBJECT(g->mode_select), "tooltip-text",
      _("method for color protection:\n - global average: fast, might show slightly wrong previews in high "
        "magnification; might sometimes protect saturation too much or too low in comparison to local "
        "average\n - local average: slower, might protect saturation better than global average by using "
        "near pixels as color reference, so it can still allow for more desaturation where required\n - "
        "static: fast, only uses the threshold as a static limit"),
      (char *)NULL);
  g_signal_connect(G_OBJECT(g->mode_select), "value-changed", G_CALLBACK(mode_callback), module);

  /* radius and threshold sliders */
  g->radius_scale = dt_bauhaus_slider_new_with_range(module, 0.5, 20.0, 0.1, p->radius, 1);
  dt_bauhaus_widget_set_label(g->radius_scale, NULL, _("edge detection radius"));

  g->thresh_scale = dt_bauhaus_slider_new_with_range(module, 0.5, 128.0, 0.1, p->thresh, 1);
  dt_bauhaus_widget_set_label(g->thresh_scale, NULL, _("threshold"));

  gtk_box_pack_start(GTK_BOX(module->widget), GTK_WIDGET(g->radius_scale), TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(module->widget), GTK_WIDGET(g->thresh_scale), TRUE, TRUE, 0);

  g_object_set(G_OBJECT(g->radius_scale), "tooltip-text", _("radius for detecting fringe"), (char *)NULL);
  g_object_set(G_OBJECT(g->thresh_scale), "tooltip-text",
               _("threshold for defringe, higher values mean less defringing"), (char *)NULL);

  g_signal_connect(G_OBJECT(g->radius_scale), "value-changed", G_CALLBACK(radius_slider_callback), module);
  g_signal_connect(G_OBJECT(g->thresh_scale), "value-changed", G_CALLBACK(thresh_slider_callback), module);
}
开发者ID:Acidburn0zzz,项目名称:darktable,代码行数:42,代码来源:defringe.c

示例14: gui_init

void gui_init(struct dt_iop_module_t *self)
{
  self->gui_data = malloc(sizeof(dt_iop_channelmixer_gui_data_t));
  dt_iop_channelmixer_gui_data_t *g = (dt_iop_channelmixer_gui_data_t *)self->gui_data;
  dt_iop_channelmixer_params_t *p = (dt_iop_channelmixer_params_t *)self->params;

  self->widget = gtk_vbox_new(FALSE, DT_BAUHAUS_SPACE);

  /* output */
  g->combo1 = dt_bauhaus_combobox_new(self);
  dt_bauhaus_widget_set_label(g->combo1, NULL, _("destination"));
  dt_bauhaus_combobox_add(g->combo1,_("hue"));
  dt_bauhaus_combobox_add(g->combo1,_("saturation"));
  dt_bauhaus_combobox_add(g->combo1,_("lightness"));
  dt_bauhaus_combobox_add(g->combo1,_("red"));
  dt_bauhaus_combobox_add(g->combo1,_("green"));
  dt_bauhaus_combobox_add(g->combo1,_("blue"));
  dt_bauhaus_combobox_add(g->combo1,C_("channelmixer", "gray"));
  dt_bauhaus_combobox_set(g->combo1, CHANNEL_RED );

  g_signal_connect (G_OBJECT (g->combo1), "value-changed",
                    G_CALLBACK (output_callback), self);

  /* red */
  g->scale1 = dt_bauhaus_slider_new_with_range(self, -2.0, 2.0, 0.005, p->red[CHANNEL_RED] , 3);
  g_object_set (GTK_OBJECT(g->scale1), "tooltip-text", _("amount of red channel in the output channel"), (char *)NULL);
  dt_bauhaus_widget_set_label(g->scale1, NULL, _("red"));
  g_signal_connect (G_OBJECT (g->scale1), "value-changed",
                    G_CALLBACK (red_callback), self);

  /* green */
  g->scale2 = dt_bauhaus_slider_new_with_range(self, -2.0, 2.0, 0.005, p->green[CHANNEL_RED] , 3);
  g_object_set (GTK_OBJECT(g->scale2), "tooltip-text", _("amount of green channel in the output channel"), (char *)NULL);
  dt_bauhaus_widget_set_label(g->scale2, NULL, _("green"));
  g_signal_connect (G_OBJECT (g->scale2), "value-changed",
                    G_CALLBACK (green_callback), self);

  /* blue */
  g->scale3 = dt_bauhaus_slider_new_with_range(self, -2.0, 2.0, 0.005, p->blue[CHANNEL_RED] , 3);
  g_object_set(g->scale3, "tooltip-text", _("amount of blue channel in the output channel"), (char *)NULL);
  dt_bauhaus_widget_set_label(g->scale3, NULL, _("blue"));
  g_signal_connect (G_OBJECT (g->scale3), "value-changed",
                    G_CALLBACK (blue_callback), self);


  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->combo1), TRUE, TRUE, 0);

  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale1), TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale2), TRUE, TRUE, 0);
  gtk_box_pack_start(GTK_BOX(self->widget), GTK_WIDGET(g->scale3), TRUE, TRUE, 0);

}
开发者ID:PolarFox,项目名称:darktable,代码行数:52,代码来源:channelmixer.c

示例15: dt_camctl_camera_get_property

/** Add  a new property of camera to the gui */
dt_lib_camera_property_t *_lib_property_add_new(dt_lib_camera_t *lib, const gchar *label,
                                                const gchar *propertyname)
{
  if(dt_camctl_camera_property_exists(darktable.camctl, NULL, propertyname))
  {
    const char *value;
    if((value = dt_camctl_camera_property_get_first_choice(darktable.camctl, NULL, propertyname)) != NULL)
    {
      // We got a value for property lets construct the gui for the property and add values
      int i = 0;
      const char *current_value = dt_camctl_camera_get_property(darktable.camctl, NULL, propertyname);
      dt_lib_camera_property_t *prop = calloc(1, sizeof(dt_lib_camera_property_t));
      prop->name = strdup(label);
      prop->property_name = strdup(propertyname);
      prop->values = dt_bauhaus_combobox_new(NULL);
      dt_bauhaus_widget_set_label(prop->values, NULL, label);
      g_object_ref_sink(prop->values);

      prop->osd = DTGTK_TOGGLEBUTTON(dtgtk_togglebutton_new(dtgtk_cairo_paint_eye, CPF_STYLE_FLAT | CPF_DO_NOT_USE_BORDER));
      g_object_ref_sink(prop->osd);
      gtk_widget_set_size_request(GTK_WIDGET(prop->osd), DT_PIXEL_APPLY_DPI(14), -1);
      g_object_set(G_OBJECT(prop->osd), "tooltip-text", _("toggle view property in center view"),
                   (char *)NULL);
      do
      {
        dt_bauhaus_combobox_add(prop->values, g_dgettext("libgphoto2-2", value));
        if(!strcmp(current_value, g_dgettext("libgphoto2-2", value)))
          dt_bauhaus_combobox_set(prop->values, i);
        i++;
      } while((value = dt_camctl_camera_property_get_next_choice(darktable.camctl, NULL, propertyname))
              != NULL);
      lib->gui.properties = g_list_append(lib->gui.properties, prop);
      // Does dead lock!!!
      g_signal_connect(G_OBJECT(prop->values), "value-changed", G_CALLBACK(property_changed_callback),
                       (gpointer)prop);
      return prop;
    }
  }
  return NULL;
}
开发者ID:dirkbr,项目名称:darktable,代码行数:41,代码来源:camera.c


注:本文中的dt_bauhaus_combobox_add函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。