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


C++ G_IS_APP_INFO函数代码示例

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


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

示例1: panel_app_info_launch_uris

gboolean
panel_app_info_launch_uris (GAppInfo   *appinfo,
			    GList      *uris,
			    GdkScreen  *screen,
			    guint32     timestamp,
			    GError    **error)
{
	GdkAppLaunchContext *context;
	GError              *local_error;
	gboolean             retval;

	g_return_val_if_fail (G_IS_APP_INFO (appinfo), FALSE);
	g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);

	context = gdk_app_launch_context_new ();
	gdk_app_launch_context_set_screen (context, screen);
	gdk_app_launch_context_set_timestamp (context, timestamp);

	local_error = NULL;
	retval = g_app_info_launch_uris (appinfo, uris,
					 (GAppLaunchContext *) context,
					 &local_error);

	g_object_unref (context);

        if ((local_error == NULL) && (retval == TRUE))
            return TRUE;

	return _panel_launch_handle_error (g_app_info_get_name (appinfo),
					   screen, local_error, error);
}
开发者ID:Lyude,项目名称:mate-panel,代码行数:32,代码来源:panel-launch.c

示例2: g_app_info_equal

/**
 * g_app_info_equal:
 * @appinfo1: the first #GAppInfo.
 * @appinfo2: the second #GAppInfo.
 *
 * Checks if two #GAppInfo<!-- -->s are equal.
 *
 * Returns: %TRUE if @appinfo1 is equal to @appinfo2. %FALSE otherwise.
 **/
gboolean
g_app_info_equal (GAppInfo *appinfo1,
		  GAppInfo *appinfo2)
{
  GAppInfoIface *iface;

  g_return_val_if_fail (G_IS_APP_INFO (appinfo1), FALSE);
  g_return_val_if_fail (G_IS_APP_INFO (appinfo2), FALSE);

  if (G_TYPE_FROM_INSTANCE (appinfo1) != G_TYPE_FROM_INSTANCE (appinfo2))
    return FALSE;
  
  iface = G_APP_INFO_GET_IFACE (appinfo1);

  return (* iface->equal) (appinfo1, appinfo2);
}
开发者ID:Andais,项目名称:glib,代码行数:25,代码来源:gappinfo.c

示例3: dentry_is_gapp

JS_EXPORT_API
gboolean dentry_is_gapp(Entry* e)
{
    if(G_IS_APP_INFO(e))
        return TRUE;
    else return FALSE;
}
开发者ID:CannedFish,项目名称:dde,代码行数:7,代码来源:entry.c

示例4: panel_app_info_launch_uri

gboolean
panel_app_info_launch_uri (GAppInfo     *appinfo,
			   const gchar  *uri,
			   GdkScreen    *screen,
			   guint32       timestamp,
			   GError      **error)
{
	GList    *uris;
	gboolean  retval;

	g_return_val_if_fail (G_IS_APP_INFO (appinfo), FALSE);
	g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
	g_return_val_if_fail (error == NULL || *error == NULL, FALSE);

	uris = NULL;
	if (uri)
		uris = g_list_prepend (uris, (gpointer) uri);

	retval = panel_app_info_launch_uris (appinfo, uris,
					     screen, timestamp, error);

	g_list_free (uris);

	return retval;
}
开发者ID:Lyude,项目名称:mate-panel,代码行数:25,代码来源:panel-launch.c

示例5: panel_app_info_launch_uris

static gboolean
panel_app_info_launch_uris (GAppInfo   *appinfo,
			    GList      *uris,
			    GdkScreen  *screen,
			    guint32     timestamp,
			    GError    **error)
{
  GdkAppLaunchContext *context;
  GError              *local_error;
  GdkDisplay          *display;

  g_return_val_if_fail (G_IS_APP_INFO (appinfo), FALSE);
  g_return_val_if_fail (GDK_IS_SCREEN (screen), FALSE);
  g_return_val_if_fail (error == NULL || *error == NULL, FALSE);

  display = gdk_screen_get_display (screen);
  context = gdk_display_get_app_launch_context (display);
  gdk_app_launch_context_set_screen (context, screen);
  gdk_app_launch_context_set_timestamp (context, timestamp);

  local_error = NULL;
  g_app_info_launch_uris (appinfo, uris,
			  (GAppLaunchContext *) context,
			  &local_error);

  g_object_unref (context);

  return _panel_launch_handle_error (g_app_info_get_name (appinfo),
				     screen, local_error, error);
}
开发者ID:zeldin,项目名称:sysmenu-applet,代码行数:30,代码来源:launch.c

