当前位置: 首页>>代码示例>>C++>>正文


C++ C_函数代码示例

本文整理汇总了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);
}
开发者ID:AdamGrzonkowski,项目名称:gimp-1,代码行数:38,代码来源:gimpchannel-select.c

示例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);
}
开发者ID:1dot75cm,项目名称:gnome-control-center,代码行数:38,代码来源:ce-page-details.c

示例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);
        }
    }
}
开发者ID:jiapei100,项目名称:gimp,代码行数:38,代码来源:gimpimage-item-list.c

示例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;
}
开发者ID:jiapei100,项目名称:gimp,代码行数:23,代码来源:gimpimage-guides.c

示例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;
}
开发者ID:jiapei100,项目名称:gimp,代码行数:23,代码来源:gimpimage-guides.c

示例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;
  }
}
开发者ID:kleopatra999,项目名称:chronojump,代码行数:23,代码来源:video-utils.c

示例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);
}
开发者ID:rzr,项目名称:gnome-initial-setup,代码行数:23,代码来源:gis-network-page.c

示例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);
  }
}
开发者ID:hauva69,项目名称:darktable,代码行数:23,代码来源:styles.c

示例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);
}
开发者ID:Distrotech,项目名称:gimp,代码行数:23,代码来源:gimpdrawabletreeview.c

示例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;
}
开发者ID:Distrotech,项目名称:libgweather,代码行数:37,代码来源:gweather-timezone-menu.c

示例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;
}
开发者ID:jdburton,项目名称:gimp-osx,代码行数:37,代码来源:image-scale-dialog.c

示例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;
}
开发者ID:GinoM,项目名称:eudisk,代码行数:22,代码来源:udisksobjectinfo.c

示例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);
}
开发者ID:City-busz,项目名称:mate-media,代码行数:44,代码来源:gvc-balance-bar.c

示例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);
  }
}
开发者ID:hauva69,项目名称:darktable,代码行数:24,代码来源:styles.c

示例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);
}
开发者ID:ChristianBusch,项目名称:gimp,代码行数:24,代码来源:gimpforegroundselecttool.c


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