~ubuntu-branches/ubuntu/vivid/liferea/vivid-proposed

« back to all changes in this revision

Viewing changes to src/script.h

  • Committer: Package Import Robot
  • Author(s): Moray Allan, Bojo42, Rodrigo Gallardo, Moray Allan
  • Date: 2012-03-27 21:44:42 UTC
  • mfrom: (1.5.1)
  • mto: (3.3.2 experimental)
  • mto: This revision was merged to the branch mainline in revision 122.
  • Revision ID: package-import@ubuntu.com-20120327214442-g0xfh714cdmsbnts
Tags: 1.8.3-0.1
[ Bojo42 ]
* Non-maintainer upload.
* New upstream release (Closes: #502307, #623619, #631778, #651913) 
* debian/patches:
  - drop libnotify0.7 as in upstream
  - debian-example-feeds: update, move planets from "News" to "Open Source"
  - www-browser: update due to new file location
  - libtool-dont-rearange-as-needed: rebase
* debian/control:
  - update Standards-Version
  - remove obsolete Build-Depends:
    - quilt not needed for "3.0 (quilt)" source format
    - libnm-glib-dev & libdbus-glib-1-dev: upstream switched to GDBus
    - liblua5.1-0-dev: LUA scripting support got dropped
  - new Build-Depends on libunique-dev, libjson-glib-dev & dh_autoreconf
  - update version dependencies
* debian/rules: run dh_autoreconf & update translations
* debian/liferea.install: nothing to ship from /usr/lib/liferea

[ Rodrigo Gallardo ]
* Lintian love:
  - debian/control: switch from Conflicts to Breaks
  - debian/rules: redo build targets

[ Moray Allan ]
* debian/copyright: update to include additional copyright owners.
* debian/patches/www-browser: also set default external browser.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**
2
 
 * @file script.h scripting support interface
3
 
 *
4
 
 * Copyright (C) 2006-2007 Lars Lindner <lars.lindner@gmail.com>
5
 
 *
6
 
 * This library is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU Library General Public
8
 
 * License as published by the Free Software Foundation; either
9
 
 * version 2 of the License, or (at your option) any later version.
10
 
 * 
11
 
 * This library 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 GNU
14
 
 * Library General Public License for more details.
15
 
 * 
16
 
 * You should have received a copy of the GNU Library General Public License
17
 
 * along with this library; see the file COPYING.LIB.  If not, write to
18
 
 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19
 
 * Boston, MA 02111-1307, USA.
20
 
 */
21
 
 
22
 
#ifndef _SCRIPT_H
23
 
#define _SCRIPT_H
24
 
 
25
 
#include <gtk/gtk.h>
26
 
 
27
 
/** scripting support plugin interface */
28
 
typedef struct scriptSupportImpl {
29
 
        guint           api_version;                            /**< API version of scripting support plugin */
30
 
        const gchar     *name;                                  /**< descriptive name of the plugin */
31
 
        void            (*init)         (void);                 /**< called on startup */
32
 
        void            (*deinit)       (void);                 /**< called on shutdown */
33
 
        void            (*run_cmd)      (const gchar *cmd);     /**< runs the given command */
34
 
        void            (*run_script)   (const gchar *file, const gchar *for_hook);     /**< runs the given script */
35
 
} *scriptSupportImplPtr;
36
 
 
37
 
#define SCRIPT_SUPPORT_API_VERSION 1
38
 
 
39
 
#define DECLARE_SCRIPT_SUPPORT_IMPL(impl) \
40
 
        G_MODULE_EXPORT scriptSupportImplPtr script_support_impl_get_info() { \
41
 
                return &impl; \
42
 
        }
43
 
        
44
 
/* script support interface */
45
 
        
46
 
typedef enum hooks {
47
 
        SCRIPT_HOOK_INVALID = 0,
48
 
        SCRIPT_HOOK_STARTUP,
49
 
        
50
 
        /* update events */
51
 
        SCRIPT_HOOK_FEED_UPDATED,
52
 
        
53
 
        /* selection hooks */
54
 
        SCRIPT_HOOK_ITEM_SELECTED,
55
 
        SCRIPT_HOOK_FEED_SELECTED,
56
 
        SCRIPT_HOOK_ITEM_UNSELECT,
57
 
        SCRIPT_HOOK_FEED_UNSELECT,
58
 
        
59
 
        SCRIPT_HOOK_SHUTDOWN,
60
 
        
61
 
        SCRIPT_HOOK_NEW_SUBSCRIPTION
62
 
} hookType;
63
 
 
64
 
/**
65
 
 * Checks wether scripting support is available and enabled or not.
66
 
 *
67
 
 * @returns TRUE if scripting support is available
68
 
 */
69
 
gboolean script_support_enabled(void);
70
 
 
71
 
/**
72
 
 * Sets up the scripting engine.
73
 
 */
74
 
void script_init(void);
75
 
 
76
 
/**
77
 
 * Runs a single command line.
78
 
 *
79
 
 * @param cmd           the command string
80
 
 */
81
 
void script_run_cmd(const gchar *cmd);
82
 
 
83
 
/**
84
 
 * Run a single script from the script repository.
85
 
 *
86
 
 * @param name          the script name
87
 
 * @param hook          type of the calling hook
88
 
 */
89
 
void script_run(const gchar *name, hookType hook);
90
 
 
91
 
/**
92
 
 * Run all scripts defined for the given hook id.
93
 
 *
94
 
 * @param type  scripting hook type
95
 
 */
96
 
void script_run_for_hook(hookType type);
97
 
 
98
 
/**
99
 
 * Adds a script to the script list of the given hook type.
100
 
 *
101
 
 * @param type          scripting hook type
102
 
 * @param scriptname    the script
103
 
 */
104
 
void script_hook_add(hookType type, const gchar *scriptname);
105
 
 
106
 
/**
107
 
 * Removes a script from the script list of the given hook type.
108
 
 * Frees the passed script name.
109
 
 *
110
 
 * @param type          scripting hook type
111
 
 * @param scriptname    the script
112
 
 */
113
 
void script_hook_remove(hookType type, gchar *scriptname);
114
 
 
115
 
/**
116
 
 * Returns the script name list for the given hook type.
117
 
 *
118
 
 * @returns script list
119
 
 */
120
 
GSList *script_hook_get_list(hookType type);
121
 
 
122
 
/**
123
 
 * Close down scripting.
124
 
 */
125
 
void script_deinit(void);
126
 
 
127
 
#endif