Logo Search packages:      
Sourcecode: ardour version File versions  Download package

window.cc

// Generated by gtkmmproc -- DO NOT MODIFY!

#include <gdkmm/window.h>
#include <gdkmm/private/window_p.h>

#include <gdk/gdkenumtypes.h>
// -*- c++ -*-
/* $Id: window.cc 4 2005-05-13 20:47:18Z taybin $ */

/* Copyright 1998-2002 The gtkmm Development Team
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the Free
 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

#include <gdk/gdkwindow.h>
#include <gdkmm/pixmap.h>
#include <gdkmm/cursor.h>
#include <gdkmm/types.h>


namespace Gdk
{

Window::Window(const Glib::RefPtr<Window>& parent, GdkWindowAttr* attributes, int attributes_mask)
:
  Drawable((GdkDrawable*) gdk_window_new(parent->gobj(), attributes, attributes_mask))
{
  //GdkWindow is X11/win32-specific, so we probably can't derived our own GType.
}

00043 void Window::set_cursor()
{
  gdk_window_set_cursor(gobj(), 0);
}

00048 GrabStatus Window::pointer_grab(bool owner_events, EventMask event_mask, const Cursor& cursor, guint32 timestamp)
{
  return ((GrabStatus)(gdk_pointer_grab(gobj(), static_cast<int>(owner_events), ((GdkEventMask)(event_mask)), 0, (cursor).gobj_copy(), timestamp)));
}

00053 GrabStatus Window::pointer_grab(bool owner_events, EventMask event_mask, guint32 timestamp)
{
  return ((GrabStatus)(gdk_pointer_grab(gobj(), static_cast<int>(owner_events), ((GdkEventMask)(event_mask)), 0, 0, timestamp)));
}

//static
void Window::unset_sm_client_id()
{
  gdk_set_sm_client_id(0 /* see GDK docs */);
}

void Window::set_icon(const Glib::RefPtr<Window>& icon_window, const Glib::RefPtr<Pixmap>& pixmap)
{
  gdk_window_set_icon(gobj(), icon_window->gobj(), pixmap->gobj(), 0); /* See GDK docs */  
}
  
void Window::unset_icon()
{
  gdk_window_set_icon(gobj(), 0, 0, 0); /* See GDK docs */
}

void Window::unset_shape_combine_mask()
{
  gdk_window_shape_combine_mask(gobj(), 0, 0, 0); //See GDK docs.
} 

void Window::get_internal_paint_info(Glib::RefPtr<Drawable>& real_drawable, int& x_offset, int& y_offset) const
{
  GdkDrawable* temp_drawable = 0;
  gdk_window_get_internal_paint_info(const_cast<GdkWindow*>(gobj()), &temp_drawable, &x_offset, &y_offset);
  real_drawable = Glib::wrap(temp_drawable);
}

} // namespace Gdk


namespace
{
} // anonymous namespace

// static
GType Glib::Value<Gdk::EventMask>::value_type()
{
  return gdk_event_mask_get_type();
}

// static
GType Glib::Value<Gdk::WindowState>::value_type()
{
  return gdk_window_state_get_type();
}

// static
GType Glib::Value<Gdk::WindowType>::value_type()
{
  return gdk_window_type_get_type();
}

// static
GType Glib::Value<Gdk::WindowAttributesType>::value_type()
{
  return gdk_window_attributes_type_get_type();
}

// static
GType Glib::Value<Gdk::WindowHints>::value_type()
{
  return gdk_window_hints_get_type();
}

// static
GType Glib::Value<Gdk::WindowTypeHint>::value_type()
{
  return gdk_window_type_hint_get_type();
}

// static
GType Glib::Value<Gdk::WMDecoration>::value_type()
{
  return gdk_wm_decoration_get_type();
}

// static
GType Glib::Value<Gdk::WMFunction>::value_type()
{
  return gdk_wm_function_get_type();
}

// static
GType Glib::Value<Gdk::WindowEdge>::value_type()
{
  return gdk_window_edge_get_type();
}

// static
GType Glib::Value<Gdk::Gravity>::value_type()
{
  return gdk_gravity_get_type();
}

// static
GType Glib::Value<Gdk::GrabStatus>::value_type()
{
  return gdk_grab_status_get_type();
}


