Kaydet (Commit) 0994c761 authored tarafından Nick Treleaven's avatar Nick Treleaven

Apply patch to add symbol list icons from Jean-François Wauthy

(thanks). Also thanks to KDevelop for the icons.
Add list of projects to THANKS.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1728 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst 2178c7c8
......@@ -5,6 +5,17 @@
Rename ui_close_buttons_toggle() ui_document_buttons_update().
Move app->sensitive_buttons to ui_utils.c for easier maintenance,
rename to document_buttons.
* configure.in, src/treeviews.c, src/treeviews.h,
src/symbols.c, THANKS, Makefile.am, icons, icons/16x16,
icons/16x16/classviewer-member.png, icons/16x16/classviewer-var.png,
icons/16x16/classviewer-namespace.png,
icons/16x16/classviewer-method.png, icons/16x16/Makefile.am,
icons/16x16/classviewer-macro.png, icons/16x16/classviewer-other.png,
icons/16x16/classviewer-struct.png,
icons/16x16/classviewer-class.png, icons/Makefile.am:
Apply patch to add symbol list icons from Jean-François Wauthy
(thanks). Also thanks to KDevelop for the icons.
Add list of projects to THANKS.
2007-07-19 Nick Treleaven <nick.treleaven@btinternet.com>
......
## Process this file with automake to produce Makefile.in
SUBDIRS = tagmanager scintilla src plugins po doc
SUBDIRS = tagmanager scintilla src plugins icons po doc
WIN32_BUILD_FILES = \
geany_private.rc \
......
What's this file about?
-----------------------
This file lists all external people that have contributed to this project.
If any contributors are missing, please email the developers - see the AUTHORS file.
Testers and contributors:
--------------------------
-------------------------
These people have contributed to Geany by testing the software,
reporting problems, sending patches and making useful suggestions.
Frank Lanitz <frank(at)frank(dot)uvena(dot)de> - heavy testing
......@@ -33,9 +34,10 @@ Dave Moore <wrex006(at)gmail(dot)com> - code navigation patch
François Cami <francois.cami(at)free(dot)fr>, Guillaume Duviol - tab replacement patch
Alexander Rodin <rodin(dot)alexander(at)gmail(dot)com> - class builder patch
Shiv <shivakumar(dot)gn(at)gmail(dot)com> - Sun Studio compiler compatibility patch
Jean-François Wauthy <pollux(at)xfce(dot)org> - Symbol list icons patch
Translators:
----------------------------------
------------
These people have translated Geany to foreign languages.
Yura Semashko <yurand2(at)gmail(dot)com> - be_BY
Dilyan Rusev <dilyanrusev(at)gmail(dot)com> - bg
......@@ -57,3 +59,12 @@ brahmann_ <brahmann(at)lifec0re(dot)org(dot)ru> - ru_RU
Clytie Siddall <clytie(at)riverland(dot)net(dot)au> - vi_VN
Dormouse Young <dormouse.young(at)gmail(dot)com> - zh_CN
KoViCH <kovich.ian(at)gmail(dot)com> - zh_TW
Projects:
---------
GTK/GLib
Scintilla
Tagmanager
CTags
Anjuta (tagmanager)
KDevelop (symbol list icons)
......@@ -178,6 +178,8 @@ AC_SUBST(GEANY_DATA_DIR)
AC_OUTPUT([
Makefile
icons/Makefile
icons/16x16/Makefile
tagmanager/Makefile
tagmanager/include/Makefile
scintilla/Makefile
......
iconsdir = $(datadir)/icons/hicolor/16x16/apps
icons_DATA = \
classviewer-class.png \
classviewer-macro.png \
classviewer-member.png \
classviewer-method.png \
classviewer-namespace.png \
classviewer-other.png \
classviewer-struct.png \
classviewer-var.png
EXTRA_DIST = \
$(icons_DATA)
SUBDIRS = \
16x16
gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
install-data-hook:
@-if test -z "$(DESTDIR)"; then \
echo "Updating Gtk icon cache."; \
$(gtk_update_icon_cache); \
else \
echo "*** Icon cache not updated. Remember to run:"; \
echo "***"; \
echo "*** $(gtk_update_icon_cache)"; \
echo "***"; \
fi
......@@ -41,7 +41,7 @@
#include "document.h"
#include "support.h"
#include "msgwindow.h"
#include "treeviews.h"
const guint TM_GLOBAL_TYPE_MASK =
tm_tag_class_t | tm_tag_enum_t | tm_tag_interface_t |
......@@ -50,7 +50,6 @@ const guint TM_GLOBAL_TYPE_MASK =
static gchar **html_entities = NULL;
typedef struct
{
gboolean tags_loaded;
......@@ -425,10 +424,27 @@ tag_list_add_groups(GtkTreeStore *tree_store, ...)
for (; iter = va_arg(args, GtkTreeIter*), iter != NULL;)
{
gchar *title = va_arg(args, gchar*);
gchar *icon_name = va_arg(args, gchar *);
GdkPixbuf *icon = NULL;
if (icon_name) {
GtkIconTheme *icon_theme;
gint x, y;
gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &x, &y);
icon_theme = gtk_icon_theme_get_default();
icon = gtk_icon_theme_load_icon (icon_theme, icon_name, x, 0, NULL);
}
g_assert(title != NULL);
gtk_tree_store_append(tree_store, iter, NULL);
gtk_tree_store_set(tree_store, iter, 0, title, -1);
if (G_IS_OBJECT (icon)) {
gtk_tree_store_set(tree_store, iter, SYMBOLS_COLUMN_ICON, icon,
SYMBOLS_COLUMN_NAME, title, -1);
g_object_unref (icon);
} else
gtk_tree_store_set(tree_store, iter, SYMBOLS_COLUMN_NAME, title, -1);
}
va_end(args);
}
......@@ -446,69 +462,73 @@ static void init_tag_list(gint idx)
case GEANY_FILETYPES_DIFF:
{
tag_list_add_groups(tag_store,
&(tv_iters.tag_function), _("Files"), NULL);
&(tv_iters.tag_function), _("Files"), NULL, NULL);
break;
}
case GEANY_FILETYPES_DOCBOOK:
{
tag_list_add_groups(tag_store,
&(tv_iters.tag_function), _("Chapter"),
&(tv_iters.tag_class), _("Section"),
&(tv_iters.tag_member), _("Sect1"),
&(tv_iters.tag_macro), _("Sect2"),
&(tv_iters.tag_variable), _("Sect3"),
&(tv_iters.tag_struct), _("Appendix"),
&(tv_iters.tag_other), _("Other"), NULL);
// &(tv_iters.tag_namespace), _("Other"), NULL);
&(tv_iters.tag_function), _("Chapter"), NULL,
&(tv_iters.tag_class), _("Section"), NULL,
&(tv_iters.tag_member), _("Sect1"), NULL,
&(tv_iters.tag_macro), _("Sect2"), NULL,
&(tv_iters.tag_variable), _("Sect3"), NULL,
&(tv_iters.tag_struct), _("Appendix"), NULL,
&(tv_iters.tag_other), _("Other"), NULL,
NULL);
// &(tv_iters.tag_namespace), _("Other"), NULL, NULL);
break;
}
case GEANY_FILETYPES_HASKELL:
tag_list_add_groups(tag_store,
&tv_iters.tag_namespace, _("Module"),
&tv_iters.tag_struct, _("Types"),
&tv_iters.tag_macro, _("Type constructors"),
&tv_iters.tag_function, _("Functions"),
&tv_iters.tag_namespace, _("Module"), NULL,
&tv_iters.tag_struct, _("Types"), NULL,
&tv_iters.tag_macro, _("Type constructors"), NULL,
&tv_iters.tag_function, _("Functions"), "classviewer-method",
NULL);
break;
case GEANY_FILETYPES_CONF:
tag_list_add_groups(tag_store,
&tv_iters.tag_namespace, _("Sections"),
&tv_iters.tag_macro, _("Keys"),
&tv_iters.tag_namespace, _("Sections"), NULL,
&tv_iters.tag_macro, _("Keys"), NULL,
NULL);
break;
case GEANY_FILETYPES_LATEX:
{
tag_list_add_groups(tag_store,
&(tv_iters.tag_function), _("Command"),
&(tv_iters.tag_class), _("Environment"),
&(tv_iters.tag_member), _("Section"),
&(tv_iters.tag_macro), _("Subsection"),
&(tv_iters.tag_variable), _("Subsubsection"),
&(tv_iters.tag_struct), _("Label"),
&(tv_iters.tag_namespace), _("Chapter"),
&(tv_iters.tag_other), _("Other"), NULL);
&(tv_iters.tag_function), _("Command"), NULL,
&(tv_iters.tag_class), _("Environment"), NULL,
&(tv_iters.tag_member), _("Section"), NULL,
&(tv_iters.tag_macro), _("Subsection"), NULL,
&(tv_iters.tag_variable), _("Subsubsection"), NULL,
&(tv_iters.tag_struct), _("Label"), NULL,
&(tv_iters.tag_namespace), _("Chapter"), NULL,
&(tv_iters.tag_other), _("Other"), NULL,
NULL);
break;
}
case GEANY_FILETYPES_PERL:
{
tag_list_add_groups(tag_store,
&(tv_iters.tag_class), _("Package"),
&(tv_iters.tag_function), _("Functions"),
&(tv_iters.tag_member), _("My"),
&(tv_iters.tag_macro), _("Local"),
&(tv_iters.tag_variable), _("Our"), NULL);
//&(tv_iters.tag_struct), _("Label"),
//&(tv_iters.tag_namespace), _("Begin"),
//&(tv_iters.tag_other), _("Other"), NULL);
&(tv_iters.tag_class), _("Package"), NULL,
&(tv_iters.tag_function), _("Functions"), "classviewer-method",
&(tv_iters.tag_member), _("My"), NULL,
&(tv_iters.tag_macro), _("Local"), NULL,
&(tv_iters.tag_variable), _("Our"), NULL,
NULL);
//&(tv_iters.tag_struct), _("Label"), NULL,
//&(tv_iters.tag_namespace), _("Begin"), NULL,
//&(tv_iters.tag_other), _("Other"), NULL, NULL);
break;
}
case GEANY_FILETYPES_PHP:
{
tag_list_add_groups(tag_store,
&(tv_iters.tag_class), _("Classes"),
&(tv_iters.tag_function), _("Functions"),
&(tv_iters.tag_macro), _("Constants"),
&(tv_iters.tag_variable), _("Variables"), NULL);
&(tv_iters.tag_class), _("Classes"), "classviewer-class",
&(tv_iters.tag_function), _("Functions"), "classviewer-method",
&(tv_iters.tag_macro), _("Constants"), NULL,
&(tv_iters.tag_variable), _("Variables"), "classviewer-var",
NULL);
//&(tv_iters.tag_struct), _("Label"),
//&(tv_iters.tag_namespace), _("Begin"),
//&(tv_iters.tag_other), _("Other"), NULL);
......@@ -517,12 +537,13 @@ static void init_tag_list(gint idx)
case GEANY_FILETYPES_RUBY:
{
tag_list_add_groups(tag_store,
&(tv_iters.tag_class), _("Classes"),
&(tv_iters.tag_member), _("Singletons"),
&(tv_iters.tag_macro), _("Mixins"),
&(tv_iters.tag_function), _("Methods"),
&(tv_iters.tag_struct), _("Members"),
&(tv_iters.tag_variable), _("Variables"), NULL);
&(tv_iters.tag_class), _("Classes"), "classviewer-class",
&(tv_iters.tag_member), _("Singletons"), NULL,
&(tv_iters.tag_macro), _("Mixins"), NULL,
&(tv_iters.tag_function), _("Methods"), "classviewer-method",
&(tv_iters.tag_struct), _("Members"), "classviewer-member",
&(tv_iters.tag_variable), _("Variables"), "classviewer-var",
NULL);
//&(tv_iters.tag_namespace), _("Begin"),
//&(tv_iters.tag_other), _("Other"), NULL);
break;
......@@ -530,9 +551,10 @@ static void init_tag_list(gint idx)
case GEANY_FILETYPES_PYTHON:
{
tag_list_add_groups(tag_store,
&(tv_iters.tag_class), _("Classes"),
&(tv_iters.tag_member), _("Methods"),
&(tv_iters.tag_function), _("Functions"), NULL);
&(tv_iters.tag_class), _("Classes"), "classviewer-class",
&(tv_iters.tag_member), _("Methods"), "classviewer-member",
&(tv_iters.tag_function), _("Functions"), "classviewer-method",
NULL);
//&(tv_iters.tag_macro), _("Mixin"),
//&(tv_iters.tag_variable), _("Variables"),
//&(tv_iters.tag_struct), _("Members"),
......@@ -543,11 +565,12 @@ static void init_tag_list(gint idx)
case GEANY_FILETYPES_VHDL:
{
tag_list_add_groups(tag_store,
&(tv_iters.tag_function), _("Functions"),
&(tv_iters.tag_function), _("Functions"), "classviewer-method",
//&(tv_iters.tag_class), _("Constants"),
//&(tv_iters.tag_member), _("Members"),
//&(tv_iters.tag_macro), _("Macros"),
&(tv_iters.tag_variable), _("Variables"), NULL);
&(tv_iters.tag_variable), _("Variables"), "classviewer-var",
NULL);
//&(tv_iters.tag_namespace), _("Namespaces"),
//&(tv_iters.tag_struct), _("Signals"),
//&(tv_iters.tag_other), _("Other"), NULL);
......@@ -556,39 +579,42 @@ static void init_tag_list(gint idx)
case GEANY_FILETYPES_JAVA:
{
tag_list_add_groups(tag_store,
&(tv_iters.tag_namespace), _("Package"),
&(tv_iters.tag_struct), _("Interfaces"),
&(tv_iters.tag_class), _("Classes"),
&(tv_iters.tag_function), _("Methods"),
&(tv_iters.tag_member), _("Members"),
&(tv_iters.tag_namespace), _("Package"), NULL,
&(tv_iters.tag_struct), _("Interfaces"), NULL,
&(tv_iters.tag_class), _("Classes"), "classviewer-class",
&(tv_iters.tag_function), _("Methods"), "classviewer-method",
&(tv_iters.tag_member), _("Members"), "classviewer-member",
// &(tv_iters.tag_macro), _("Macros"),
// &(tv_iters.tag_variable), _("Variables"),
&(tv_iters.tag_other), _("Other"), NULL);
&(tv_iters.tag_other), _("Other"), "classviewer-other",
NULL);
break;
}
case GEANY_FILETYPES_D:
default:
{
gchar *namespace_name = _("Namespaces");
if (ft_id == GEANY_FILETYPES_D)
namespace_name = _("Module"); // one file can only belong to one module
tag_list_add_groups(tag_store,
&(tv_iters.tag_namespace), _("Module"), NULL, NULL);
else
tag_list_add_groups(tag_store,
&(tv_iters.tag_namespace), _("Namespaces"), "classviewer-namespace", NULL);
tag_list_add_groups(tag_store,
&(tv_iters.tag_namespace), namespace_name,
&(tv_iters.tag_class), _("Classes"),
&(tv_iters.tag_function), _("Functions"),
&(tv_iters.tag_member), _("Members"),
&(tv_iters.tag_struct), _("Structs / Typedefs"), NULL);
&(tv_iters.tag_class), _("Classes"), "classviewer-class",
&(tv_iters.tag_function), _("Functions"), "classviewer-method",
&(tv_iters.tag_member), _("Members"), "classviewer-member",
&(tv_iters.tag_struct), _("Structs / Typedefs"), "classviewer-struct",
NULL);
if (ft_id != GEANY_FILETYPES_D)
{
tag_list_add_groups(tag_store,
&(tv_iters.tag_macro), _("Macros"), NULL);
&(tv_iters.tag_macro), _("Macros"), "classviewer-macro", NULL);
}
tag_list_add_groups(tag_store,
&(tv_iters.tag_variable), _("Variables"),
&(tv_iters.tag_other), _("Other"), NULL);
&(tv_iters.tag_variable), _("Variables"), "classviewer-var",
&(tv_iters.tag_other), _("Other"), "classviewer-other", NULL);
}
}
}
......@@ -617,6 +643,8 @@ gboolean symbols_recreate_tag_list(gint idx)
{
gchar buf[100];
const GeanySymbol *symbol = (GeanySymbol*)tmp->data;
GtkTreeIter *parent = NULL;
GdkPixbuf *icon = NULL;
g_snprintf(buf, sizeof(buf), "%s [%d]", symbol->str, symbol->line);
......@@ -627,31 +655,27 @@ gboolean symbols_recreate_tag_list(gint idx)
case tm_tag_function_t:
{
if (tv_iters.tag_function.stamp == -1) break;
gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv_iters.tag_function));
gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, buf, -1);
parent = &(tv_iters.tag_function);
break;
}
case tm_tag_macro_t:
case tm_tag_macro_with_arg_t:
{
if (tv_iters.tag_macro.stamp == -1) break;
gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv_iters.tag_macro));
gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, buf, -1);
parent = &(tv_iters.tag_macro);
break;
}
case tm_tag_class_t:
{
if (tv_iters.tag_class.stamp == -1) break;
gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv_iters.tag_class));
gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, buf, -1);
parent = &(tv_iters.tag_class);
break;
}
case tm_tag_member_t:
case tm_tag_field_t:
{
if (tv_iters.tag_member.stamp == -1) break;
gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv_iters.tag_member));
gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, buf, -1);
parent = &(tv_iters.tag_member);
break;
}
case tm_tag_typedef_t:
......@@ -661,32 +685,40 @@ gboolean symbols_recreate_tag_list(gint idx)
case tm_tag_interface_t:
{
if (tv_iters.tag_struct.stamp == -1) break;
gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv_iters.tag_struct));
gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, buf, -1);
parent = &(tv_iters.tag_struct);
break;
}
case tm_tag_variable_t:
{
if (tv_iters.tag_variable.stamp == -1) break;
gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv_iters.tag_variable));
gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, buf, -1);
parent = &(tv_iters.tag_variable);
break;
}
case tm_tag_namespace_t:
case tm_tag_package_t:
{
if (tv_iters.tag_namespace.stamp == -1) break;
gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv_iters.tag_namespace));
gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, buf, -1);
parent = &(tv_iters.tag_namespace);
break;
}
default:
{
if (tv_iters.tag_other.stamp == -1) break;
gtk_tree_store_append(doc_list[idx].tag_store, &iter, &(tv_iters.tag_other));
gtk_tree_store_set(doc_list[idx].tag_store, &iter, 0, buf, -1);
parent = &(tv_iters.tag_other);
}
}
if (parent) {
gtk_tree_model_get(GTK_TREE_MODEL(doc_list[idx].tag_store), parent,
SYMBOLS_COLUMN_ICON, &icon, -1);
gtk_tree_store_append(doc_list[idx].tag_store, &iter, parent);
gtk_tree_store_set(doc_list[idx].tag_store, &iter,
SYMBOLS_COLUMN_ICON, icon,
SYMBOLS_COLUMN_NAME, buf, -1);
if (G_LIKELY(G_IS_OBJECT(icon)))
g_object_unref(icon);
}
}
gtk_tree_view_set_model(GTK_TREE_VIEW(doc_list[idx].tag_tree), model); // Re-attach model to view
g_object_unref(model);
......
......@@ -69,13 +69,24 @@ static gboolean on_treeviews_button_press_event(GtkWidget *widget, GdkEventButto
/* the prepare_* functions are document-related, but I think they fit better here than in document.c */
static void prepare_taglist(GtkWidget *tree, GtkTreeStore *store)
{
GtkCellRenderer *renderer;
GtkCellRenderer *text_renderer, *icon_renderer;
GtkTreeViewColumn *column;
GtkTreeSelection *select;
PangoFontDescription *pfd;
renderer = gtk_cell_renderer_text_new();
column = gtk_tree_view_column_new_with_attributes(_("Symbols"), renderer, "text", 0, NULL);
text_renderer = gtk_cell_renderer_text_new();
icon_renderer = gtk_cell_renderer_pixbuf_new();
column = gtk_tree_view_column_new();
gtk_tree_view_column_pack_start(column, icon_renderer, FALSE);
gtk_tree_view_column_set_attributes(column, icon_renderer, "pixbuf", SYMBOLS_COLUMN_ICON, NULL);
g_object_set(icon_renderer, "xalign", 0.0, NULL);
gtk_tree_view_column_pack_start(column, text_renderer, TRUE);
gtk_tree_view_column_set_attributes(column, text_renderer, "text", SYMBOLS_COLUMN_NAME, NULL);
g_object_set(text_renderer, "yalign", 0.5, NULL);
gtk_tree_view_column_set_title(column, _("Symbols"));
gtk_tree_view_append_column(GTK_TREE_VIEW(tree), column);
gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(tree), FALSE);
......@@ -144,7 +155,7 @@ void treeviews_update_tag_list(gint idx, gboolean update)
{ // updating the tag list in the left tag window
if (doc_list[idx].tag_tree == NULL)
{
doc_list[idx].tag_store = gtk_tree_store_new(1, G_TYPE_STRING);
doc_list[idx].tag_store = gtk_tree_store_new(SYMBOLS_N_COLUMNS, GDK_TYPE_PIXBUF, G_TYPE_STRING);
doc_list[idx].tag_tree = gtk_tree_view_new();
prepare_taglist(doc_list[idx].tag_tree, doc_list[idx].tag_store);
gtk_widget_show(doc_list[idx].tag_tree);
......@@ -476,7 +487,7 @@ static gboolean on_taglist_tree_selection_changed(GtkTreeSelection *selection)
if (gtk_tree_selection_get_selected(selection, &model, &iter))
{
gtk_tree_model_get(model, &iter, 0, &string, -1);
gtk_tree_model_get(model, &iter, SYMBOLS_COLUMN_NAME, &string, -1);
if (NZV(string))
{
gint idx = document_get_cur_idx();
......
......@@ -35,6 +35,12 @@ struct SidebarTreeviews
GtkWidget *popup_openfiles;
} tv;
enum
{
SYMBOLS_COLUMN_ICON,
SYMBOLS_COLUMN_NAME,
SYMBOLS_N_COLUMNS,
};
void treeviews_update_tag_list(gint idx, gboolean update);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment