BamfMatcher

BamfMatcher — The base class for all matchers

Synopsis

                    BamfMatcher;
                    BamfMatcherClass;
                    BamfMatcherPrivate;
BamfMatcher *       bamf_matcher_get_default            (void);
BamfApplication *   bamf_matcher_get_active_application (BamfMatcher *matcher);
BamfWindow *        bamf_matcher_get_active_window      (BamfMatcher *matcher);
BamfApplication *   bamf_matcher_get_application_for_xid
                                                        (BamfMatcher *matcher,
                                                         guint32 xid);
BamfApplication *   bamf_matcher_get_application_for_window
                                                        (BamfMatcher *matcher,
                                                         BamfWindow *window);
gboolean            bamf_matcher_application_is_running (BamfMatcher *matcher,
                                                         const gchar *application);
GList *             bamf_matcher_get_applications       (BamfMatcher *matcher);
void                bamf_matcher_register_favorites     (BamfMatcher *matcher,
                                                         const gchar **favorites);
GList *             bamf_matcher_get_running_applications
                                                        (BamfMatcher *matcher);
GList *             bamf_matcher_get_tabs               (BamfMatcher *matcher);
GArray *            bamf_matcher_get_xids_for_application
                                                        (BamfMatcher *matcher,
                                                         const gchar *application);
GList *             bamf_matcher_get_windows            (BamfMatcher *matcher);
BamfApplication *   bamf_matcher_get_application_for_desktop_file
                                                        (BamfMatcher *matcher,
                                                         const gchar *desktop_file_path,
                                                         gboolean create_if_not_found);

Object Hierarchy

  GObject
   +----BamfMatcher

Signals

  "active-application-changed"                     
  "active-window-changed"                          
  "view-closed"                                    
  "view-opened"                                    

Description

BamfMatcher is the base class that all matchers need to derive from.

Details

BamfMatcher

typedef struct _BamfMatcher BamfMatcher;


BamfMatcherClass

typedef struct {
  GObjectClass parent_class;
} BamfMatcherClass;


BamfMatcherPrivate

typedef struct _BamfMatcherPrivate BamfMatcherPrivate;


bamf_matcher_get_default ()

BamfMatcher *       bamf_matcher_get_default            (void);

Returns the default matcher. This matcher is owned by bamf and shared between other callers.

Returns :

A new BamfMatcher. [transfer none]

bamf_matcher_get_active_application ()

BamfApplication *   bamf_matcher_get_active_application (BamfMatcher *matcher);

Used to fetch the active BamfApplication.

matcher :

a BamfMatcher

Returns :

The active BamfApplication. [transfer none]

bamf_matcher_get_active_window ()

BamfWindow *        bamf_matcher_get_active_window      (BamfMatcher *matcher);

Used to fetch the active BamfWindow.

matcher :

a BamfMatcher

Returns :

The active BamfWindow. [transfer none]

bamf_matcher_get_application_for_xid ()

BamfApplication *   bamf_matcher_get_application_for_xid
                                                        (BamfMatcher *matcher,
                                                         guint32 xid);

Used to fetch the BamfApplication containing the passed xid.

matcher :

a BamfMatcher

xid :

The XID to search for

Returns :

The BamfApplication representing the xid passed, or NULL if none exists. [transfer container]

bamf_matcher_get_application_for_window ()

BamfApplication *   bamf_matcher_get_application_for_window
                                                        (BamfMatcher *matcher,
                                                         BamfWindow *window);

Used to fetch the BamfApplication containing the passed window.

matcher :

a BamfMatcher

window :

The window to look for

Returns :

The BamfApplication representing the xid passed, or NULL if none exists. [transfer container]

bamf_matcher_application_is_running ()

gboolean            bamf_matcher_application_is_running (BamfMatcher *matcher,
                                                         const gchar *application);

matcher :

application :

Returns :


bamf_matcher_get_applications ()

GList *             bamf_matcher_get_applications       (BamfMatcher *matcher);

Used to fetch all xid's associated with an application. Useful for performing window

matcher :

a BamfMatcher

Returns :

A list of xids. [element-type guint32][transfer none guint32]

bamf_matcher_register_favorites ()

void                bamf_matcher_register_favorites     (BamfMatcher *matcher,
                                                         const gchar **favorites);

Used to effect how bamf performs matching. Desktop files passed to this method will be prefered by bamf to system desktop files.

matcher :

a BamfMatcher

favorites :

an array of strings, each containing an absolute path to a .desktop file

bamf_matcher_get_running_applications ()

GList *             bamf_matcher_get_running_applications
                                                        (BamfMatcher *matcher);

Used to fetch all BamfApplication's which are running.

matcher :

a BamfMatcher

Returns :

A list of BamfApplication's. [element-type Bamf.Application][transfer container Bamf.Application]

bamf_matcher_get_tabs ()

GList *             bamf_matcher_get_tabs               (BamfMatcher *matcher);

Used to fetch all BamfView's representing tabs. Currently unused.

matcher :

a BamfMatcher

Returns :

A list of BamfViews's. [element-type Bamf.View][transfer container Bamf.View]

bamf_matcher_get_xids_for_application ()

GArray *            bamf_matcher_get_xids_for_application
                                                        (BamfMatcher *matcher,
                                                         const gchar *application);

matcher :

application :

Returns :


bamf_matcher_get_windows ()

GList *             bamf_matcher_get_windows            (BamfMatcher *matcher);

Used to fetch all windows that BAMF knows about.

matcher :

a BamfMatcher

Returns :

A list of windows. [element-type Bamf.View][transfer container Bamf.View]

bamf_matcher_get_application_for_desktop_file ()

BamfApplication *   bamf_matcher_get_application_for_desktop_file
                                                        (BamfMatcher *matcher,
                                                         const gchar *desktop_file_path,
                                                         gboolean create_if_not_found);

matcher :

desktop_file_path :

create_if_not_found :

Returns :

Signal Details

The "active-application-changed" signal

void                user_function                      (BamfMatcher *bamfmatcher,
                                                        GObject     *arg1,
                                                        GObject     *arg2,
                                                        gpointer     user_data)

bamfmatcher :

the object which received the signal.

arg1 :

arg2 :

user_data :

user data set when the signal handler was connected.

The "active-window-changed" signal

void                user_function                      (BamfMatcher *bamfmatcher,
                                                        GObject     *arg1,
                                                        GObject     *arg2,
                                                        gpointer     user_data)

bamfmatcher :

the object which received the signal.

arg1 :

arg2 :

user_data :

user data set when the signal handler was connected.

The "view-closed" signal

void                user_function                      (BamfMatcher *bamfmatcher,
                                                        GObject     *arg1,
                                                        gpointer     user_data)

bamfmatcher :

the object which received the signal.

arg1 :

user_data :

user data set when the signal handler was connected.

The "view-opened" signal

void                user_function                      (BamfMatcher *bamfmatcher,
                                                        GObject     *arg1,
                                                        gpointer     user_data)

bamfmatcher :

the object which received the signal.

arg1 :

user_data :

user data set when the signal handler was connected.