forked from AuroraMiddleware/gtk
626c525706
Due to the many different ways to set factories, it makes sense to expose them as custom objects. This makes the actual APIs for the list widgets simpler, because they can just have a regular "factory" property. As a convenience function, gtk_list_view_new_with_factory() was added to make this whole approach easy to use from C.
94 lines
5.3 KiB
C
94 lines
5.3 KiB
C
/*
|
|
* Copyright © 2018 Benjamin Otte
|
|
*
|
|
* 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/>.
|
|
*
|
|
* Authors: Benjamin Otte <otte@gnome.org>
|
|
*/
|
|
|
|
|
|
#ifndef __GTK_LIST_ITEM_FACTORY_PRIVATE_H__
|
|
#define __GTK_LIST_ITEM_FACTORY_PRIVATE_H__
|
|
|
|
#include <gtk/gtklistitem.h>
|
|
#include <gtk/gtklistitemfactory.h>
|
|
#include <gtk/gtklistview.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
struct _GtkListItemFactory
|
|
{
|
|
GObject parent_instance;
|
|
};
|
|
|
|
struct _GtkListItemFactoryClass
|
|
{
|
|
GObjectClass parent_class;
|
|
|
|
/* setup @list_item so it can be bound */
|
|
void (* setup) (GtkListItemFactory *self,
|
|
GtkListItem *list_item);
|
|
/* undo the effects of GtkListItemFactoryClass::setup() */
|
|
void (* teardown) (GtkListItemFactory *self,
|
|
GtkListItem *list_item);
|
|
|
|
/* bind @list_item to the given @item, which is in @position and @selected state */
|
|
void (* bind) (GtkListItemFactory *self,
|
|
GtkListItem *list_item,
|
|
guint position,
|
|
gpointer item,
|
|
gboolean selected);
|
|
/* unbind the current item and bind a new one */
|
|
void (* rebind) (GtkListItemFactory *self,
|
|
GtkListItem *list_item,
|
|
guint position,
|
|
gpointer item,
|
|
gboolean selected);
|
|
/* like GtkListItemFactoryClass::rebind(), but the item didn't change */
|
|
void (* update) (GtkListItemFactory *self,
|
|
GtkListItem *list_item,
|
|
guint position,
|
|
gboolean selected);
|
|
/* undo the effects of GtkListItemFactoryClass::bind() */
|
|
void (* unbind) (GtkListItemFactory *self,
|
|
GtkListItem *list_item);
|
|
};
|
|
|
|
void gtk_list_item_factory_setup (GtkListItemFactory *self,
|
|
GtkListItem *list_item);
|
|
void gtk_list_item_factory_teardown (GtkListItemFactory *self,
|
|
GtkListItem *list_item);
|
|
|
|
void gtk_list_item_factory_bind (GtkListItemFactory *self,
|
|
GtkListItem *list_item,
|
|
guint position,
|
|
gpointer item,
|
|
gboolean selected);
|
|
void gtk_list_item_factory_rebind (GtkListItemFactory *self,
|
|
GtkListItem *list_item,
|
|
guint position,
|
|
gpointer item,
|
|
gboolean selected);
|
|
void gtk_list_item_factory_update (GtkListItemFactory *self,
|
|
GtkListItem *list_item,
|
|
guint position,
|
|
gboolean selected);
|
|
void gtk_list_item_factory_unbind (GtkListItemFactory *self,
|
|
GtkListItem *list_item);
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
#endif /* __GTK_LIST_ITEM_FACTORY_PRIVATE_H__ */
|