Back to index

bamf  0.2.120
Classes | Defines | Typedefs | Functions
bamf-legacy-screen.h File Reference
#include "bamf.h"
#include "bamf-view.h"
#include "bamf-legacy-window.h"
#include <glib.h>
#include <glib-object.h>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _BamfLegacyScreenClass
struct  _BamfLegacyScreen

Defines

#define BAMF_TYPE_LEGACY_SCREEN   (bamf_legacy_screen_get_type ())
#define BAMF_LEGACY_SCREEN(obj)   (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_LEGACY_SCREEN, BamfLegacyScreen))
#define BAMF_IS_LEGACY_SCREEN(obj)   (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAMF_TYPE_LEGACY_SCREEN))
#define BAMF_LEGACY_SCREEN_CLASS(klass)   (G_TYPE_CHECK_CLASS_CAST ((klass), BAMF_TYPE_LEGACY_SCREEN, BamfLegacyScreenClass))
#define BAMF_IS_LEGACY_SCREEN_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), BAMF_TYPE_LEGACY_SCREEN))
#define BAMF_LEGACY_SCREEN_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), BAMF_TYPE_LEGACY_SCREEN, BamfLegacyScreenClass))
#define BAMF_LEGACY_SCREEN_SIGNAL_WINDOW_OPENED   "window-opened"
#define BAMF_LEGACY_SCREEN_SIGNAL_WINDOW_CLOSED   "window-closed"
#define BAMF_LEGACY_SCREEN_SIGNAL_STACKING_CHANGED   "stacking-changed"
#define BAMF_LEGACY_SCREEN_SIGNAL_ACTIVE_WINDOW_CHANGED   "active-window-changed"

Typedefs

typedef struct _BamfLegacyScreen
typedef struct _BamfLegacyScreenClass
typedef struct _BamfLegacyScreenPrivate

Functions

GType bamf_legacy_screen_get_type (void) G_GNUC_CONST
void bamf_legacy_screen_set_state_file (BamfLegacyScreen *screen, const char *file)
GList * bamf_legacy_screen_get_windows (BamfLegacyScreen *screen)
BamfLegacyWindow * bamf_legacy_screen_get_active_window (BamfLegacyScreen *screen)
BamfLegacyScreen * bamf_legacy_screen_get_default (void)
void bamf_legacy_screen_inject_window (BamfLegacyScreen *screen, guint xid)

Class Documentation

struct _BamfLegacyScreen

Definition at line 58 of file bamf-legacy-screen.h.

Class Members
GObject parent
BamfLegacyScreenPrivate * priv

Define Documentation

#define BAMF_IS_LEGACY_SCREEN (   obj)    (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAMF_TYPE_LEGACY_SCREEN))

Definition at line 31 of file bamf-legacy-screen.h.

#define BAMF_IS_LEGACY_SCREEN_CLASS (   klass)    (G_TYPE_CHECK_CLASS_TYPE ((klass), BAMF_TYPE_LEGACY_SCREEN))

Definition at line 33 of file bamf-legacy-screen.h.

#define BAMF_LEGACY_SCREEN (   obj)    (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_LEGACY_SCREEN, BamfLegacyScreen))

Definition at line 30 of file bamf-legacy-screen.h.

#define BAMF_LEGACY_SCREEN_CLASS (   klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), BAMF_TYPE_LEGACY_SCREEN, BamfLegacyScreenClass))

Definition at line 32 of file bamf-legacy-screen.h.

#define BAMF_LEGACY_SCREEN_GET_CLASS (   obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj), BAMF_TYPE_LEGACY_SCREEN, BamfLegacyScreenClass))

Definition at line 34 of file bamf-legacy-screen.h.

Definition at line 39 of file bamf-legacy-screen.h.

#define BAMF_LEGACY_SCREEN_SIGNAL_STACKING_CHANGED   "stacking-changed"

Definition at line 38 of file bamf-legacy-screen.h.

#define BAMF_LEGACY_SCREEN_SIGNAL_WINDOW_CLOSED   "window-closed"

Definition at line 37 of file bamf-legacy-screen.h.

#define BAMF_LEGACY_SCREEN_SIGNAL_WINDOW_OPENED   "window-opened"

Definition at line 36 of file bamf-legacy-screen.h.

Definition at line 29 of file bamf-legacy-screen.h.


Typedef Documentation

typedef struct _BamfLegacyScreen

Definition at line 41 of file bamf-legacy-screen.h.

typedef struct _BamfLegacyScreenClass

Definition at line 42 of file bamf-legacy-screen.h.

typedef struct _BamfLegacyScreenPrivate

Definition at line 43 of file bamf-legacy-screen.h.


Function Documentation

BamfLegacyWindow* bamf_legacy_screen_get_active_window ( BamfLegacyScreen *  screen)

Definition at line 358 of file bamf-legacy-screen.c.

{
  BamfLegacyWindow *window;
  GList *l;

  g_return_val_if_fail (BAMF_IS_LEGACY_SCREEN (screen), NULL);

  for (l = screen->priv->windows; l; l = l->next)
    {
      window = l->data;

      if (bamf_legacy_window_is_active (window))
        return window;
    }

  return NULL;
}

Here is the call graph for this function:

BamfLegacyScreen* bamf_legacy_screen_get_default ( void  )

Definition at line 447 of file bamf-legacy-screen.c.

{
  if (self)
    return self;

  self = (BamfLegacyScreen *) g_object_new (BAMF_TYPE_LEGACY_SCREEN, NULL);

  self->priv->legacy_screen = wnck_screen_get_default ();

  g_signal_connect (G_OBJECT (self->priv->legacy_screen), "window-opened",
                    (GCallback) handle_window_opened, self);

  g_signal_connect (G_OBJECT (self->priv->legacy_screen), "window-stacking-changed",
                    (GCallback) handle_stacking_changed, self);

  g_signal_connect (G_OBJECT (self->priv->legacy_screen), "active-window-changed",
                    (GCallback) handle_active_window_changed, self);

  return self;
}

Here is the call graph for this function:

Here is the caller graph for this function:

GType bamf_legacy_screen_get_type ( void  )
GList* bamf_legacy_screen_get_windows ( BamfLegacyScreen *  screen)

Definition at line 350 of file bamf-legacy-screen.c.

{
  g_return_val_if_fail (BAMF_IS_LEGACY_SCREEN (screen), NULL);

  return screen->priv->windows;
}

Here is the caller graph for this function:

void bamf_legacy_screen_inject_window ( BamfLegacyScreen *  screen,
guint  xid 
)

Definition at line 291 of file bamf-legacy-screen.c.

{
  g_return_if_fail (BAMF_IS_LEGACY_SCREEN (self));
  BamfLegacyWindow *window;
  GList *l;

  for (l = self->priv->windows; l; l = l->next)
    {
      window = l->data;

      if (bamf_legacy_window_get_xid (window) == xid)
        {
          return;
        }
    }

  WnckWindow *legacy_window = wnck_window_get(xid);

  if (WNCK_IS_WINDOW (legacy_window))
    {
      handle_window_opened(NULL, legacy_window, self);
    }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void bamf_legacy_screen_set_state_file ( BamfLegacyScreen *  screen,
const char *  file 
)

Definition at line 316 of file bamf-legacy-screen.c.

{
  GFile *gfile;
  GDataInputStream *stream;

  g_return_if_fail (BAMF_IS_LEGACY_SCREEN (self));

  // Disconnect our handlers so we can work purely on the file
  g_signal_handlers_disconnect_by_func (self->priv->legacy_screen, handle_window_opened, self);
  g_signal_handlers_disconnect_by_func (self->priv->legacy_screen, handle_window_closed, self);
  g_signal_handlers_disconnect_by_func (self->priv->legacy_screen, handle_stacking_changed, self);

  gfile = g_file_new_for_path (file);

  if (!file)
    {
      g_error ("Could not open file %s", file);
    }

  stream = g_data_input_stream_new (G_INPUT_STREAM (g_file_read (gfile, NULL, NULL)));

  if (!stream)
    {
      g_error ("Could not open file stream for %s", file);
    }

  self->priv->file = gfile;
  self->priv->stream = stream;

  g_timeout_add (500, (GSourceFunc) on_state_file_load_timeout, self);
}

Here is the call graph for this function:

Here is the caller graph for this function: