Update of /cvsroot/ufraw/ufraw In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20093
Modified Files: configure.ac ufraw-batch.c ufraw-gimp.c ufraw.c ufraw_preview.c ufraw_ufraw.c Log Message: Add glib and gdk thread support. Index: ufraw-batch.c =================================================================== RCS file: /cvsroot/ufraw/ufraw/ufraw-batch.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- ufraw-batch.c 24 Feb 2010 00:24:15 -0000 1.36 +++ ufraw-batch.c 24 Feb 2010 17:44:27 -0000 1.37 @@ -28,6 +28,7 @@ int status; int exitCode = 0; + g_thread_init(NULL); char *argFile = uf_win32_locale_to_utf8(argv[0]); ufraw_binary = g_path_get_basename(argFile); uf_init_locale(argFile); Index: configure.ac =================================================================== RCS file: /cvsroot/ufraw/ufraw/configure.ac,v retrieving revision 1.150 retrieving revision 1.151 diff -u -d -r1.150 -r1.151 --- configure.ac 7 Feb 2010 22:37:26 -0000 1.150 +++ configure.ac 24 Feb 2010 17:44:26 -0000 1.151 @@ -105,7 +105,7 @@ [ with_dosprefix=$withval], [ with_dosprefix=NONE ] ) -PKG_CHECK_MODULES(GLIB, glib-2.0) +PKG_CHECK_MODULES(GLIB, glib-2.0 gthread-2.0) PKG_CHECK_MODULES(LCMS, lcms) AC_ARG_WITH([gtk], Index: ufraw-gimp.c =================================================================== RCS file: /cvsroot/ufraw/ufraw/ufraw-gimp.c,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- ufraw-gimp.c 5 Feb 2010 23:22:15 -0000 1.62 +++ ufraw-gimp.c 24 Feb 2010 17:44:27 -0000 1.63 @@ -147,6 +147,9 @@ conf_data rc; int status; + g_thread_init(NULL); + gdk_threads_init(); + gdk_threads_enter(); ufraw_binary = g_path_get_basename(gimp_get_progname()); uf_init_locale(gimp_get_progname()); @@ -164,6 +167,7 @@ } else { values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_CALLING_ERROR; + gdk_threads_leave(); return; } gboolean loadThumbnail = size>0; @@ -183,6 +187,7 @@ else *return_vals = gimp_run_procedure2 ("file_jpeg_load", nreturn_vals, nparams, param); + gdk_threads_leave(); return; } else if (!strcasecmp(filename+strlen(filename)-4, ".tif")) { if ( !loadThumbnail ) @@ -203,12 +208,15 @@ nreturn_vals, 3, tiffParam); */ } + gdk_threads_leave(); return; } else { /* Don't issue a message on thumbnail failure, since ufraw-gimp * will be called again with "file_ufraw_load" */ - if ( loadThumbnail ) return; - + if ( loadThumbnail ) { + gdk_threads_leave(); + return; + } ufraw_icons_init(); GtkWidget *dummyWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); uf_window_set_icon_name(GTK_WINDOW(dummyWindow), "ufraw"); @@ -220,6 +228,7 @@ values[0].data.d_status = GIMP_PDB_CANCEL; gtk_widget_destroy(dummyWindow); + gdk_threads_leave(); return; } } @@ -258,6 +267,7 @@ if ( status!=UFRAW_SUCCESS ) { values[0].type = GIMP_PDB_STATUS; values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; + gdk_threads_leave(); return; } if ( sendToGimpMode ) gimp_progress_update(0.3); @@ -276,6 +286,7 @@ values[0].data.d_status = GIMP_PDB_CANCEL; else values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR; + gdk_threads_leave(); return; } *nreturn_vals = 2; @@ -290,6 +301,8 @@ values[3].type = GIMP_PDB_INT32; values[3].data.d_int32 = uf->initialHeight; } + gdk_threads_leave(); + return; } int gimp_row_writer(ufraw_data *uf, void *volatile out, void *pixbuf, Index: ufraw_ufraw.c =================================================================== RCS file: /cvsroot/ufraw/ufraw/ufraw_ufraw.c,v retrieving revision 1.244 retrieving revision 1.245 diff -u -d -r1.244 -r1.245 --- ufraw_ufraw.c 23 Feb 2010 19:36:43 -0000 1.244 +++ ufraw_ufraw.c 24 Feb 2010 17:44:27 -0000 1.245 @@ -27,7 +27,7 @@ #include <bzlib.h> #endif -void (*ufraw_progress)(int what, int ticks); +void (*ufraw_progress)(int what, int ticks) = NULL; #ifdef HAVE_LENSFUN /* What about LF_MODIFY_ALL? */ Index: ufraw_preview.c =================================================================== RCS file: /cvsroot/ufraw/ufraw/ufraw_preview.c,v retrieving revision 1.342 retrieving revision 1.343 diff -u -d -r1.342 -r1.343 --- ufraw_preview.c 23 Feb 2010 19:36:43 -0000 1.342 +++ ufraw_preview.c 24 Feb 2010 17:44:27 -0000 1.343 @@ -1141,6 +1141,9 @@ ufraw_image_data *img1 = ufraw_convert_image_area(data->UF, subarea, ufraw_phases_num - 1); UFRectangle area = ufraw_image_get_subarea_rectangle(img1, subarea); +#ifdef _OPENMP +#pragma omp critical +#endif preview_draw_area(data, area.x, area.y, area.width, area.height); progress(PROGRESS_RENDER, 1); again = TRUE; Index: ufraw.c =================================================================== RCS file: /cvsroot/ufraw/ufraw/ufraw.c,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- ufraw.c 24 Feb 2010 00:24:15 -0000 1.57 +++ ufraw.c 24 Feb 2010 17:44:27 -0000 1.58 @@ -28,6 +28,9 @@ int optInd; int plugin = 0; + g_thread_init(NULL); + gdk_threads_init(); + gdk_threads_enter(); char *argFile = uf_win32_locale_to_utf8(argv[0]); ufraw_binary = g_path_get_basename(argFile); uf_init_locale(argFile); @@ -70,9 +73,14 @@ ufraw_message(UFRAW_ERROR, _("Extracting embedded image is not supported in interactive mode")); optInd = -1; } - if (optInd<0) exit(1); - if (optInd==0) exit(0); - + if (optInd < 0) { + gdk_threads_leave(); + exit(1); + } + if (optInd == 0) { + gdk_threads_leave(); + exit(0); + } /* Create a dummyWindow for the GUI error messenger */ if (dummyWindow==NULL) { dummyWindow = gtk_window_new(GTK_WINDOW_TOPLEVEL); @@ -84,6 +92,7 @@ if (optInd==argc) { ufraw_chooser(&rc, &conf, &cmd, NULL); // ufraw_close(cmd.darkframe); + gdk_threads_leave(); exit(0); } /* If there only one argument and it is a directory, use it as the @@ -93,6 +102,7 @@ ufraw_chooser(&rc, &conf, &cmd, argFile); uf_win32_locale_free(argFile); // ufraw_close(cmd.darkframe); + gdk_threads_leave(); exit(0); } uf_win32_locale_free(argFile); @@ -111,6 +121,7 @@ if (status==UFRAW_ERROR) { ufraw_close(uf); g_free(uf); + gdk_threads_leave(); exit(1); } ufraw_preview(uf, &rc, plugin, NULL); @@ -121,5 +132,6 @@ // ufraw_close(cmd.darkframe); ufobject_delete(cmd.ufobject); ufobject_delete(rc.ufobject); + gdk_threads_leave(); exit(exitCode); } ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ ufraw-cvs mailing list ufraw-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ufraw-cvs