Example #1
0
/**
 * wnck_application_get_startup_id:
 * @app: a #WnckApplication.
 *
 * Gets the startup sequence ID used for startup notification of @app.
 *
 * Return value: the startup sequence ID used for startup notification of @app,
 * or %NULL if none is available.
 *
 * Since: 2.2
 */
const char*
wnck_application_get_startup_id (WnckApplication *app)
{
  g_return_val_if_fail (WNCK_IS_APPLICATION (app), NULL);

  return app->priv->startup_id;
}
Example #2
0
/**
 * wnck_application_get_n_windows:
 * @app: a #WnckApplication.
 * 
 * Gets the number of #WnckWindow belonging to @app.
 * 
 * Return value: the number of #WnckWindow belonging to @app.
 **/
int
wnck_application_get_n_windows (WnckApplication *app)
{
  g_return_val_if_fail (WNCK_IS_APPLICATION (app), 0);

  return g_list_length (app->priv->windows);
}
Example #3
0
/**
 * wnck_application_get_pid:
 * @app: a #WnckApplication.
 * 
 * Gets the process ID of @app.
 * 
 * Return value: the process ID of @app, or 0 if none is available.
 **/
int
wnck_application_get_pid (WnckApplication *app)
{
  g_return_val_if_fail (WNCK_IS_APPLICATION (app), 0);

  return app->priv->pid;
}
Example #4
0
/**
 * wnck_application_get_windows:
 * @app: a #WnckApplication.
 * 
 * Gets the list of #WnckWindow belonging to @app.
 * 
 * Return value: the list of #WnckWindow belonging to @app, or %NULL if the
 * application contains no window. The list should not be modified nor freed,
 * as it is owned by @app.
 **/
GList*
wnck_application_get_windows (WnckApplication *app)
{
  g_return_val_if_fail (WNCK_IS_APPLICATION (app), NULL);

  return app->priv->windows;
}
Example #5
0
/**
 * wnck_application_get_xid:
 * @app: a #WnckApplication.
 * 
 * Gets the X window ID of the group leader window for @app.
 * 
 * Return value: the X window ID of the group leader window for @app.
 **/
gulong
wnck_application_get_xid (WnckApplication *app)
{
  g_return_val_if_fail (WNCK_IS_APPLICATION (app), 0);
  
  return app->priv->xwindow;
}
Example #6
0
/**
 * wnck_set_default_mini_icon_size:
 * @size: the default size for windows and application mini icons.
 *
 * The default main icon size is %WNCK_DEFAULT_MINI_ICON_SIZE. This function
 * allows to change this value.
 *
 * Since: 2.4.6
 */
void
wnck_set_default_mini_icon_size (gsize size)
{
  int default_screen;
  WnckScreen *screen;
  GList *l;

  default_mini_icon_size = size;

  default_screen = DefaultScreen (_wnck_get_default_display ());
  screen = _wnck_screen_get_existing (default_screen);

  if (WNCK_IS_SCREEN (screen))
    {
      /* Make applications and icons to reload their icons */
      for (l = wnck_screen_get_windows (screen); l; l = l->next)
        {
          WnckWindow *window = WNCK_WINDOW (l->data);
          WnckApplication *application = wnck_window_get_application (window);

          _wnck_window_load_icons (window);

          if (WNCK_IS_APPLICATION (application))
            _wnck_application_load_icons (application);
        }
    }
}
Example #7
0
void
_wnck_application_load_icons (WnckApplication *app)
{
  g_return_if_fail (WNCK_IS_APPLICATION (app));

  get_icons (app);
  if (app->priv->need_emit_icon_changed)
    emit_icon_changed (app);
}
Example #8
0
/**
 * wnck_application_get_name:
 * @app: a #WnckApplication.
 * 
 * Gets the name of @app. Since there is no way to properly find this name,
 * various suboptimal heuristics are used to find it. GTK+ should probably have
 * a function to allow applications to set the _NET_WM_NAME property on the
 * group leader as the application name, and the <ulink
 * url="http://standards.freedesktop.org/wm-spec/wm-spec-latest.html">EWMH</ulink>
 * should say that this is where the application name goes.
 * 
 * Return value: the name of @app, or a fallback name if no name is available.
 **/
const char*
wnck_application_get_name (WnckApplication *app)
{
  g_return_val_if_fail (WNCK_IS_APPLICATION (app), NULL);

  if (app->priv->name)
    return app->priv->name;
  else
    return FALLBACK_NAME;
}
Example #9
0
/**
 * wnck_application_get_icon_name:
 * @app: a #WnckApplication
 * 
 * Gets the icon name of @app (to be used when @app is minimized). Since
 * there is no way to properly find this name, various suboptimal heuristics
 * are used to find it.
 * 
 * Return value: the icon name of @app, or a fallback icon name if no icon name
 * is available.
 **/