namespace Glib
{

00163 Glib::RefPtr<Gdk::Window> wrap(GdkWindowObject* object, bool take_copy)
{
  return Glib::RefPtr<Gdk::Window>( dynamic_cast<Gdk::Window*> (Glib::wrap_auto ((GObject*)(object), take_copy)) );
  //We use dynamic_cast<> in case of multiple inheritance.
}

} /* namespace Glib */


namespace Gdk
{


/* The *_Class implementation: */

const Glib::Class& Window_Class::init()
{
  if(!gtype_) // create the GType if necessary
  {
    // Glib::Class has to know the class init function to clone custom types.
    class_init_func_ = &Window_Class::class_init_function;

    // This is actually just optimized away, apparently with no harm.
    // Make sure that the parent type has been created.
    //CppClassParent::CppObjectType::get_type();

    // Create the wrapper type, with the same class/instance size as the base type.
    register_derived_type(gdk_window_object_get_type());

    // Add derived versions of interfaces, if the C type implements any interfaces:
  }

  return *this;
}

void Window_Class::class_init_function(void* g_class, void* class_data)
{
  BaseClassType *const klass = static_cast<BaseClassType*>(g_class);
  CppClassParent::class_init_function(klass, class_data);

}


Glib::ObjectBase* Window_Class::wrap_new(GObject* object)
{
  return new Window((GdkWindow*)object);
}


/* The implementation: */

00214 GdkWindow* Window::gobj_copy()
{
  reference();
  return gobj();
}

Window::Window(const Glib::ConstructParams& construct_params)
:
  Gdk::Drawable(construct_params)
{}

Window::Window(GdkWindow* castitem)
:
  Gdk::Drawable((GdkDrawable*)(castitem))
{}

Window::~Window()
{}


Window::CppClassType Window::window_class_; // initialize static member

GType Window::get_type()
{
  return window_class_.init().get_type();
}

GType Window::get_base_type()
{
  return gdk_window_object_get_type();
}


Glib::RefPtr<Window> Window::create(const Glib::RefPtr<Window>& parent, GdkWindowAttr* attributes, int attributes_mask)
{
  return Glib::RefPtr<Window>( new Window(parent, attributes, attributes_mask) );
}
00251 WindowType Window::get_window_type() const
{
  return ((WindowType)(gdk_window_get_window_type(const_cast<GdkWindow*>(gobj()))));
}

00256 void Window::show()
{
  gdk_window_show(gobj());
}

00261 void Window::hide()
{
  gdk_window_hide(gobj());
}

00266 void Window::withdraw()
{
  gdk_window_withdraw(gobj());
}

00271 void Window::show_unraised()
{
  gdk_window_show_unraised(gobj());
}

00276 void Window::move(int x, int y)
{
  gdk_window_move(gobj(), x, y);
}

00281 void Window::resize(int width, int height)
{
  gdk_window_resize(gobj(), width, height);
}

00286 void Window::move_resize(int x, int y, int width, int height)
{
  gdk_window_move_resize(gobj(), x, y, width, height);
}

00291 void Window::reparent(const Glib::RefPtr<Window>& new_parent, int x, int y)
{
  gdk_window_reparent(gobj(), Glib::unwrap(new_parent), x, y);
}

00296 void Window::clear()
{
  gdk_window_clear(gobj());
}

00301 void Window::clear_area(int x, int y, int width, int height)
{
  gdk_window_clear_area(gobj(), x, y, width, height);
}

00306 void Window::clear_area_e(int x, int y, int width, int height)
{
  gdk_window_clear_area_e(gobj(), x, y, width, height);
}

00311 void Window::raise()
{
  gdk_window_raise(gobj());
}

00316 void Window::lower()
{
  gdk_window_lower(gobj());
}

00321 void Window::focus(guint32 timestamp)
{
  gdk_window_focus(gobj(), timestamp);
}

00326 void Window::set_user_data(gpointer user_data)
{
  gdk_window_set_user_data(gobj(), user_data);
}

00331 void Window::set_override_redirect(bool override_redirect)
{
  gdk_window_set_override_redirect(gobj(), static_cast<int>(override_redirect));
}

00336 void Window::add_filter(GdkFilterFunc function, gpointer data)
{
  gdk_window_add_filter(gobj(), function, data);
}

00341 void Window::remove_filter(GdkFilterFunc function, gpointer data)
{
  gdk_window_remove_filter(gobj(), function, data);
}

00346 void Window::scroll(int dx, int dy)
{
  gdk_window_scroll(gobj(), dx, dy);
}

00351 void Window::shape_combine_mask(const Glib::RefPtr<Bitmap>& mask, int x, int y)
{
  gdk_window_shape_combine_mask(gobj(), Glib::unwrap(mask), x, y);
}

00356 void Window::shape_combine_region(const Region& shape_region, int offset_x, int offset_y)
{
  gdk_window_shape_combine_region(gobj(), const_cast<GdkRegion*>((shape_region).gobj()), offset_x, offset_y);
}

00361 void Window::set_child_shapes()
{
  gdk_window_set_child_shapes(gobj());
}

00366 void Window::merge_child_shapes()
{
  gdk_window_merge_child_shapes(gobj());
}

00371 bool Window::is_visible() const
{
  return gdk_window_is_visible(const_cast<GdkWindow*>(gobj()));
}

00376 bool Window::is_viewable() const
{
  return gdk_window_is_viewable(const_cast<GdkWindow*>(gobj()));
}

00381 WindowState Window::get_state() const
{
  return ((WindowState)(gdk_window_get_state(const_cast<GdkWindow*>(gobj()))));
}

00386 bool Window::set_static_gravities(bool use_static)
{
  return gdk_window_set_static_gravities(gobj(), static_cast<int>(use_static));
}

00391 void Window::set_type_hint(WindowTypeHint hint)
{
  gdk_window_set_type_hint(gobj(), ((GdkWindowTypeHint)(hint)));
}

00396 void Window::set_modal_hint(bool modal)
{
  gdk_window_set_modal_hint(gobj(), static_cast<int>(modal));
}

00401 void Window::set_geometry_hints(const Geometry& geometry, WindowHints geom_mask)
{
  gdk_window_set_geometry_hints(gobj(), const_cast<GdkGeometry*>(&(geometry)), ((GdkWindowHints)(geom_mask)));
}

00406 void Window::set_sm_client_id(const Glib::ustring& sm_client_id)
{
  gdk_set_sm_client_id(sm_client_id.c_str());
}

00411 void Window::begin_paint_rect(Rectangle& rectangle)
{
  gdk_window_begin_paint_rect(gobj(), (rectangle).gobj());
}

00416 void Window::begin_paint_region(const Region& region)
{
  gdk_window_begin_paint_region(gobj(), const_cast<GdkRegion*>((region).gobj()));
}

00421 void Window::end_paint()
{
  gdk_window_end_paint(gobj());
}

00426 void Window::set_title(const Glib::ustring& title)
{
  gdk_window_set_title(gobj(), title.c_str());
}

00431 void Window::set_role(const Glib::ustring& role)
{
  gdk_window_set_role(gobj(), role.c_str());
}

00436 void Window::set_transient_for(const Glib::RefPtr<Window>& parent)
{
  gdk_window_set_transient_for(gobj(), Glib::unwrap(parent));
}

00441 void Window::set_background(const Color& color)
{
  gdk_window_set_background(gobj(), (color).gobj());
}

00446 void Window::set_back_pixmap(const Glib::RefPtr<Pixmap>& pixmap, bool parent_relative)
{
  gdk_window_set_back_pixmap(gobj(), Glib::unwrap(pixmap), static_cast<int>(parent_relative));
}

00451 void Window::set_cursor(const Cursor& cursor)
{
  gdk_window_set_cursor(gobj(), (cursor).gobj_copy());
}

00456 void Window::get_user_data(gpointer* data)
{
  gdk_window_get_user_data(gobj(), data);
}

00461 void Window::get_geometry(int& x, int& y, int& width, int& height, int& depth) const
{
  gdk_window_get_geometry(const_cast<GdkWindow*>(gobj()), &x, &y, &width, &height, &depth);
}

00466 void Window::get_position(int& x, int& y) const
{
  gdk_window_get_position(const_cast<GdkWindow*>(gobj()), &x, &y);
}

00471 int Window::get_origin(int& x, int& y) const
{
  return gdk_window_get_origin(const_cast<GdkWindow*>(gobj()), &x, &y);
}

00476 void Window::get_root_origin(int& x, int& y) const
{
  gdk_window_get_root_origin(const_cast<GdkWindow*>(gobj()), &x, &y);
}

00481 void Window::get_frame_extents(Rectangle& rect)
{
  gdk_window_get_frame_extents(gobj(), (rect).gobj());
}

00486 Glib::RefPtr<Window> Window::get_pointer(int& x, int& y, ModifierType& mask)
{

  Glib::RefPtr<Window> retvalue = Glib::wrap((GdkWindowObject*)(gdk_window_get_pointer(gobj(), &x, &y, ((GdkModifierType*) &(mask)))));

  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

00496 Glib::RefPtr<Window> Window::get_parent()
{

  Glib::RefPtr<Window> retvalue = Glib::wrap((GdkWindowObject*)(gdk_window_get_parent(gobj())));

  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

00506 Glib::RefPtr<const Window> Window::get_parent() const
{

  Glib::RefPtr<const Window> retvalue = Glib::wrap((GdkWindowObject*)(gdk_window_get_parent(const_cast<GdkWindow*>(gobj()))));

  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

00516 Glib::RefPtr<Window> Window::get_toplevel()
{

  Glib::RefPtr<Window> retvalue = Glib::wrap((GdkWindowObject*)(gdk_window_get_toplevel(gobj())));

  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

00526 Glib::RefPtr<const Window> Window::get_toplevel() const
{

  Glib::RefPtr<const Window> retvalue = Glib::wrap((GdkWindowObject*)(gdk_window_get_toplevel(const_cast<GdkWindow*>(gobj()))));

  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

00536 Glib::ListHandle< Glib::RefPtr<Window> > Window::get_children()
{
  return Glib::ListHandle< Glib::RefPtr<Window> >(gdk_window_get_children(gobj()), Glib::OWNERSHIP_SHALLOW);
}

00541 Glib::ListHandle< Glib::RefPtr<const Window> > Window::get_children() const
{
  return Glib::ListHandle< Glib::RefPtr<const Window> >(gdk_window_get_children(const_cast<GdkWindow*>(gobj())), Glib::OWNERSHIP_SHALLOW);
}

00546 EventMask Window::get_events() const
{
  return ((EventMask)(gdk_window_get_events(const_cast<GdkWindow*>(gobj()))));
}

00551 void Window::set_events(EventMask event_mask)
{
  gdk_window_set_events(gobj(), ((GdkEventMask)(event_mask)));
}

00556 void Window::set_icon_list(const Glib::ListHandle< Glib::RefPtr<Gdk::Pixbuf> >& pixbufs)
{
  gdk_window_set_icon_list(gobj(), pixbufs.data());
}

00561 void Window::set_icon(const Glib::RefPtr<Window>& icon_window, const Glib::RefPtr<Pixmap>& pixmap, const Glib::RefPtr<Bitmap>& mask)
{
  gdk_window_set_icon(gobj(), Glib::unwrap(icon_window), Glib::unwrap(pixmap), Glib::unwrap(mask));
}

00566 void Window::set_icon_name(const Glib::ustring& name)
{
  gdk_window_set_icon_name(gobj(), name.c_str());
}

00571 void Window::set_group(const Glib::RefPtr<Window>& leader)
{
  gdk_window_set_group(gobj(), Glib::unwrap(leader));
}

00576 Glib::RefPtr<Window> Window::get_group()
{
  return Glib::wrap((GdkWindowObject*)(gdk_window_get_group(gobj())));
}

00581 Glib::RefPtr<const Window> Window::get_group() const
{
  return Glib::wrap((GdkWindowObject*)(gdk_window_get_group(const_cast<GdkWindow*>(gobj()))));
}

00586 void Window::set_decorations(WMDecoration decorations)
{
  gdk_window_set_decorations(gobj(), ((GdkWMDecoration)(decorations)));
}

00591 bool Window::get_decorations(WMDecoration& decorations) const
{
  return gdk_window_get_decorations(const_cast<GdkWindow*>(gobj()), ((GdkWMDecoration*) &(decorations)));
}

00596 void Window::set_functions(WMFunction functions)
{
  gdk_window_set_functions(gobj(), ((GdkWMFunction)(functions)));
}

00601 Glib::ListHandle< Glib::RefPtr<Window> > Window::get_toplevels()
{
  return Glib::ListHandle< Glib::RefPtr<Window> >(gdk_window_get_toplevels(), Glib::OWNERSHIP_SHALLOW);
}

00606 void Window::iconify()
{
  gdk_window_iconify(gobj());
}

00611 void Window::deiconify()
{
  gdk_window_deiconify(gobj());
}

00616 void Window::stick()
{
  gdk_window_stick(gobj());
}

00621 void Window::unstick()
{
  gdk_window_unstick(gobj());
}

00626 void Window::maximize()
{
  gdk_window_maximize(gobj());
}

00631 void Window::unmaximize()
{
  gdk_window_unmaximize(gobj());
}

void Window::register_dnd()
{
  gdk_window_register_dnd(gobj());
}

00641 void Window::begin_resize_drag(WindowEdge edge, int button, int root_x, int root_y, guint32 timestamp)
{
  gdk_window_begin_resize_drag(gobj(), ((GdkWindowEdge)(edge)), button, root_x, root_y, timestamp);
}

00646 void Window::begin_move_drag(int button, int root_x, int root_y, guint32 timestamp)
{
  gdk_window_begin_move_drag(gobj(), button, root_x, root_y, timestamp);
}

00651 void Window::invalidate_rect(const Rectangle& rect, bool invalidate_children)
{
  gdk_window_invalidate_rect(gobj(), const_cast<GdkRectangle*>(rect.gobj()), static_cast<int>(invalidate_children));
}

00656 void Window::invalidate_region(const Region& region, bool invalidate_children)
{
  gdk_window_invalidate_region(gobj(), const_cast<GdkRegion*>((region).gobj()), static_cast<int>(invalidate_children));
}

00661 Region Window::get_update_area()
{
  return Region(gdk_window_get_update_area(gobj()));
}

00666 void Window::freeze_updates()
{
  gdk_window_freeze_updates(gobj());
}

00671 void Window::thaw_updates()
{
  gdk_window_thaw_updates(gobj());
}

00676 void Window::process_all_updates()
{
  gdk_window_process_all_updates();
}

00681 void Window::process_updates(bool update_children)
{
  gdk_window_process_updates(gobj(), static_cast<int>(update_children));
}

00686 void Window::set_debug_updates(bool setting)
{
  gdk_window_set_debug_updates(static_cast<int>(setting));
}

00691 void Window::constrain_size(const Geometry& geometry, guint flags, int width, int height, int& new_width, int& new_height)
{
  gdk_window_constrain_size(const_cast<GdkGeometry*>(&(geometry)), flags, width, height, &new_width, &new_height);
}

00696 void Window::enable_synchronized_configure()
{
  gdk_window_enable_synchronized_configure(gobj());
}

00701 void Window::configure_finished()
{
  gdk_window_configure_finished(gobj());
}

00706 void Window::set_skip_taskbar_hint(bool skips_taskbar)
{
  gdk_window_set_skip_taskbar_hint(gobj(), static_cast<int>(skips_taskbar));
}

00711 void Window::set_skip_pager_hint(bool skips_pager)
{
  gdk_window_set_skip_pager_hint(gobj(), static_cast<int>(skips_pager));
}

00716 void Window::fullscreen()
{
  gdk_window_fullscreen(gobj());
}

00721 void Window::unfullscreen()
{
  gdk_window_unfullscreen(gobj());
}

GrabStatus Window::pointer_grab(bool owner_events, EventMask event_mask, const Glib::RefPtr<const Window>& confine_to, const Cursor& cursor, guint32 time_)
{
  return ((GrabStatus)(gdk_pointer_grab(gobj(), static_cast<int>(owner_events), ((GdkEventMask)(event_mask)), const_cast<GdkWindow*>(Glib::unwrap<Gdk::Window>(confine_to)), (cursor).gobj_copy(), time_)));
}

00731 void Window::pointer_ungrab(guint32 timestamp)
{
  gdk_pointer_ungrab(timestamp);
}

GrabStatus Window::keyboard_grab(bool owner_events, guint32 timestamp)
{
  return ((GrabStatus)(gdk_keyboard_grab(gobj(), static_cast<int>(owner_events), timestamp)));
}

00741 void Window::keyboard_ungrab(guint32 timestamp)
{
  gdk_keyboard_ungrab(timestamp);
}

00746 void Window::set_keep_above(bool setting)
{
  gdk_window_set_keep_above(gobj(), static_cast<int>(setting));
}

00751 void Window::set_keep_below(bool setting)
{
  gdk_window_set_keep_below(gobj(), static_cast<int>(setting));
}

00756 void Window::set_accept_focus(bool accept_focus)
{
  gdk_window_set_accept_focus(gobj(), static_cast<int>(accept_focus));
}

00761 void Window::set_focus_on_map(bool focus_on_map)
{
  gdk_window_set_focus_on_map(gobj(), static_cast<int>(focus_on_map));
}


} // namespace Gdk



Generated by  Doxygen 1.6.0   Back to index