medit/moo/mooedit/mooeditbookmark.h

86 lines
3.4 KiB
C
Raw Normal View History

2006-11-25 15:03:17 -06:00
/*
2010-11-23 21:54:39 -08:00
* mooeditbookmark.h
2006-11-25 15:03:17 -06:00
*
2010-12-21 20:15:45 -08:00
* Copyright (C) 2004-2010 by Yevgen Muntyan <emuntyan@users.sourceforge.net>
2006-11-25 15:03:17 -06:00
*
* This file is part of medit. medit 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.
2006-11-25 15:03:17 -06:00
*
* You should have received a copy of the GNU Lesser General Public
* License along with medit. If not, see <http://www.gnu.org/licenses/>.
2006-11-25 15:03:17 -06:00
*/
2010-11-23 21:54:39 -08:00
#ifndef MOO_EDIT_BOOKMARK_H
#define MOO_EDIT_BOOKMARK_H
2006-11-25 15:03:17 -06:00
#include <mooedit/mooedit.h>
#include <mooedit/moolinemark.h>
2016-01-31 00:03:05 -08:00
#include <moocpp/moocpp.h>
2016-01-03 06:13:38 -08:00
2006-11-25 15:03:17 -06:00
G_BEGIN_DECLS
#define MOO_TYPE_EDIT_BOOKMARK (moo_edit_bookmark_get_type ())
#define MOO_EDIT_BOOKMARK(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), MOO_TYPE_EDIT_BOOKMARK, MooEditBookmark))
#define MOO_EDIT_BOOKMARK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), MOO_TYPE_EDIT_BOOKMARK, MooEditBookmarkClass))
#define MOO_IS_EDIT_BOOKMARK(object) (G_TYPE_CHECK_INSTANCE_TYPE ((object), MOO_TYPE_EDIT_BOOKMARK))
#define MOO_IS_EDIT_BOOKMARK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MOO_TYPE_EDIT_BOOKMARK))
#define MOO_EDIT_BOOKMARK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MOO_TYPE_EDIT_BOOKMARK, MooEditBookmarkClass))
2010-12-12 02:29:20 -08:00
typedef struct MooEditBookmark MooEditBookmark;
typedef struct MooEditBookmarkClass MooEditBookmarkClass;
2006-11-25 15:03:17 -06:00
2010-12-12 02:29:20 -08:00
struct MooEditBookmark
2006-11-25 15:03:17 -06:00
{
MooLineMark mark;
guint no;
2016-01-04 03:56:42 -08:00
#ifdef __cplusplus
2016-01-04 09:56:33 -08:00
static void set_enable_bookmarks (Edit edit,
bool enable);
static bool get_enable_bookmarks (const Edit& edit);
2016-05-10 23:26:06 -07:00
#endif // __cplusplus
2006-11-25 15:03:17 -06:00
};
2010-12-12 02:29:20 -08:00
struct MooEditBookmarkClass
2006-11-25 15:03:17 -06:00
{
MooLineMarkClass mark_class;
};
2016-01-03 06:13:38 -08:00
#ifdef __cplusplus
2016-01-04 10:24:03 -08:00
using EditBookmarkPtr = moo::gobj_ptr<MooEditBookmark>;
using EditBookmark = moo::gobj_ref<MooEditBookmark>;
2016-01-03 06:13:38 -08:00
#endif
2006-11-25 15:03:17 -06:00
GType moo_edit_bookmark_get_type (void) G_GNUC_CONST;
/* list must not be modified */
const GSList *moo_edit_list_bookmarks (MooEdit *edit);
void moo_edit_toggle_bookmark (MooEdit *edit,
guint line);
void moo_edit_remove_bookmark (MooEdit *edit,
MooEditBookmark *bookmark);
void moo_edit_add_bookmark (MooEdit *edit,
guint line,
guint no);
MooEditBookmark *moo_edit_get_bookmark_at_line (MooEdit *edit,
guint line);
MooEditBookmark *moo_edit_get_bookmark (MooEdit *edit,
guint n);
GSList *moo_edit_get_bookmarks_in_range(MooEdit *edit,
int first_line,
int last_line);
2011-01-17 03:01:11 -08:00
void moo_edit_view_goto_bookmark (MooEditView *view,
2006-11-25 15:03:17 -06:00
MooEditBookmark *bookmark);
char *_moo_edit_bookmark_get_text (MooEditBookmark *bookmark);
G_END_DECLS
2010-11-23 21:54:39 -08:00
#endif /* MOO_EDIT_BOOKMARK_H */