const char*
wnck_application_get_icon_name (WnckApplication *app)
{
  g_return_val_if_fail (WNCK_IS_APPLICATION (app), NULL);

  /* FIXME this isn't actually implemented, should be different
   * from regular name
   */
  
  if (app->priv->name)
    return app->priv->name;
  else
    return FALLBACK_NAME;
}
Example #10
0
/**
 * wnck_application_get_icon_is_fallback:
 * @app: a #WnckApplication
 *
 * Gets whether a default fallback icon is used for @app (because none
 * was set on @app).
 * 
 * Return value: %TRUE if the icon for @app is a fallback, %FALSE otherwise.
 **/
gboolean
wnck_application_get_icon_is_fallback (WnckApplication *app)
{
  g_return_val_if_fail (WNCK_IS_APPLICATION (app), FALSE);

  if (app->priv->icon)
    return FALSE;
  else
    {
      WnckWindow *w = find_icon_window (app);
      if (w)
        return wnck_window_get_icon_is_fallback (w);
      else
        return TRUE;
    }
}
Example #11
0
/**
 * wnck_application_get_mini_icon:
 * @app: a #WnckApplication.
 *
 * Gets the mini-icon to be used for @app. If no mini-icon is set for @app,
 * a suboptimal heuristic is used to find an appropriate icon. If no mini-icon
 * was found, a fallback mini-icon is used.
 *
 * Return value: (transfer none): the mini-icon for @app. The caller should
 * reference the returned <classname>GdkPixbuf</classname> if it needs to keep
 * the mini-icon around.
 **/
GdkPixbuf*
wnck_application_get_mini_icon (WnckApplication *app)
{
  g_return_val_if_fail (WNCK_IS_APPLICATION (app), NULL);

  _wnck_application_load_icons (app);

  if (app->priv->mini_icon)
    return app->priv->mini_icon;
  else
    {
      WnckWindow *w = find_icon_window (app);
      if (w)
        return wnck_window_get_mini_icon (w);
      else
        return NULL;
    }
}
Example #12
0
/**
 * wnck_application_get_icon:
 * @app: a #WnckApplication.
 * 
 * Gets the icon to be used for @app. If no icon is set for @app, a
 * suboptimal heuristic is used to find an appropriate icon. If no icon was
 * found, a fallback icon is used.
 * 
 * Return value: the icon for @app. The caller should reference the returned
 * <classname>GdkPixbuf</classname> if it needs to keep the icon around.
 **/
GdkPixbuf*
wnck_application_get_icon (WnckApplication *app)
{
  g_return_val_if_fail (WNCK_IS_APPLICATION (app), NULL);

  get_icons (app);
  if (app->priv->need_emit_icon_changed)
    emit_icon_changed (app);

  if (app->priv->icon)
    return app->priv->icon;
  else
    {
      WnckWindow *w = find_icon_window (app);
      if (w)
        return wnck_window_get_icon (w);
      else
        return NULL;
    }
}
Example #13
0
void
_wnck_application_remove_window (WnckApplication *app,
                                 WnckWindow      *window)
{
  g_return_if_fail (WNCK_IS_APPLICATION (app));
  g_return_if_fail (WNCK_IS_WINDOW (window));
  g_return_if_fail (wnck_window_get_application (window) == app);
  
  app->priv->windows = g_list_remove (app->priv->windows, window);
  _wnck_window_set_application (window, NULL);

  g_signal_handlers_disconnect_by_func (G_OBJECT (window),
                                        window_name_changed, app);
  
  /* emits signals, so do it last */
  reset_name (app);
  update_name (app);

  /* see if we're using icon from a window */
  if (app->priv->icon == NULL ||
      app->priv->mini_icon == NULL)
    emit_icon_changed (app);
}
Example #14
0
void
_wnck_application_add_window (WnckApplication *app,
                              WnckWindow      *window)
{
  g_return_if_fail (WNCK_IS_APPLICATION (app));
  g_return_if_fail (WNCK_IS_WINDOW (window));
  g_return_if_fail (wnck_window_get_application (window) == NULL);
  
  app->priv->windows = g_list_prepend (app->priv->windows, window);  
  _wnck_window_set_application (window, app);

  g_signal_connect (G_OBJECT (window), "name_changed",
                    G_CALLBACK (window_name_changed), app);
  
  /* emits signals, so do it last */
  reset_name (app);
  update_name (app);

  /* see if we're using icon from a window */
  if (app->priv->icon == NULL ||
      app->priv->mini_icon == NULL)
    emit_icon_changed (app);
}