2
* Copyright (C) 2009 Canonical Ltd
4
* This program is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 3 as
6
* published by the Free Software Foundation.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
16
* Authored by Neil Jagdish Patel <neil.patel@canonical.com>
22
string strip_characters (string text,
28
bool matching = false;
32
GLib.Regex regex = null;
36
regex = new GLib.Regex (match_regex,
37
GLib.RegexCompileFlags.DOTALL |
38
GLib.RegexCompileFlags.OPTIMIZE,
41
catch (GLib.RegexError e)
43
warning ("Creating regular-expression failed: \"%s\"\n", e.message);
46
matching = regex.match (text, 0, out info);
51
GLib.Regex regex = null;
55
regex = new GLib.Regex (replace_regex,
56
GLib.RegexCompileFlags.DOTALL |
57
GLib.RegexCompileFlags.OPTIMIZE,
60
catch (GLib.RegexError e)
62
warning ("Creating regular-expression failed: \"%s\"\n", e.message);
67
ret = regex.replace (text, -1, 0, replace_text, 0);
69
catch (GLib.RegexError e)
71
warning ("Replacing text failed: \"%s\"\n", e.message);
80
[CCode (lower_case_prefix = "utils_")]
81
public extern void set_strut (Gtk.Window *window,
89
[CCode (lower_case_prefix = "utils_")]
90
public extern void register_object_on_dbus (DBus.Connection conn,
94
[CCode (lower_case_prefix = "utils_")]
95
public extern X.Window get_stage_window (Clutter.Stage stage);
97
[CCode (lower_case_prefix = "utils_")]
98
public extern bool save_snapshot (Clutter.Stage stage,
105
[CCode (lower_case_prefix = "utils_")]
106
public extern bool compare_snapshot (Clutter.Stage stage,
115
[CCode (lower_case_prefix = "utils_")]
116
public extern bool utils_compare_images (string img1_path,
119
[CCode (lower_case_prefix = "utils_")]
120
public extern bool window_is_decorated (X.Window window);
122
[CCode (lower_case_prefix = "utils_")]
123
public extern void window_set_decorations (X.Window window, uint decorations);
125
[CCode (lower_case_prefix = "utils_")]
126
public extern void volume_eject (GLib.Volume volume);