gspell-entry-utils.h 1.66 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
/*
 * This file is part of gspell, a spell-checking library.
 *
 * Copyright 2016 - Sébastien Wilmet
 *
 * This library 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.
 *
 * This library 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 this library; if not, see <http://www.gnu.org/licenses/>.
 */

#ifndef GSPELL_ENTRY_UTILS_H
#define GSPELL_ENTRY_UTILS_H

#include <gtk/gtk.h>

G_BEGIN_DECLS

typedef struct _GspellEntryWord GspellEntryWord;
struct _GspellEntryWord
{
	gchar *word_str;

	/* Position in the GtkEntryBuffer. The character at the byte_end index
	 * is not included, like in #PangoAttribute.
	 */
	gint byte_start;
	gint byte_end;
37 38 39 40 41 42

	/* The same as @byte_start and @byte_end, but in characters.
	 * Useful for example for the #GtkEditable functions.
	 */
	gint char_start;
	gint char_end;
43 44 45
};

G_GNUC_INTERNAL
46
GspellEntryWord *_gspell_entry_word_new				(void);
47 48

G_GNUC_INTERNAL
49
void		 _gspell_entry_word_free			(gpointer data);
50 51

G_GNUC_INTERNAL
52 53 54 55 56
GSList *	 _gspell_entry_utils_get_words			(GtkEntry *entry);

G_GNUC_INTERNAL
gint		 _gspell_entry_utils_get_char_position_at_event	(GtkEntry       *entry,
								 GdkEventButton *event);
57 58 59 60 61 62

G_END_DECLS

#endif /* GSPELL_ENTRY_UTILS_H */

/* ex:set ts=8 noet: */