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


C++ dt_bauhaus_combobox_set函数代码示例

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


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

示例1: 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] = p->coeffs[k]/fp->coeffs[k];
  convert_rgb_to_k(mul, p->temp_out, &temp, &tint);

  dt_bauhaus_slider_set(g->scale_k_out, p->temp_out);
  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);
  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:AntonSh,项目名称:darktable,代码行数:27,代码来源:temperature.c

示例2: dt_bauhaus_popup_scroll

static gboolean
dt_bauhaus_popup_scroll(GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
{
  gtk_widget_queue_draw(darktable.bauhaus->popup_area);
  dt_bauhaus_widget_t *w = darktable.bauhaus->current;
  switch(w->type)
  {
    case DT_BAUHAUS_COMBOBOX:
      {
        gint wx, wy;
        GtkWidget *w = GTK_WIDGET(darktable.bauhaus->current);
        const int ht = w->allocation.height;
        const int skip = ht + get_line_space();
        gdk_window_get_origin (gtk_widget_get_window (w), &wx, &wy);
        dt_bauhaus_combobox_data_t *d = &darktable.bauhaus->current->data.combobox;
        if(event->direction == GDK_SCROLL_UP)
          dt_bauhaus_combobox_set(w, CLAMP(d->active-1, 0, d->num_labels-1));
        else
          dt_bauhaus_combobox_set(w, CLAMP(d->active+1, 0, d->num_labels-1));
        gdk_window_move(gtk_widget_get_window(darktable.bauhaus->popup_window), wx, wy - d->active * skip);
      }
      break;
    case DT_BAUHAUS_SLIDER:
      break;
    default:
      break;
  }
  return TRUE;
}
开发者ID:joninvski,项目名称:darktable,代码行数:29,代码来源:bauhaus.c

示例3: value_member

static int value_member(lua_State*L)
{
  lua_combobox combobox;
  luaA_to(L,lua_combobox,&combobox,1);
  int length = dt_bauhaus_combobox_length(combobox->widget);
  if(lua_gettop(L) > 2) {
    if(lua_isnil(L,3)) {
      dt_bauhaus_combobox_set(combobox->widget,-1);
    } else if(lua_isnumber(L,3)) {
      int index = lua_tointeger(L,3) ;
      if(index < 1 || index > length) {
        return luaL_error(L,"Invalid index for combo box : %d\n",index);
      }
      dt_bauhaus_combobox_set(combobox->widget,index -1);
    } else if(lua_isstring(L,3)&& dt_bauhaus_combobox_get_editable(combobox->widget)) {
      const char * string = lua_tostring(L,3);
      dt_bauhaus_combobox_set_text(combobox->widget,string);
    } else {
      return luaL_error(L,"Invalid type for combo box value\n");
    }
    return 0;
  }
  lua_pushstring(L,dt_bauhaus_combobox_get_text(combobox->widget));
  return 1;
}
开发者ID:CChiappa,项目名称:darktable,代码行数:25,代码来源:combobox.c

示例4: gui_update

void gui_update(struct dt_iop_module_t *self)
{
  dt_iop_exposure_gui_data_t *g = (dt_iop_exposure_gui_data_t *)self->gui_data;
  dt_iop_exposure_params_t *p = (dt_iop_exposure_params_t *)self->params;

  if(!dt_image_is_raw(&self->dev->image_storage))
  {
    gtk_widget_hide(GTK_WIDGET(g->mode));
    p->mode = EXPOSURE_MODE_MANUAL;
    dt_dev_add_history_item(darktable.develop, self, TRUE);
  } else
  {
    gtk_widget_show(GTK_WIDGET(g->mode));
  }

  dt_bauhaus_combobox_set(g->mode, g_list_index(g->modes, GUINT_TO_POINTER(p->mode)));

  dt_bauhaus_slider_set(g->black, p->black);
  dt_bauhaus_slider_set_soft(g->exposure, p->exposure);

  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->autoexp), FALSE);
  dt_bauhaus_slider_set(g->autoexpp, 0.01);
  gtk_widget_set_sensitive(GTK_WIDGET(g->autoexpp), FALSE);

  dt_bauhaus_slider_set(g->deflicker_percentile, p->deflicker_percentile);
  dt_bauhaus_slider_set(g->deflicker_target_level, p->deflicker_target_level);
  dt_bauhaus_combobox_set(g->deflicker_histogram_source, g_list_index(g->deflicker_histogram_sources, GUINT_TO_POINTER(p->deflicker_histogram_source)));

  self->request_color_pick = DT_REQUEST_COLORPICK_OFF;

  free(g->deflicker_histogram);
  g->deflicker_histogram = NULL;

  g->reprocess_on_next_expose = FALSE;

  gtk_label_set_text(g->deflicker_used_EC, "");
  g->deflicker_computed_exposure = NAN;

  switch(p->mode)
  {
    case EXPOSURE_MODE_DEFLICKER:
      autoexp_disable(self);
      gtk_widget_hide(GTK_WIDGET(g->vbox_manual));
      gtk_widget_show(GTK_WIDGET(g->vbox_deflicker));

      if(p->deflicker_histogram_source == DEFLICKER_HISTOGRAM_SOURCE_SOURCEFILE)
        deflicker_prepare_histogram(self, &g->deflicker_histogram,
                                    &g->deflicker_histogram_stats);
      break;
    case EXPOSURE_MODE_MANUAL:
    default:
      gtk_widget_hide(GTK_WIDGET(g->vbox_deflicker));
      gtk_widget_show(GTK_WIDGET(g->vbox_manual));
      break;
  }
}
开发者ID:cyr123,项目名称:darktable,代码行数:56,代码来源:exposure.c

