Commit c3365e45 authored by Johannes Schmid's avatar Johannes Schmid Committed by Johannes Schmid

New bookmark system. Will be extended to remember bookmarks across

2008-12-19  Johannes Schmid  <jhs@gnome.org>

	* libanjuta/interfaces/libanjuta.idl:
	* plugins/document-manager/Makefile.am:
	* plugins/document-manager/action-callbacks.c:
	* plugins/document-manager/action-callbacks.h:
	* plugins/document-manager/anjuta-bookmarks.c
	(on_document_changed), (on_add_clicked), (on_remove_clicked),
	(on_row_activate), (on_document_added), (on_selection_changed),
	(anjuta_bookmarks_init), (anjuta_bookmarks_finalize),
	(anjuta_bookmarks_class_init), (anjuta_bookmarks_new),
	(anjuta_bookmarks_add), (anjuta_bookmarks_remove),
	(anjuta_bookmarks_session_save), (anjuta_bookmarks_session_load):
	* plugins/document-manager/anjuta-bookmarks.h:
	* plugins/document-manager/anjuta-document-manager.ui:
	* plugins/document-manager/plugin.c (register_stock_icons),
	(activate_plugin), (deactivate_plugin):
	* plugins/document-manager/plugin.h:
	* plugins/editor/aneditor.cxx:
	* plugins/editor/text_editor.c:
	* plugins/search/search-replace.c (search_and_replace):
	* plugins/sourceview/sourceview-io.c (on_save_finished):
	* plugins/sourceview/sourceview.c:
  New bookmark system. Will be extended to remember bookmarks across sessions
  and with some other things soon.

	* plugins/file-manager/file-view.c (file_view_row_activated),
	(file_view_do_popup_menu), (file_view_button_press_event),
	(file_view_popup_menu), (file_view_class_init):
	Fixed mouse actions and popup-menu handling to use the correct gtk+ stuff.

svn path=/trunk/; revision=4454
parent 9af9744d
2008-12-19 Johannes Schmid <jhs@gnome.org>
* libanjuta/interfaces/libanjuta.idl:
* plugins/document-manager/Makefile.am:
* plugins/document-manager/action-callbacks.c:
* plugins/document-manager/action-callbacks.h:
* plugins/document-manager/anjuta-bookmarks.c
(on_document_changed), (on_add_clicked), (on_remove_clicked),
(on_row_activate), (on_document_added), (on_selection_changed),
(anjuta_bookmarks_init), (anjuta_bookmarks_finalize),
(anjuta_bookmarks_class_init), (anjuta_bookmarks_new),
(anjuta_bookmarks_add), (anjuta_bookmarks_remove),
(anjuta_bookmarks_session_save), (anjuta_bookmarks_session_load):
* plugins/document-manager/anjuta-bookmarks.h:
* plugins/document-manager/anjuta-document-manager.ui:
* plugins/document-manager/plugin.c (register_stock_icons),
(activate_plugin), (deactivate_plugin):
* plugins/document-manager/plugin.h:
* plugins/editor/aneditor.cxx:
* plugins/editor/text_editor.c:
* plugins/search/search-replace.c (search_and_replace):
* plugins/sourceview/sourceview-io.c (on_save_finished):
* plugins/sourceview/sourceview.c:
New bookmark system. Will be extended to remember bookmarks across sessions
and with some other things soon.
* plugins/file-manager/file-view.c (file_view_row_activated),
(file_view_do_popup_menu), (file_view_button_press_event),
(file_view_popup_menu), (file_view_class_init):
Fixed mouse actions and popup-menu handling to use the correct gtk+ stuff.
2008-12-17 James Liggett <jrliggett@cox.net>
* libanjuta/Makefile.am:
......@@ -2340,80 +2340,6 @@ interface IAnjutaEditorCell
}
}
/**
* SECTION:ianjuta-bookmark
* @title: IAnjutaBookmark
* @short_description: Bookmark interface
* @see_also:
* @stability: Unstable
* @include: libanjuta/interfaces/ianjuta-bookmark.h
*
*/
interface IAnjutaBookmark
{
/**
* ianjuta_bookmark_toggle:
* @obj: Self
* @location: The location where bookmark is toggled.
* @ensure_visible: If the location must be made visible.
* @err: Error propagation and reporting
*
* Toggle bookmark at given @location
*
*/
void toggle (gint location, gboolean ensure_visible);
/**
* ianjuta_bookmark_first:
* @obj: Self
* @err: Error propagation and reporting
*
* Goto first bookmark
*
*/
void first ();
/**
* ianjuta_bookmark_last:
* @obj: Self
* @err: Error propagation and reporting
*
* Goto last bookmark
*
*/
void last ();
/**
* ianjuta_bookmark_next:
* @obj: Self
* @err: Error propagation and reporting
*
* Goto next bookmark
*
*/
void next ();
/**
* ianjuta_bookmark_previous:
* @obj: Self
* @err: Error propagation and reporting
*
* Goto previous bookmark
*
*/
void previous ();
/**
* ianjuta_bookmark_clear_all:
* @obj: Self
* @err: Error propagation and reporting
*
* Clear all bookmarks
*
*/
void clear_all ();
}
/**
* SECTION:ianjuta-editor-factory
* @title: IAnjutaEditorFactory
......
......@@ -44,7 +44,9 @@ libanjuta_document_manager_la_SOURCES= \
file_history.c \
file_history.h \
search-box.h \
search-box.c
search-box.c \
anjuta-bookmarks.h \
anjuta-bookmarks.c
prefs_glade_files = anjuta-document-manager.glade
include $(top_srcdir)/scripts/build-schemas.mk
......
......@@ -28,7 +28,6 @@
#include <libanjuta/interfaces/ianjuta-editor-line-mode.h>
#include <libanjuta/interfaces/ianjuta-editor-view.h>
#include <libanjuta/interfaces/ianjuta-editor-folds.h>
#include <libanjuta/interfaces/ianjuta-bookmark.h>
#include <libanjuta/interfaces/ianjuta-file.h>
#include <libanjuta/interfaces/ianjuta-file-savable.h>
#include <libanjuta/interfaces/ianjuta-print.h>
......@@ -605,68 +604,6 @@ on_editor_command_toggle_fold_activate (GtkAction *action, gpointer user_data)
ianjuta_editor_folds_toggle_current (IANJUTA_EDITOR_FOLDS (doc), NULL);
}
void
on_editor_command_bookmark_toggle_activate (GtkAction *action, gpointer user_data)
{
IAnjutaDocument *doc;
doc = get_current_document (user_data);
if (doc)
ianjuta_bookmark_toggle (IANJUTA_BOOKMARK (doc),
ianjuta_editor_get_lineno (IANJUTA_EDITOR (doc), NULL),
FALSE, NULL);
}
void
on_editor_command_bookmark_first_activate (GtkAction *action, gpointer user_data)
{
IAnjutaDocument *doc;
doc = get_current_document (user_data);
if (doc)
ianjuta_bookmark_first (IANJUTA_BOOKMARK (doc), NULL);
}
void
on_editor_command_bookmark_next_activate (GtkAction *action, gpointer user_data)
{
IAnjutaDocument *doc;
doc = get_current_document (user_data);
if (doc)
ianjuta_bookmark_next (IANJUTA_BOOKMARK (doc), NULL);
}
void
on_editor_command_bookmark_prev_activate (GtkAction *action, gpointer user_data)
{
IAnjutaDocument *doc;
doc = get_current_document (user_data);
if (doc)
ianjuta_bookmark_previous (IANJUTA_BOOKMARK (doc), NULL);
}
void
on_editor_command_bookmark_last_activate (GtkAction *action, gpointer user_data)
{
IAnjutaDocument *doc;
doc = get_current_document (user_data);
if (doc)
ianjuta_bookmark_last (IANJUTA_BOOKMARK (doc), NULL);
}
void
on_editor_command_bookmark_clear_activate (GtkAction *action, gpointer user_data)
{
IAnjutaDocument *doc;
doc = get_current_document (user_data);
if (doc)
ianjuta_bookmark_clear_all (IANJUTA_BOOKMARK (doc), NULL);
}
void
on_transform_eolchars1_activate (GtkAction *action, gpointer user_data)
{
......
......@@ -49,12 +49,6 @@ void on_editor_command_complete_word_activate (GtkAction *action, gpointer user_
void on_editor_command_close_folds_all_activate (GtkAction *action, gpointer user_data);
void on_editor_command_open_folds_all_activate (GtkAction *action, gpointer user_data);
void on_editor_command_toggle_fold_activate (GtkAction *action, gpointer user_data);
void on_editor_command_bookmark_toggle_activate (GtkAction *action, gpointer user_data);
void on_editor_command_bookmark_first_activate (GtkAction *action, gpointer user_data);
void on_editor_command_bookmark_next_activate (GtkAction *action, gpointer user_data);
void on_editor_command_bookmark_prev_activate (GtkAction *action, gpointer user_data);
void on_editor_command_bookmark_last_activate (GtkAction *action, gpointer user_data);
void on_editor_command_bookmark_clear_activate (GtkAction *action, gpointer user_data);
void on_transform_eolchars1_activate (GtkAction *action, gpointer user_data);
......
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* anjuta-trunk
* Copyright (C) Johannes Schmid 2008 <jhs@gnome.org>
*
* anjuta-trunk is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* anjuta-trunk 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "anjuta-bookmarks.h"
#include "anjuta-docman.h"
#include <libanjuta/interfaces/ianjuta-markable.h>
#include <libanjuta/interfaces/ianjuta-file.h>
#include <gtk/gtk.h>
#include <gio/gio.h>
#define BOOKMARKS_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), ANJUTA_TYPE_BOOKMARKS, AnjutaBookmarksPrivate))
#define ANJUTA_STOCK_BOOKMARK_TOGGLE "anjuta-bookmark-toggle"
typedef struct _AnjutaBookmarksPrivate AnjutaBookmarksPrivate;
struct _AnjutaBookmarksPrivate
{
GtkWidget* window;
GtkWidget* tree;
GtkTreeModel* model;
GtkWidget* button_add;
GtkWidget* button_remove;
DocmanPlugin* docman;
};
enum
{
COLUMN_TEXT = 0,
COLUMN_FILE,
COLUMN_LINE,
COLUMN_HANDLE,
N_COLUMNS
};
G_DEFINE_TYPE (AnjutaBookmarks, anjuta_bookmarks, G_TYPE_OBJECT);
static void
on_document_changed (AnjutaDocman *docman, IAnjutaDocument *doc,
AnjutaBookmarks *bookmarks)
{
AnjutaBookmarksPrivate* priv = BOOKMARKS_GET_PRIVATE(bookmarks);
gboolean status = IANJUTA_IS_EDITOR(doc);
gtk_widget_set_sensitive (GTK_WIDGET(priv->button_add), status);
}
static void
on_add_clicked (GtkWidget* button, AnjutaBookmarks* bookmarks)
{
AnjutaBookmarksPrivate* priv = BOOKMARKS_GET_PRIVATE(bookmarks);
IAnjutaDocument* doc =
anjuta_docman_get_current_document (ANJUTA_DOCMAN(priv->docman->docman));
g_return_if_fail (IANJUTA_IS_EDITOR(doc));
IAnjutaEditor* editor = IANJUTA_EDITOR(doc);
anjuta_bookmarks_add (bookmarks, editor, ianjuta_editor_get_lineno (editor, NULL));
}
static void
on_remove_clicked (GtkWidget* button, AnjutaBookmarks* bookmarks)
{
anjuta_bookmarks_remove (bookmarks);
}
static void
on_row_activate (GtkTreeView* view, GtkTreePath* path,
GtkTreeViewColumn* column, AnjutaBookmarks* bookmarks)
{
GtkTreeIter iter;
GFile* file;
gint line;
AnjutaBookmarksPrivate* priv = BOOKMARKS_GET_PRIVATE(bookmarks);
IAnjutaEditor* editor;
gtk_tree_model_get_iter (priv->model, &iter, path);
gtk_tree_model_get (priv->model, &iter,
COLUMN_FILE, &file,
COLUMN_LINE, &line,
-1);
editor = anjuta_docman_goto_file_line (ANJUTA_DOCMAN(priv->docman->docman), file, line);
g_object_unref (file);
}
static void
on_document_added (AnjutaDocman* docman, IAnjutaDocument* doc,
AnjutaBookmarks* bookmarks)
{
IAnjutaMarkable* markable;
GtkTreeIter iter;
AnjutaBookmarksPrivate* priv = BOOKMARKS_GET_PRIVATE(bookmarks);
if (!IANJUTA_IS_MARKABLE(doc))
return;
markable = IANJUTA_MARKABLE(doc);
if (!gtk_tree_model_get_iter_first (priv->model, &iter))
return;
do
{
GFile* file;
GFile* editor_file = ianjuta_file_get_file (IANJUTA_FILE(doc), NULL);
gint line;
gtk_tree_model_get (priv->model, &iter,
COLUMN_FILE, &file,
COLUMN_LINE, &line,
-1);
if (g_file_equal (file, editor_file))
{
if (!ianjuta_markable_is_marker_set (markable,
line,
IANJUTA_MARKABLE_BOOKMARK,
NULL))
{
int handle = ianjuta_markable_mark (markable, line,
IANJUTA_MARKABLE_BOOKMARK,
NULL);
gtk_list_store_set (GTK_LIST_STORE(priv->model),
&iter,
COLUMN_HANDLE,
handle, -1);
}
}
g_object_unref (editor_file);
g_object_unref (file);
}
while (gtk_tree_model_iter_next (priv->model, &iter));
}
static void
on_selection_changed (GtkTreeSelection* selection, AnjutaBookmarks* bookmarks)
{
AnjutaBookmarksPrivate* priv = BOOKMARKS_GET_PRIVATE(bookmarks);
gboolean status = gtk_tree_selection_get_selected (selection, NULL, NULL);
gtk_widget_set_sensitive (priv->button_remove, status);
}
static void
anjuta_bookmarks_init (AnjutaBookmarks *bookmarks)
{
AnjutaBookmarksPrivate* priv = BOOKMARKS_GET_PRIVATE(bookmarks);
GtkCellRenderer* renderer;
GtkTreeViewColumn* column;
GtkWidget* scrolled_window;
GtkWidget* button_box;
GtkTreeSelection* selection;
priv->window = gtk_vbox_new (FALSE, 5);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(scrolled_window),
GTK_SHADOW_ETCHED_IN);
gtk_box_pack_start (GTK_BOX (priv->window),
scrolled_window,
TRUE, TRUE, 0);
priv->model = GTK_TREE_MODEL(gtk_list_store_new (N_COLUMNS, G_TYPE_STRING,
G_TYPE_OBJECT, G_TYPE_INT, G_TYPE_INT));
priv->tree = gtk_tree_view_new_with_model (priv->model);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(priv->tree), FALSE);
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes ("Bookmark", renderer,
"text", COLUMN_TEXT, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW(priv->tree), column);
gtk_container_add (GTK_CONTAINER(scrolled_window),
priv->tree);
g_signal_connect (G_OBJECT(priv->tree), "row-activated", G_CALLBACK(on_row_activate),
bookmarks);
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(priv->tree));
g_signal_connect (G_OBJECT(selection), "changed", G_CALLBACK(on_selection_changed),
bookmarks);
button_box = gtk_hbutton_box_new ();
priv->button_add = gtk_button_new_from_stock (GTK_STOCK_ADD);
priv->button_remove = gtk_button_new_from_stock (GTK_STOCK_REMOVE);
g_signal_connect (G_OBJECT(priv->button_add), "clicked", G_CALLBACK(on_add_clicked), bookmarks);
g_signal_connect (G_OBJECT(priv->button_remove), "clicked", G_CALLBACK(on_remove_clicked), bookmarks);
gtk_widget_set_sensitive (GTK_WIDGET(priv->button_add), FALSE);
gtk_widget_set_sensitive (GTK_WIDGET(priv->button_remove), FALSE);
gtk_box_pack_start_defaults (GTK_BOX(button_box), priv->button_add);
gtk_box_pack_start_defaults (GTK_BOX(button_box), priv->button_remove);
gtk_box_pack_start(GTK_BOX(priv->window),
button_box,
FALSE, FALSE, 0);
gtk_widget_show_all (priv->window);
}
static void
anjuta_bookmarks_finalize (GObject *object)
{
AnjutaBookmarks* bookmarks = ANJUTA_BOOKMARKS (object);
AnjutaBookmarksPrivate* priv = BOOKMARKS_GET_PRIVATE(bookmarks);
anjuta_shell_remove_widget (ANJUTA_PLUGIN(priv->docman)->shell,
priv->window,
NULL);
G_OBJECT_CLASS (anjuta_bookmarks_parent_class)->finalize (object);
}
static void
anjuta_bookmarks_class_init (AnjutaBookmarksClass *klass)
{
GObjectClass* object_class = G_OBJECT_CLASS (klass);
object_class->finalize = anjuta_bookmarks_finalize;
g_type_class_add_private (klass, sizeof (AnjutaBookmarksPrivate));
}
AnjutaBookmarks*
anjuta_bookmarks_new (DocmanPlugin* docman)
{
AnjutaBookmarks* bookmarks = ANJUTA_BOOKMARKS (g_object_new (ANJUTA_TYPE_BOOKMARKS,
NULL));
AnjutaBookmarksPrivate* priv = BOOKMARKS_GET_PRIVATE(bookmarks);
priv->docman = docman;
anjuta_shell_add_widget (ANJUTA_PLUGIN(docman)->shell,
priv->window,
"bookmarks",
_("Bookmarks"),
ANJUTA_STOCK_BOOKMARK_TOGGLE,
ANJUTA_SHELL_PLACEMENT_RIGHT,
NULL);
g_signal_connect (G_OBJECT(docman->docman), "document-changed",
G_CALLBACK(on_document_changed), bookmarks);
g_signal_connect (G_OBJECT(docman->docman), "document-added",
G_CALLBACK(on_document_added), bookmarks);
return bookmarks;
}
void
anjuta_bookmarks_add (AnjutaBookmarks* bookmarks, IAnjutaEditor* editor, gint line)
{
g_return_if_fail (IANJUTA_IS_MARKABLE(editor));
IAnjutaMarkable* markable = IANJUTA_MARKABLE(editor);
GtkTreeIter iter;
gint handle;
gchar* text;
AnjutaBookmarksPrivate* priv = BOOKMARKS_GET_PRIVATE(bookmarks);
GFile* file;
/* If there is already a marker -> do nothing */
if (ianjuta_markable_is_marker_set (markable, line, IANJUTA_MARKABLE_BOOKMARK, NULL))
return;
handle = ianjuta_markable_mark (markable, line, IANJUTA_MARKABLE_BOOKMARK, NULL);
gtk_list_store_append (GTK_LIST_STORE(priv->model), &iter);
text = g_strdup_printf ("%s:%d", ianjuta_document_get_filename(IANJUTA_DOCUMENT(editor), NULL),
line);
file = ianjuta_file_get_file(IANJUTA_FILE(editor), NULL);
gtk_list_store_set (GTK_LIST_STORE(priv->model), &iter,
COLUMN_TEXT, text,
COLUMN_FILE, file,
COLUMN_LINE, line,
COLUMN_HANDLE, handle,
-1);
g_free(text);
g_object_unref (file);
}
void
anjuta_bookmarks_remove (AnjutaBookmarks* bookmarks)
{
AnjutaBookmarksPrivate* priv = BOOKMARKS_GET_PRIVATE(bookmarks);
GtkTreeIter iter;
GtkTreeSelection* selection = gtk_tree_view_get_selection (GTK_TREE_VIEW(priv->tree));
if (gtk_tree_selection_get_selected (selection, NULL, &iter))
{
GFile* file;
gint line;
IAnjutaEditor* editor;
gtk_tree_model_get (priv->model, &iter,
COLUMN_FILE, &file,
COLUMN_LINE, &line,
-1);
editor = IANJUTA_EDITOR(anjuta_docman_get_document_for_file (ANJUTA_DOCMAN(priv->docman->docman),
file));
if (editor)
{
if (ianjuta_markable_is_marker_set (IANJUTA_MARKABLE(editor),
line, IANJUTA_MARKABLE_BOOKMARK, NULL))
{
ianjuta_markable_unmark (IANJUTA_MARKABLE(editor), line,
IANJUTA_MARKABLE_BOOKMARK, NULL);
}
}
g_object_unref (file);
gtk_list_store_remove (GTK_LIST_STORE (priv->model), &iter);
}
}
void
anjuta_bookmarks_session_save (AnjutaBookmarks* bookmarks, AnjutaSession* session)
{
/* TODO: Add public function implementation here */
}
void
anjuta_bookmarks_session_load (AnjutaBookmarks* bookmarks, AnjutaSession* session)
{
/* TODO: Add public function implementation here */
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
/*
* anjuta-trunk
* Copyright (C) Johannes Schmid 2008 <jhs@gnome.org>
*
* anjuta-trunk is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* anjuta-trunk 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _ANJUTA_BOOKMARKS_H_
#define _ANJUTA_BOOKMARKS_H_
#include <glib-object.h>
#include <libanjuta/interfaces/ianjuta-editor.h>
#include <libanjuta/anjuta-session.h>
#include "plugin.h"
G_BEGIN_DECLS
#define ANJUTA_TYPE_BOOKMARKS (anjuta_bookmarks_get_type ())
#define ANJUTA_BOOKMARKS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), ANJUTA_TYPE_BOOKMARKS, AnjutaBookmarks))
#define ANJUTA_BOOKMARKS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), ANJUTA_TYPE_BOOKMARKS, AnjutaBookmarksClass))
#define ANJUTA_IS_BOOKMARKS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), ANJUTA_TYPE_BOOKMARKS))
#define ANJUTA_IS_BOOKMARKS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), ANJUTA_TYPE_BOOKMARKS))
#define ANJUTA_BOOKMARKS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), ANJUTA_TYPE_BOOKMARKS, AnjutaBookmarksClass))
typedef struct _AnjutaBookmarksClass AnjutaBookmarksClass;
typedef struct _AnjutaBookmarks AnjutaBookmarks;
struct _AnjutaBookmarksClass
{
GObjectClass parent_class;
};
struct _AnjutaBookmarks
{
GObject parent_instance;
};
GType anjuta_bookmarks_get_type (void) G_GNUC_CONST;
AnjutaBookmarks* anjuta_bookmarks_new (DocmanPlugin* docman);
void anjuta_bookmarks_add (AnjutaBookmarks* bookmarks, IAnjutaEditor* editor, gint line);
void anjuta_bookmarks_remove (AnjutaBookmarks* bookmarks);
void anjuta_bookmarks_session_save (AnjutaBookmarks* bookmarks, AnjutaSession* session);
void anjuta_bookmarks_session_load (AnjutaBookmarks* bookmarks, AnjutaSession* session);
G_END_DECLS
#endif /* _ANJUTA_BOOKMARKS_H_ */
......@@ -84,18 +84,6 @@
<menuitem name="FoldToggle" action="ActionFormatFoldToggle" />
</menu>
<menu name="Goto" action="ActionMenuGoto">
<placeholder name="PlaceHolderBookmarkMenus">
<menu name="MenuBookmark" action="ActionMenuBookmark">
<menuitem name="Toggle" action="ActionBookmarkToggle" />
<separator name="separator11" />
<menuitem name="First" action="ActionBookmarkFirst" />
<menuitem name="Previous" action="ActionBookmarkPrevious" />
<menuitem name="Next" action="ActionBookmarkNext" />
<menuitem name="Last" action="ActionBookmarkLast" />
<separator name="separator12" />
<menuitem name="Clear" action="ActionBookmarkClear" />
</menu>
</placeholder>
<menuitem name="Line" action="ActionEditGotoLine" />
<menuitem name="MatchingBrace" action="ActionEditGotoMatchingBrace" />
<separator name="separator13"/>
......@@ -131,30 +119,13 @@
<toolitem name="Redo" action="ActionEditRedo" />
</placeholder>
</toolbar>
<toolbar name="ToolbarBookmark">
<placeholder name="PlaceholderBrowserToolbar" >
<toolitem name="Toggle" action="ActionBookmarkToggle"/>
<toolitem name="First" action="ActionBookmarkFirst"/>
<toolitem name="Previous" action="ActionBookmarkPrevious"/>
<toolitem name="Next" action="ActionBookmarkNext"/>
<toolitem name="Last" action="ActionBookmarkLast"/>
<toolitem name="Clear" action="ActionBookmarkClear"/>
<separator name="separator19"/>
<toolitem name="BlockStart" action="ActionEditGotoBlockStart"/>
<toolitem name="BlockEnd" action="ActionEditGotoBlockEnd"/>
<separator name="separator20"/>
</placeholder>
</toolbar>
<popup name="PopupDocumentManager">
<menuitem name="Cut" action="ActionEditCut" />
<menuitem name="Copy" action="ActionEditCopy" />
<menuitem name="Paste" action="ActionEditPaste" />
<separator name="separator26"/>
<menuitem name="Toggle" action="ActionBookmarkToggle" />
<menu name="Goto" action="ActionMenuGoto">
<separator name="separator27"/>
<menuitem name="Previous" action="ActionBookmarkPrevious" />
<menuitem name="Next" action="ActionBookmarkNext" />
<menuitem name="HistoryPrevious" action="ActionEditGotoHistoryPrev" />
<menuitem name="HistoryNext" action="ActionEditGotoHistoryNext" />
</menu>
......
......@@ -48,17 +48,13 @@
#include "action-callbacks.h"
#include "plugin.h"
#include "search-box.h"
#include "anjuta-bookmarks.h"
#define UI_FILE PACKAGE_DATA_DIR"/ui/anjuta-document-manager.ui"
#define PREFS_GLADE PACKAGE_DATA_DIR"/glade/anjuta-document-manager.glade"
#define ICON_FILE "anjuta-document-manager-plugin-48.png"
#define ANJUTA_PIXMAP_BOOKMARK_TOGGLE "anjuta-bookmark-toggle"
#define ANJUTA_PIXMAP_BOOKMARK_FIRST "anjuta-bookmark-first"
#define ANJUTA_PIXMAP_BOOKMARK_PREV "anjuta-bookmark-prev"
#define ANJUTA_PIXMAP_BOOKMARK_NEXT "anjuta-bookmark-next"
#define ANJUTA_PIXMAP_BOOKMARK_LAST "anjuta-bookmark-last"
#define ANJUTA_PIXMAP_BOOKMARK_CLEAR "anjuta-bookmark-clear"
#define ANJUTA_PIXMAP_FOLD_TOGGLE "anjuta-fold-toggle"
#define ANJUTA_PIXMAP_FOLD_CLOSE "anjuta-fold-close"
......@@ -89,11 +85,6 @@
#define ANJUTA_STOCK_BLOCK_START "anjuta-block-start"
#define ANJUTA_STOCK_BLOCK_END "anjuta-block-end"
#define ANJUTA_STOCK_BOOKMARK_TOGGLE "anjuta-bookmark-toggle"
#define ANJUTA_STOCK_BOOKMARK_FIRST "anjuta-bookmark-first"
#define ANJUTA_STOCK_BOOKMARK_PREV "anjuta-bookmark-previous"
#define ANJUTA_STOCK_BOOKMARK_NEXT "anjuta-bookmark-next"
#define ANJUTA_STOCK_BOOKMARK_LAST "anjuta-bookmark-last"
#define ANJUTA_STOCK_BOOKMARK_CLEAR "anjuta-bookmark-clear"
#define ANJUTA_STOCK_GOTO_LINE "anjuta-goto-line"
#define ANJUTA_STOCK_HISTORY_NEXT "anjuta-history-next"
#define ANJUTA_STOCK_HISTORY_PREV "anjuta-history-prev"
......@@ -365,28 +356,6 @@ static GtkActionEntry actions_format[] = {
G_CALLBACK (on_editor_command_toggle_fold_activate)},
};
static GtkActionEntry actions_bookmark[] = {
{ "ActionMenuBookmark", NULL, N_("Bookmar_k"), NULL, NULL, NULL},
{ "ActionBookmarkToggle", ANJUTA_STOCK_BOOKMARK_TOGGLE, N_("_Toggle Bookmark"),
"<control>k", N_("Toggle a bookmark at the current line position"),
G_CALLBACK (on_editor_command_bookmark_toggle_activate)},
{ "ActionBookmarkFirst", ANJUTA_STOCK_BOOKMARK_FIRST, N_("_First Bookmark"),
NULL, N_("Jump to the first bookmark in the file"),
G_CALLBACK (on_editor_command_bookmark_first_activate)},
{ "ActionBookmarkPrevious", ANJUTA_STOCK_BOOKMARK_PREV, N_("_Previous Bookmark"),
"<control>comma", N_("Jump to the previous bookmark in the file"),
G_CALLBACK (on_editor_command_bookmark_prev_activate)},
{ "ActionBookmarkNext", ANJUTA_STOCK_BOOKMARK_NEXT, N_("_Next Bookmark"),
"<control>period", N_("Jump to the next bookmark in the file"),
G_CALLBACK (on_editor_command_bookmark_next_activate)},
{ "ActionBookmarkLast", ANJUTA_STOCK_BOOKMARK_LAST, N_("_Last Bookmark"),
NULL, N_("Jump to the last bookmark in the file"),
G_CALLBACK (on_editor_command_bookmark_last_activate)},
{ "ActionBookmarkClear", ANJUTA_STOCK_BOOKMARK_CLEAR, N_("_Clear All Bookmarks"),
NULL, N_("Clear bookmarks"),
G_CALLBACK (on_editor_command_bookmark_clear_activate)},
};
static GtkActionEntry