/* $Id: displaymanager.hg,v 1.8 2006/04/12 11:11:24 murrayc Exp $ */

/* displaymanager.h
 *
 * Copyright (C) 2002 The gtkmm Development Team
 *
 * 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 Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#include <vector>

#include <glibmm/object.h>
#include <gdkmm/display.h>

_DEFS(gdkmm,gdk)
_PINCLUDE(glibmm/private/object_p.h)


namespace Gdk
{

/** The purpose of the GdkDisplayManager singleton object is to offer notification when displays appear or disappear or the
 * default display changes.
 */
class DisplayManager : public Glib::Object
{
  _CLASS_GOBJECT(DisplayManager,GdkDisplayManager,GDK_DISPLAY_MANAGER,Glib::Object,GObject)
protected:

public:

  _WRAP_METHOD(static Glib::RefPtr<DisplayManager> get(), gdk_display_manager_get, refreturn)
  _WRAP_METHOD(Glib::RefPtr<Display> get_default_display(), gdk_display_manager_get_default_display, refreturn)
  _WRAP_METHOD(Glib::RefPtr<const Display> get_default_display() const, gdk_display_manager_get_default_display, refreturn, constversion)

  _WRAP_METHOD(void set_default_display(const Glib::RefPtr<Display>& display), gdk_display_manager_set_default_display)

#m4 _CONVERSION(`GSList*',`std::vector< Glib::RefPtr<Display> >',`Glib::SListHandler<Glib::RefPtr<Display> >::slist_to_vector($3, Glib::OWNERSHIP_SHALLOW)')
  _WRAP_METHOD(std::vector< Glib::RefPtr<Display> > list_displays(), gdk_display_manager_list_displays)

  _WRAP_METHOD(Glib::RefPtr<Display> open_display(const Glib::ustring& name), gdk_display_manager_open_display, refreturn)

  _WRAP_PROPERTY("default-display", Glib::RefPtr<Display>)
  

#m4 _CONVERSION(`GdkDisplay*',`const Glib::RefPtr<Display>&', Glib::wrap($3, true))

  //We use no_default_handler because GdkDisplayManagerClass is private.
  
  _WRAP_SIGNAL(void display_opened(const Glib::RefPtr<Display>& display), display-opened, no_default_handler)
};

} /* namespace Gdk */