示例5: 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

示例6: 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

示例7: gui_update

/** gui callbacks, these are needed. */
void gui_update(dt_iop_module_t *self)
{
  // let gui slider match current parameters:
  dt_iop_bilat_gui_data_t *g = (dt_iop_bilat_gui_data_t *)self->gui_data;
  dt_iop_bilat_params_t *p = (dt_iop_bilat_params_t *)self->params;
  dt_bauhaus_slider_set(g->detail, 100.0f*p->detail+100.0f);
  dt_bauhaus_combobox_set(g->mode, p->mode);
  if(p->mode == s_mode_local_laplacian)
  {
    dt_bauhaus_slider_set(g->shadows, p->sigma_s*100.0f);
    dt_bauhaus_slider_set(g->highlights, p->sigma_r*100.0f);
    dt_bauhaus_slider_set(g->midtone, p->midtone);
    gtk_widget_set_visible(g->range, FALSE);
    gtk_widget_set_visible(g->spatial, FALSE);
    gtk_widget_set_visible(g->highlights, TRUE);
    gtk_widget_set_visible(g->shadows, TRUE);
    gtk_widget_set_visible(g->midtone, TRUE);
    dt_pthread_mutex_lock(&g->lock);
    g->hash = 0;
    dt_pthread_mutex_unlock(&g->lock);
  }
  else
  {
    dt_bauhaus_slider_set(g->spatial, p->sigma_s);
    dt_bauhaus_slider_set(g->range, p->sigma_r);
    gtk_widget_set_visible(g->range, TRUE);
    gtk_widget_set_visible(g->spatial, TRUE);
    gtk_widget_set_visible(g->highlights, FALSE);
    gtk_widget_set_visible(g->shadows, FALSE);
    gtk_widget_set_visible(g->midtone, FALSE);
  }
}
开发者ID:CChiappa,项目名称:darktable,代码行数:33,代码来源:bilat.c

示例8: gui_update

void gui_update(dt_iop_module_t *self)
{
  dt_iop_levels_gui_data_t *g = (dt_iop_levels_gui_data_t *)self->gui_data;
  dt_iop_levels_params_t *p = (dt_iop_levels_params_t *)self->params;

  dt_bauhaus_combobox_set(g->mode, g_list_index(g->modes, GUINT_TO_POINTER(p->mode)));
  dt_bauhaus_slider_set(g->percentile_black, p->percentiles[0]);
  dt_bauhaus_slider_set(g->percentile_grey, p->percentiles[1]);
  dt_bauhaus_slider_set(g->percentile_white, p->percentiles[2]);

  switch(p->mode)
  {
    case LEVELS_MODE_AUTOMATIC:
      gtk_stack_set_visible_child_name(GTK_STACK(g->mode_stack), "automatic");
      break;
    case LEVELS_MODE_MANUAL:
    default:
      gtk_stack_set_visible_child_name(GTK_STACK(g->mode_stack), "manual");
      break;
  }

  dt_pthread_mutex_lock(&g->lock);
  g->auto_levels[0] = NAN;
  g->auto_levels[1] = NAN;
  g->auto_levels[2] = NAN;
  dt_pthread_mutex_unlock(&g->lock);

  gtk_widget_queue_draw(self->widget);
}
开发者ID:AdamMajer,项目名称:darktable,代码行数:29,代码来源:levels.c

示例9: gui_update

void gui_update(struct dt_iop_module_t *self)
{
  dt_iop_module_t *module = (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 *)module->params;
  dt_bauhaus_slider_set(g->opacity, p->opacity);
  dt_bauhaus_slider_set_soft(g->scale, p->scale);
  dt_bauhaus_slider_set(g->rotate, p->rotate);
  dt_bauhaus_slider_set(g->x_offset, p->xoffset);
  dt_bauhaus_slider_set(g->y_offset, p->yoffset);
  gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(g->align[p->alignment]), TRUE);
  _combo_box_set_active_text(g->watermarks, p->filename);
  dt_bauhaus_combobox_set(g->sizeto, p->sizeto);
  gtk_entry_set_text(GTK_ENTRY(g->text), p->text);
  GdkRGBA color = (GdkRGBA){.red = p->color[0], .green = p->color[1], .blue = p->color[2], .alpha = 1.0 };
  gtk_color_chooser_set_rgba(GTK_COLOR_CHOOSER(g->colorpick), &color);
  gtk_font_button_set_font_name(GTK_FONT_BUTTON(g->fontsel), p->font);
}

