Esempio n. 1
0
File: main.c Progetto: GNOME/gthumb
G_MODULE_EXPORT void
gthumb_extension_activate (void)
{
	int p;

	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_SAVE);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_SAVE_AS);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_UNDO);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_REDO);

	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_ADJUST_CONTRAST);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_ADJUST_COLORS);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_SHARPEN);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_GRAYSCALE);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_CURVES);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_EFFECTS);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_COLOR_PICKER);

	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_ROTATE_LEFT);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_ROTATE_RIGHT);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_MIRROR);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_FLIP);

	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_ROTATE);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_RESIZE);
	gth_main_register_type ("file-tools", GTH_TYPE_FILE_TOOL_CROP);

	gth_hook_add_callback ("gth-browser-file-list-key-press", 10, G_CALLBACK (file_tools__gth_browser_file_list_key_press_cb), NULL);

	/**
	 * Add a filter to the filter list shown in the Effects tool
	 *
	 * @filter_grid (GthFilterGrid*): the filter grid to add the effect to.
	 **/
	gth_hook_register ("add-special-effect", 1);

	p = 10;
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (desert_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (cherry_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (soil_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (artic_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (fresh_blue_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (mangos_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (warmer_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (cooler_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (vintage_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (lomo_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (vignette_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (blurred_edges_add_to_special_effects), NULL);
	gth_hook_add_callback ("add-special-effect", p++, G_CALLBACK (negative_add_to_special_effects), NULL);
}
Esempio n. 2
0
G_MODULE_EXPORT void
gthumb_extension_activate (void)
{
	/**
	 * Called after successfully rotating a jpeg image
	 *
	 * @out_buffer (void **): pointer to file data
	 * @out_buffer_size (gsize *): pointer to file data size
	 * @tranform (GthTransform *): the transformation applied to the file
	 **/
	gth_hook_register ("jpegtran-after", 3);

	gth_hook_add_callback ("gth-browser-construct", 10, G_CALLBACK (ir__gth_browser_construct_cb), NULL);
	gth_hook_add_callback ("gth-browser-update-sensitivity", 10, G_CALLBACK (ir__gth_browser_update_sensitivity_cb), NULL);
	gth_hook_add_callback ("gth-browser-file-list-key-press", 10, G_CALLBACK (ir__gth_browser_file_list_key_press_cb), NULL);
}
Esempio n. 3
0
G_MODULE_EXPORT void
gthumb_extension_activate (void)
{
	/**
	 * Called to delete a file metadata
	 *
	 * @file (GFile *): the file
	 * @buffer (void **buffer): the file content
	 * @size (gsize *): the file size
	 **/
	gth_hook_register ("delete-metadata", 3);

	gth_main_register_type ("edit-comment-dialog-page", GTH_TYPE_EDIT_GENERAL_PAGE);
	gth_hook_add_callback ("gth-browser-construct", 7, G_CALLBACK (edit_metadata__gth_browser_construct_cb), NULL);
	gth_hook_add_callback ("gth-browser-set-current-page", 5, G_CALLBACK (edit_metadata__gth_browser_set_current_page_cb), NULL);
	gth_hook_add_callback ("gth-browser-update-sensitivity", 10, G_CALLBACK (edit_metadata__gth_browser_update_sensitivity_cb), NULL);
	gth_hook_add_callback ("gth-browser-file-list-key-press", 10, G_CALLBACK (edit_metadata__gth_browser_file_list_key_press_cb), NULL);
}
Esempio n. 4
0
void
gth_main_register_default_hooks (void)
{
	gth_hooks_initialize ();

	/**
	 * Called at start up time to do basic initialization.
	 *
	 * no arguments.
	 **/
	gth_hook_register ("initialize", 0);

	/**
	 * Called after the window has been initialized.  Can be used by
	 * an extension to create and attach specific data to the window.
	 *
	 * @browser (GthBrowser*): the relative window.
	 **/
	gth_hook_register ("gth-browser-construct", 1);

	/**
	 * Called in an idle callback after the window has been initialized.
	 *
	 * @browser (GthBrowser*): the relative window.
	 **/
	gth_hook_register ("gth-browser-construct-idle-callback", 1);

	/**
	 * Called when the window is realized.
	 *
	 * @browser (GthBrowser*): the window.
	 **/
	gth_hook_register ("gth-browser-realize", 1);

	/**
	 * Called when the window is unrealized.
	 *
	 * @browser (GthBrowser*): the window.
	 **/
	gth_hook_register ("gth-browser-unrealize", 1);

	/**
	 * Called before closing a window.
	 *
	 * @browser (GthBrowser*): the window to be closed.
	 **/
	gth_hook_register ("gth-browser-close", 1);

	/**
	 * Called before closing the last window and after the
	 * 'gth-browser-close' hook functions.
	 *
	 * @browser (GthBrowser*): the window to be closed.
	 **/
	gth_hook_register ("gth-browser-close-last-window", 1);

	/**
	 *  Called when a sensitivity update is requested.
	 *
	 * @browser (GthBrowser*): the relative window.
	 **/
	gth_hook_register ("gth-browser-update-sensitivity", 1);

	/**
	 *  Called when the current page changes.
	 *
	 * @browser (GthBrowser*): the relative window.
	 **/
	gth_hook_register ("gth-browser-set-current-page", 1);

	/**
	 *  Called when after the activation of a viewer page
	 *
	 * @browser (GthBrowser*): the relative window.
	 **/
	gth_hook_register ("gth-browser-activate-viewer-page", 1);

	/**
	 *  Called before the deactivation of a viewer page.
	 *
	 * @browser (GthBrowser*): the relative window.
	 **/
	gth_hook_register ("gth-browser-deactivate-viewer-page", 1);

	/**
	 * Called before loading a folder.
	 *
	 * @browser (GthBrowser*): the window
	 * @folder (GFile*): the folder to load
	 **/
	gth_hook_register ("gth-browser-load-location-before", 2);

	/**
	 * Called after the folder has been loaded.
	 *
	 * @browser (GthBrowser*): the window
	 * @folder (GthFileData*): the loaded folder data
	 * @error (GError*): the error or NULL if the folder was loaded
	 * correctly.
	 **/
	gth_hook_register ("gth-browser-load-location-after", 3);

	/**
	 * Called before displaying the file list popup menu.
	 *
	 * @browser (GthBrowser*): the relative window.
	 **/
	gth_hook_register ("gth-browser-file-list-popup-before", 1);

	/**
	 * Called before displaying the file popup menu.
	 *
	 * @browser (GthBrowser*): the relative window.
	 **/
	gth_hook_register ("gth-browser-file-popup-before", 1);

	/**
	 * Called before displaying the folder tree popup menu.
	 *
	 * @browser (GthBrowser*): the relative window.
	 * @file_source (GthFileSource*): the file_source relative to the file.
	 * @file (GFile*): the relative folder or NULL if the button was
	 * pressed in an empty area.
	 **/
	gth_hook_register ("gth-browser-folder-tree-popup-before", 3);

	/**
	 * Called after a drag-data-received event on the folder tree
	 *
	 * @browser (GthBrowser *): the relative window.
	 * @destination (GthFileData *): the drop destination.
	 * @file_list (GList *): the GFile list of the dropped files
	 * @action (GdkDragAction): the drag action
	 * pressed in an empty area.
	 **/
	gth_hook_register ("gth-browser-folder-tree-drag-data-received", 4);

	/**
	 * Called to view file
	 *
	 * @browser (GthBrowser*): the relative window.
	 * @file (GthFileData*): the file
	 **/
	gth_hook_register ("gth-browser-view-file", 2);

	/**
	 * Called after a key press in the file list
	 *
	 * @browser (GthBrowser*): the relative window.
	 * @event (GdkEventKey *); the key event.
	 */
	gth_hook_register ("gth-browser-file-list-key-press", 2);

	/**
	 * Called when the list extra widget needs to be updated.
	 *
	 * @browser (GthBrowser*): the relative window.
	 */
	gth_hook_register ("gth-browser-update-extra-widget", 1);

	/**
	 * Called when a file-renamed signal is received by a browser window.
	 *
	 * @browser (GthBrowser*): the window that received the signal.
	 * @file (GFile *): the file that was renamed.
	 * @new_file (GFile *): the new file.
	 */
	gth_hook_register ("gth-browser-file-renamed", 3);

	/**
	 * Called in gth_image_save_to_file
	 *
	 * @data (GthImageSaveData*):
	 **/
	gth_hook_register ("save-image", 1);

	/**
	 * Called when copying files in _g_copy_files_async with the
	 * GTH_FILE_COPY_ALL_METADATA flag activated and when deleting file
	 * with _g_delete_files.  Used to add sidecar files that contain
	 * file metadata.
	 *
	 * @file (GFile *): the original file.
	 * @sidecar_sources (GList **): the sidecars list.
	 */
	gth_hook_register ("add-sidecars", 2);

	/**
	 * Called after a file metadata has been read.  Used to syncronize
	 * embedded metadata with the .comment file.
	 *
	 * @file_list (GList *): list of GthFileData
	 * @attributes (const char *): the attributes read for the file
	 */
	gth_hook_register ("read-metadata-ready", 2);

	/**
	 * Called to generate a thumbnail pixbuf for a file
	 *
	 * @uri (char *): the file uri
	 * @mime_type (char *): the file mime type
	 * @size (int): the requested thumbnail size
	 * @return (GdkPixbuf *): the thumbnail pixbuf
	 */
	gth_hook_register ("generate-thumbnail", 3);

	/**
	 * Called when creating the preferences dialog to add other tabs to
	 * the dialog.
	 *
	 * @dialog (GtkWidget *): the preferences dialog.
	 * @browser (GthBrowser*): the relative window.
	 * @builder (GtkBuilder*): the dialog ui builder.
	 **/
	gth_hook_register ("dlg-preferences-construct", 3);

	/**
	 * Called when to apply the changes from the preferences dialog.
	 *
	 * @dialog (GtkWidget *): the preferences dialog.
	 * @browser (GthBrowser*): the relative window.
	 * @builder (GtkBuilder*): the dialog ui builder.
	 **/
	gth_hook_register ("dlg-preferences-apply", 3);

	/**
	 * Called at start up time if the --import-photos argument is
	 * specified.
	 *
	 * @browser (GthBrowser*): the main window.
	 * @file (GFile *): import from this location
	 **/
	gth_hook_register ("import-photos", 2);

	/**
	 * Called at start up time if the --slideshow argument is
	 * specified.
	 *
	 * @browser (GthBrowser*): the main window.
	 **/
	gth_hook_register ("slideshow", 1);

	/**
	 * Called at start up time with the list of the command line
	 * files.
	 *
	 * @file_list (GList *): list of GFile with the files specified
	 * on the command line.
	 * @return (GFile *): the location where to open the window at or NULL
	 * for nothing.
	 **/
	gth_hook_register ("command-line-files", 1);
}
Esempio n. 5
0
File: main.c Progetto: GNOME/gthumb
G_MODULE_EXPORT void
gthumb_extension_activate (void)
{
	/**
	 * Called to create the catalog class from the given file content.
	 *
	 * @buffer (const char *): the file content.
	 * @return (GthCatalog *): return a pointer to the object that can
	 * handle the catalog data, or NULL if the data type doesn't match.
	 **/
	gth_hook_register ("gth-catalog-load-from-data", 1);

	/**
	 * Called to update the catalog data from a given file data.
	 *
	 * @catalog (GthCatalog *): the catalog to update
	 * @file_data (GthFileData *): the file data
	 **/
	gth_hook_register ("gth-catalog-read-metadata", 2);

	/**
	 * Called to update the file metadata from a catalog.
	 *
	 * @catalog (GthCatalog *): the catalog
	 * @file_data (GthFileData *): the file data to update
	 **/
	gth_hook_register ("gth-catalog-write-metadata", 2);

	/**
	 * Called to update the catalog from a xml file.
	 *
	 * @catalog (GthCatalog *):
	 * @root (DomElement *):
	 */
	gth_hook_register ("gth-catalog-read-from-doc", 2);

	/**
	 * Called to update a xml file from a catalog.
	 *
	 * @catalog (GthCatalog *):
	 * @doc (DomDocument *):
	 * @root (DomElement *):
	 */
	gth_hook_register ("gth-catalog-write-to-doc", 3);

	/**
	 * Called to add sections to the catalog properties dialog.
	 *
	 * @builder   (GtkBuilder *): the builder relative to the window
	 * @file_data (GthFileData *): the catalog file
	 * @catalog (GthCatalog *): the catalog data
	 **/
	gth_hook_register ("dlg-catalog-properties", 3);

	/**
	 * Called to save the properties dialog changes.
	 *
	 * @builder   (GtkBuilder *): the builder relative to the window
	 * @file_data (GthFileData *): the catalog file
	 * @catalog (GthCatalog *): the catalog data
	 **/
	gth_hook_register ("dlg-catalog-properties-save", 3);

	/**
	 * Called after saving the catalog properties.
	 *
	 * @browser (GthBrowser *): the main window
	 * @file_data (GthFileData *): the catalog file
	 * @catalog (GthCatalog *): the catalog data
	 **/
	gth_hook_register ("dlg-catalog-properties-saved", 3);

	/**
	 * Called to create a catalog when organizing files in catalogs.
	 *
	 * @data (GthGroupPolicyData *): a structure that contains in and out
	 * parameters, as described in gth-organize-task.h
	 **/
	gth_hook_register ("gth-organize-task-create-catalog", 1);

	gth_hook_add_callback ("command-line-files", 10, G_CALLBACK (catalogs__command_line_files_cb), NULL);
	gth_hook_add_callback ("gth-catalog-load-from-data", 10, G_CALLBACK (catalogs__gth_catalog_load_from_data_cb), NULL);

	gth_main_register_file_source (GTH_TYPE_FILE_SOURCE_CATALOGS);
	gth_hook_add_callback ("initialize", 10, G_CALLBACK (catalogs__initialize_cb), NULL);
	gth_hook_add_callback ("gth-browser-construct", 10, G_CALLBACK (catalogs__gth_browser_construct_cb), NULL);
	gth_hook_add_callback ("gth-browser-update-sensitivity", 10, G_CALLBACK (catalogs__gth_browser_update_sensitivity_cb), NULL);
	gth_hook_add_callback ("gth-browser-folder-tree-popup-before", 10, G_CALLBACK (catalogs__gth_browser_folder_tree_popup_before_cb), NULL);
	gth_hook_add_callback ("gth-browser-load-location-after", 10, G_CALLBACK (catalogs__gth_browser_load_location_after_cb), NULL);
	gth_hook_add_callback ("gth-browser-update-extra-widget", 10, G_CALLBACK (catalogs__gth_browser_update_extra_widget_cb), NULL);
	gth_hook_add_callback ("gth-browser-file-renamed", 10, G_CALLBACK (catalogs__gth_browser_file_renamed_cb), NULL);
}