本文整理汇总了C++中INIT_I18N函数的典型用法代码示例。如果您正苦于以下问题:C++ INIT_I18N函数的具体用法?C++ INIT_I18N怎么用?C++ INIT_I18N使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了INIT_I18N函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpParasite *parasite;
gint32 image;
gint32 drawable;
gint32 orig_image;
GimpExportReturn export = GIMP_EXPORT_CANCEL;
GError *error = NULL;
run_mode = param[0].data.d_int32;
INIT_I18N ();
gegl_init (NULL, NULL);
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
TIFFSetWarningHandler (tiff_warning);
TIFFSetErrorHandler (tiff_error);
if ((strcmp (name, SAVE_PROC) == 0) ||
(strcmp (name, SAVE2_PROC) == 0))
{
/* Plug-in is either file_tiff_save or file_tiff_save2 */
image = orig_image = param[1].data.d_int32;
drawable = param[2].data.d_int32;
/* Do this right this time, if POSSIBLE query for parasites, otherwise
or if there isn't one, choose the default comment from the gimprc. */
/* eventually export the image */
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
case GIMP_RUN_WITH_LAST_VALS:
gimp_ui_init (PLUG_IN_BINARY, FALSE);
export = gimp_export_image (&image, &drawable, NULL,
(GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA ));
if (export == GIMP_EXPORT_CANCEL)
{
values[0].data.d_status = GIMP_PDB_CANCEL;
return;
}
break;
default:
break;
}
示例2: run
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpRunMode run_mode;
run_mode = param[0].data.d_int32;
INIT_I18N ();
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_CALLING_ERROR;
if (strcmp (name, PLUG_IN_PROC) == 0)
{
values[0].data.d_status = GIMP_PDB_SUCCESS;
unit_editor_dialog ();
}
}
示例3: run
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
gint32 image_ID;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
INIT_I18N();
image_ID = param[1].data.d_image;
if (status == GIMP_PDB_SUCCESS)
{
gimp_progress_init (_("Guillotine"));
guillotine (image_ID);
gimp_displays_flush ();
}
values[0].data.d_status = status;
}
示例4: run
static void
run (const gchar *name,
gint n_params,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint32 drawable_id;
gint32 image_id;
INIT_I18N ();
gegl_init (NULL, NULL);
*nreturn_vals = 1;
*return_vals = values;
run_mode = param[0].data.d_int32;
if (run_mode == GIMP_RUN_NONINTERACTIVE)
{
if (n_params != 3)
{
status = GIMP_PDB_CALLING_ERROR;
}
}
if (status == GIMP_PDB_SUCCESS)
{
/* Get the specified drawable */
image_id = param[1].data.d_int32;
drawable_id = param[2].data.d_int32;
/* Make sure that the drawable is gray or RGB or indexed */
if (gimp_drawable_is_rgb (drawable_id) ||
gimp_drawable_is_gray (drawable_id) ||
gimp_drawable_is_indexed (drawable_id))
{
gimp_progress_init (_("Zealous cropping"));
do_zcrop (drawable_id, image_id);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
}
else
{
status = GIMP_PDB_EXECUTION_ERROR;
}
}
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
gegl_exit ();
}
示例5: run
static void
run (const gchar *name,
gint n_params,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gboolean diff_only = FALSE;
*nreturn_vals = 2;
*return_vals = values;
run_mode = param[0].data.d_int32;
INIT_I18N ();
if (run_mode == GIMP_RUN_NONINTERACTIVE && n_params != 3)
{
status = GIMP_PDB_CALLING_ERROR;
}
/* Check the procedure name we were called with, to decide
what needs to be done. */
if (strcmp (name, OPTIMIZE_PROC) == 0)
opmode = OPOPTIMIZE;
else if (strcmp (name, OPTIMIZE_DIFF_PROC) == 0)
{
opmode = OPOPTIMIZE;
diff_only = TRUE;
}
else if (strcmp (name, UNOPTIMIZE_PROC) == 0)
opmode = OPUNOPTIMIZE;
else if (strcmp (name, FIND_BACKDROP_PROC) == 0)
opmode = OPBACKGROUND;
else if (strcmp (name, REMOVE_BACKDROP_PROC) == 0)
opmode = OPFOREGROUND;
else
g_error("GAH!!!");
if (status == GIMP_PDB_SUCCESS)
{
image_id = param[1].data.d_image;
new_image_id = do_optimizations (run_mode, diff_only);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush();
}
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
values[1].type = GIMP_PDB_IMAGE;
values[1].data.d_image = new_image_id;
}
示例6: run
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
GimpDrawable *drawable;
INIT_I18N ();
run_mode = param[0].data.d_int32;
drawable = gimp_drawable_get (param[2].data.d_int32);
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
gimp_get_data (HSV_NOISE_PROC, &VALS);
if (!gimp_drawable_is_rgb (drawable->drawable_id))
{
g_message (_("Can only operate on RGB drawables."));
return;
}
if (! scatter_hsv_dialog (drawable))
return;
break;
case GIMP_RUN_NONINTERACTIVE:
VALS.holdness = CLAMP (param[3].data.d_int32, 1, 8);
VALS.hue_distance = CLAMP (param[4].data.d_int32, 0, 180);
VALS.saturation_distance = CLAMP (param[5].data.d_int32, 0, 255);
VALS.value_distance = CLAMP (param[6].data.d_int32, 0, 255);
break;
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data (HSV_NOISE_PROC, &VALS);
break;
}
scatter_hsv (drawable);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush();
if (run_mode == GIMP_RUN_INTERACTIVE && status == GIMP_PDB_SUCCESS )
gimp_set_data (HSV_NOISE_PROC, &VALS, sizeof (ValueType));
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
}
示例7: run
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpPDBStatusType status = GIMP_PDB_EXECUTION_ERROR;
GimpRunMode run_mode;
gint image_id, layer_num;
run_mode = param[0].data.d_int32;
image_id = param[1].data.d_int32;
INIT_I18N ();
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
switch ( run_mode )
{
case GIMP_RUN_INTERACTIVE:
gimp_image_get_layers (image_id, &layer_num);
if (layer_num < 2)
{
*nreturn_vals = 2;
values[1].type = GIMP_PDB_STRING;
values[1].data.d_string = _("There are not enough layers to align.");
return;
}
gimp_get_data (PLUG_IN_PROC, &VALS);
VALS.grid_size = MAX (VALS.grid_size, 1);
if (! align_layers_dialog ())
return;
break;
case GIMP_RUN_NONINTERACTIVE:
break;
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data (PLUG_IN_PROC, &VALS);
break;
}
status = align_layers (image_id);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
if (run_mode == GIMP_RUN_INTERACTIVE && status == GIMP_PDB_SUCCESS)
gimp_set_data (PLUG_IN_PROC, &VALS, sizeof (ValueType));
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
}
示例8: run
/* main function */
static void
run (const gchar *name,
gint n_params,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpDrawable *drawable;
run_mode = param[0].data.d_int32;
INIT_I18N ();
*nreturn_vals = 2;
*return_vals = values;
if (run_mode == GIMP_RUN_NONINTERACTIVE)
{
if (n_params != 3)
status = GIMP_PDB_CALLING_ERROR;
}
if (status == GIMP_PDB_SUCCESS)
{
drawable = gimp_drawable_get (param[2].data.d_drawable);
imageID = param[1].data.d_image;
if (gimp_drawable_is_rgb (drawable->drawable_id) ||
gimp_drawable_is_gray (drawable->drawable_id) ||
gimp_drawable_is_indexed (drawable->drawable_id))
{
memset (hist_red, 0, sizeof (hist_red));
memset (hist_green, 0, sizeof (hist_green));
memset (hist_blue, 0, sizeof (hist_blue));
gimp_tile_cache_ntiles (2 *
(drawable->width / gimp_tile_width () + 1));
analyze (drawable);
/* show dialog after we analyzed image */
if (run_mode != GIMP_RUN_NONINTERACTIVE)
doDialog ();
}
else
status = GIMP_PDB_EXECUTION_ERROR;
gimp_drawable_detach (drawable);
}
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
values[1].type = GIMP_PDB_INT32;
values[1].data.d_int32 = uniques;
}
示例9: run
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
gint32 image_ID;
GError *error = NULL;
INIT_I18N ();
gegl_init (NULL, NULL);
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (strcmp (name, LOAD_PROC) == 0)
{
run_mode = param[0].data.d_int32;
image_ID = load_image (param[1].data.d_string,
run_mode == GIMP_RUN_INTERACTIVE, &error);
if (image_ID != -1)
{
*nreturn_vals = 2;
values[1].type = GIMP_PDB_IMAGE;
values[1].data.d_image = image_ID;
}
else
{
status = GIMP_PDB_EXECUTION_ERROR;
}
}
else
{
status = GIMP_PDB_CALLING_ERROR;
}
if (status != GIMP_PDB_SUCCESS && error)
{
*nreturn_vals = 2;
values[1].type = GIMP_PDB_STRING;
values[1].data.d_string = error->message;
}
values[0].data.d_status = status;
}
示例10: run
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
GimpDrawable *drawable;
static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_EXECUTION_ERROR;
GimpRunMode run_mode;
run_mode = param[0].data.d_int32;
drawable = gimp_drawable_get (param[2].data.d_drawable);
INIT_I18N ();
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
switch (run_mode)
{
case GIMP_RUN_INTERACTIVE:
gimp_get_data (PLUG_IN_PROC, &pvals);
/* Since a channel might be selected, we must check wheter RGB or not. */
if (!gimp_drawable_is_rgb (drawable->drawable_id))
{
g_message (_("Can only operate on RGB drawables."));
return;
}
if (! max_rgb_dialog (drawable))
return;
break;
case GIMP_RUN_NONINTERACTIVE:
/* You must copy the values of parameters to pvals or dialog variables. */
pvals.max_p = param[3].data.d_int32;
break;
case GIMP_RUN_WITH_LAST_VALS:
gimp_get_data (PLUG_IN_PROC, &pvals);
break;
}
status = main_function (drawable, NULL);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
if (run_mode == GIMP_RUN_INTERACTIVE && status == GIMP_PDB_SUCCESS)
gimp_set_data (PLUG_IN_PROC, &pvals, sizeof (ValueType));
values[0].data.d_status = status;
}
示例11: run
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpDrawable *drawable;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpRunMode run_mode;
gint32 image_ID;
INIT_I18N();
run_mode = param[0].data.d_int32;
/* Get the specified drawable */
drawable = gimp_drawable_get (param[2].data.d_drawable);
image_ID = param[1].data.d_image;
/* Make sure that the drawable is gray or RGB color */
if (gimp_drawable_is_rgb (drawable->drawable_id) ||
gimp_drawable_is_gray (drawable->drawable_id))
{
gimp_progress_init (_("Auto-Stretching HSV"));
gimp_tile_cache_ntiles (2 * (drawable->width / gimp_tile_width () + 1));
autostretch_hsv (drawable);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
}
else if (gimp_drawable_is_indexed (drawable->drawable_id))
{
indexed_autostretch_hsv (image_ID);
if (run_mode != GIMP_RUN_NONINTERACTIVE)
gimp_displays_flush ();
}
else
{
/* gimp_message ("autostretch_hsv: cannot operate on indexed color images"); */
status = GIMP_PDB_EXECUTION_ERROR;
}
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
gimp_drawable_detach (drawable);
}
示例12: run
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GError *error = NULL;
INIT_I18N ();
gegl_init (NULL, NULL);
*nreturn_vals = 1;
*return_vals = values;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
gimp_get_data (SAVE_PROC, >mvals);
if (save_dialog (param[1].data.d_int32))
{
GeglBuffer *buffer;
buffer = gimp_drawable_get_buffer (param[2].data.d_int32);
if (save_image (param[3].data.d_string, buffer, &error))
{
gimp_set_data (SAVE_PROC, >mvals, sizeof (GTMValues));
}
else
{
status = GIMP_PDB_EXECUTION_ERROR;
}
g_object_unref (buffer);
}
else
{
status = GIMP_PDB_CANCEL;
}
if (status != GIMP_PDB_SUCCESS && error)
{
*nreturn_vals = 2;
values[1].type = GIMP_PDB_STRING;
values[1].data.d_string = error->message;
}
values[0].data.d_status = status;
}
示例13: run
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[1];
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
INIT_I18N ();
/* make sure all the arguments are there */
if (nparams == 4)
{
if (! gimp_help_init (param[0].data.d_int32,
param[1].data.d_stringarray,
param[2].data.d_int32,
param[3].data.d_stringarray))
{
status = GIMP_PDB_CALLING_ERROR;
}
}
else
{
g_printerr ("help: wrong number of arguments in procedure call.\n");
status = GIMP_PDB_CALLING_ERROR;
}
if (status == GIMP_PDB_SUCCESS)
{
main_loop = g_main_loop_new (NULL, FALSE);
temp_proc_install ();
gimp_extension_ack ();
gimp_extension_enable ();
g_main_loop_run (main_loop);
g_main_loop_unref (main_loop);
main_loop = NULL;
gimp_uninstall_temp_proc (GIMP_HELP_TEMP_EXT_PROC);
}
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = status;
*nreturn_vals = 1;
*return_vals = values;
}
示例14: run
static void
run (const gchar *name,
gint nparams,
const GimpParam *param,
gint *nreturn_vals,
GimpParam **return_vals)
{
static GimpParam values[2];
GimpRunMode run_mode;
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
GimpExportReturn export = GIMP_EXPORT_CANCEL;
run_mode = param[0].data.d_int32;
*nreturn_vals = 1;
*return_vals = values;
INIT_I18N ();
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
if (run_mode == GIMP_RUN_INTERACTIVE &&
strcmp (name, SAVE_PROC) == 0)
{
gint32 image_ID = param[1].data.d_int32;
gint32 drawable_ID = param[2].data.d_int32;
GimpParasite *parasite;
gchar *x;
GimpImageType drawable_type = gimp_drawable_type (drawable_ID);
gimp_get_data (SAVE_PROC, &config);
config.prefixed_name = "gimp_image";
config.comment = NULL;
config.file_name = param[3].data.d_string;
config.alpha = (drawable_type == GIMP_RGBA_IMAGE ||
drawable_type == GIMP_GRAYA_IMAGE ||
drawable_type == GIMP_INDEXEDA_IMAGE);
parasite = gimp_image_parasite_find (image_ID, "gimp-comment");
if (parasite)
{
config.comment = g_strndup (gimp_parasite_data (parasite),
gimp_parasite_data_size (parasite));
gimp_parasite_free (parasite);
}
x = config.comment;
gimp_ui_init (PLUG_IN_BINARY, FALSE);
export = gimp_export_image (&image_ID, &drawable_ID, "C Source",
示例15: query
static void query ()
{
static GParamDef args_foreach[] =
{
{PARAM_INT32, "run_mode", "Interactive, non-interactive"},
{PARAM_IMAGE, "image", "Input image"},
{PARAM_DRAWABLE, "drawable", "Input drawable (unused)"},
{PARAM_STRING, "vidfile", "filename of the movtar video (to write)"},
{PARAM_INT32, "dont_recode_frames", "=1: store the frames _directly_ into the movtar. "
"(works only for 4:2:2 JPEG !)"},
{PARAM_STRING, "wavfile", "optional audiodata file .wav audiodata, pass empty string if no audiodata should be included"},
{PARAM_INT32, "auto_videoparam", "automatic or manual video parameters ?"},
{PARAM_STRING, "videonorm", "The used videonorm is one of these 2 strings (ignored if auto_videoparam=1): "
"\"" "TVNORM_PAL" "\""
"\"" "TVNORM_NTSC" "\""
},
{PARAM_INT32, "jpeg_interlaced", "=1: store two JPEG frames, for the odd/even lines "
"(ignored if auto_videoparam=1): "},
{PARAM_STRING, "text_author", "The content of the Author field in the movtar."},
{PARAM_STRING, "text_software", "The content of the Software field in the movtar."},
{PARAM_STRING, "text_device", "The content of the Device field in the movtar."},
{PARAM_STRING, "text_input", "The content of the Input field in the movtar."},
{PARAM_STRING, "text_contclassification", "The content of the Author field in the movtar."},
{PARAM_STRING, "text_contdescription", "The content of the Author field in the movtar."},
{PARAM_INT32, "jpeg_quality", "the quality of the coded jpegs (0 - 100%)"}
};
#define NUMARGS 16
static int nargs_foreach = sizeof(args_foreach) / sizeof(args_foreach[0]);
static GParamDef *return_vals = NULL;
static int nreturn_vals = 0;
INIT_I18N();
gimp_install_procedure(PLUGIN_NAME_MOVTAR_ENCODE,
"movtar encoding of anim frames",
_("This plugin encodes the selected range of animframes into a movtar."
" The (optional) audiodata must be in .wav-format (RIFF WAVEfmt )"
"The text information fields' content can be chosen freely."),
"Gernot Ziegler ([email protected])",
"Gernot Ziegler",
gap_movtar_version,
N_("<Image>/Video/Encode/Movtar"),
"RGB*, INDEXED*, GRAY*",
PROC_PLUG_IN,
nargs_foreach, nreturn_vals,
args_foreach, return_vals);
} /* end movtar_query */