void init(dt_iop_module_t *module)
{
  module->params = calloc(1, sizeof(dt_iop_watermark_params_t));
  module->params_size = sizeof(dt_iop_watermark_params_t);
  module->default_params = calloc(1, sizeof(dt_iop_watermark_params_t));
  module->default_enabled = 0;
  module->priority = 969; // module order created by iop_dependencies.py, do not edit!
  module->params_size = sizeof(dt_iop_watermark_params_t);
  module->gui_data = NULL;
  dt_iop_watermark_params_t tmp = (dt_iop_watermark_params_t){
    100.0, 100.0, 0.0, 0.0, 4, 0.0, DT_SCALE_IMAGE, { "darktable.svg" }, { "" }, {0.0, 0.0, 0.0}, {"DejaVu Sans 10"}
  }; // opacity,scale,xoffs,yoffs,alignment
  memcpy(module->params, &tmp, sizeof(dt_iop_watermark_params_t));
  memcpy(module->default_params, &tmp, sizeof(dt_iop_watermark_params_t));
}
开发者ID:edgomez,项目名称:darktable,代码行数:34,代码来源:watermark.c

示例10: gui_update

void gui_update(struct dt_iop_module_t *self)
{
  dt_iop_module_t *module = (dt_iop_module_t *)self;
  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 *)module->params;
  dt_bauhaus_combobox_set(g->operator, p->operator);
  gtk_widget_set_visible(g->drago.bias, FALSE);
  gtk_widget_set_visible(g->drago.max_light, FALSE);
  /* show ui for selected operator */
  if(p->operator== OPERATOR_DRAGO)
  {
    gtk_widget_set_visible(g->drago.bias, TRUE);
    gtk_widget_set_visible(g->drago.max_light, TRUE);
  }

  /* drago */
  dt_bauhaus_slider_set(g->drago.bias, p->drago.bias);
  dt_bauhaus_slider_set(g->drago.max_light, p->drago.max_light);
  dt_bauhaus_slider_set(g->detail, p->detail);

  dt_pthread_mutex_lock(&g->lock);
  g->lwmax = NAN;
  g->hash = 0;
  dt_pthread_mutex_unlock(&g->lock);

}
开发者ID:a3novy,项目名称:darktable,代码行数:26,代码来源:globaltonemap.c

示例11: gui_update

void gui_update(struct dt_iop_module_t *self)
{
  dt_iop_tonecurve_gui_data_t *g = (dt_iop_tonecurve_gui_data_t *)self->gui_data;
  dt_iop_tonecurve_params_t *p = (dt_iop_tonecurve_params_t *)self->params;
  dt_bauhaus_combobox_set(g->autoscale_ab, 1-p->tonecurve_autoscale_ab);
  // that's all, gui curve is read directly from params during expose event.
  gtk_widget_queue_draw(self->widget);
}
开发者ID:rikles,项目名称:darktable,代码行数:8,代码来源:tonecurve.c

示例12: _set_preset_spot

static gboolean _set_preset_spot(GtkAccelGroup *accel_group, GObject *acceleratable, guint keyval,
                                 GdkModifierType modifier, gpointer data)
{
  dt_iop_module_t *self = data;
  dt_iop_temperature_gui_data_t *g = self->gui_data;
  dt_bauhaus_combobox_set(g->presets, 2);
  return TRUE;
}
开发者ID:pryds,项目名称:darktable,代码行数:8,代码来源:temperature.c

示例13: gui_update

void gui_update(dt_iop_module_t *module)
{
  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;
  dt_bauhaus_combobox_set(g->mode_select, p->op_mode);
  dt_bauhaus_slider_set(g->radius_scale, p->radius);
  dt_bauhaus_slider_set(g->thresh_scale, p->thresh);
}
开发者ID:Acidburn0zzz,项目名称:darktable,代码行数:8,代码来源:defringe.c

示例14: set_params

int set_params(dt_imageio_module_format_t *self, const void *params, const int size)
{
  if(size != self->params_size(self)) return 1;
  const dt_imageio_tiff_t *d = (dt_imageio_tiff_t *)params;
  const dt_imageio_tiff_gui_t *g = (dt_imageio_tiff_gui_t *)self->gui_data;

  if(d->bpp == 16)
    dt_bauhaus_combobox_set(g->bpp, 1);
  else if(d->bpp == 32)
    dt_bauhaus_combobox_set(g->bpp, 2);
  else // (d->bpp == 8)
    dt_bauhaus_combobox_set(g->bpp, 0);

  dt_bauhaus_combobox_set(g->compress, d->compress);

  return 0;
}
开发者ID:MarcelloPerathoner,项目名称:darktable,代码行数:17,代码来源:tiff.c

示例15: gui_update

void gui_update(struct dt_iop_module_t *self)
{
  dt_iop_module_t *module = (dt_iop_module_t *)self;
  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 *)module->params;
  dt_bauhaus_slider_set(g->clip, p->clip);
  dt_bauhaus_combobox_set(g->mode, p->mode);
}
开发者ID:VolkerChristian,项目名称:darktable,代码行数:8,代码来源:highlights.c


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