// Generated by gmmproc 2.72.1 -- DO NOT MODIFY!


#include <glibmm.h>

#include <gtkmm/gridview.h>
#include <gtkmm/private/gridview_p.h>


/* Copyright (C) 2020 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, see <http://www.gnu.org/licenses/>.
 */

#include <gtk/gtk.h>

namespace
{


static void GridView_signal_activate_callback(GtkGridView* self, guint p0,void* data)
{
  using namespace Gtk;
  using SlotType = sigc::slot<void(guint)>;

  auto obj = dynamic_cast<GridView*>(Glib::ObjectBase::_get_current_wrapper((GObject*) self));
  // Do not try to call a signal on a disassociated wrapper.
  if(obj)
  {
    try
    {
      if(const auto slot = Glib::SignalProxyNormal::data_to_slot(data))
        (*static_cast<SlotType*>(slot))(p0);
    }
    catch(...)
    {
       Glib::exception_handlers_invoke();
    }
  }
}

static const Glib::SignalProxyInfo GridView_signal_activate_info =
{
  "activate",
  (GCallback) &GridView_signal_activate_callback,
  (GCallback) &GridView_signal_activate_callback
};


} // anonymous namespace


namespace Glib
{

Gtk::GridView* wrap(GtkGridView* object, bool take_copy)
{
  return dynamic_cast<Gtk::GridView *> (Glib::wrap_auto ((GObject*)(object), take_copy));
}

} /* namespace Glib */

namespace Gtk
{


/* The *_Class implementation: */

const Glib::Class& GridView_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_ = &GridView_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(gtk_grid_view_get_type());

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

  }

  return *this;
}


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


}


Glib::ObjectBase* GridView_Class::wrap_new(GObject* o)
{
  return manage(new GridView((GtkGridView*)(o)));

}


/* The implementation: */

GridView::GridView(const Glib::ConstructParams& construct_params)
:
  ListBase(construct_params)
{
  }

GridView::GridView(GtkGridView* castitem)
:
  ListBase((GtkListBase*)(castitem))
{
  }


GridView::GridView(GridView&& src) noexcept
: ListBase(std::move(src))
{}

GridView& GridView::operator=(GridView&& src) noexcept
{
  ListBase::operator=(std::move(src));
  return *this;
}

GridView::~GridView() noexcept
{
  destroy_();
}

GridView::CppClassType GridView::gridview_class_; // initialize static member

GType GridView::get_type()
{
  return gridview_class_.init().get_type();
}


GType GridView::get_base_type()
{
  return gtk_grid_view_get_type();
}


GridView::GridView(const Glib::RefPtr<SelectionModel>& model, const Glib::RefPtr<ListItemFactory>& factory)
:
  // Mark this class as non-derived to allow C++ vfuncs to be skipped.
  Glib::ObjectBase(nullptr),
  ListBase(Glib::ConstructParams(gridview_class_.init(), "model", Glib::unwrap(model), "factory", Glib::unwrap(factory), nullptr))
{
  

}

Glib::RefPtr<SelectionModel> GridView::get_model()
{
  auto retvalue = Glib::wrap(gtk_grid_view_get_model(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const SelectionModel> GridView::get_model() const
{
  return const_cast<GridView*>(this)->get_model();
}

void GridView::set_model(const Glib::RefPtr<SelectionModel>& model)
{
  gtk_grid_view_set_model(gobj(), Glib::unwrap(model));
}

void GridView::set_factory(const Glib::RefPtr<ListItemFactory>& factory)
{
  gtk_grid_view_set_factory(gobj(), Glib::unwrap(factory));
}

Glib::RefPtr<ListItemFactory> GridView::get_factory()
{
  auto retvalue = Glib::wrap(gtk_grid_view_get_factory(gobj()));
  if(retvalue)
    retvalue->reference(); //The function does not do a ref for us.
  return retvalue;
}

Glib::RefPtr<const ListItemFactory> GridView::get_factory() const
{
  return const_cast<GridView*>(this)->get_factory();
}

guint GridView::get_min_columns() const
{
  return gtk_grid_view_get_min_columns(const_cast<GtkGridView*>(gobj()));
}

void GridView::set_min_columns(guint min_columns)
{
  gtk_grid_view_set_min_columns(gobj(), min_columns);
}

guint GridView::get_max_columns() const
{
  return gtk_grid_view_get_max_columns(const_cast<GtkGridView*>(gobj()));
}

void GridView::set_max_columns(guint max_columns)
{
  gtk_grid_view_set_max_columns(gobj(), max_columns);
}

void GridView::set_enable_rubberband(bool enable_rubberband)
{
  gtk_grid_view_set_enable_rubberband(gobj(), static_cast<int>(enable_rubberband));
}

bool GridView::get_enable_rubberband() const
{
  return gtk_grid_view_get_enable_rubberband(const_cast<GtkGridView*>(gobj()));
}

void GridView::set_single_click_activate(bool single_click_activate)
{
  gtk_grid_view_set_single_click_activate(gobj(), static_cast<int>(single_click_activate));
}

bool GridView::get_single_click_activate() const
{
  return gtk_grid_view_get_single_click_activate(const_cast<GtkGridView*>(gobj()));
}


Glib::SignalProxy<void(guint)> GridView::signal_activate()
{
  return Glib::SignalProxy<void(guint) >(this, &GridView_signal_activate_info);
}


static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<Glib::RefPtr<ListItemFactory>>::value,
  "Type Glib::RefPtr<ListItemFactory> cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy< Glib::RefPtr<ListItemFactory> > GridView::property_factory() 
{
  return Glib::PropertyProxy< Glib::RefPtr<ListItemFactory> >(this, "factory");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ListItemFactory> > GridView::property_factory() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<ListItemFactory> >(this, "factory");
}

Glib::PropertyProxy< guint > GridView::property_max_columns() 
{
  return Glib::PropertyProxy< guint >(this, "max-columns");
}

Glib::PropertyProxy_ReadOnly< guint > GridView::property_max_columns() const
{
  return Glib::PropertyProxy_ReadOnly< guint >(this, "max-columns");
}

Glib::PropertyProxy< guint > GridView::property_min_columns() 
{
  return Glib::PropertyProxy< guint >(this, "min-columns");
}

Glib::PropertyProxy_ReadOnly< guint > GridView::property_min_columns() const
{
  return Glib::PropertyProxy_ReadOnly< guint >(this, "min-columns");
}

static_assert(Glib::Traits::ValueCompatibleWithWrapProperty<Glib::RefPtr<SelectionModel>>::value,
  "Type Glib::RefPtr<SelectionModel> cannot be used in _WRAP_PROPERTY. "
  "There is no suitable template specialization of Glib::Value<>.");

Glib::PropertyProxy< Glib::RefPtr<SelectionModel> > GridView::property_model() 
{
  return Glib::PropertyProxy< Glib::RefPtr<SelectionModel> >(this, "model");
}

Glib::PropertyProxy_ReadOnly< Glib::RefPtr<SelectionModel> > GridView::property_model() const
{
  return Glib::PropertyProxy_ReadOnly< Glib::RefPtr<SelectionModel> >(this, "model");
}

Glib::PropertyProxy< bool > GridView::property_single_click_activate() 
{
  return Glib::PropertyProxy< bool >(this, "single-click-activate");
}

Glib::PropertyProxy_ReadOnly< bool > GridView::property_single_click_activate() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "single-click-activate");
}

Glib::PropertyProxy< bool > GridView::property_enable_rubberband() 
{
  return Glib::PropertyProxy< bool >(this, "enable-rubberband");
}

Glib::PropertyProxy_ReadOnly< bool > GridView::property_enable_rubberband() const
{
  return Glib::PropertyProxy_ReadOnly< bool >(this, "enable-rubberband");
}


} // namespace Gtk


