[maemo-commits] [maemo-commits] r12454 - projects/haf/trunk/hildon-desktop/libhildonwm

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Mon Jun 25 23:53:17 EEST 2007
Author: moimart
Date: 2007-06-25 23:53:03 +0300 (Mon, 25 Jun 2007)
New Revision: 12454

Added:
   projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-desktop.c
   projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-desktop.h
   projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-entry-info.c
   projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-entry-info.h
Removed:
   projects/haf/trunk/hildon-desktop/libhildonwm/hd-entry-info.c
   projects/haf/trunk/hildon-desktop/libhildonwm/hd-entry-info.h
Log:

	* Fixed previous commit



Deleted: projects/haf/trunk/hildon-desktop/libhildonwm/hd-entry-info.c
===================================================================

Deleted: projects/haf/trunk/hildon-desktop/libhildonwm/hd-entry-info.h
===================================================================

Added: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-desktop.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-desktop.c	2007-06-25 20:45:10 UTC (rev 12453)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-desktop.c	2007-06-25 20:53:03 UTC (rev 12454)
@@ -0,0 +1,216 @@
+/* -*- mode:C; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/* 
+ * This file is part of libhildonwm
+ *
+ * Copyright (C) 2005, 2006, 2007 Nokia Corporation.
+ *
+ * Author: Moises Martinez <moises.martinez at nokia.com>
+ * Contact: Karoliina Salminen <karoliina.t.salminen at nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "hd-wm-window.h"
+
+#include <sys/types.h>
+#include <signal.h>
+#include <string.h>
+#include <X11/Xutil.h> 		/* For WMHints */
+#include <X11/Xatom.h>
+#include <gdk/gdkx.h>
+#include <gtk/gtk.h> /* needed by hildon-navigator-main.h */
+#include <glib/gi18n.h>
+
+#include "hd-wm-application.h"
+#include "hd-wm-entry-info.h"
+
+#define HD_WM_DESKTOP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HD_WM_TYPE_DESKTOP, HDWMDesktopPrivate))
+
+static void hd_wm_desktop_entry_info_init (HDWMEntryInfoIface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (HDWMDesktop,hd_wm_desktop,G_TYPE_OBJECT,
+			 G_IMPLEMENT_INTERFACE (HD_WM_TYPE_ENTRY_INFO,
+                                                hd_wm_desktop_entry_info_init));
+
+
+
+#define HDWM_WIN_SET_FLAG(a,f)    ((a)->priv->flags |= (f))
+#define HDWM_WIN_UNSET_FLAG(a,f)  ((a)->priv->flags &= ~(f))
+#define HDWM_WIN_IS_SET_FLAG(a,f) ((a)->priv->flags & (f))
+
+struct _HDWMDesktopPrivate
+{
+  Window                  xwin;
+
+  GdkPixbuf		 *icon;
+};
+
+static const gchar *
+hd_wm_desk_info_peek_app_name (HDWMEntryInfo *info)
+{
+  return _("tana_fi_home");
+}
+
+static const gchar *
+hd_wm_desk_info_peek_title (HDWMEntryInfo *info)
+{
+  return _("tana_fi_home");
+}
+
+static gchar *
+hd_wm_desk_info_get_title (HDWMEntryInfo *info)
+{
+  return g_strdup (_("tana_fi_home"));
+}
+
+static gchar * 
+hd_wm_desk_info_get_app_name (HDWMEntryInfo *info)
+{
+  return g_strdup (_("tana_fi_home"));
+}
+
+static gchar * 
+hd_wm_desk_info_get_window_name (HDWMEntryInfo *info)
+{
+  return g_strdup (_("tana_fi_home_thumb"));
+}  
+
+static const gchar *
+hd_wm_desk_info_get_app_icon_name (HDWMEntryInfo *info)
+{
+  return "qgn_list_home";	
+}
+
+static GdkPixbuf *
+hd_wm_desk_info_get_app_icon (HDWMEntryInfo *info,
+                               gint          size,
+                               GError     **error)
+{
+  GdkPixbuf *retval;	
+  GError *load_error = NULL;
+  HDWMDesktop *desktop = (HDWMDesktop *) info;
+
+  if (desktop->priv->icon != NULL)
+    return desktop->priv->icon;	  
+
+  retval = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
+                                     "qgn_list_home",
+                                     size,
+                                     GTK_ICON_LOOKUP_NO_SVG,
+                                     &load_error);
+  if (load_error)
+  {
+    g_propagate_error (error, load_error);
+    return NULL;
+  }
+
+  desktop->priv->icon = NULL;
+  
+  return retval;
+}
+
+static gboolean
+hd_wm_desk_info_is_active (HDWMEntryInfo *info)
+{
+  return TRUE;
+}
+
+static Window
+hd_wm_desk_info_get_x_window (HDWMEntryInfo *info)
+{
+  HDWMDesktop *desktop = (HDWMDesktop *) info;
+
+  return desktop->priv->xwin;
+}
+
+static void 
+hd_wm_desktop_entry_info_init (HDWMEntryInfoIface *iface)
+{
+  iface->init		   = NULL;
+  iface->get_parent        = NULL;
+  iface->set_parent        = NULL;
+  iface->add_child         = NULL;
+  iface->remove_child      = NULL;
+  iface->get_children      = NULL;
+  iface->get_n_children    = NULL;
+  iface->peek_app_name     = hd_wm_desk_info_peek_app_name;
+  iface->peek_title        = hd_wm_desk_info_peek_title;
+  iface->get_title         = hd_wm_desk_info_get_title;
+  iface->set_title         = NULL;
+  iface->get_app_name      = hd_wm_desk_info_get_app_name;
+  iface->get_window_name   = hd_wm_desk_info_get_window_name;
+  iface->get_icon          = NULL;
+  iface->set_icon          = NULL;
+  iface->get_app_icon_name = hd_wm_desk_info_get_app_icon_name;
+  iface->get_app_icon      = hd_wm_desk_info_get_app_icon;
+  iface->close             = NULL;
+  iface->is_urgent         = NULL;
+  iface->get_ignore_urgent = NULL;
+  iface->set_ignore_urgent = NULL;
+  iface->is_active         = hd_wm_desk_info_is_active;
+  iface->is_hibernating    = NULL;
+  iface->has_extra_icon    = NULL;
+  iface->get_extra_icon    = NULL;
+  iface->get_x_window      = hd_wm_desk_info_get_x_window;
+}
+
+static void
+hd_wm_desktop_finalize (GObject *object)
+{
+  HDWMDesktop *desktop = HD_WM_DESKTOP (object);	
+
+  g_object_unref (G_OBJECT (desktop->priv->icon));
+}
+
+static void 
+hd_wm_desktop_init (HDWMDesktop *desktop)
+{
+  desktop->priv = HD_WM_DESKTOP_GET_PRIVATE (desktop);	
+
+  desktop->priv->xwin = None;
+  
+  desktop->priv->icon = NULL;
+}
+
+static void 
+hd_wm_desktop_class_init (HDWMDesktopClass *desktop_class)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (desktop_class);
+
+  object_class->finalize = hd_wm_desktop_finalize;
+	
+  g_type_class_add_private (desktop_class, sizeof (HDWMDesktopPrivate));
+}
+
+HDWMDesktop *
+hd_wm_desktop_new (void)
+{
+  return 
+    HD_WM_DESKTOP (g_object_new (HD_WM_TYPE_DESKTOP, NULL));
+}  
+
+void 
+hd_wm_desktop_set_x_window (HDWMDesktop *desktop, Window win)
+{
+  g_assert (HD_WM_IS_DESKTOP (desktop));
+
+  desktop->priv->xwin = win;
+}
+

