Back to index

bamf  0.2.120
Functions
bamf-view-private.h File Reference
#include <libbamf/bamf-view.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void _bamf_view_set_path (BamfView *view, const char *dbus_path)
const char * _bamf_view_get_path (BamfView *view)
gboolean _bamf_view_remote_ready (BamfView *view)
void _bamf_view_reset_flags (BamfView *view)
void _bamf_view_set_name (BamfView *view, const char *name)
void _bamf_view_set_icon (BamfView *view, const char *icon)
void _bamf_view_set_closed (BamfView *view, gboolean closed)

Function Documentation

const char* _bamf_view_get_path ( BamfView *  view)

Definition at line 734 of file bamf-view.c.

{
  g_return_val_if_fail (BAMF_IS_VIEW (view), NULL);

  return view->priv->path;
}

Here is the caller graph for this function:

gboolean _bamf_view_remote_ready ( BamfView *  view)

Definition at line 416 of file bamf-view.c.

{
  if (BAMF_IS_VIEW (view) && view->priv->proxy)
    return !view->priv->is_closed;

  return FALSE;
}

Here is the caller graph for this function:

void _bamf_view_reset_flags ( BamfView *  view)

Definition at line 742 of file bamf-view.c.

{
  BamfViewPrivate *priv;
  g_return_if_fail (BAMF_IS_VIEW (view));

  priv = view->priv;
  priv->checked_flags = 0x0;

  if (bamf_view_user_visible (view))
    {
      g_signal_emit (G_OBJECT(view), view_signals[VISIBLE_CHANGED], 0, TRUE);
      g_object_notify (G_OBJECT (view), "user-visible");
    }
  
  if (bamf_view_is_active (view))
    {
      g_signal_emit (G_OBJECT(view), view_signals[ACTIVE_CHANGED], 0, TRUE);
      g_object_notify (G_OBJECT (view), "active");
    }
  
  if (bamf_view_is_running (view))
    {
      g_signal_emit (G_OBJECT(view), view_signals[RUNNING_CHANGED], 0, TRUE);
      g_object_notify (G_OBJECT (view), "running");
    }
    
  if (bamf_view_is_urgent (view))
    {
      g_signal_emit (G_OBJECT(view), view_signals[URGENT_CHANGED], 0, TRUE);
      g_object_notify (G_OBJECT (view), "urgent");
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void _bamf_view_set_closed ( BamfView *  view,
gboolean  closed 
)

Definition at line 564 of file bamf-view.c.

{
  BamfViewPrivate *priv;
  g_return_if_fail (BAMF_IS_VIEW (view));

  priv = view->priv;

  if (priv->is_closed != closed)
    {
      priv->is_closed = closed;

      if (closed && priv->cached_children)
        {
          g_list_free_full (priv->cached_children, g_object_unref);
          priv->cached_children = NULL;
        }
    }
}

Here is the caller graph for this function:

void _bamf_view_set_icon ( BamfView *  view,
const char *  icon 
)

Definition at line 299 of file bamf-view.c.

{
  g_return_if_fail (BAMF_IS_VIEW (view));

  g_free (view->priv->local_icon);

  if (icon && icon[0] == '\0')
    {
      view->priv->local_icon = NULL;
    }
  else
    {
      view->priv->local_icon = g_strdup (icon);
    }
}

Here is the caller graph for this function:

void _bamf_view_set_name ( BamfView *  view,
const char *  name 
)

Definition at line 279 of file bamf-view.c.

{
  g_return_if_fail (BAMF_IS_VIEW (view));
  
  if (!g_strcmp0 (name, view->priv->local_name))
    return;

  g_free (view->priv->local_name);

  if (name && name[0] == '\0')
    {
      view->priv->local_name = NULL;
    }
  else
    {
      view->priv->local_name = g_strdup (name);
    }
}

Here is the caller graph for this function:

void _bamf_view_set_path ( BamfView *  view,
const char *  dbus_path 
)

Definition at line 776 of file bamf-view.c.

{
  BamfViewPrivate *priv;

  g_return_if_fail (BAMF_IS_VIEW (view));
  g_return_if_fail (path);

  priv = view->priv;

  _bamf_view_set_closed (view, FALSE);

  if (priv->proxy && g_strcmp0 (priv->path, path) == 0)
    {
      // The proxy path has not been changed, no need to unset and re-set it again
      return;
    }

  g_free (priv->path);
  bamf_view_unset_proxy (view);

  priv->path = g_strdup (path);
  priv->proxy = dbus_g_proxy_new_for_name (priv->connection,
                                           "org.ayatana.bamf",
                                           priv->path,
                                           "org.ayatana.bamf.view");

  if (priv->proxy == NULL)
    {
      g_critical ("Unable to get org.ayatana.bamf.view view");
      return;
    }

  g_signal_connect (priv->proxy, "destroy", G_CALLBACK (on_view_proxy_destroyed), view);

  dbus_g_proxy_add_signal (priv->proxy,
                           "ActiveChanged",
                           G_TYPE_BOOLEAN,
                           G_TYPE_INVALID);

  dbus_g_proxy_add_signal (priv->proxy,
                           "Closed",
                           G_TYPE_INVALID);

  dbus_g_proxy_add_signal (priv->proxy,
                           "ChildAdded",
                           G_TYPE_STRING,
                           G_TYPE_INVALID);

  dbus_g_proxy_add_signal (priv->proxy,
                           "ChildRemoved",
                           G_TYPE_STRING,
                           G_TYPE_INVALID);

  dbus_g_proxy_add_signal (priv->proxy,
                           "RunningChanged",
                           G_TYPE_BOOLEAN,
                           G_TYPE_INVALID);

  dbus_g_proxy_add_signal (priv->proxy,
                           "UrgentChanged",
                           G_TYPE_BOOLEAN,
                           G_TYPE_INVALID);

  dbus_g_proxy_add_signal (priv->proxy,
                           "UserVisibleChanged",
                           G_TYPE_BOOLEAN,
                           G_TYPE_INVALID);

  dbus_g_proxy_add_signal (priv->proxy,
                           "NameChanged",
                           G_TYPE_STRING,
                           G_TYPE_STRING,
                           G_TYPE_INVALID);

  dbus_g_proxy_connect_signal (priv->proxy,
                               "ActiveChanged",
                               (GCallback) bamf_view_on_active_changed,
                               view,
                               NULL);

  dbus_g_proxy_connect_signal (priv->proxy,
                               "Closed",
                               (GCallback) bamf_view_on_closed,
                               view,
                               NULL);

  dbus_g_proxy_connect_signal (priv->proxy,
                               "ChildAdded",
                               (GCallback) bamf_view_on_child_added,
                               view,
                               NULL);

  dbus_g_proxy_connect_signal (priv->proxy,
                               "ChildRemoved",
                               (GCallback) bamf_view_on_child_removed,
                               view,
                               NULL);

  dbus_g_proxy_connect_signal (priv->proxy,
                               "RunningChanged",
                               (GCallback) bamf_view_on_running_changed,
                               view,
                               NULL);

  dbus_g_proxy_connect_signal (priv->proxy,
                               "UrgentChanged",
                               (GCallback) bamf_view_on_urgent_changed,
                               view,
                               NULL);

  dbus_g_proxy_connect_signal (priv->proxy,
                               "UserVisibleChanged",
                               (GCallback) bamf_view_on_user_visible_changed,
                               view,
                               NULL);

  dbus_g_proxy_connect_signal (priv->proxy,
                               "NameChanged",
                               (GCallback) bamf_view_on_name_changed,
                               view,
                               NULL);

  if (bamf_view_is_sticky (view))
    {
      _bamf_view_reset_flags (view);
    }

  if (BAMF_VIEW_GET_CLASS (view)->set_path)
    BAMF_VIEW_GET_CLASS (view)->set_path (view, path);
}

Here is the call graph for this function:

Here is the caller graph for this function: