# This file is part of gtkD.
#
# gtkD is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
#
# gtkD 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with gtkD; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

#############################################
### Definitions for wrapping Gtk+ ###########
#############################################

# must start with wrap
wrap: vte
file: Vte-2.91.gir

struct: Terminal
import: vte.Regex : RegexVte = Regex
in: event_check_gregex_simple n_regexes
in: event_check_gregex_simple matches
in: event_check_regex_simple n_regexes
in: event_check_regex_simple matches
structWrap: Regex RegexVte

struct: Regex
import: glib.Str
import: glib.ConstructionException
noCode: new_for_match
noCode: new_for_search
code: start
	/** */
	public static Regex newMatch(string pattern, ptrdiff_t patternLength, uint flags)
	{
		GError* err = null;

		auto p = vte_regex_new_for_match(Str.toStringz(pattern), patternLength, flags, &err);

		if (err !is null)
		{
			throw new GException( new ErrorG(err) );
		}

		if(p is null)
		{
			throw new ConstructionException("null returned by new_for_match");
		}

		return new Regex(cast(VteRegex*) p);
	}

	/** */
	public static Regex newSearch(string pattern, ptrdiff_t patternLength, uint flags)
	{
		GError* err = null;

		auto p = vte_regex_new_for_search(Str.toStringz(pattern), patternLength, flags, &err);

		if (err !is null)
		{
			throw new GException( new ErrorG(err) );
		}

		if(p is null)
		{
			throw new ConstructionException("null returned by new_for_search");
		}

		return new Regex(cast(VteRegex*) p);
	}
code: end

struct:

move: get_user_shell Terminal

move: get_features Version
move: get_major_version Version
move: get_micro_version Version
move: get_minor_version Version
