libgimp: add gimp_get_num_processors().

This commit is contained in:
Jehan
2020-12-11 18:24:36 +01:00
parent 991e99f08a
commit 698b7184b2
3 changed files with 21 additions and 0 deletions

View File

@ -145,6 +145,7 @@ static gboolean _export_comment = FALSE;
static gboolean _export_exif = FALSE; static gboolean _export_exif = FALSE;
static gboolean _export_xmp = FALSE; static gboolean _export_xmp = FALSE;
static gboolean _export_iptc = FALSE; static gboolean _export_iptc = FALSE;
static gint32 _num_processors = 1;
static GimpCheckSize _check_size = GIMP_CHECK_SIZE_MEDIUM_CHECKS; static GimpCheckSize _check_size = GIMP_CHECK_SIZE_MEDIUM_CHECKS;
static GimpCheckType _check_type = GIMP_CHECK_TYPE_GRAY_CHECKS; static GimpCheckType _check_type = GIMP_CHECK_TYPE_GRAY_CHECKS;
static gint _default_display_id = -1; static gint _default_display_id = -1;
@ -782,6 +783,23 @@ gimp_export_iptc (void)
return _export_iptc; return _export_iptc;
} }
/**
* gimp_get_num_processors:
*
* Returns the number of threads set explicitly by the user in the
* preferences. This information can be used by plug-ins wishing to
* follow user settings for multi-threaded implementations.
*
* Returns: the prefered number of threads to use.
*
* Since: 3.0
**/
gint32
gimp_get_num_processors (void)
{
return _num_processors;
}
/** /**
* gimp_check_size: * gimp_check_size:
* *
@ -1132,6 +1150,7 @@ _gimp_config (GPConfig *config)
_export_xmp = config->export_xmp ? TRUE : FALSE; _export_xmp = config->export_xmp ? TRUE : FALSE;
_export_iptc = config->export_iptc ? TRUE : FALSE; _export_iptc = config->export_iptc ? TRUE : FALSE;
_export_comment = config->export_comment; _export_comment = config->export_comment;
_num_processors = config->num_processors;
_default_display_id = config->default_display_id; _default_display_id = config->default_display_id;
_wm_class = g_strdup (config->wm_class); _wm_class = g_strdup (config->wm_class);
_display_name = g_strdup (config->display_name); _display_name = g_strdup (config->display_name);

View File

@ -294,6 +294,7 @@ EXPORTS
gimp_get_images gimp_get_images
gimp_get_module_load_inhibit gimp_get_module_load_inhibit
gimp_get_monitor_resolution gimp_get_monitor_resolution
gimp_get_num_processors
gimp_get_parasite gimp_get_parasite
gimp_get_parasite_list gimp_get_parasite_list
gimp_get_pdb gimp_get_pdb

View File

@ -178,6 +178,7 @@ gboolean gimp_export_comment (void) G_GNUC_CONST;
gboolean gimp_export_exif (void) G_GNUC_CONST; gboolean gimp_export_exif (void) G_GNUC_CONST;
gboolean gimp_export_xmp (void) G_GNUC_CONST; gboolean gimp_export_xmp (void) G_GNUC_CONST;
gboolean gimp_export_iptc (void) G_GNUC_CONST; gboolean gimp_export_iptc (void) G_GNUC_CONST;
gint gimp_get_num_processors (void) G_GNUC_CONST;
GimpCheckSize gimp_check_size (void) G_GNUC_CONST; GimpCheckSize gimp_check_size (void) G_GNUC_CONST;
GimpCheckType gimp_check_type (void) G_GNUC_CONST; GimpCheckType gimp_check_type (void) G_GNUC_CONST;
GimpDisplay * gimp_default_display (void) G_GNUC_CONST; GimpDisplay * gimp_default_display (void) G_GNUC_CONST;