本文整理汇总了C++中C_函数的典型用法代码示例。如果您正苦于以下问题:C++ C_函数的具体用法?C++ C_怎么用?C++ C_使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了C_函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gimp_channel_select_by_index
void
gimp_channel_select_by_index (GimpChannel *channel,
GimpDrawable *drawable,
gint index,
GimpChannelOps op,
gboolean feather,
gdouble feather_radius_x,
gdouble feather_radius_y)
{
GeglBuffer *add_on;
gint add_on_x = 0;
gint add_on_y = 0;
g_return_if_fail (GIMP_IS_CHANNEL (channel));
g_return_if_fail (gimp_item_is_attached (GIMP_ITEM (channel)));
g_return_if_fail (GIMP_IS_DRAWABLE (drawable));
g_return_if_fail (gimp_drawable_is_indexed (drawable));
add_on = gegl_buffer_new (GEGL_RECTANGLE (0, 0,
gimp_item_get_width (GIMP_ITEM (drawable)),
gimp_item_get_height (GIMP_ITEM (drawable))),
babl_format ("Y float"));
gimp_gegl_index_to_mask (gimp_drawable_get_buffer (drawable), NULL,
gimp_drawable_get_format_without_alpha (drawable),
add_on, NULL,
index);
gimp_item_get_offset (GIMP_ITEM (drawable), &add_on_x, &add_on_y);
gimp_channel_select_buffer (channel, C_("undo-type", "Select by Indexed Color"),
add_on, add_on_x, add_on_y,
op,
feather,
feather_radius_x,
feather_radius_y);
g_object_unref (add_on);
}
示例2: get_ap_security_string
static gchar *
get_ap_security_string (NMAccessPoint *ap)
{
NM80211ApSecurityFlags wpa_flags, rsn_flags;
NM80211ApFlags flags;
GString *str;
flags = nm_access_point_get_flags (ap);
wpa_flags = nm_access_point_get_wpa_flags (ap);
rsn_flags = nm_access_point_get_rsn_flags (ap);
str = g_string_new ("");
if ((flags & NM_802_11_AP_FLAGS_PRIVACY) &&
(wpa_flags == NM_802_11_AP_SEC_NONE) &&
(rsn_flags == NM_802_11_AP_SEC_NONE)) {
/* TRANSLATORS: this WEP WiFi security */
g_string_append_printf (str, "%s, ", _("WEP"));
}
if (wpa_flags != NM_802_11_AP_SEC_NONE) {
/* TRANSLATORS: this WPA WiFi security */
g_string_append_printf (str, "%s, ", _("WPA"));
}
if (rsn_flags != NM_802_11_AP_SEC_NONE) {
/* TRANSLATORS: this WPA WiFi security */
g_string_append_printf (str, "%s, ", _("WPA2"));
}
if ((wpa_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X) ||
(rsn_flags & NM_802_11_AP_SEC_KEY_MGMT_802_1X)) {
/* TRANSLATORS: this Enterprise WiFi security */
g_string_append_printf (str, "%s, ", _("Enterprise"));
}
if (str->len > 0)
g_string_set_size (str, str->len - 2);
else {
g_string_append (str, C_("Wifi security", "None"));
}
return g_string_free (str, FALSE);
}
示例3: gimp_image_item_list_rotate
void
gimp_image_item_list_rotate (GimpImage *image,
GList *list,
GimpContext *context,
GimpRotationType rotate_type,
gdouble center_x,
gdouble center_y,
gboolean clip_result)
{
g_return_if_fail (GIMP_IS_IMAGE (image));
g_return_if_fail (GIMP_IS_CONTEXT (context));
if (list)
{
GList *l;
if (list->next)
{
gimp_image_undo_group_start (image, GIMP_UNDO_GROUP_TRANSFORM,
C_("undo-type", "Rotate Items"));
for (l = list; l; l = g_list_next (l))
gimp_item_start_transform (GIMP_ITEM (l->data), TRUE);
}
for (l = list; l; l = g_list_next (l))
gimp_item_rotate (GIMP_ITEM (l->data), context,
rotate_type, center_x, center_y, clip_result);
if (list->next)
{
for (l = list; l; l = g_list_next (l))
gimp_item_end_transform (GIMP_ITEM (l->data), TRUE);
gimp_image_undo_group_end (image);
}
}
}
示例4: gimp_image_add_vguide
GimpGuide *
gimp_image_add_vguide (GimpImage *image,
gint position,
gboolean push_undo)
{
GimpGuide *guide;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (position >= 0 &&
position <= gimp_image_get_width (image), NULL);
guide = gimp_guide_new (GIMP_ORIENTATION_VERTICAL,
image->gimp->next_guide_ID++);
if (push_undo)
gimp_image_undo_push_guide (image,
C_("undo-type", "Add Vertical Guide"), guide);
gimp_image_add_guide (image, guide, position);
g_object_unref (guide);
return guide;
}
示例5: gimp_image_add_hguide
GimpGuide *
gimp_image_add_hguide (GimpImage *image,
gint position,
gboolean push_undo)
{
GimpGuide *guide;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (position >= 0 &&
position <= gimp_image_get_height (image), NULL);
guide = gimp_guide_new (GIMP_ORIENTATION_HORIZONTAL,
image->gimp->next_guide_ID++);
if (push_undo)
gimp_image_undo_push_guide (image,
C_("undo-type", "Add Horizontal Guide"), guide);
gimp_image_add_guide (image, guide, position);
g_object_unref (G_OBJECT (guide));
return guide;
}
示例6: totem_string_to_time
gint64
totem_string_to_time (const char *time_string)
{
int sec, min, hour, args;
args =
sscanf (time_string, C_ ("long time format", "%d:%02d:%02d"), &hour, &min,
&sec);
if (args == 3) {
/* Parsed all three arguments successfully */
return (hour * (60 * 60) + min * 60 + sec) * 1000;
} else if (args == 2) {
/* Only parsed the first two arguments; treat hour and min as min and sec, respectively */
return (hour * 60 + min) * 1000;
} else if (args == 1) {
/* Only parsed the first argument; treat hour as sec */
return hour * 1000;
} else {
/* Error! */
return -1;
}
}
示例7: add_access_point_other
static void
add_access_point_other (GisNetworkPage *page)
{
GisNetworkPagePrivate *priv = page->priv;
GtkTreeIter iter;
gtk_list_store_append (priv->ap_list, &iter);
gtk_list_store_set (priv->ap_list, &iter,
PANEL_WIRELESS_COLUMN_ID, "ap-other...",
/* TRANSLATORS: this is when the access point is not listed
* * in the dropdown (or hidden) and the user has to select
* * another entry manually */
PANEL_WIRELESS_COLUMN_TITLE, C_("Wireless access point", "Other..."),
/* always last */
PANEL_WIRELESS_COLUMN_STRENGTH, 0,
PANEL_WIRELESS_COLUMN_MODE, NM_802_11_MODE_UNKNOWN,
PANEL_WIRELESS_COLUMN_SECURITY, NM_AP_SEC_UNKNOWN,
PANEL_WIRELESS_COLUMN_ACTIVATING, FALSE,
PANEL_WIRELESS_COLUMN_ACTIVE, FALSE,
PANEL_WIRELESS_COLUMN_PULSE, priv->pulse,
-1);
}
示例8: connect_styles_key_accels
void connect_styles_key_accels()
{
GList *result = dt_styles_get_list("");
if (result)
{
do
{
GClosure *closure;
dt_style_t *style = (dt_style_t *)result->data;
closure = g_cclosure_new(
G_CALLBACK(_apply_style_shortcut_callback),
style->name, _destroy_style_shortcut_callback);
char tmp_accel[1024];
snprintf(tmp_accel,1024,C_("accel", "styles/apply %s"),style->name);
dt_accel_connect_global(tmp_accel, closure);
//g_free(style->name); freed at closure destruction
g_free(style->description);
g_free(style);
}
while ((result=g_list_next(result))!=NULL);
}
}
示例9: gimp_drawable_tree_view_drop_viewable
static void
gimp_drawable_tree_view_drop_viewable (GimpContainerTreeView *view,
GimpViewable *src_viewable,
GimpViewable *dest_viewable,
GtkTreeViewDropPosition drop_pos)
{
if (dest_viewable && GIMP_IS_PATTERN (src_viewable))
{
gimp_edit_fill_full (gimp_item_get_image (GIMP_ITEM (dest_viewable)),
GIMP_DRAWABLE (dest_viewable),
NULL, GIMP_PATTERN (src_viewable),
GIMP_OPACITY_OPAQUE, GIMP_NORMAL_MODE,
C_("undo-type", "Drop pattern to layer"));
gimp_image_flush (gimp_item_get_image (GIMP_ITEM (dest_viewable)));
return;
}
GIMP_CONTAINER_TREE_VIEW_CLASS (parent_class)->drop_viewable (view,
src_viewable,
dest_viewable,
drop_pos);
}
示例10: gweather_timezone_model_new
static GtkTreeModel *
gweather_timezone_model_new (GWeatherLocation *top)
{
GtkTreeStore *store;
GtkTreeModel *model;
GtkTreeIter iter;
char *unknown;
GWeatherTimezone *utc;
store = gtk_tree_store_new (2, G_TYPE_STRING, GWEATHER_TYPE_TIMEZONE);
model = GTK_TREE_MODEL (store);
unknown = g_markup_printf_escaped ("<i>%s</i>", C_("timezone", "Unknown"));
gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter,
GWEATHER_TIMEZONE_MENU_NAME, unknown,
GWEATHER_TIMEZONE_MENU_ZONE, NULL,
-1);
utc = gweather_timezone_get_utc ();
if (utc) {
insert_location (store, utc, NULL, NULL);
gweather_timezone_unref (utc);
}
gtk_tree_store_append (store, &iter, NULL);
g_free (unknown);
if (!top)
top = gweather_location_get_world ();
insert_locations (store, top);
return model;
}
示例11: image_scale_dialog_new
GtkWidget *
image_scale_dialog_new (GimpImage *image,
GimpContext *context,
GtkWidget *parent,
GimpUnit unit,
GimpInterpolationType interpolation,
GimpScaleCallback callback,
gpointer user_data)
{
ImageScaleDialog *dialog;
g_return_val_if_fail (GIMP_IS_IMAGE (image), NULL);
g_return_val_if_fail (GIMP_IS_CONTEXT (context), NULL);
g_return_val_if_fail (callback != NULL, NULL);
dialog = g_slice_new0 (ImageScaleDialog);
dialog->image = image;
dialog->dialog = scale_dialog_new (GIMP_VIEWABLE (image), context,
C_("dialog-title", "Scale Image"),
"gimp-image-scale",
parent,
gimp_standard_help_func,
GIMP_HELP_IMAGE_SCALE,
unit,
interpolation,
image_scale_callback,
dialog);
g_object_weak_ref (G_OBJECT (dialog->dialog),
(GWeakNotify) image_scale_dialog_free, dialog);
dialog->callback = callback;
dialog->user_data = user_data;
return dialog->dialog;
}
示例12: format_mdraid_level
static const gchar *
format_mdraid_level (const gchar *level)
{
const gchar *ret = NULL;
if (g_strcmp0 (level, "raid0") == 0)
ret = C_("mdraid-desc", "RAID-0 Array");
else if (g_strcmp0 (level, "raid1") == 0)
ret = C_("mdraid-desc", "RAID-1 Array");
else if (g_strcmp0 (level, "raid4") == 0)
ret = C_("mdraid-desc", "RAID-4 Array");
else if (g_strcmp0 (level, "raid5") == 0)
ret = C_("mdraid-desc", "RAID-5 Array");
else if (g_strcmp0 (level, "raid6") == 0)
ret = C_("mdraid-desc", "RAID-6 Array");
else if (g_strcmp0 (level, "raid10") == 0)
ret = C_("mdraid-desc", "RAID-10 Array");
else
ret = C_("mdraid-desc", "RAID Array");
return ret;
}
示例13: update_scale_marks
static void
update_scale_marks (GvcBalanceBar *bar)
{
gchar *str_lower = NULL,
*str_upper = NULL;
gdouble lower,
upper;
gtk_scale_clear_marks (GTK_SCALE (bar->priv->scale));
switch (bar->priv->btype) {
case BALANCE_TYPE_RL:
str_lower = g_strdup_printf ("<small>%s</small>", C_("balance", "Left"));
str_upper = g_strdup_printf ("<small>%s</small>", C_("balance", "Right"));
break;
case BALANCE_TYPE_FR:
str_lower = g_strdup_printf ("<small>%s</small>", C_("balance", "Rear"));
str_upper = g_strdup_printf ("<small>%s</small>", C_("balance", "Front"));
break;
case BALANCE_TYPE_LFE:
str_lower = g_strdup_printf ("<small>%s</small>", C_("balance", "Minimum"));
str_upper = g_strdup_printf ("<small>%s</small>", C_("balance", "Maximum"));
break;
}
lower = gtk_adjustment_get_lower (bar->priv->adjustment);
gtk_scale_add_mark (GTK_SCALE (bar->priv->scale),
lower,
GTK_POS_BOTTOM,
str_lower);
upper = gtk_adjustment_get_upper (bar->priv->adjustment);
gtk_scale_add_mark (GTK_SCALE (bar->priv->scale),
upper,
GTK_POS_BOTTOM,
str_upper);
g_free (str_lower);
g_free (str_upper);
if (bar->priv->btype != BALANCE_TYPE_LFE)
gtk_scale_add_mark (GTK_SCALE (bar->priv->scale),
(upper - lower) / 2 + lower,
GTK_POS_BOTTOM,
NULL);
}
示例14: dt_styles_delete_by_name
void
dt_styles_delete_by_name(const char *name)
{
int id=0;
if ((id=dt_styles_get_id_by_name(name)) != 0)
{
/* delete the style */
sqlite3_stmt *stmt;
DT_DEBUG_SQLITE3_PREPARE_V2(dt_database_get(darktable.db), "DELETE FROM styles WHERE id = ?1", -1, &stmt, NULL);
DT_DEBUG_SQLITE3_BIND_INT(stmt, 1, id);
sqlite3_step (stmt);
sqlite3_finalize (stmt);
/* delete style_items belonging to style */
DT_DEBUG_SQLITE3_PREPARE_V2(dt_database_get(darktable.db), "delete from style_items where styleid = ?1", -1, &stmt, NULL);
DT_DEBUG_SQLITE3_BIND_INT(stmt, 1, id);
sqlite3_step (stmt);
sqlite3_finalize (stmt);
char tmp_accel[1024];
snprintf(tmp_accel,1024,C_("accel", "styles/apply %s"),name);
dt_accel_deregister_global(tmp_accel);
}
}
示例15: gimp_foreground_select_tool_apply
static void
gimp_foreground_select_tool_apply (GimpForegroundSelectTool *fg_select,
GimpDisplay *display)
{
GimpTool *tool = GIMP_TOOL (fg_select);
GimpSelectionOptions *options = GIMP_SELECTION_TOOL_GET_OPTIONS (fg_select);
GimpImage *image = gimp_display_get_image (display);
g_return_if_fail (fg_select->mask != NULL);
gimp_channel_select_buffer (gimp_image_get_mask (image),
C_("command", "Foreground Select"),
fg_select->mask,
0, /* x offset */
0, /* y offset */
options->operation,
options->feather,
options->feather_radius,
options->feather_radius);
gimp_tool_control (tool, GIMP_TOOL_ACTION_HALT, display);
gimp_image_flush (image);
}