2005-11-22 12:26:26 +00:00
|
|
|
/*
|
2009-09-28 11:16:59 +00:00
|
|
|
* sidebar.h - this file is part of Geany, a fast and lightweight IDE
|
2005-11-22 12:26:26 +00:00
|
|
|
*
|
2011-01-19 19:39:09 +00:00
|
|
|
* Copyright 2005-2011 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
|
|
|
|
* Copyright 2006-2011 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
|
2005-11-22 12:26:26 +00:00
|
|
|
*
|
|
|
|
* This program 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 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program 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, write to the Free Software
|
|
|
|
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
2009-09-28 11:16:59 +00:00
|
|
|
#ifndef GEANY_SIDEBAR_H
|
|
|
|
#define GEANY_SIDEBAR_H 1
|
2005-11-22 12:26:26 +00:00
|
|
|
|
|
|
|
|
2007-08-23 11:34:06 +00:00
|
|
|
typedef struct SidebarTreeviews
|
2007-01-14 12:12:18 +00:00
|
|
|
{
|
2005-11-22 12:26:26 +00:00
|
|
|
GtkWidget *tree_openfiles;
|
2007-08-23 11:34:06 +00:00
|
|
|
GtkWidget *default_tag_tree;
|
2006-01-14 22:41:35 +00:00
|
|
|
GtkWidget *popup_taglist;
|
2009-07-16 15:50:13 +00:00
|
|
|
}
|
|
|
|
SidebarTreeviews;
|
2007-08-23 11:34:06 +00:00
|
|
|
|
|
|
|
extern SidebarTreeviews tv;
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2007-07-20 16:33:16 +00:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
SYMBOLS_COLUMN_ICON,
|
|
|
|
SYMBOLS_COLUMN_NAME,
|
2008-11-03 17:25:35 +00:00
|
|
|
SYMBOLS_COLUMN_TAG,
|
2008-11-29 12:50:52 +00:00
|
|
|
SYMBOLS_COLUMN_TOOLTIP,
|
Update the symbol list rather than clearing and re-building it
The main advantages of not clearing and rebuilding the whole list is
that it doesn't loose the folding and selection (as far as the selected
row(s) still exist after the update, of course), and it reduces
flickering upon update.
The current implementation works in 3-steps:
1) mark all rows as invalid;
2) insert/update the rows, according to the new tag list, marking them
as valid;
3) remove all rows that are still invalid.
This walks (rows) the first time, (tags*rows) the second and (rows) the
third. This also uses an extra column to store the row's validity.
A (probably) better implementation would be to:
1) walk the current rows, updating them if necessary, or removing them;
2) add the remaining tags that weren't there before.
This is probably faster in theory (and probably also in practice), but
it needs to refactor a lot the code to easily update *or* create a row,
what the current code does not provide.
Basically this is would be a two-pass update, walking (rows*tags) in
the first pass, and only the remaining non-added tags in the second.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@5562 ea778897-0a13-0410-b9d1-a72fbfd435f5
2011-03-05 22:53:13 +00:00
|
|
|
SYMBOLS_COLUMN_VALID,
|
2008-02-20 11:24:23 +00:00
|
|
|
SYMBOLS_N_COLUMNS
|
2007-07-20 16:33:16 +00:00
|
|
|
};
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2009-09-28 11:16:59 +00:00
|
|
|
void sidebar_init(void);
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2009-09-28 11:16:59 +00:00
|
|
|
void sidebar_finalize(void);
|
2009-07-16 15:50:13 +00:00
|
|
|
|
2009-09-28 11:16:59 +00:00
|
|
|
void sidebar_update_tag_list(GeanyDocument *doc, gboolean update);
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2009-09-28 11:16:59 +00:00
|
|
|
void sidebar_openfiles_add(GeanyDocument *doc);
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2009-09-28 11:16:59 +00:00
|
|
|
void sidebar_openfiles_update(GeanyDocument *doc);
|
2006-01-14 22:41:35 +00:00
|
|
|
|
2009-09-28 11:16:59 +00:00
|
|
|
void sidebar_openfiles_update_all(void);
|
2006-07-22 14:36:20 +00:00
|
|
|
|
2009-09-28 11:16:59 +00:00
|
|
|
void sidebar_select_openfiles_item(GeanyDocument *doc);
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2009-09-28 11:16:59 +00:00
|
|
|
void sidebar_remove_document(GeanyDocument *doc);
|
2005-11-22 12:26:26 +00:00
|
|
|
|
2008-11-18 13:29:53 +00:00
|
|
|
void sidebar_add_common_menu_items(GtkMenu *menu);
|
|
|
|
|
2010-02-21 18:06:42 +00:00
|
|
|
void sidebar_focus_openfiles_tab(void);
|
|
|
|
|
|
|
|
void sidebar_focus_symbols_tab(void);
|
|
|
|
|
2005-11-22 12:26:26 +00:00
|
|
|
#endif
|