aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--camel/ChangeLog7
-rw-r--r--camel/camel-filter-driver.c24
-rw-r--r--camel/camel-filter-driver.h6
3 files changed, 31 insertions, 6 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index c3265b3675..fe684e01b5 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,10 @@
+2002-01-24 Jeffrey Stedfast <fejj@ximian.com>
+
+ * camel-filter-driver.c (do_beep): Call the beep callback
+ function.
+ (camel_filter_driver_set_system_beep_func): New function to set
+ the beep callback.
+
2002-01-22 Jeffrey Stedfast <fejj@ximian.com>
* camel-filter-driver.c (camel_filter_driver_remove_rule_by_name):
diff --git a/camel/camel-filter-driver.c b/camel/camel-filter-driver.c
index 0c500b78bb..47f60c2f7a 100644
--- a/camel/camel-filter-driver.c
+++ b/camel/camel-filter-driver.c
@@ -75,10 +75,13 @@ struct _CamelFilterDriverPrivate {
void *statusdata; /* status callback data */
CamelFilterShellExecFunc *execfunc; /* execute shell command callback */
- void *execdata; /* execute shell command data */
+ void *execdata; /* execute shell command callback data */
CamelFilterPlaySoundFunc *playfunc; /* play-sound command callback */
- void *playdata; /* play-sound command data */
+ void *playdata; /* play-sound command callback data */
+
+ CamelFilterSystemBeepFunc *beep; /* system beep callback */
+ void *beepdata; /* system beep callback data */
/* for callback */
CamelFilterGetFolderFunc get_folder;
@@ -307,6 +310,15 @@ camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySo
}
void
+camel_filter_driver_set_system_beep_func (CamelFilterDriver *d, CamelFilterSystemBeepFunc *func, void *data)
+{
+ struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
+
+ p->beep = func;
+ p->beepdata = data;
+}
+
+void
camel_filter_driver_set_default_folder (CamelFilterDriver *d, CamelFolder *def)
{
struct _CamelFilterDriverPrivate *p = _PRIVATE (d);
@@ -591,10 +603,14 @@ shell_exec (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterD
static ESExpResult *
do_beep (struct _ESExp *f, int argc, struct _ESExpResult **argv, CamelFilterDriver *driver)
{
+ struct _CamelFilterDriverPrivate *p = _PRIVATE (driver);
+
d(fprintf (stderr, "beep\n"));
- camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Beep");
- printf ("\a");
+ if (p->beep) {
+ p->beep (driver, p->beepdata);
+ camel_filter_driver_log (driver, FILTER_LOG_ACTION, "Beep");
+ }
return NULL;
}
diff --git a/camel/camel-filter-driver.h b/camel/camel-filter-driver.h
index 04568c94b2..f33b529700 100644
--- a/camel/camel-filter-driver.h
+++ b/camel/camel-filter-driver.h
@@ -61,8 +61,9 @@ typedef CamelFolder * (*CamelFilterGetFolderFunc) (CamelFilterDriver *driver, co
typedef void (CamelFilterStatusFunc) (CamelFilterDriver *driver, enum camel_filter_status_t status,
int pc, const char *desc, void *data);
-typedef void (CamelFilterShellExecFunc) (CamelFilterDriver *driver, const char *command, void *data);
-typedef void (CamelFilterPlaySoundFunc) (CamelFilterDriver *driver, const char *filename, void *data);
+typedef void (CamelFilterShellExecFunc) (CamelFilterDriver *driver, const char *command, void *data);
+typedef void (CamelFilterPlaySoundFunc) (CamelFilterDriver *driver, const char *filename, void *data);
+typedef void (CamelFilterSystemBeepFunc) (CamelFilterDriver *driver, void *data);
CamelType camel_filter_driver_get_type (void);
CamelFilterDriver *camel_filter_driver_new (void);
@@ -73,6 +74,7 @@ void camel_filter_driver_set_logfile (CamelFilterDriver *d, FILE *logfi
void camel_filter_driver_set_status_func (CamelFilterDriver *d, CamelFilterStatusFunc *func, void *data);
void camel_filter_driver_set_shell_exec_func (CamelFilterDriver *d, CamelFilterShellExecFunc *func, void *data);
void camel_filter_driver_set_play_sound_func (CamelFilterDriver *d, CamelFilterPlaySoundFunc *func, void *data);
+void camel_filter_driver_set_system_beep_func (CamelFilterDriver *d, CamelFilterSystemBeepFunc *func, void *data);
void camel_filter_driver_set_folder_func (CamelFilterDriver *d, CamelFilterGetFolderFunc fetcher, void *data);
void camel_filter_driver_set_default_folder (CamelFilterDriver *d, CamelFolder *def);