Back to index

bamf  0.2.120
bamf-legacy-window.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  *
00018  */
00019 
00020 
00021 #ifndef __BAMFLEGACY_WINDOW_H__
00022 #define __BAMFLEGACY_WINDOW_H__
00023 
00024 #include "config.h"
00025 
00026 #include "bamf.h"
00027 #include "bamf-view.h"
00028 #include <sys/types.h>
00029 #include <glib.h>
00030 #include <glib-object.h>
00031 #include <libwnck/libwnck.h>
00032 
00033 #define BAMF_TYPE_LEGACY_WINDOW                  (bamf_legacy_window_get_type ())
00034 #define BAMF_LEGACY_WINDOW(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_LEGACY_WINDOW, BamfLegacyWindow))
00035 #define BAMF_IS_LEGACY_WINDOW(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAMF_TYPE_LEGACY_WINDOW))
00036 #define BAMF_LEGACY_WINDOW_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), BAMF_TYPE_LEGACY_WINDOW, BamfLegacyWindowClass))
00037 #define BAMF_IS_LEGACY_WINDOW_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), BAMF_TYPE_LEGACY_WINDOW))
00038 #define BAMF_LEGACY_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAMF_TYPE_LEGACY_WINDOW, BamfLegacyWindowClass))
00039 
00040 #define BAMF_LEGACY_WINDOW_SIGNAL_NAME_CHANGED     "name-changed"
00041 #define BAMF_LEGACY_WINDOW_SIGNAL_STATE_CHANGED    "state-changed"
00042 #define BAMF_LEGACY_WINDOW_SIGNAL_GEOMETRY_CHANGED "geometry-changed"
00043 #define BAMF_LEGACY_WINDOW_SIGNAL_CLOSED           "closed"
00044 
00045 typedef struct _BamfLegacyWindow BamfLegacyWindow;
00046 typedef struct _BamfLegacyWindowClass BamfLegacyWindowClass;
00047 typedef struct _BamfLegacyWindowPrivate BamfLegacyWindowPrivate;
00048 
00049 typedef enum
00050 {
00051   BAMF_WINDOW_NORMAL,       /* document/app window */
00052   BAMF_WINDOW_DESKTOP,      /* desktop background */
00053   BAMF_WINDOW_DOCK,         /* panel */
00054   BAMF_WINDOW_DIALOG,       /* dialog */
00055   BAMF_WINDOW_TOOLBAR,      /* tearoff toolbar */
00056   BAMF_WINDOW_MENU,         /* tearoff menu */
00057   BAMF_WINDOW_UTILITY,      /* palette/toolbox window */
00058   BAMF_WINDOW_SPLASHSCREEN  /* splash screen */
00059 } BamfWindowType;
00060 
00061 typedef enum
00062 {
00063   BAMF_WINDOW_FLOATING,
00064   BAMF_WINDOW_HORIZONTAL_MAXIMIZED,
00065   BAMF_WINDOW_VERTICAL_MAXIMIZED,
00066   BAMF_WINDOW_MAXIMIZED
00067 } BamfWindowMaximizationType;
00068 
00069 struct _BamfLegacyWindowClass
00070 {
00071   GObjectClass parent;
00072 
00073   const char * (*get_name)                (BamfLegacyWindow *legacy_window);
00074   const char * (*get_class_name)          (BamfLegacyWindow *legacy_window);
00075   const char * (*get_class_instance_name) (BamfLegacyWindow *legacy_window);
00076   char       * (*get_exec_string)         (BamfLegacyWindow *legacy_window);
00077   char       * (*get_app_id)              (BamfLegacyWindow *legacy_window);
00078   char       * (*get_unique_bus_name)     (BamfLegacyWindow *legacy_window);
00079   char       * (*get_menu_object_path)    (BamfLegacyWindow *legacy_window);
00080   gint         (*get_pid)                 (BamfLegacyWindow *legacy_window);
00081   guint32      (*get_xid)                 (BamfLegacyWindow *legacy_window);
00082   gboolean     (*needs_attention)         (BamfLegacyWindow *legacy_window);
00083   gboolean     (*is_active)               (BamfLegacyWindow *legacy_window);
00084   gboolean     (*is_skip_tasklist)        (BamfLegacyWindow *legacy_window);
00085   gboolean     (*is_desktop)              (BamfLegacyWindow *legacy_window);
00086   gboolean     (*is_dialog)               (BamfLegacyWindow *legacy_window);
00087   BamfWindowMaximizationType (*maximized) (BamfLegacyWindow *legacy_window);
00088 
00089   void         (*get_geometry)         (BamfLegacyWindow *self,
00090                                         gint *x, gint *y,
00091                                         gint *width, gint *height);
00092 
00093   /*< signals >*/
00094   void     (*name_changed)     (BamfLegacyWindow *legacy_window);
00095   void     (*state_changed)    (BamfLegacyWindow *legacy_window);
00096   void     (*geometry_changed) (BamfLegacyWindow *legacy_window);
00097   void     (*closed)           (BamfLegacyWindow *legacy_window);
00098 };
00099 
00100 struct _BamfLegacyWindow
00101 {
00102   GObject parent;
00103 
00104   /* private */
00105   BamfLegacyWindowPrivate *priv;
00106 };
00107 
00108 GType              bamf_legacy_window_get_type             (void) G_GNUC_CONST;
00109 
00110 guint32            bamf_legacy_window_get_xid              (BamfLegacyWindow *self);
00111 
00112 gint               bamf_legacy_window_get_pid              (BamfLegacyWindow *self);
00113 
00114 void               bamf_legacy_window_get_geometry         (BamfLegacyWindow *self,
00115                                                             gint *x, gint *y,
00116                                                             gint *width, gint *height);
00117 
00118 gboolean           bamf_legacy_window_is_active            (BamfLegacyWindow *self);
00119 
00120 gboolean           bamf_legacy_window_is_skip_tasklist     (BamfLegacyWindow *self);
00121 
00122 gboolean           bamf_legacy_window_needs_attention      (BamfLegacyWindow *self);
00123 
00124 gboolean           bamf_legacy_window_is_closed            (BamfLegacyWindow *self);
00125 
00126 BamfWindowType     bamf_legacy_window_get_window_type      (BamfLegacyWindow *self);
00127 
00128 BamfWindowMaximizationType bamf_legacy_window_maximized    (BamfLegacyWindow *self);
00129 
00130 const char       * bamf_legacy_window_get_class_instance_name (BamfLegacyWindow *self);
00131 
00132 const char       * bamf_legacy_window_get_class_name       (BamfLegacyWindow *self);
00133 
00134 const char       * bamf_legacy_window_get_name             (BamfLegacyWindow *self);
00135 
00136 const char       * bamf_legacy_window_save_mini_icon       (BamfLegacyWindow *self);
00137 
00138 char             * bamf_legacy_window_get_exec_string      (BamfLegacyWindow *self);
00139 
00140 BamfLegacyWindow * bamf_legacy_window_get_transient        (BamfLegacyWindow *self);
00141 
00142 char             * bamf_legacy_window_get_utf8_xprop       (BamfLegacyWindow *self, const char* prop);
00143 
00144 gint               bamf_legacy_window_get_stacking_position (BamfLegacyWindow *self);
00145 
00146 void               bamf_legacy_window_reopen               (BamfLegacyWindow *self);
00147 
00148 BamfLegacyWindow * bamf_legacy_window_new                  (WnckWindow *legacy_window);
00149 
00150 #endif