diff options
author | Wu Xiaotian <[email protected]> | 2019-07-31 16:51:14 +0800 |
---|---|---|
committer | raveit65 <[email protected]> | 2019-08-26 14:21:14 +0200 |
commit | 00f68491bad7d3cd06e013f3bdba4282f9afcf62 (patch) | |
tree | 5171025a9477f46f5954cc6fc5d35b89e96a7ebf /libcaja-extension | |
parent | 35876a8ad959dac4561e0c0fc753cb303c9c6283 (diff) | |
download | caja-00f68491bad7d3cd06e013f3bdba4282f9afcf62.tar.bz2 caja-00f68491bad7d3cd06e013f3bdba4282f9afcf62.tar.xz |
add new interface
Diffstat (limited to 'libcaja-extension')
-rw-r--r-- | libcaja-extension/caja-widget-view-provider.c | 32 | ||||
-rw-r--r-- | libcaja-extension/caja-widget-view-provider.h | 53 |
2 files changed, 56 insertions, 29 deletions
diff --git a/libcaja-extension/caja-widget-view-provider.c b/libcaja-extension/caja-widget-view-provider.c index d678fb26..44b33001 100644 --- a/libcaja-extension/caja-widget-view-provider.c +++ b/libcaja-extension/caja-widget-view-provider.c @@ -1,9 +1,8 @@ /* vi: set sw=4 ts=4 wrap ai: */ /* - * caja-widget-view-provider.c: This file is part of ____ - * - * Copyright (C) 2019 yetist <yetist@yetipc> + * caja-widget-view-provider.c: This file is part of caja. * + * Copyright (C) 2019 Wu Xiaotian <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -86,8 +85,8 @@ caja_widget_view_provider_get_widget (CajaWidgetViewProvider *provider) /** * caja_widget_view_provider_add_file: * @provider: a #CajaWidgetViewProvider - * @file: - * @directory: + * @file: + * @directory: * * **/ @@ -129,6 +128,29 @@ void caja_widget_view_provider_set_window (CajaWidgetViewProvider *provider, Gtk CAJA_WIDGET_VIEW_PROVIDER_GET_IFACE (provider)->set_window (provider, window); } +guint caja_widget_view_provider_get_item_count (CajaWidgetViewProvider *provider) +{ + g_return_val_if_fail (CAJA_IS_WIDGET_VIEW_PROVIDER (provider), 0); + g_return_val_if_fail (CAJA_WIDGET_VIEW_PROVIDER_GET_IFACE (provider)->get_item_count != NULL, 0); + + return CAJA_WIDGET_VIEW_PROVIDER_GET_IFACE (provider)->get_item_count (provider); +} + +gchar* caja_widget_view_provider_get_first_visible_file (CajaWidgetViewProvider *provider) +{ + g_return_val_if_fail (CAJA_IS_WIDGET_VIEW_PROVIDER (provider), NULL); + g_return_val_if_fail (CAJA_WIDGET_VIEW_PROVIDER_GET_IFACE (provider)->get_first_visible_file != NULL, NULL); + + return CAJA_WIDGET_VIEW_PROVIDER_GET_IFACE (provider)->get_first_visible_file (provider); +} + +void caja_widget_view_provider_clear (CajaWidgetViewProvider *provider) +{ + g_return_if_fail (CAJA_IS_WIDGET_VIEW_PROVIDER (provider)); + g_return_if_fail (CAJA_WIDGET_VIEW_PROVIDER_GET_IFACE (provider)->clear != NULL); + + CAJA_WIDGET_VIEW_PROVIDER_GET_IFACE (provider)->clear (provider); +} /** * caja_widget_view_provider_supports_uri: diff --git a/libcaja-extension/caja-widget-view-provider.h b/libcaja-extension/caja-widget-view-provider.h index 1bd21a5f..e232d3b8 100644 --- a/libcaja-extension/caja-widget-view-provider.h +++ b/libcaja-extension/caja-widget-view-provider.h @@ -1,9 +1,8 @@ /* vi: set sw=4 ts=4 wrap ai: */ /* - * caja-widget-view-provider.h: This file is part of ____ - * - * Copyright (C) 2019 yetist <yetist@yetipc> + * caja-widget-view-provider.h: This file is part of caja. * + * Copyright (C) 2019 Wu Xiaotian <[email protected]> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -49,31 +48,37 @@ typedef struct _CajaWidgetViewProviderIface CajaWidgetViewProviderIface; struct _CajaWidgetViewProviderIface { GTypeInterface g_iface; - gboolean (*supports_uri) (CajaWidgetViewProvider *provider, - const char *uri, - GFileType file_type, - const char *mime_type); - GtkWidget* (*get_widget) (CajaWidgetViewProvider *provider); - void (*add_file) (CajaWidgetViewProvider *provider, CajaFile *file, CajaFile *directory); - void (*set_location) (CajaWidgetViewProvider *provider, const char *location); - void (*set_window) (CajaWidgetViewProvider *provider, GtkWindow *window); + gboolean (*supports_uri) (CajaWidgetViewProvider *provider, + const char *uri, + GFileType file_type, + const char *mime_type); + GtkWidget* (*get_widget) (CajaWidgetViewProvider *provider); + void (*add_file) (CajaWidgetViewProvider *provider, CajaFile *file, CajaFile *directory); + void (*set_location) (CajaWidgetViewProvider *provider, const char *location); + void (*set_window) (CajaWidgetViewProvider *provider, GtkWindow *window); + guint (*get_item_count) (CajaWidgetViewProvider *provider); + gchar* (*get_first_visible_file) (CajaWidgetViewProvider *provider); + void (*clear) (CajaWidgetViewProvider *provider); }; /* Interface Functions */ -GType caja_widget_view_provider_get_type (void); +GType caja_widget_view_provider_get_type (void); -GtkWidget *caja_widget_view_provider_get_widget (CajaWidgetViewProvider *provider); -void caja_widget_view_provider_add_file (CajaWidgetViewProvider *provider, - CajaFile *file, - CajaFile *directory); -void caja_widget_view_provider_set_location (CajaWidgetViewProvider *provider, - const char *location); -void caja_widget_view_provider_set_window (CajaWidgetViewProvider *provider, - GtkWindow *window); -gboolean caja_widget_view_provider_supports_uri (CajaWidgetViewProvider *provider, - const char *uri, - GFileType file_type, - const char *mime_type); +GtkWidget *caja_widget_view_provider_get_widget (CajaWidgetViewProvider *provider); +void caja_widget_view_provider_add_file (CajaWidgetViewProvider *provider, + CajaFile *file, + CajaFile *directory); +void caja_widget_view_provider_set_location (CajaWidgetViewProvider *provider, + const char *location); +void caja_widget_view_provider_set_window (CajaWidgetViewProvider *provider, + GtkWindow *window); +guint caja_widget_view_provider_get_item_count (CajaWidgetViewProvider *provider); +gchar* caja_widget_view_provider_get_first_visible_file (CajaWidgetViewProvider *provider); +void caja_widget_view_provider_clear (CajaWidgetViewProvider *provider); +gboolean caja_widget_view_provider_supports_uri (CajaWidgetViewProvider *provider, + const char *uri, + GFileType file_type, + const char *mime_type); G_END_DECLS #endif /* __CAJA_WIDGET_VIEW_PROVIDER_H__ */ |