~ubuntu-branches/ubuntu/karmic/mhwaveedit/karmic

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*
 * Copyright (C) 2003 2004 2007, Magnus Hjorth
 *
 * This file is part of mhWaveEdit.
 *
 * mhWaveEdit is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by        
 * the Free Software Foundation; either version 2 of the License, or  
 * (at your option) any later version.
 *
 * mhWaveEdit 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 General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with mhWaveEdit; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 */


#ifndef EFFECTBROWSER_H_INCLUDED
#define EFFECTBROWSER_H_INCLUDED


#include "documentlist.h"
#include "effectdialog.h"


#define EFFECT_BROWSER(obj) GTK_CHECK_CAST(obj,effect_browser_get_type(),EffectBrowser)
#define EFFECT_BROWSER_CLASS(klass) GTK_CHECK_CLASS_CAST(klass,effect_browser_get_type(),EffectBrowserClass)
#define IS_EFFECT_BROWSER(obj) GTK_CHECK_TYPE(obj,effect_browser_get_type())


#define EFFECT_BROWSER_CACHE_SIZE 8

typedef struct {    
     GtkWindow window;

     DocumentList *dl;

     GtkBox *mw_list_box;
     GtkList *list_widget;
     GtkListItem *list_widget_sel,*list_widget_clicked;

     GtkToggleButton *close_after;

     gint current_dialog;
     EffectDialog *dialogs[EFFECT_BROWSER_CACHE_SIZE];
     gpointer dialog_effects[EFFECT_BROWSER_CACHE_SIZE];

     GtkContainer *effect_list_container;
     GtkContainer *dialog_container;
} EffectBrowser;


typedef struct {
     GtkWindowClass window_class;
} EffectBrowserClass;

typedef void (*effect_register_rebuild_func)(gchar source_tag,
					     gpointer user_data);
typedef EffectDialog *(*effect_register_get_func)(gchar *name, 
						  gchar source_tag, 
						  gpointer user_data);

#define EFFECT_PARAM_TAG 0
#define EFFECT_PARAM_TITLE 1
#define EFFECT_PARAM_AUTHOR 2
#define EFFECT_PARAM_LOCATION 3
#define EFFECT_PARAM_MAX 3

void effect_register_init(void);
void effect_register_add_source(gchar *name, gchar tag,
				effect_register_rebuild_func rebuild_func,
				gpointer rebuild_func_data,
				effect_register_get_func get_func,
				gpointer get_func_data);
void effect_register_add_effect(gchar source_tag, const gchar *name, 
				const gchar *title, const gchar *author, 
				const gchar *location);
void effect_register_rebuild(void);


GtkType effect_browser_get_type(void);
GtkWidget *effect_browser_new(Document *doc);
GtkWidget *effect_browser_new_with_effect(Document *doc, gchar *effect_name, 
					  gchar source_tag, 
					  gboolean close_after);

void effect_browser_set_effect(EffectBrowser *eb, gchar *effect_name, 
			       gchar source_tag);

void effect_browser_invalidate_effect(EffectBrowser *eb, gchar *effect_name,
				      gchar source_tag);

void effect_browser_shutdown(void);
				    
#endif