• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ dt_control_add_job函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: dt_control_delete_images

void dt_control_delete_images()
{
  if(dt_conf_get_bool("ask_before_delete"))
  {
    GtkWidget *dialog;
    GtkWidget *win = dt_ui_main_window(darktable.gui->ui);

    int number = dt_collection_get_selected_count(darktable.collection);

    // Do not show the dialog if no image is selected:
    if(number == 0) return;

    dialog = gtk_message_dialog_new(GTK_WINDOW(win),
                                    GTK_DIALOG_DESTROY_WITH_PARENT,
                                    GTK_MESSAGE_QUESTION,
                                    GTK_BUTTONS_YES_NO,
                                    ngettext("do you really want to physically delete %d selected image from disk?",
                                        "do you really want to physically delete %d selected images from disk?", number), number);

    gtk_window_set_title(GTK_WINDOW(dialog), _("delete images?"));
    gint res = gtk_dialog_run(GTK_DIALOG(dialog));
    gtk_widget_destroy(dialog);
    if(res != GTK_RESPONSE_YES) return;
  }
  dt_job_t j;
  dt_control_delete_images_job_init(&j);
  dt_control_add_job(darktable.control, &j);
}
开发者ID:minusdreidb,项目名称:darktable,代码行数:28,代码来源:control_jobs.c


示例2: lua_job_cancelled

static void lua_job_cancelled(dt_progress_t *progress, gpointer user_data)
{
    dt_job_t *job = dt_control_job_create(&lua_job_canceled_job, "lua: on background cancel");
    if(!job) return;
    dt_control_job_set_params(job, progress);
    dt_control_add_job(darktable.control, DT_JOB_QUEUE_SYSTEM_BG, job);
}
开发者ID:markcottrell,项目名称:darktable,代码行数:7,代码来源:gui.c


示例3: _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++;
}
开发者ID:AntonSh,项目名称:darktable,代码行数:30,代码来源:camera_jobs.c


示例4: dt_control_delete_images

void dt_control_delete_images()
{
  if(dt_conf_get_bool("ask_before_delete"))
  {
    GtkWidget *dialog;
    GtkWidget *win = dt_ui_main_window(darktable.gui->ui);

    sqlite3_stmt *stmt = NULL;
    int number = 0;
    
    DT_DEBUG_SQLITE3_PREPARE_V2(dt_database_get(darktable.db), "select count(imgid) from selected_images", -1, &stmt, NULL);
    if(sqlite3_step(stmt) == SQLITE_ROW)
    {
      number = sqlite3_column_int(stmt, 0);
    }

    dialog = gtk_message_dialog_new(GTK_WINDOW(win),
                                    GTK_DIALOG_DESTROY_WITH_PARENT,
                                    GTK_MESSAGE_QUESTION,
                                    GTK_BUTTONS_YES_NO,
                                    ngettext("do you really want to physically delete %d selected image from disk?",
                                             "do you really want to physically delete %d selected images from disk?", number), number);
    gtk_window_set_title(GTK_WINDOW(dialog), _("delete images?"));
    gint res = gtk_dialog_run(GTK_DIALOG(dialog));
    gtk_widget_destroy(dialog);
    if(res != GTK_RESPONSE_YES) return;
  }
  dt_job_t j;
  dt_control_delete_images_job_init(&j);
  dt_control_add_job(darktable.control, &j);
}
开发者ID:nagyistoce,项目名称:radhermit-darktable,代码行数:31,代码来源:control_jobs.c


示例5: dt_control_reset_local_copy_images

void dt_control_reset_local_copy_images()
{
  dt_job_t j;
  dt_control_local_copy_images_job_init(&j);
  j.user_data=(void *)0;
  dt_control_add_job(darktable.control, &j);
  return;
}
开发者ID:jmarca,项目名称:darktable,代码行数:8,代码来源:control_jobs.c


示例6: _camera_capture_image_downloaded

static void _camera_capture_image_downloaded(const dt_camera_t *camera, const char *filename, void *data)
{
  dt_capture_t *lib = (dt_capture_t *)data;

  /* create an import job of downloaded image */
  dt_control_add_job(darktable.control, DT_JOB_QUEUE_USER_BG,
                     dt_image_import_job_create(dt_import_session_film_id(lib->session), filename));
}
开发者ID:AdamMajer,项目名称:darktable,代码行数:8,代码来源:tethering.c


示例7: dt_lua_init