示例6: get_hotkey_info_from_key_file

static GtkHotkeyInfo*
get_hotkey_info_from_key_file (GKeyFile	*keyfile,
							   const gchar *app_id,
							   const gchar *key_id,
							   GError **error)
{
	GtkHotkeyInfo   *info = NULL;
	gchar			*group, *description, *app_info_id, *signature;
	GAppInfo		*app_info = NULL;
	
	g_return_val_if_fail (keyfile != NULL, NULL);
	g_return_val_if_fail (error == NULL || *error == NULL, NULL);
	g_return_val_if_fail (app_id != NULL, NULL);
	g_return_val_if_fail (key_id != NULL, NULL);
	
	group = g_strconcat (HOTKEY_GROUP, key_id, NULL);
	description = g_key_file_get_string (keyfile, group, "Description", NULL);
	app_info_id = g_key_file_get_string (keyfile, group, "AppInfo", NULL);
	signature = g_key_file_get_string (keyfile, group, "Signature", NULL);
	
	if (!g_key_file_has_group (keyfile, group)) {
		g_set_error (error, GTK_HOTKEY_REGISTRY_ERROR,
					 GTK_HOTKEY_REGISTRY_ERROR_UNKNOWN_KEY,
					 "Keyfile has no group "HOTKEY_GROUP"%s", key_id);
		goto clean_up;
	}
	
	if (!signature) {
		g_set_error (error, GTK_HOTKEY_REGISTRY_ERROR,
					 GTK_HOTKEY_REGISTRY_ERROR_BAD_SIGNATURE,
					 "No 'Signature' defined for hotkey '%s' for application '%s'",
					 key_id, app_id);
		goto clean_up;
	}
	
	if (app_info_id) {
		app_info = G_APP_INFO(g_desktop_app_info_new (app_info_id));
		if (!G_IS_APP_INFO(app_info)) {
			g_set_error (error, GTK_HOTKEY_REGISTRY_ERROR,
						 GTK_HOTKEY_REGISTRY_ERROR_MISSING_APP,
						 "Keyfile refering to 'AppInfo = %s', but no application"
						 "by that id is registered on the system", app_info_id);
			goto clean_up;
		}	
	}
	
	info = gtk_hotkey_info_new (app_id, key_id, signature, app_info);
	if (description)
		gtk_hotkey_info_set_description (info, description);
	
	clean_up:
		g_free (group);
		if (signature) g_free (signature);
		if (description) g_free (description);
		if (app_info_id) g_free (app_info_id);
		if (app_info) g_object_unref (app_info);
			
	return info;
}
开发者ID:SpOOnman,项目名称:claws,代码行数:59,代码来源:gtk-hotkey-key-file-registry.c

示例7: xfdashboard_application_tracker_is_running_by_app_info

gboolean xfdashboard_application_tracker_is_running_by_app_info(XfdashboardApplicationTracker *self,
																GAppInfo *inAppInfo)
{
	g_return_val_if_fail(XFDASHBOARD_IS_APPLICATION_TRACKER(self), FALSE);
	g_return_val_if_fail(G_IS_APP_INFO(inAppInfo), FALSE);

	return(_xfdashboard_application_tracker_find_item_by_app_info(self, inAppInfo) ? TRUE : FALSE);
}
开发者ID:Zeioth,项目名称:xfdashboard,代码行数:8,代码来源:application-tracker.c

示例8: _xfdashboard_application_tracker_find_item_by_app_info

/* Find application tracker item by desktop application info */
static XfdashboardApplicationTrackerItem* _xfdashboard_application_tracker_find_item_by_app_info(XfdashboardApplicationTracker *self,
																									GAppInfo *inAppInfo)
{
	g_return_val_if_fail(XFDASHBOARD_IS_APPLICATION_TRACKER(self), NULL);
	g_return_val_if_fail(G_IS_APP_INFO(inAppInfo), NULL);

	return(_xfdashboard_application_tracker_find_item_by_desktop_id(self, g_app_info_get_id(inAppInfo)));
}
开发者ID:Zeioth,项目名称:xfdashboard,代码行数:9,代码来源:application-tracker.c

示例9: _app_activate_cb

static void
_app_activate_cb (OlAppChooserWidget *chooser,
                  GAppInfo *app_info,
                  OlPlayerChooser *window)
{
  ol_assert (G_IS_APP_INFO (app_info));
  _launch_app (window, app_info);
}
开发者ID:AhmadMAlam,项目名称:osd-lyrics-1,代码行数:8,代码来源:ol_player_chooser.c

示例10: g_app_info_get_executable

/**
 * g_app_info_get_executable:
 * @appinfo: a #GAppInfo
 * 
 * Gets the executable's name for the installed application.
 *
 * Returns: a string containing the @appinfo's application 
 * binaries name
 **/
const char *
g_app_info_get_executable (GAppInfo *appinfo)
{
  GAppInfoIface *iface;
  
  g_return_val_if_fail (G_IS_APP_INFO (appinfo), NULL);

  iface = G_APP_INFO_GET_IFACE (appinfo);

  return (* iface->get_executable) (appinfo);
}
开发者ID:Andais,项目名称:glib,代码行数:20,代码来源:gappinfo.c

示例11: g_app_info_get_icon

/**
 * g_app_info_get_icon:
 * @appinfo: a #GAppInfo.
 * 
 * Gets the icon for the application.
 *
 * Returns: (transfer none): the default #GIcon for @appinfo.
 **/
GIcon *
g_app_info_get_icon (GAppInfo *appinfo)
{
  GAppInfoIface *iface;
  
  g_return_val_if_fail (G_IS_APP_INFO (appinfo), NULL);

  iface = G_APP_INFO_GET_IFACE (appinfo);

  return (* iface->get_icon) (appinfo);
}
开发者ID:Andais,项目名称:glib,代码行数:19,代码来源:gappinfo.c

示例12: g_app_info_supports_files

/**
 * g_app_info_supports_files:
 * @appinfo: a #GAppInfo.
 * 
 * Checks if the application accepts files as arguments.
 *
 * Returns: %TRUE if the @appinfo supports files.
 **/
gboolean
g_app_info_supports_files (GAppInfo *appinfo)
{
  GAppInfoIface *iface;
  
  g_return_val_if_fail (G_IS_APP_INFO (appinfo), FALSE);

  iface = G_APP_INFO_GET_IFACE (appinfo);

  return (* iface->supports_files) (appinfo);
}
开发者ID:Andais,项目名称:glib,代码行数:19,代码来源:gappinfo.c

示例13: g_app_info_should_show

/**
 * g_app_info_should_show:
 * @appinfo: a #GAppInfo.
 *
 * Checks if the application info should be shown in menus that 
 * list available applications.
 * 
 * Returns: %TRUE if the @appinfo should be shown, %FALSE otherwise.
 **/
gboolean
g_app_info_should_show (GAppInfo *appinfo)
{
  GAppInfoIface *iface;
  
  g_return_val_if_fail (G_IS_APP_INFO (appinfo), FALSE);

  iface = G_APP_INFO_GET_IFACE (appinfo);

  return (* iface->should_show) (appinfo);
}
开发者ID:Andais,项目名称:glib,代码行数:20,代码来源:gappinfo.c

示例14: g_app_info_dup

/**
 * g_app_info_dup:
 * @appinfo: a #GAppInfo.
 * 
 * Creates a duplicate of a #GAppInfo.
 *
 * Returns: a duplicate of @appinfo.
 **/
GAppInfo *
g_app_info_dup (GAppInfo *appinfo)
{
  GAppInfoIface *iface;

  g_return_val_if_fail (G_IS_APP_INFO (appinfo), NULL);

  iface = G_APP_INFO_GET_IFACE (appinfo);

  return (* iface->dup) (appinfo);
}
开发者ID:Andais,项目名称:glib,代码行数:19,代码来源:gappinfo.c

示例15: g_app_info_get_commandline

/**
 * g_app_info_get_commandline:
 * @appinfo: a #GAppInfo
 * 
 * Gets the commandline with which the application will be
 * started.  
 *
 * Returns: a string containing the @appinfo's commandline, 
 *     or %NULL if this information is not available
 *
 * Since: 2.20
 **/
const char *
g_app_info_get_commandline (GAppInfo *appinfo)
{
  GAppInfoIface *iface;
  
  g_return_val_if_fail (G_IS_APP_INFO (appinfo), NULL);

  iface = G_APP_INFO_GET_IFACE (appinfo);

  if (iface->get_commandline)
    return (* iface->get_commandline) (appinfo);
 
  return NULL;
}
开发者ID:Andais,项目名称:glib,代码行数:26,代码来源:gappinfo.c


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