Added: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-desktop.h
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-desktop.h	2007-06-25 20:45:10 UTC (rev 12453)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-desktop.h	2007-06-25 20:53:03 UTC (rev 12454)
@@ -0,0 +1,74 @@
+/* -*- mode:C; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+
+/* 
+ * This file is part of libhildonwm
+ *
+ * Copyright (C) 2005, 2006 Nokia Corporation.
+ *
+ * Author: Moises Martinez <moises.martinez at nokia.com>
+ * Contact: Karoliina Salminen <karoliina.t.salminen at nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+/* A HDWMDesktop is a running watched / tracked instance of a window 
+ * that references a valid HDWMApplication. A watched window *may* contain
+ * a list of views ( see below ). 
+ */
+
+#ifndef __HD_WM_DESKTOP_H__
+#define __HD_WM_DESKTOP_H__
+
+#include <libhildonwm/hd-wm.h>
+#include <libhildonwm/hd-wm-util.h>
+#include <libhildonwm/hd-wm-types.h>
+
+G_BEGIN_DECLS
+
+/* For window_sync(), should go in enum */
+
+#define HD_WM_TYPE_DESKTOP            (hd_wm_desktop_get_type ())
+#define HD_WM_DESKTOP(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), HD_WM_TYPE_DESKTOP, HDWMDesktop))
+#define HD_WM_DESKTOP_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass),  HD_WM_TYPE_DESKTOP, HDWMDesktopClass))
+#define HD_WM_IS_DESKTOP(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HD_WM_TYPE_DESKTOP))
+#define HD_IS_WM_DESKTOP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),  HD_WM_TYPE_DESKTOP))
+#define HD_WM_DESKTOP_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj),  HD_WM_TYPE_DESKTOP, HDWMDesktopClass))
+
+typedef struct _HDWMDesktopClass HDWMDesktopClass;
+typedef struct _HDWMDesktopPrivate HDWMDesktopPrivate;
+
+struct _HDWMDesktop
+{
+  GObject parent;
+ 
+  HDWMDesktopPrivate *priv; 
+};
+
+struct _HDWMDesktopClass
+{
+  GObjectClass parent_class;
+};
+
+GType 
+hd_wm_desktop_get_type (void);
+
+HDWMDesktop * hd_wm_desktop_new (void);
+
+void hd_wm_desktop_set_x_window (HDWMDesktop *desktop, Window win);
+
+G_END_DECLS
+
+#endif