void dt_lua_init(lua_State*L,const char *lua_command)
{
  /*
     Note to reviewers
     this is the only place where lua code is run without the lua lock.
     At this point, no user script has been called,
     so we are completely thread-safe. no need to lock

     This is also the only place where lua code is run with the gdk lock
     held, but this is not a problem because it is very brief, user calls
     are delegated to a secondary job
     */
  char tmp_path[PATH_MAX];
  // init the lua environment
  lua_CFunction* cur_type = init_funcs;
  while(*cur_type)
  {
    (*cur_type)(L);
    cur_type++;
  }
  // build the table containing the configuration info

  lua_getglobal(L,"package");
  dt_lua_goto_subtable(L,"loaded");
  lua_pushstring(L,"darktable");
  dt_lua_push_darktable_lib(L);
  lua_settable(L,-3);
  lua_pop(L,1);

  lua_getglobal(L,"package");
  lua_getfield(L,-1,"path");
  lua_pushstring(L,";");
  dt_loc_get_datadir(tmp_path, sizeof(tmp_path));
  lua_pushstring(L,tmp_path);
  lua_pushstring(L,"/lua/?.lua");
  lua_pushstring(L,";");
  dt_loc_get_user_config_dir(tmp_path, sizeof(tmp_path));
  lua_pushstring(L,tmp_path);
  lua_pushstring(L,"/lua/?.lua");
  lua_concat(L,7);
  lua_setfield(L,-2,"path");
  lua_pop(L,1);



  dt_job_t *job = dt_control_job_create(&run_early_script, "lua: run initial script");
  dt_control_job_set_params(job, g_strdup(lua_command));
  if(darktable.gui)
  {
    dt_control_add_job(darktable.control, DT_JOB_QUEUE_USER_BG, job);
  }
  else
  {
    run_early_script(job);
    dt_control_job_dispose(job);
  }

}
开发者ID:grinoscar,项目名称:darktable,代码行数:58,代码来源:init.c


示例8: dt_control_add_background_job

/* Background jobs will be timestamped and added to queue
    the queue will then check ts and detect if its background job
    and place it on the job_res if its available...
*/
int32_t dt_control_add_background_job(dt_control_t *s, dt_job_t *job, time_t delay)
{
  /* setup timestamps */
  job->ts_added = time(NULL);
  job->ts_execute = job->ts_added+delay;

  /* pass the job further to scheduled jobs worker */
  return dt_control_add_job(s,job);
}
开发者ID:kriomant,项目名称:darktable,代码行数:13,代码来源:control.c


示例9: free_params_wrapper

static void  free_params_wrapper  (struct dt_imageio_module_storage_t *self, dt_imageio_module_data_t *data)
{
  dt_job_t job;
  dt_control_job_init(&job, "lua: destroy storage param");
  job.execute = &free_param_wrapper_job;
  free_param_wrapper_data *t = (free_param_wrapper_data*)job.param;
  t->data = (lua_storage_t*)data;
  dt_control_add_job(darktable.control, &job);
}
开发者ID:danielbaak,项目名称:darktable,代码行数:9,代码来源:storage.c


示例10: dt_control_move_images

void dt_control_move_images()
{
  // Open file chooser dialog
  gchar *dir = NULL;
  GtkWidget *win = dt_ui_main_window(darktable.gui->ui);
  int number = dt_collection_get_selected_count(darktable.collection);

  // Do not show the dialog if no image is selected:
  if(number == 0) return;

  GtkWidget *filechooser = gtk_file_chooser_dialog_new (_("select directory"),
                           GTK_WINDOW (win),
                           GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
                           GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                           GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
                           (char *)NULL);

  gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(filechooser), FALSE);
  if (gtk_dialog_run (GTK_DIALOG (filechooser)) == GTK_RESPONSE_ACCEPT)
  {
    dir = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filechooser));
  }
  gtk_widget_destroy (filechooser);

  if(!dir || !g_file_test(dir, G_FILE_TEST_IS_DIR))
    goto abort;

  if(dt_conf_get_bool("ask_before_move"))
  {
    GtkWidget *dialog = gtk_message_dialog_new(GTK_WINDOW(win),
                        GTK_DIALOG_DESTROY_WITH_PARENT,
                        GTK_MESSAGE_QUESTION,
                        GTK_BUTTONS_YES_NO,
                        ngettext("do you really want to physically move the %d selected image to %s?\n"
                                 "(all unselected duplicates will be moved along)",
                                 "do you really want to physically move %d selected images to %s?\n"
                                 "(all unselected duplicates will be moved along)", number), number, dir);
    gtk_window_set_title(GTK_WINDOW(dialog), ngettext("move image?", "move images?", number));

    gint res = gtk_dialog_run(GTK_DIALOG(dialog));
    gtk_widget_destroy(dialog);

    if(res != GTK_RESPONSE_YES)
      goto abort;
  }

  dt_job_t j;
  dt_control_move_images_job_init(&j);
  j.user_data = dir;
  dt_control_add_job(darktable.control, &j);
  return;

