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


C++ g_list_concat函数代码示例

本文整理汇总了C++中g_list_concat函数的典型用法代码示例。如果您正苦于以下问题:C++ g_list_concat函数的具体用法?C++ g_list_concat怎么用?C++ g_list_concat使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了g_list_concat函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: g_list_copy

static Window *visible_windows(i3ipcCon *root)
{
    GList *nodes = g_list_copy((GList *) i3ipc_con_get_nodes(root));
    GList *floating = g_list_copy((GList *) i3ipc_con_get_floating_nodes(root));
    nodes = g_list_concat(nodes, floating);
    if (nodes == NULL)
    {
        return con_to_window(root);
    }

    gchar *layout = NULL;
    g_object_get(root, "layout", &layout, NULL);

    Window *res = NULL;
    const GList *elem;
    if ((strcmp(layout, "tabbed") == 0) ||
        (strcmp(layout, "stacked") == 0))
    {
        unsigned long focus_id = con_get_focused_id(root);
        for (elem = nodes; elem; elem = elem->next)
        {
            i3ipcCon *curr = elem->data;
            unsigned long id;
            g_object_get(curr, "id", &id, NULL);
            Window *win = NULL;
            if (id == focus_id)
            {
                win = visible_windows(curr);
                if (win->id != id)
                {
                    res = window_append(res, con_to_window(curr));
                }
            }
            else
            {
                win = con_to_window(curr);
            }

            res = window_append(res, win);
        }
    }
    else if ((strcmp(layout, "splith") == 0) ||
             (strcmp(layout, "splitv") == 0))
    {
        for (elem = nodes; elem; elem = elem->next)
        {
            i3ipcCon *curr = elem->data;
            res = window_append(res, visible_windows(curr));
        }
    }
    else
    {
        LOG("unknown layout of con: %s\n", layout);
    }

    g_free(layout);
    g_list_free(nodes);

    return res;
}
开发者ID:cornerman,项目名称:i3-easyfocus,代码行数:60,代码来源:ipc.c

示例2: resources_os_list_ocf_agents

GList *
resources_os_list_ocf_agents(const char *provider)
{
    GList *gIter = NULL;
    GList *result = NULL;
    GList *providers = NULL;

    if (provider) {
        char buffer[500];

        snprintf(buffer, sizeof(buffer), "%s/resource.d/%s", OCF_ROOT_DIR, provider);
        return get_directory_list(buffer, TRUE, TRUE);
    }

    providers = resources_os_list_ocf_providers();
    for (gIter = providers; gIter != NULL; gIter = gIter->next) {
        GList *tmp1 = result;
        GList *tmp2 = resources_os_list_ocf_agents(gIter->data);

        if (tmp2) {
            result = g_list_concat(tmp1, tmp2);
        }
    }
    g_list_free_full(providers, free);
    return result;
}
开发者ID:FumihiroSaito,项目名称:pacemaker,代码行数:26,代码来源:services_linux.c

示例3: gimp_scale_combo_box_mru_add

static void
gimp_scale_combo_box_mru_add (GimpScaleComboBox *combo_box,
                              GtkTreeIter       *iter)
{
  GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (combo_box));
  GtkTreePath  *path  = gtk_tree_model_get_path (model, iter);
  GList        *list;
  gboolean      found;

  for (list = combo_box->mru, found = FALSE; list && !found; list = list->next)
    {
      GtkTreePath *this = gtk_tree_row_reference_get_path (list->data);

      if (gtk_tree_path_compare (this, path) == 0)
        {
          if (list->prev)
            {
              combo_box->mru = g_list_remove_link (combo_box->mru, list);
              combo_box->mru = g_list_concat (list, combo_box->mru);
            }

          found = TRUE;
        }

      gtk_tree_path_free (this);
    }

  if (! found)
    combo_box->mru = g_list_prepend (combo_box->mru,
                                     gtk_tree_row_reference_new (model, path));

  gtk_tree_path_free (path);
}
开发者ID:Distrotech,项目名称:gimp,代码行数:33,代码来源:gimpscalecombobox.c

示例4: xde_wmmenu

static GList *
xde_wmmenu(MenuContext *ctx)
{
	GList *text = NULL;
	GList *xsessions, *xsession;
	int gotone = FALSE;
	char *s;

	s = g_strdup_printf("\n%s\n", "Menu \"managers\" twm_MenuColor");
	text = g_list_append(text, s);
	s = strdup("{\n");
	text = g_list_append(text, s);

	xde_increase_indent(ctx);

	s = g_strdup_printf("    %-32s  %s\n", "\"Window Managers\"", "f.title");
	text = g_list_append(text, s);

	xsessions = xde_get_xsessions(ctx);
	for (xsession = xsessions; xsession; xsession = xsession->next) {
		XdeXsession *xsess = xsession->data;
		char *esc1, *esc2, *qname, *cmd;

		if (strncasecmp(xsess->key, ctx->name, strlen(ctx->name)) == 0)
			continue;
		if (options.launch)
			cmd = g_strdup_printf("xdg-launch --pointer -X %s", xsess->key);
		else
			cmd = xde_get_command(xsess->info, xsess->key, NULL);
		esc1 = xde_character_escape(xsess->name, '"');
		esc2 = xde_character_escape(cmd, '"');
		qname = g_strdup_printf("\"%s\"", esc1);
		if (!strcmp(ctx->name, "mwm") || !strcmp(ctx->name, "dtwm"))
			s = g_strdup_printf("    %-32s  %s \"%s\"\n", qname, "f.restart -", esc2);
		else if (!strcmp(ctx->name, "twm")||!strcmp(ctx->name, "vtwm"))
			s = g_strdup_printf("    %-32s  %s \"%s\"\n", qname, "f.startwm", esc2);
		else
			s = g_strdup_printf("    %-32s  %s \"exec %s &\"\n", qname, "f.exec", esc2);
		text = g_list_append(text, s);

		gotone = TRUE;
		free(esc1);
		free(esc2);
		free(qname);
		free(cmd);
	}
	if (gotone)
		text = g_list_concat(text, ctx->wmm.ops.separator(ctx, NULL));
	s = g_strdup_printf("    %-32s  %s\n", "\"Restart\"", "f.restart");
	text = g_list_append(text, s);
	if (!strcmp(ctx->name, "mwm") || !strcmp(ctx->name, "dtwm"))
		s = g_strdup_printf("    %-32s  %s\n", "\"Quit\"", "f.quit_mwm");
	else
		s = g_strdup_printf("    %-32s  %s\n", "\"Quit\"", "f.quit");
	text = g_list_append(text, s);
	s = strdup("}\n");
	text = g_list_append(text, s);

	return (text);
}
开发者ID:bbidulock,项目名称:xde-menu,代码行数:60,代码来源:xde_vtwm.c

示例5: xde_directory

static GList *
xde_directory(MenuContext *ctx, GMenuTreeDirectory *dir)
{
	GList *text = NULL;
	const char *name, *path;
	char *esc1, *esc2;
	GIcon *gicon = NULL;
	char *icon = NULL;

	name = gmenu_tree_directory_get_name(dir);
	esc1 = xde_character_escape(name, ')');
	esc2 = xde_character_escape(name, '}');
	if (ctx->stack)
		gicon = gmenu_tree_directory_get_icon(ctx->stack->data);
	if ((path = gmenu_tree_directory_get_desktop_file_path(dir))) {
		GKeyFile *file = g_key_file_new();

		g_key_file_load_from_file(file, path, G_KEY_FILE_NONE, NULL);
		icon = xde_get_entry_icon(ctx, file, gicon, "folder", "unknown",
				GET_ENTRY_ICON_FLAG_XPM | GET_ENTRY_ICON_FLAG_PNG);
		g_key_file_unref(file);
	} else
		icon = xde_get_icon2(ctx, "folder", "unknown");
	icon = ctx->wmm.wrap(ctx, icon);
	text = g_list_append(text, g_strdup_printf("%s%s (%s) {%s Menu}%s\n", ctx->indent, "[submenu]", esc1, esc2, icon));
	text = g_list_concat(text, ctx->wmm.ops.menu(ctx, dir));
	text = g_list_append(text, g_strdup_printf("%s[end]\n", ctx->indent));
	free(icon);
	free(esc1);
	free(esc2);
	return (text);
}
开发者ID:bbidulock,项目名称:xde-menu,代码行数:32,代码来源:xde_openboxold.c

示例6: _search_in_item

static GList* _search_in_item (CDBookmarkItem *pFolderItem, const gchar *cText, int iFilter, int iNbMax, int *iNbEntries)
{
	GList *pEntries = NULL;
	int i = 0;
	CDBookmarkItem *pItem;
	CDEntry *pEntry;
	GList *it;
	for (it = pFolderItem->pSubItems; it != NULL && iNbMax > 0; it = it->next)
	{
		pItem = it->data;
		if (g_strstr_len (pItem->cLowerCaseName, -1, cText))
		{
			pEntry = _make_entry_from_item (pItem);
			pEntries = g_list_prepend (pEntries, pEntry);
			i ++;
			iNbMax --;
		}
		if (pItem->pSubItems != NULL)
		{
			int j = 0;
			GList *pSubList = _search_in_item (pItem, cText, iFilter, iNbMax, &j);
			i += j;
			iNbMax -= j;
			pEntries = g_list_concat (pEntries, pSubList);
		}
	}
	*iNbEntries = i;
	return pEntries;
}
开发者ID:Cairo-Dock,项目名称:cairo-dock-plug-ins,代码行数:29,代码来源:applet-backend-firefox.c

示例7: get_connected_drives

static GList *
get_connected_drives (GVolumeMonitor *volume_monitor)
{
  GUnionVolumeMonitor *monitor;
  GVolumeMonitor *child_monitor;
  GList *res;
  GList *l;
  
  monitor = G_UNION_VOLUME_MONITOR (volume_monitor);

  res = NULL;
  
  g_static_rec_mutex_lock (&the_volume_monitor_mutex);

  for (l = monitor->monitors; l != NULL; l = l->next)
    {
      child_monitor = l->data;

      res = g_list_concat (res, g_volume_monitor_get_connected_drives (child_monitor));
    }
  
  g_static_rec_mutex_unlock (&the_volume_monitor_mutex);

  return res;
}
开发者ID:Andais,项目名称:glib,代码行数:25,代码来源:gunionvolumemonitor.c

示例8: mgmt_unregister_index

bool mgmt_unregister_index(struct mgmt *mgmt, uint16_t index)
{
	GList *list, *next;

	if (!mgmt)
		return false;

	for (list = g_list_first(mgmt->notify_list); list; list = next) {
		struct mgmt_notify *notify = list->data;

		next = g_list_next(list);

		if (notify->index != index)
			continue;

		mgmt->notify_list = g_list_remove_link(mgmt->notify_list, list);

		if (!mgmt->in_notify) {
			g_list_free_1(list);
			destroy_notify(notify, NULL);
			continue;
		}

		notify->destroyed = true;

		mgmt->notify_destroyed = g_list_concat(mgmt->notify_destroyed,
									list);
	}

	return true;
}
开发者ID:DaisyPi,项目名称:sensortag,代码行数:31,代码来源:mgmt.c

示例9: get_extension_menus

static GList *
get_extension_menus (NautilusWindow *window)
{
    NautilusFile *file;
    NautilusWindowSlot *slot;
    GList *providers;
    GList *items;
    GList *l;

    providers = nautilus_module_get_extensions_for_type (NAUTILUS_TYPE_MENU_PROVIDER);
    items = NULL;

    slot = nautilus_window_get_active_slot (window);
    file = nautilus_window_slot_get_file (slot);

    for (l = providers; l != NULL; l = l->next) {
        NautilusMenuProvider *provider;
        GList *file_items;

        provider = NAUTILUS_MENU_PROVIDER (l->data);
        file_items = nautilus_menu_provider_get_background_items (provider,
                     GTK_WIDGET (window),
                     file);
        items = g_list_concat (items, file_items);
    }

    nautilus_module_extension_list_free (providers);

    return items;
}
开发者ID:GeorgesStavracas,项目名称:eos-file-manager,代码行数:30,代码来源:nautilus-window-menus.c

示例10: pidgin_conversations_find_unseen_list

GList *get_pending_list(guint max) {
	const char *im=purple_prefs_get_string("/plugins/gtk/gtk-sarah-barnot/im");
	const char *chat=purple_prefs_get_string(
	                                     "/plugins/gtk/gtk-sarah-barnot/chat");
	GList *l_im = NULL;
	GList *l_chat = NULL;

	
	if (im != NULL && strcmp(im, "always") == 0) {
		l_im = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM,
		                                             PIDGIN_UNSEEN_TEXT,
		                                             FALSE, max);
	} else if (im != NULL && strcmp(im, "hidden") == 0) {
		l_im = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_IM,
		                                             PIDGIN_UNSEEN_TEXT,
		                                             TRUE, max);
	}

	if (chat != NULL && strcmp(chat, "always") == 0) {
		l_chat = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_CHAT,
		                                               PIDGIN_UNSEEN_TEXT,
		                                               FALSE, max);
	} else if (chat != NULL && strcmp(chat, "nick") == 0) {
		l_chat = pidgin_conversations_find_unseen_list(PURPLE_CONV_TYPE_CHAT,
		                                               PIDGIN_UNSEEN_NICK,
		                                               FALSE, max);
	}

	if (l_im != NULL && l_chat != NULL)
		return g_list_concat(l_im, l_chat);
	else if (l_im != NULL)
		return l_im;
	else
		return l_chat;
}
开发者ID:moutons,项目名称:pidgin-xmonad,代码行数:35,代码来源:xmobar-notification.c

示例11: mgmt_unregister

bool mgmt_unregister(struct mgmt *mgmt, unsigned int id)
{
	struct mgmt_notify *notify;
	GList *list;

	if (!mgmt || !id)
		return false;

	list = g_list_find_custom(mgmt->notify_list,
				GUINT_TO_POINTER(id), compare_notify_id);
	if (!list)
		return false;

	notify = list->data;

	mgmt->notify_list = g_list_remove_link(mgmt->notify_list, list);

	if (!mgmt->in_notify) {
		g_list_free_1(list);
		destroy_notify(notify, NULL);
		return true;
	}

	notify->destroyed = true;

	mgmt->notify_destroyed = g_list_concat(mgmt->notify_destroyed, list);

	return true;
}
开发者ID:DaisyPi,项目名称:sensortag,代码行数:29,代码来源:mgmt.c

示例12: pop3_store_query_auth_types_sync

static GList *
pop3_store_query_auth_types_sync (CamelService *service,
                                  GCancellable *cancellable,
                                  GError **error)
{
	CamelServiceClass *service_class;
	CamelPOP3Store *store = CAMEL_POP3_STORE (service);
	GList *types = NULL;
	GError *local_error = NULL;

	/* Chain up to parent's query_auth_types() method. */
	service_class = CAMEL_SERVICE_CLASS (camel_pop3_store_parent_class);
	types = service_class->query_auth_types_sync (
		service, cancellable, &local_error);

	if (local_error != NULL) {
		g_propagate_error (error, local_error);
		return NULL;
	}

	if (connect_to_server (service, cancellable, error)) {
		CamelPOP3Engine *pop3_engine;

		pop3_engine = camel_pop3_store_ref_engine (store);

		if (pop3_engine) {
			types = g_list_concat (types, g_list_copy (pop3_engine->auth));
			pop3_store_disconnect_sync (service, TRUE, cancellable, NULL);

			g_clear_object (&pop3_engine);
		}
	}

	return types;
}
开发者ID:Pecisk,项目名称:eds-gtasks,代码行数:35,代码来源:camel-pop3-store.c

示例13: thunar_folder_infos_ready

static gboolean
thunar_folder_infos_ready (ThunarVfsJob *job,
                           GList        *infos,
                           ThunarFolder *folder)
{
  ThunarFile *file;
  GList      *lp;

  _thunar_return_val_if_fail (THUNAR_IS_FOLDER (folder), FALSE);
  _thunar_return_val_if_fail (THUNAR_VFS_IS_JOB (job), FALSE);
  _thunar_return_val_if_fail (folder->handle == NULL, FALSE);
  _thunar_return_val_if_fail (folder->job == job, FALSE);

  /* turn the info list into a file list */
  for (lp = infos; lp != NULL; lp = lp->next)
    {
      /* get the file corresponding to the info... */
      file = thunar_file_get_for_info (lp->data);

      /* ...release the info at the list position... */
      thunar_vfs_info_unref (lp->data);

      /* ...and replace it with the file */
      lp->data = file;
    }

  /* merge the list with the existing list of new files */
  folder->new_files = g_list_concat (folder->new_files, infos);

  /* TRUE to indicate that we took over ownership of the infos list */
  return TRUE;
}
开发者ID:EchelonTeam,项目名称:sca3_main,代码行数:32,代码来源:thunar-folder.c

示例14: ug_app_cmd_save

void	ug_app_cmd_save (UgAppCmd* app)
{
	GList*	link;
	GList*	list;
	gchar*	file;

	// get all of UgDataset from all UgCategory
	list = NULL;
	for (link = app->category_list;  link;  link = link->next) {
		list = g_list_concat (list, ug_category_cmd_get_all ((UgCategory*) link->data));
	}

	// save all UgDataset
	file = g_build_filename (g_get_user_config_dir (),
	                         UG_APP_CMD_DIR, UG_APP_CMD_DOWNLOAD_FILE,
	                         NULL);
	ug_download_list_save (list, file);
	g_list_free (list);
	g_free (file);

	// save all UgCategory after calling ug_download_list_save()
	file = g_build_filename (g_get_user_config_dir (),
	                         UG_APP_CMD_DIR, UG_APP_CMD_CATEGORY_FILE,
	                         NULL);
	ug_category_list_save (app->category_list, file);
	g_free (file);
}
开发者ID:Endz0,项目名称:uget,代码行数:27,代码来源:UgApp-cmd.c

示例15: gimp_vectors_add_strokes

void
gimp_vectors_add_strokes (const GimpVectors *src_vectors,
                          GimpVectors       *dest_vectors)
{
  GList *current_lstroke;
  GList *strokes_copy;

  g_return_if_fail (GIMP_IS_VECTORS (src_vectors));
  g_return_if_fail (GIMP_IS_VECTORS (dest_vectors));

  gimp_vectors_freeze (dest_vectors);

  strokes_copy = g_list_copy (src_vectors->strokes);
  current_lstroke = strokes_copy;

  while (current_lstroke)
    {
      current_lstroke->data = gimp_stroke_duplicate (current_lstroke->data);
      dest_vectors->last_stroke_ID ++;
      gimp_stroke_set_ID (current_lstroke->data,
                          dest_vectors->last_stroke_ID);
      current_lstroke = g_list_next (current_lstroke);
    }

  dest_vectors->strokes = g_list_concat (dest_vectors->strokes, strokes_copy);

  gimp_vectors_thaw (dest_vectors);
}
开发者ID:ni1son,项目名称:gimp,代码行数:28,代码来源:gimpvectors.c


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