Added: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-entry-info.c
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-entry-info.c	2007-06-25 20:45:10 UTC (rev 12453)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-entry-info.c	2007-06-25 20:53:03 UTC (rev 12454)
@@ -0,0 +1,370 @@
+/*
+ * This file is part of libhildonwm
+ *
+ * Copyright (C) 2007 Nokia Corporation.
+ *
+ * Author:  Moises Martinez <moises.martinez at nokia.com>
+ * Contact: Karoliina Salminen <karoliina.t.salminen at nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#include "hd-wm-entry-info.h"
+#include <gtk/gtkmarshal.h>
+#include <gtk/gtkmain.h>            /* For _gtk_boolean_handled_accumulator */
+
+#define _HD_WM_ENTRY_INFO_GET_IFACE(iface) \
+  iface = HD_WM_ENTRY_INFO_GET_IFACE (info); \
+  g_assert (iface != NULL);
+	
+
+static void hd_wm_entry_info_base_init (gpointer g_class);
+
+GType 
+hd_wm_entry_info_get_type (void)
+{
+  static GType entry_info_type = 0;
+
+  if (!entry_info_type)
+  {
+    static const GTypeInfo entry_info_info =
+    {
+      sizeof (HDWMEntryInfoIface), /* class_size */
+      hd_wm_entry_info_base_init,   /* base_init */
+      NULL,		/* base_finalize */
+      NULL,
+      NULL,		/* class_finalize */
+      NULL,		/* class_data */
+      0,
+      0,
+      NULL
+    };
+
+    entry_info_type =
+      g_type_register_static (G_TYPE_INTERFACE, "HDWMEntryInfo",
+			      &entry_info_info, 0);
+
+  }
+
+  return entry_info_type;
+}
+
+static void
+hd_wm_entry_info_base_init (gpointer g_class)
+{
+  static gboolean initialized = FALSE;
+  /* TODO: Something to inirialize? */
+  if (!initialized)
+  {
+    initialized = TRUE;
+  }
+}
+
+gboolean 
+hd_wm_entry_info_init (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  g_return_val_if_fail (info != NULL, TRUE);
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->init != NULL, TRUE);
+
+  return (* iface->init) (info);
+}	
+
+HDWMEntryInfo *
+hd_wm_entry_info_get_parent (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->get_parent != NULL, NULL);
+
+  return (* iface->get_parent) (info);
+}	
+
+void 
+hd_wm_entry_info_set_parent (HDWMEntryInfo *info, HDWMEntryInfo *parent)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_if_fail (iface->set_parent != NULL);
+
+  (* iface->set_parent) (info, parent);
+}	
+
+void 
+hd_wm_entry_info_add_child (HDWMEntryInfo *info, HDWMEntryInfo *child)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_if_fail (iface->add_child != NULL);
+
+  (* iface->add_child) (info, child);
+}
+
+gboolean 
+hd_wm_entry_info_remove_child (HDWMEntryInfo *info, HDWMEntryInfo *child)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->remove_child != NULL, FALSE);
+
+  return (* iface->remove_child) (info, child);
+}
+
+const GList *
+hd_wm_entry_info_get_children (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->get_children != NULL, NULL);
+
+  return (* iface->get_children) (info);
+}
+
+gint 
+hd_wm_entry_info_get_n_children (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->get_n_children != NULL,0);
+  
+  return (* iface->get_n_children) (info);
+}	
+
+const gchar *
+hd_wm_entry_info_peek_app_name (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->peek_app_name != NULL, NULL);
+
+  return (* iface->peek_app_name) (info);
+}
+
+const gchar *
+hd_wm_entry_info_peek_title (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->peek_title != NULL, NULL);
+
+  return (* iface->peek_title) (info);
+}	
+
+gchar * 
+hd_wm_entry_info_get_title (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->get_title != NULL, NULL);
+
+  return (* iface->get_title) (info);
+}
+
+void 
+hd_wm_entry_info_set_title (HDWMEntryInfo *info, const gchar *title)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_if_fail (iface->set_title != NULL);
+
+  (* iface->set_title) (info, title);
+}	
+
+gchar * 
+hd_wm_entry_info_get_app_name (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->get_app_name != NULL, NULL);
+  
+  return (* iface->get_app_name) (info);
+}
+
+gchar * 
+hd_wm_entry_info_get_window_name (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->get_window_name != NULL, NULL);
+
+  return (* iface->get_window_name) (info);
+}	
+
+GdkPixbuf *
+hd_wm_entry_info_get_icon (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->get_icon != NULL, NULL);
+
+  return (* iface->get_icon) (info);
+}
+
+void 
+hd_wm_entry_info_set_icon (HDWMEntryInfo *info, GdkPixbuf *icon)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_if_fail (iface->set_icon != NULL);
+
+  (* iface->set_icon) (info, icon);
+}
+
+const gchar *
+hd_wm_entry_info_get_app_icon_name (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->get_app_icon_name != NULL, NULL);
+  
+  return (* iface->get_app_icon_name) (info);
+}
+
+GdkPixbuf *
+hd_wm_entry_info_get_app_icon (HDWMEntryInfo *info,
+			       gint           size,
+			       GError     **error)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->get_app_icon != NULL, NULL);
+
+  return (* iface->get_app_icon) (info, size, error);
+}
+
+void 
+hd_wm_entry_info_close (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_if_fail (iface->close != NULL);
+
+  (* iface->close) (info);
+}	
+
+gboolean 
+hd_wm_entry_info_is_urgent (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->is_urgent != NULL, FALSE);
+
+  return (* iface->is_urgent) (info);
+}	
+
+gboolean 
+hd_wm_entry_info_get_ignore_urgent (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface)
+  g_return_val_if_fail (iface->get_ignore_urgent != NULL, FALSE);
+
+  return (* iface->get_ignore_urgent) (info);
+}	
+
+void 
+hd_wm_entry_info_set_ignore_urgent (HDWMEntryInfo *info,
+                                    gboolean       ignore)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_if_fail (iface->set_ignore_urgent != NULL);
+
+  (* iface->set_ignore_urgent) (info, ignore);
+}
+
+gboolean 
+hd_wm_entry_info_is_active (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  if (info == NULL)
+    return FALSE;	  
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->is_active != NULL, FALSE);
+  
+  return (* iface->is_active) (info);
+}	
+
+gboolean 
+hd_wm_entry_info_is_hibernating (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->is_hibernating != NULL, FALSE);
+
+  return (* iface->is_hibernating) (info);
+}	
+
+gboolean 
+hd_wm_entry_info_has_extra_icon (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->has_extra_icon != NULL, FALSE);
+
+  return (* iface->has_extra_icon) (info);
+}	
+
+const gchar *
+hd_wm_entry_info_get_extra_icon (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->get_extra_icon != NULL, NULL);
+
+  return (* iface->get_extra_icon) (info);
+}	
+
+Window
+hd_wm_entry_info_get_x_window (HDWMEntryInfo *info)
+{
+  HDWMEntryInfoIface *iface;
+
+  _HD_WM_ENTRY_INFO_GET_IFACE (iface);
+  g_return_val_if_fail (iface->get_x_window != NULL, None);  
+
+  return (* iface->get_x_window) (info);
+}
+

Added: projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-entry-info.h
===================================================================
--- projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-entry-info.h	2007-06-25 20:45:10 UTC (rev 12453)
+++ projects/haf/trunk/hildon-desktop/libhildonwm/hd-wm-entry-info.h	2007-06-25 20:53:03 UTC (rev 12454)
@@ -0,0 +1,161 @@
+/*
+ * This file is part of libhildonwm
+ *
+ * Copyright (C) 2007 Nokia Corporation.
+ *
+ * Author:  Moises Martinez <moises.martinez at nokia.com>
+ * Contact: Karoliina Salminen <karoliina.t.salminen at nokia.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * as published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This library 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
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ *
+ */
+
+#ifndef __HD_WM_ENTRY_INFO_H__
+#define __HD_WM_ENTRY_INFO_H__
+
+#include <glib-object.h>
+#include <gdk/gdk.h>
+#include <gdk/gdkpixbuf.h>
+#include <X11/Xlib.h>
+
+G_BEGIN_DECLS
+
+#define HD_WM_TYPE_ENTRY_INFO           (hd_wm_entry_info_get_type ())
+#define HD_WM_ENTRY_INFO(obj)           (G_TYPE_CHECK_INSTANCE_CAST ((obj), HD_WM_TYPE_ENTRY_INFO, HDWMEntryInfo))
+#define HD_WM_IS_ENTRY_INFO(obj)        (G_TYPE_CHECK_INSTANCE_TYPE ((obj), HD_WM_TYPE_ENTRY_INFO))
+#define HD_WM_ENTRY_INFO_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), HD_WM_TYPE_ENTRY_INFO, HDWMEntryInfoIface))
+
+typedef struct _HDWMEntryInfo HDWMEntryInfo;
+typedef struct _HDWMEntryInfoIface HDWMEntryInfoIface;
+
+struct _HDWMEntryInfoIface
+{
+  GTypeInterface g_iface;
+
+  gboolean       (*init)	    (HDWMEntryInfo *info);
+
+  HDWMEntryInfo *(*get_parent)      (HDWMEntryInfo *info);
+  
+  void		 (*set_parent)      (HDWMEntryInfo *info,
+		  		     HDWMEntryInfo *parent);
+
+  void           (*add_child)       (HDWMEntryInfo *info,
+	                             HDWMEntryInfo *child);
+
+  gboolean       (*remove_child)   (HDWMEntryInfo *info,
+                           	    HDWMEntryInfo *child);
+
+  const GList    *(*get_children)   (HDWMEntryInfo *info);
+
+  gint           (*get_n_children) (HDWMEntryInfo *info);
+
+  const gchar   *(*peek_app_name)  (HDWMEntryInfo *info);
+
+  const gchar   *(*peek_title)     (HDWMEntryInfo *info);
+
+  gchar         *(*get_title)      (HDWMEntryInfo *info);
+
+  void           (*set_title)      (HDWMEntryInfo *info,
+                                            	     const gchar *title);
+
+  gchar         *(*get_app_name)   (HDWMEntryInfo *info);
+
+  gchar         *(*get_window_name) (HDWMEntryInfo *info);
+
+  GdkPixbuf     *(*get_icon)       (HDWMEntryInfo *info);
+
+  void           (*set_icon)       (HDWMEntryInfo *info,
+                                            	     GdkPixbuf   *icon);
+
+  const gchar   *(*get_app_icon_name) (HDWMEntryInfo *info);
+
+  GdkPixbuf     *(*get_app_icon)      (HDWMEntryInfo *info,
+                                              		gint         size,
+                                              		GError     **error);
+
+  void           (*close)          (HDWMEntryInfo *info);
+
+  gboolean       (*is_active)      (HDWMEntryInfo *info);
+
+  gboolean       (*is_hibernating) (HDWMEntryInfo *info);
+
+  gboolean       (*has_extra_icon)    (HDWMEntryInfo *info);
+  const gchar   *(*get_extra_icon)    (HDWMEntryInfo *info);
+  
+  Window         (*get_x_window)   (HDWMEntryInfo *info);
+
+  gboolean       (*is_urgent)      (HDWMEntryInfo *info);
+
+  gboolean       (*get_ignore_urgent) (HDWMEntryInfo *info);
+
+  void           (*set_ignore_urgent) (HDWMEntryInfo *info,
+                                              		gboolean     ignore); 
+	
+};
+
+GType hd_wm_entry_info_get_type (void);
+
+gboolean       hd_wm_entry_info_init          (HDWMEntryInfo *info);
+
+HDWMEntryInfo *hd_wm_entry_info_get_parent      (HDWMEntryInfo *info);
+void 	       hd_wm_entry_info_set_parent    (HDWMEntryInfo *info,
+						 HDWMEntryInfo *parent);
+
+void         hd_wm_entry_info_add_child       (HDWMEntryInfo *info,
+                                               HDWMEntryInfo *child);
+
+gboolean     hd_wm_entry_info_remove_child    (HDWMEntryInfo *info,
+                                               HDWMEntryInfo *child);
+
+const GList* hd_wm_entry_info_get_children    (HDWMEntryInfo *info);
+gint         hd_wm_entry_info_get_n_children  (HDWMEntryInfo *info);
+
+const gchar *hd_wm_entry_info_peek_app_name   (HDWMEntryInfo *info);
+const gchar *hd_wm_entry_info_peek_title      (HDWMEntryInfo *info);
+gchar *      hd_wm_entry_info_get_title       (HDWMEntryInfo *info);
+void         hd_wm_entry_info_set_title       (HDWMEntryInfo *info,
+                                              const gchar *title);
+
+gchar *      hd_wm_entry_info_get_app_name    (HDWMEntryInfo *info);
+gchar *      hd_wm_entry_info_get_window_name (HDWMEntryInfo *info);
+GdkPixbuf *  hd_wm_entry_info_get_icon        (HDWMEntryInfo *info);
+
+void         hd_wm_entry_info_set_icon        (HDWMEntryInfo *info,
+                                               GdkPixbuf   *icon);
+
+const gchar *hd_wm_entry_info_get_app_icon_name (HDWMEntryInfo *info);
+GdkPixbuf *  hd_wm_entry_info_get_app_icon      (HDWMEntryInfo *info,
+                                              gint         size,
+                                              GError     **error);
+
+void         hd_wm_entry_info_close             (HDWMEntryInfo *info);
+
+gboolean     hd_wm_entry_info_is_urgent         (HDWMEntryInfo *info);
+gboolean     hd_wm_entry_info_get_ignore_urgent (HDWMEntryInfo *info);
+void         hd_wm_entry_info_set_ignore_urgent (HDWMEntryInfo *info,
+                                              gboolean     ignore);
+
+gboolean     hd_wm_entry_info_is_active         (HDWMEntryInfo *info);
+
+gboolean     hd_wm_entry_info_is_hibernating    (HDWMEntryInfo *info);
+
+gboolean     hd_wm_entry_info_has_extra_icon    (HDWMEntryInfo *info);
+const gchar *hd_wm_entry_info_get_extra_icon    (HDWMEntryInfo *info);
+Window       hd_wm_entry_info_get_x_window      (HDWMEntryInfo *info);
+
+G_END_DECLS
+
+#endif/*__HD_WM_ENTRY_INFO_H__*/


More information about the maemo-commits mailing list