1 /* 2 * Copyright (C) 2002 2003 2004, 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 /* -------------------------------------------------------------------------- 23 * This is the base class for most of the dialogs inside the effects 24 * browser. The class should be considered "abstract" and the functions in this 25 * file should only be used from subclasses. 26 * 27 * Each EffectDialog is associated with an effect browser and when 28 * the associated browser is closed, the dialog will automatically 29 * close as well. 30 * 31 * The EffectDialog has an input area where subclasses can place widgets for 32 * setting effect parameters etc. 33 * -------------------------------------------------------------------------- */ 34 35 36 #ifndef EFFECT_DIALOG_H_INCLUDED 37 #define EFFECT_DIALOG_H_INCLUDED 38 39 #include <gtk/gtk.h> 40 #include "mainwindow.h" 41 42 #define EFFECT_DIALOG(obj) GTK_CHECK_CAST(obj,effect_dialog_get_type(),EffectDialog) 43 #define EFFECT_DIALOG_CLASS(klass) GTK_CHECK_CLASS_CAST(klass,effect_dialog_get_type(),EffectDialogClass) 44 #define IS_EFFECT_DIALOG(obj) GTK_CHECK_TYPE(obj,effect_dialog_get_type()) 45 46 typedef struct _EffectDialog { 47 48 GtkVBox vbox; 49 50 /* Input area - subclasses can add their own widgets here. */ 51 GtkContainer *input_area; 52 53 /* Associated effect browser. Read-only, set this once with the 54 * effect_dialog_setup function. */ 55 gpointer eb; 56 57 /* Effect name. Read-only, do not modify or free. */ 58 gchar *effect_name; 59 60 } EffectDialog; 61 62 63 64 typedef struct _EffectDialogClass { 65 GtkVBoxClass vbox_class; 66 67 /* This signal is emitted when the OK or Apply button is pressed. Default 68 * action: do nothing. Return TRUE if something failed. */ 69 gboolean (*apply)(EffectDialog *ed); 70 71 /* This signal is called when the associated EffectBrowser and 72 * effect name has been set for the dialog. */ 73 void (*setup)(EffectDialog *ed); 74 75 /* Called when eb->mwl->selected->chunk has changed */ 76 void (*target_changed)(EffectDialog *ed); 77 78 } EffectDialogClass; 79 80 GtkType effect_dialog_get_type(void); 81 82 /* This sets the associated Mainwindow for the dialog. This must be called once 83 * and only once for a dialog. 84 * 85 * ed - An EffectDialog 86 * eb - The EffectBrowser to associate with the EffectDialog. 87 */ 88 void effect_dialog_setup(EffectDialog *ed, gchar *effect_name, gpointer eb); 89 90 91 92 /* This "runs" the effect with the current settings. Returns TRUE on failure. 93 */ 94 gboolean effect_dialog_apply(EffectDialog *ed); 95 96 97 #endif 98