requires 2.0.0 %{ /* gpeiconlist - an icon list widget Copyright (C) 2002 Robert Mibus 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include "gpe-iconlist.h" #include "gpeiconlistview.h" %} class GPE:IconList from Gtk:Scrolled:Window { private GtkWidget *view; /* Signals */ signal last NONE(POINTER) void clicked(self, gpointer udata); signal last NONE(POINTER) void show_popup(self, gpointer udata); private void _relay_show_popup (GtkWidget *w, gpointer udata, gpointer self) { gpe_iconlist_show_popup (self, udata); } private void _relay_clicked (GtkWidget *w, gpointer udata, gpointer self) { gpe_iconlist_clicked (self, udata); } /* init and other gtkish methods */ init (self) { GtkWidget *vp; gtk_scrolled_window_set_hadjustment (GTK_SCROLLED_WINDOW(self), NULL); gtk_scrolled_window_set_vadjustment (GTK_SCROLLED_WINDOW(self), NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (GTK_SCROLLED_WINDOW (self)), GTK_POLICY_NEVER, GTK_POLICY_ALWAYS); vp = gtk_viewport_new (NULL, NULL); gtk_container_add (GTK_CONTAINER (self), vp); self->_priv->view = gpe_icon_list_view_new (); gtk_container_add (GTK_CONTAINER (vp), self->_priv->view); g_signal_connect (G_OBJECT (self->_priv->view), "clicked", G_CALLBACK (gpe_iconlist__relay_clicked), self); g_signal_connect (G_OBJECT (self->_priv->view), "show_popup", G_CALLBACK (gpe_iconlist__relay_show_popup), self); gtk_widget_show_all (vp); } public GtkWidget * new (void) { return GTK_WIDGET (GET_NEW); } /* Set the background */ public void set_bg (GPE:IconList *self, char *bg) { gpe_icon_list_view_set_bg (GPE_ICON_LIST_VIEW (self->_priv->view), bg); } public void set_bg_pixmap (GPE::IconList *self, GdkPixbuf *bg) { gpe_icon_list_view_set_bg_pixmap (GPE_ICON_LIST_VIEW (self->_priv->view), bg); } public void set_bg_color (GPE::IconList *self, guint32 color) { gpe_icon_list_view_set_bg_color (GPE_ICON_LIST_VIEW (self->_priv->view), color); } public GObject *add_item (self, char *title, char *icon, gpointer udata) { return gpe_icon_list_view_add_item (GPE_ICON_LIST_VIEW (self->_priv->view), title, icon, udata); } public GObject *add_item_pixbuf (self, char *title, GdkPixbuf *icon, gpointer udata) { return gpe_icon_list_view_add_item_pixbuf (GPE_ICON_LIST_VIEW (self->_priv->view), title, icon, udata); } public void remove_item (self, GObject *item) { gpe_icon_list_view_remove_item (GPE_ICON_LIST_VIEW (self->_priv->view), item); } public void set_embolden (self, gboolean yes) { gpe_icon_list_view_set_embolden (GPE_ICON_LIST_VIEW (self->_priv->view), yes); } public void set_show_title (self, gboolean yes) { gpe_icon_list_view_set_show_title (GPE_ICON_LIST_VIEW (self->_priv->view), yes); } public void set_icon_xmargin (self, guint margin) { gpe_icon_list_view_set_icon_xmargin (GPE_ICON_LIST_VIEW (self->_priv->view), margin); } public void clear (self) { gpe_icon_list_view_clear (GPE_ICON_LIST_VIEW (self->_priv->view)); } public void set_icon_size (self, guint size) { gpe_icon_list_view_set_icon_size (GPE_ICON_LIST_VIEW (self->_priv->view), size); } public void popup_removed (self) { gpe_icon_list_view_popup_removed (GPE_ICON_LIST_VIEW (self->_priv->view)); } }