* 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.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include "gtktypebuiltins.h"
#include "gtkprivate.h"
#include "gtkmarshalers.h"
-#include "gtkalias.h"
+
+/**
+ * SECTION:gtkrecentchooser
+ * @Short_description: Interface implemented by widgets displaying recently
+ * used files
+ * @Title: GtkRecentChooser
+ * @See_also: #GtkRecentManager, #GtkRecentChooserDialog,
+ * #GtkRecentChooserWidget, #GtkRecentChooserMenu
+ *
+ * #GtkRecentChooser is an interface that can be implemented by widgets
+ * displaying the list of recently used files. In GTK+, the main objects
+ * that implement this interface are #GtkRecentChooserWidget,
+ * #GtkRecentChooserDialog and #GtkRecentChooserMenu.
+ *
+ * Recently used files are supported since GTK+ 2.10.
+ */
enum
LAST_SIGNAL
};
-static void gtk_recent_chooser_class_init (gpointer g_iface);
static gboolean recent_chooser_has_show_numbers (GtkRecentChooser *chooser);
static GQuark quark_gtk_related_action = 0;
static guint chooser_signals[LAST_SIGNAL] = { 0, };
-GType
-gtk_recent_chooser_get_type (void)
-{
- static GType chooser_type = 0;
-
- if (!chooser_type)
- {
- chooser_type = g_type_register_static_simple (G_TYPE_INTERFACE,
- I_("GtkRecentChooser"),
- sizeof (GtkRecentChooserIface),
- (GClassInitFunc) gtk_recent_chooser_class_init,
- 0, NULL, 0);
-
- g_type_interface_add_prerequisite (chooser_type, G_TYPE_OBJECT);
- }
-
- return chooser_type;
-}
+
+typedef GtkRecentChooserIface GtkRecentChooserInterface;
+G_DEFINE_INTERFACE (GtkRecentChooser, gtk_recent_chooser, G_TYPE_OBJECT);
+
static void
-gtk_recent_chooser_class_init (gpointer g_iface)
+gtk_recent_chooser_default_init (GtkRecentChooserInterface *iface)
{
- GType iface_type = G_TYPE_FROM_INTERFACE (g_iface);
+ GType iface_type = G_TYPE_FROM_INTERFACE (iface);
quark_gtk_related_action = g_quark_from_static_string (gtk_related_action_key);
quark_gtk_use_action_appearance = g_quark_from_static_string (gtk_use_action_appearance_key);
/**
- * GtkRecentChooser::selection-changed
+ * GtkRecentChooser::selection-changed:
* @chooser: the object which received the signal
*
* This signal is emitted when there is a change in the set of
G_TYPE_NONE, 0);
/**
- * GtkRecentChooser::item-activated
+ * GtkRecentChooser::item-activated:
* @chooser: the object which received the signal
*
* This signal is emitted when the user "activates" a recent item
*
* Since: 2.10
*/
- g_object_interface_install_property (g_iface,
+ g_object_interface_install_property (iface,
g_param_spec_object ("recent-manager",
P_("Recent Manager"),
P_("The RecentManager object to use"),
*
* Since: 2.10
*/
- g_object_interface_install_property (g_iface,
+ g_object_interface_install_property (iface,
g_param_spec_boolean ("show-private",
P_("Show Private"),
P_("Whether the private items should be displayed"),
*
* Since: 2.10
*/
- g_object_interface_install_property (g_iface,
+ g_object_interface_install_property (iface,
g_param_spec_boolean ("show-tips",
P_("Show Tooltips"),
P_("Whether there should be a tooltip on the item"),
*
* Since: 2.10
*/
- g_object_interface_install_property (g_iface,
+ g_object_interface_install_property (iface,
g_param_spec_boolean ("show-icons",
P_("Show Icons"),
P_("Whether there should be an icon near the item"),
*
* Since: 2.10
*/
- g_object_interface_install_property (g_iface,
+ g_object_interface_install_property (iface,
g_param_spec_boolean ("show-not-found",
P_("Show Not Found"),
P_("Whether the items pointing to unavailable resources should be displayed"),
*
* Since: 2.10
*/
- g_object_interface_install_property (g_iface,
+ g_object_interface_install_property (iface,
g_param_spec_boolean ("select-multiple",
P_("Select Multiple"),
P_("Whether to allow multiple items to be selected"),
*
* Since: 2.10
*/
- g_object_interface_install_property (g_iface,
+ g_object_interface_install_property (iface,
g_param_spec_boolean ("local-only",
P_("Local only"),
P_("Whether the selected resource(s) should be limited to local file: URIs"),
*
* Since: 2.10
*/
- g_object_interface_install_property (g_iface,
+ g_object_interface_install_property (iface,
g_param_spec_int ("limit",
P_("Limit"),
P_("The maximum number of items to be displayed"),
*
* Since: 2.10
*/
- g_object_interface_install_property (g_iface,
+ g_object_interface_install_property (iface,
g_param_spec_enum ("sort-type",
P_("Sort Type"),
P_("The sorting order of the items displayed"),
*
* Since: 2.10
*/
- g_object_interface_install_property (g_iface,
+ g_object_interface_install_property (iface,
g_param_spec_object ("filter",
P_("Filter"),
P_("The current filter for selecting which resources are displayed"),
*
* Since the returned array is %NULL terminated, @length may be %NULL.
*
- * Return value: A newly allocated, %NULL terminated array of strings. Use
- * g_strfreev() to free it.
+ * Return value: (array length=length zero-terminated=1) (transfer full):
+ * A newly allocated, %NULL-terminated array of strings. Use
+ * g_strfreev() to free it.
*
* Since: 2.10
*/
if (length)
*length = i;
- g_list_foreach (items,
- (GFunc) gtk_recent_info_unref,
- NULL);
- g_list_free (items);
+ g_list_free_full (items, (GDestroyNotify) gtk_recent_info_unref);
return retval;
}
* Gets the #GtkRecentFilter object currently used by @chooser to affect
* the display of the recently used resources.
*
- * Return value: a #GtkRecentFilter object.
+ * Return value: (transfer none): a #GtkRecentFilter object.
*
* Since: 2.10
*/
{
return !GPOINTER_TO_INT (g_object_get_qdata (G_OBJECT (recent_chooser), quark_gtk_use_action_appearance));
}
-
-#define __GTK_RECENT_CHOOSER_C__
-#include "gtkaliasdef.c"