Back to index

bamf  0.2.120
bamf-matcher.h
Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2010 Canonical Ltd
00003  *
00004  * This program is free software: you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License version 3 as
00006  * published by the Free Software Foundation.
00007  *
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  *
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
00015  *
00016  * Authored by: Jason Smith <jason.smith@canonical.com>
00017  *              Marco Trevisan (TreviƱo) <3v1n0@ubuntu.com>
00018  *
00019  */
00020 
00021 
00022 #ifndef __BAMFMATCHER_H__
00023 #define __BAMFMATCHER_H__
00024 
00025 #include "bamf.h"
00026 #include <stdio.h>
00027 #include <stdlib.h>
00028 #include <unistd.h>
00029 #include <sys/types.h>
00030 #include <gdk/gdk.h>
00031 #include <glib.h>
00032 #include <glib-object.h>
00033 #include <gio/gio.h>
00034 #include <gio/gdesktopappinfo.h>
00035 #include <libgtop-2.0/glibtop.h>
00036 #include <glibtop/procargs.h>
00037 #include <glibtop/procuid.h>
00038 #include <X11/Xatom.h>
00039 #include <X11/Xlib.h>
00040 
00041 #define BAMF_TYPE_MATCHER                 (bamf_matcher_get_type ())
00042 #define BAMF_MATCHER(obj)                 (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_MATCHER, BamfMatcher))
00043 #define BAMF_IS_MATCHER(obj)                     (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAMF_TYPE_MATCHER))
00044 #define BAMF_MATCHER_CLASS(klass)         (G_TYPE_CHECK_CLASS_CAST ((klass), BAMF_TYPE_MATCHER, BamfMatcherClass))
00045 #define BAMF_IS_MATCHER_CLASS(klass)             (G_TYPE_CHECK_CLASS_TYPE ((klass), BAMF_TYPE_MATCHER))
00046 #define BAMF_MATCHER_GET_CLASS(obj)              (G_TYPE_INSTANCE_GET_CLASS ((obj), BAMF_TYPE_MATCHER, BamfMatcherClass))
00047 
00048 #define _NET_WM_DESKTOP_FILE "_NET_WM_DESKTOP_FILE"
00049 #define WM_WINDOW_ROLE       "WM_WINDOW_ROLE"
00050 
00051 typedef struct _BamfMatcher BamfMatcher;
00052 typedef struct _BamfMatcherClass BamfMatcherClass;
00053 typedef struct _BamfMatcherPrivate BamfMatcherPrivate;
00054 
00055 struct _BamfMatcherClass
00056 {
00057   BamfDBusMatcherSkeletonClass parent;
00058 };
00059 
00060 struct _BamfMatcher
00061 {
00062   BamfDBusMatcherSkeleton parent;
00063 
00064   /* private */
00065   BamfMatcherPrivate *priv;
00066 };
00067 
00068 GType         bamf_matcher_get_type                      (void) G_GNUC_CONST;
00069 
00070 void          bamf_matcher_load_desktop_file             (BamfMatcher * self,
00071                                                           const char * desktop_file);
00072 
00073 void          bamf_matcher_register_desktop_file_for_pid (BamfMatcher * self,
00074                                                           const char *application,
00075                                                           gint pid);
00076 
00077 const char  * bamf_matcher_get_desktop_file_class        (BamfMatcher * self,
00078                                                           const char * desktop_file);
00079 
00080 const char  * bamf_matcher_get_active_application        (BamfMatcher *matcher);
00081 
00082 const char  * bamf_matcher_get_active_window             (BamfMatcher *matcher);
00083 
00084 const char  * bamf_matcher_application_for_xid           (BamfMatcher *matcher,
00085                                                           guint32 xid);
00086 
00087 gboolean      bamf_matcher_application_is_running        (BamfMatcher *matcher,
00088                                                           const char *application);
00089 
00090 GVariant    * bamf_matcher_application_dbus_paths        (BamfMatcher *matcher);
00091 
00092 GVariant    * bamf_matcher_window_dbus_paths             (BamfMatcher *matcher);
00093 
00094 const char  * bamf_matcher_dbus_path_for_application     (BamfMatcher *matcher,
00095                                                           const char *application);
00096 
00097 void          bamf_matcher_register_favorites            (BamfMatcher *matcher,
00098                                                           const char **favorites);
00099                                                           
00100 GList       * bamf_matcher_get_favorites                 (BamfMatcher *matcher);
00101 
00102 GVariant    * bamf_matcher_running_application_paths     (BamfMatcher *matcher);
00103 
00104 GVariant    * bamf_matcher_tab_dbus_paths                (BamfMatcher *matcher);
00105 
00106 GVariant    * bamf_matcher_xids_for_application          (BamfMatcher *matcher,
00107                                                           const char *application);
00108 
00109 GVariant    * bamf_matcher_get_window_stack_for_monitor  (BamfMatcher *matcher,
00110                                                           gint monitor);
00111 
00112 BamfMatcher * bamf_matcher_get_default                   (void);
00113 
00114 #endif