abort:
  g_free(dir);
  return;
}
开发者ID:minusdreidb,项目名称:darktable,代码行数:56,代码来源:control_jobs.c


示例11: dt_control_match_similar

void dt_control_match_similar(dt_similarity_t *data)
{
  dt_job_t j;
  GList *selected = dt_collection_get_selected(darktable.collection);
  if(selected)
  {
    dt_control_match_similar_job_init(&j, (long int)selected->data, data);
    dt_control_add_job(darktable.control, &j);
  }
  else
    dt_control_log(_("select an image as target for search of similar images"));
}
开发者ID:ksyz,项目名称:darktable,代码行数:12,代码来源:control_jobs.c


示例12: free_params_wrapper

static void free_params_wrapper(struct dt_imageio_module_storage_t *self, dt_imageio_module_data_t *data)
{
  dt_job_t *job = dt_control_job_create(&free_param_wrapper_job, "lua: destroy storage param");
  if(!job) return;
  free_param_wrapper_data *t = (free_param_wrapper_data *)calloc(1, sizeof(free_param_wrapper_data));
  if(!t)
  {
    dt_control_job_dispose(job);
    return;
  }
  dt_control_job_set_params(job, t, free_param_wrapper_destroy);
  t->data = (lua_storage_t *)data;
  dt_control_add_job(darktable.control, DT_JOB_QUEUE_SYSTEM_BG, job);
}
开发者ID:kael-shipman,项目名称:darktable,代码行数:14,代码来源:luastorage.c


示例13: shortcut_callback

static gboolean shortcut_callback(GtkAccelGroup *accel_group,
    GObject *acceleratable,
    guint keyval,
    GdkModifierType modifier,
    gpointer p)
{
  dt_job_t job;
  dt_control_job_init(&job, "lua: on export image tmpfile");
  job.execute = &shortcut_callback_job;
  shortcut_callback_data *t = (shortcut_callback_data*)job.param;
  t->name = strdup(p);
  dt_control_add_job(darktable.control, &job);
  return TRUE;
}
开发者ID:danielbaak,项目名称:darktable,代码行数:14,代码来源:events.c


示例14: _camera_capture_image_downloaded

void _camera_capture_image_downloaded(const dt_camera_t *camera,const char *filename,void *data)
{
  dt_camera_capture_t *t;

  t = (dt_camera_capture_t*)data;

  /* create an import job of downloaded image */
  dt_control_add_job(darktable.control, DT_JOB_QUEUE_USER_BG, dt_image_import_job_create(dt_import_session_film_id(t->shared.session), filename));
  if (--t->total == 0)
  {
    pthread_mutex_lock(&t->mutex);
    pthread_cond_broadcast(&t->done);
    pthread_mutex_unlock(&t->mutex);
  }
}
开发者ID:PolarFox,项目名称:darktable,代码行数:15,代码来源:camera_jobs.c


示例15: dt_printers_discovery

void dt_printers_discovery(void (*cb)(dt_printer_info_t *pr, void *user_data), void *user_data)
{
  // asynchronously checks for available printers
  dt_job_t *job = dt_control_job_create(&_detect_printers_callback, "detect connected printers");
  if(job)
  {
    dt_prtctl_t *prtctl = g_malloc0(sizeof(dt_prtctl_t));

    prtctl->cb = cb;
    prtctl->user_data = user_data;

    dt_control_job_set_params(job, prtctl, g_free);
    dt_control_add_job(darktable.control, DT_JOB_QUEUE_SYSTEM_BG, job);
  }
}
开发者ID:CChiappa,项目名称:darktable,代码行数:15,代码来源:cups_print.c


示例16: on_image_imported

static void on_image_imported(gpointer instance,uint32_t id, gpointer user_data){
  dt_job_t *job = dt_control_job_create(&on_image_imported_callback_job, "lua: on image imported");
  if(job)
  {
    on_image_imported_callback_data_t *t = (on_image_imported_callback_data_t*)calloc(1, sizeof(on_image_imported_callback_data_t));
    if(!t)
    {
      dt_control_job_dispose(job);
    }
    else
    {
      dt_control_job_set_params(job, t);
      t->imgid = id;
      dt_control_add_job(darktable.control, DT_JOB_QUEUE_USER_FG, job);
    }
  }
}
开发者ID:Coshibu,项目名称:darktable,代码行数:17,代码来源:database.c


示例17: _lib_import_from_camera_callback

/* show import from camera dialog */
static void _lib_import_from_camera_callback(GtkButton *button,gpointer data)
{
  dt_camera_import_dialog_param_t *params=(dt_camera_import_dialog_param_t *)g_malloc(sizeof(dt_camera_import_dialog_param_t));
  memset( params, 0, sizeof(dt_camera_import_dialog_param_t));
  params->camera = (dt_camera_t*)data;

  dt_camera_import_dialog_new(params);
  if( params->result )
  {
    /* initialize a import job and put it on queue.... */
    gchar *path = g_build_path(G_DIR_SEPARATOR_S,params->basedirectory,params->subdirectory,(char *)NULL);
    dt_job_t j;
    dt_camera_import_job_init(&j,params->jobcode,path,params->filenamepattern,params->result,params->camera,params->time_override);
    dt_control_add_job(darktable.control, &j);
    g_free(path);
  }
  g_free(params);
}
开发者ID:ealasu,项目名称:darktable,代码行数:19,代码来源:import.c


示例18: dt_control_export

void dt_control_export(GList *imgid_list,int max_width, int max_height, int format_index, int storage_index, gboolean high_quality,char *style)
{
  dt_job_t job;
  dt_control_job_init(&job, "export");
  job.execute = &dt_control_export_job_run;
  dt_control_image_enumerator_t *t = (dt_control_image_enumerator_t *)job.param;
  t->index = imgid_list;
  dt_control_export_t *data = (dt_control_export_t*)malloc(sizeof(dt_control_export_t));
  data->max_width = max_width;
  data->max_height = max_height;
  data->format_index = format_index;
  data->storage_index = storage_index;
  data->high_quality = high_quality;
  strncpy(data->style,style,128);
  t->data = data;
  dt_control_signal_raise(darktable.signals,DT_SIGNAL_IMAGE_EXPORT_MULTIPLE,t);
  dt_control_add_job(darktable.control, &job);
}
开发者ID:bleader,项目名称:darktable,代码行数:18,代码来源:control_jobs.c


示例19: _lib_import_from_camera_callback

/* show import from camera dialog */
static void _lib_import_from_camera_callback(GtkButton *button, gpointer data)
{
  dt_camera_import_dialog_param_t *params
      = (dt_camera_import_dialog_param_t *)g_malloc0(sizeof(dt_camera_import_dialog_param_t));
  params->camera = (dt_camera_t *)data;

  dt_camera_import_dialog_new(params);
  if(params->result)
  {
    /* initialize a import job and put it on queue.... */
    dt_control_add_job(
        darktable.control, DT_JOB_QUEUE_USER_BG,
        dt_camera_import_job_create(params->jobcode, params->result, params->camera, params->time_override));
  }
  g_free(params->jobcode);
  g_list_free(params->result);
  g_free(params);
}
开发者ID:Acidburn0zzz,项目名称:darktable,代码行数:19,代码来源:import.c


示例20: dt_lua_do_chunk_later_internal

void dt_lua_do_chunk_later_internal(const char* function, int line,lua_State *L, int nargs)
{
#ifdef _DEBUG
  dt_print(DT_DEBUG_LUA,"LUA DEBUG : %s called from %s %d\n",__FUNCTION__,function,line);
#endif
  
  lua_getfield(L, LUA_REGISTRYINDEX, "dt_lua_bg_threads");
  lua_State *new_thread = lua_newthread(L);
  const int reference = luaL_ref(L,-2);
  lua_pop(L,1);
  lua_xmove(L,new_thread,nargs+1);
  dt_job_t *job = dt_control_job_create(&do_chunk_later_callback, "lua: later_chunk");

  if(job)
  {
    dt_control_job_set_params(job, GINT_TO_POINTER(reference), NULL);
    dt_control_add_job(darktable.control, DT_JOB_QUEUE_USER_FG, job);
  }
}
开发者ID:Nitrosito,项目名称:darktable,代码行数:19,代码来源:call.c



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ dt_control_job_init函数代码示例发布时间:2022-05-30
下一篇:
C++ dt_conf_set_int函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap