/* * Copyright (C) 2010 Canonical Ltd * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License version 3 as * published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * * Authored by: Jason Smith * */ #ifndef __BAMFLEGACY_WINDOW_H__ #define __BAMFLEGACY_WINDOW_H__ #include "config.h" #include "bamf.h" #include "bamf-view.h" #include #include #include #include #define BAMF_TYPE_LEGACY_WINDOW (bamf_legacy_window_get_type ()) #define BAMF_LEGACY_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BAMF_TYPE_LEGACY_WINDOW, BamfLegacyWindow)) #define BAMF_IS_LEGACY_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BAMF_TYPE_LEGACY_WINDOW)) #define BAMF_LEGACY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), BAMF_TYPE_LEGACY_WINDOW, BamfLegacyWindowClass)) #define BAMF_IS_LEGACY_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), BAMF_TYPE_LEGACY_WINDOW)) #define BAMF_LEGACY_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), BAMF_TYPE_LEGACY_WINDOW, BamfLegacyWindowClass)) #define BAMF_LEGACY_WINDOW_SIGNAL_NAME_CHANGED "name-changed" #define BAMF_LEGACY_WINDOW_SIGNAL_STATE_CHANGED "state-changed" #define BAMF_LEGACY_WINDOW_SIGNAL_GEOMETRY_CHANGED "geometry-changed" #define BAMF_LEGACY_WINDOW_SIGNAL_CLOSED "closed" typedef struct _BamfLegacyWindow BamfLegacyWindow; typedef struct _BamfLegacyWindowClass BamfLegacyWindowClass; typedef struct _BamfLegacyWindowPrivate BamfLegacyWindowPrivate; typedef enum { BAMF_WINDOW_NORMAL, /* document/app window */ BAMF_WINDOW_DESKTOP, /* desktop background */ BAMF_WINDOW_DOCK, /* panel */ BAMF_WINDOW_DIALOG, /* dialog */ BAMF_WINDOW_TOOLBAR, /* tearoff toolbar */ BAMF_WINDOW_MENU, /* tearoff menu */ BAMF_WINDOW_UTILITY, /* palette/toolbox window */ BAMF_WINDOW_SPLASHSCREEN /* splash screen */ } BamfWindowType; typedef enum { BAMF_WINDOW_FLOATING, BAMF_WINDOW_HORIZONTAL_MAXIMIZED, BAMF_WINDOW_VERTICAL_MAXIMIZED, BAMF_WINDOW_MAXIMIZED } BamfWindowMaximizationType; struct _BamfLegacyWindowClass { GObjectClass parent; const char * (*get_name) (BamfLegacyWindow *legacy_window); const char * (*get_class_name) (BamfLegacyWindow *legacy_window); char * (*get_exec_string) (BamfLegacyWindow *legacy_window); char * (*get_app_id) (BamfLegacyWindow *legacy_window); char * (*get_unique_bus_name) (BamfLegacyWindow *legacy_window); char * (*get_menu_object_path) (BamfLegacyWindow *legacy_window); gint (*get_pid) (BamfLegacyWindow *legacy_window); guint32 (*get_xid) (BamfLegacyWindow *legacy_window); gboolean (*needs_attention) (BamfLegacyWindow *legacy_window); gboolean (*is_active) (BamfLegacyWindow *legacy_window); gboolean (*is_skip_tasklist) (BamfLegacyWindow *legacy_window); gboolean (*is_desktop) (BamfLegacyWindow *legacy_window); gboolean (*is_dialog) (BamfLegacyWindow *legacy_window); BamfWindowMaximizationType (*maximized) (BamfLegacyWindow *legacy_window); void (*get_geometry) (BamfLegacyWindow *self, gint *x, gint *y, gint *width, gint *height); /*< signals >*/ void (*name_changed) (BamfLegacyWindow *legacy_window); void (*state_changed) (BamfLegacyWindow *legacy_window); void (*geometry_changed) (BamfLegacyWindow *legacy_window); void (*closed) (BamfLegacyWindow *legacy_window); }; struct _BamfLegacyWindow { GObject parent; /* private */ BamfLegacyWindowPrivate *priv; }; GType bamf_legacy_window_get_type (void) G_GNUC_CONST; guint32 bamf_legacy_window_get_xid (BamfLegacyWindow *self); gint bamf_legacy_window_get_pid (BamfLegacyWindow *self); void bamf_legacy_window_get_geometry (BamfLegacyWindow *self, gint *x, gint *y, gint *width, gint *height); gboolean bamf_legacy_window_is_active (BamfLegacyWindow *self); gboolean bamf_legacy_window_is_skip_tasklist (BamfLegacyWindow *self); gboolean bamf_legacy_window_needs_attention (BamfLegacyWindow *self); gboolean bamf_legacy_window_is_closed (BamfLegacyWindow *self); BamfWindowType bamf_legacy_window_get_window_type (BamfLegacyWindow *self); BamfWindowMaximizationType bamf_legacy_window_maximized (BamfLegacyWindow *self); #ifdef USE_GTK3 const char * bamf_legacy_window_get_class_instance_name (BamfLegacyWindow *self); #endif const char * bamf_legacy_window_get_class_name (BamfLegacyWindow *self); const char * bamf_legacy_window_get_name (BamfLegacyWindow *self); const char * bamf_legacy_window_save_mini_icon (BamfLegacyWindow *self); char * bamf_legacy_window_get_exec_string (BamfLegacyWindow *self); BamfLegacyWindow * bamf_legacy_window_get_transient (BamfLegacyWindow *self); char * bamf_legacy_window_get_app_id (BamfLegacyWindow *self); char * bamf_legacy_window_get_unique_bus_name (BamfLegacyWindow *self); char * bamf_legacy_window_get_menu_object_path (BamfLegacyWindow *self); gint bamf_legacy_window_get_stacking_position (BamfLegacyWindow *self); void bamf_legacy_window_reopen (BamfLegacyWindow *self); BamfLegacyWindow * bamf_legacy_window_new (WnckWindow *legacy_window); #endif