1 /* 2 * Copyright (C) 2003 2004 2007, Magnus Hjorth 3 * 4 * This file is part of mhWaveEdit. 5 * 6 * mhWaveEdit is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * mhWaveEdit is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with mhWaveEdit; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 19 */ 20 21 22 #ifndef EFFECTBROWSER_H_INCLUDED 23 #define EFFECTBROWSER_H_INCLUDED 24 25 26 #include "documentlist.h" 27 #include "effectdialog.h" 28 29 30 #define EFFECT_BROWSER(obj) GTK_CHECK_CAST(obj,effect_browser_get_type(),EffectBrowser) 31 #define EFFECT_BROWSER_CLASS(klass) GTK_CHECK_CLASS_CAST(klass,effect_browser_get_type(),EffectBrowserClass) 32 #define IS_EFFECT_BROWSER(obj) GTK_CHECK_TYPE(obj,effect_browser_get_type()) 33 34 35 #define EFFECT_BROWSER_CACHE_SIZE 8 36 37 typedef struct { 38 GtkWindow window; 39 40 DocumentList *dl; 41 42 GtkBox *mw_list_box; 43 GtkList *list_widget; 44 GtkListItem *list_widget_sel,*list_widget_clicked; 45 46 GtkToggleButton *close_after; 47 48 gint current_dialog; 49 EffectDialog *dialogs[EFFECT_BROWSER_CACHE_SIZE]; 50 gpointer dialog_effects[EFFECT_BROWSER_CACHE_SIZE]; 51 52 GtkContainer *effect_list_container; 53 GtkContainer *dialog_container; 54 } EffectBrowser; 55 56 57 typedef struct { 58 GtkWindowClass window_class; 59 } EffectBrowserClass; 60 61 typedef void (*effect_register_rebuild_func)(gchar source_tag, 62 gpointer user_data); 63 typedef EffectDialog *(*effect_register_get_func)(gchar *name, 64 gchar source_tag, 65 gpointer user_data); 66 67 #define EFFECT_PARAM_TAG 0 68 #define EFFECT_PARAM_TITLE 1 69 #define EFFECT_PARAM_AUTHOR 2 70 #define EFFECT_PARAM_LOCATION 3 71 #define EFFECT_PARAM_MAX 3 72 73 void effect_register_init(void); 74 void effect_register_add_source(gchar *name, gchar tag, 75 effect_register_rebuild_func rebuild_func, 76 gpointer rebuild_func_data, 77 effect_register_get_func get_func, 78 gpointer get_func_data); 79 void effect_register_add_effect(gchar source_tag, const gchar *name, 80 const gchar *title, const gchar *author, 81 const gchar *location); 82 void effect_register_rebuild(void); 83 84 85 GtkType effect_browser_get_type(void); 86 GtkWidget *effect_browser_new(Document *doc); 87 GtkWidget *effect_browser_new_with_effect(Document *doc, gchar *effect_name, 88 gchar source_tag, 89 gboolean close_after); 90 91 void effect_browser_set_effect(EffectBrowser *eb, gchar *effect_name, 92 gchar source_tag); 93 94 void effect_browser_invalidate_effect(EffectBrowser *eb, gchar *effect_name, 95 gchar source_tag); 96 97 void effect_browser_shutdown(void); 98 99 #endif 100