Mercurial > pidgin
changeset 18053:891f22c7e884
merge of 'e82c41f34ce5f7439b2f2971139efaf6ef7a54ff'
and 'f024502a953161972f4fac58e80c288007ebd5fb'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Wed, 06 Jun 2007 16:00:27 +0000 |
parents | 1cedd520cd18 (diff) 627f9d40ca1b (current diff) |
children | 0c70c55506cf 5c4efa98e8dd |
files | libpurple/protocols/bonjour/dns_sd.c libpurple/protocols/bonjour/dns_sd.h |
diffstat | 49 files changed, 2433 insertions(+), 75 deletions(-) [+] |
line wrap: on
line diff
--- a/finch/libgnt/gnt-skel.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gnt-skel.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gnt-skel.h" enum
--- a/finch/libgnt/gnt-skel.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gnt-skel.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_SKEL_H #define GNT_SKEL_H @@ -38,9 +60,19 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_skel_get_gtype(void); -GntWidget *gnt_skel_new(); +/** + * + * + * @return + */ +GntWidget * gnt_skel_new(); G_END_DECLS
--- a/finch/libgnt/gnt.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gnt.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,39 +1,140 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include <glib.h> #include "gntwidget.h" #include "gntclipboard.h" #include "gntcolors.h" #include "gntkeys.h" +/** + * + */ void gnt_init(void); +/** + * + */ void gnt_main(void); +/** + * + * + * @return + */ gboolean gnt_ascii_only(void); +/** + * + * @param widget + */ void gnt_screen_occupy(GntWidget *widget); +/** + * + * @param widget + */ void gnt_screen_release(GntWidget *widget); +/** + * + * @param widget + */ void gnt_screen_update(GntWidget *widget); +/** + * + * @param widget + * @param width + * @param height + */ void gnt_screen_resize_widget(GntWidget *widget, int width, int height); +/** + * + * @param widget + * @param x + * @param y + */ void gnt_screen_move_widget(GntWidget *widget, int x, int y); +/** + * + * @param widget + * @param text + */ void gnt_screen_rename_widget(GntWidget *widget, const char *text); +/** + * + * @param widget + * + * @return + */ gboolean gnt_widget_has_focus(GntWidget *widget); +/** + * + * @param widget + */ void gnt_widget_set_urgent(GntWidget *widget); +/** + * + * @param label + * @param callback)() + */ void gnt_register_action(const char *label, void (*callback)()); +/** + * + * @param menu + * + * @return + */ gboolean gnt_screen_menu_show(gpointer menu); +/** + * + */ void gnt_quit(void); -GntClipboard *gnt_get_clipboard(void); +/** + * + * + * @return + */ +GntClipboard * gnt_get_clipboard(void); -gchar *gnt_get_clipboard_string(void); +/** + * + * + * @return + */ +gchar * gnt_get_clipboard_string(void); +/** + * + * @param string + */ void gnt_set_clipboard_string(gchar *string); +
--- a/finch/libgnt/gntbindable.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntbindable.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntbindable.h" #include "gntstyle.h" #include "gnt.h"
--- a/finch/libgnt/gntbindable.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntbindable.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_BINDABLE_H #define GNT_BINDABLE_H @@ -39,6 +61,11 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_bindable_get_gtype(void); /******************/ @@ -70,18 +97,53 @@ GList *list; }; - /*GntBindableAction *gnt_bindable_action_parse(const char *name);*/ +/** + * + * @param action + */ void gnt_bindable_action_free(GntBindableAction *action); + +/** + * + * @param param + */ void gnt_bindable_action_param_free(GntBindableActionParam *param); -void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, - GntBindableActionCallback callback, const char *trigger, ...); -void gnt_bindable_register_binding(GntBindableClass *klass, const char *name, - const char *trigger, ...); +/** + * + * @param klass + * @param name + * @param callback + * @param trigger + */ +void gnt_bindable_class_register_action(GntBindableClass *klass, const char *name, GntBindableActionCallback callback, const char *trigger, ...); + +/** + * + * @param klass + * @param name + * @param trigger + */ +void gnt_bindable_register_binding(GntBindableClass *klass, const char *name, const char *trigger, ...); +/** + * + * @param bindable + * @param keys + * + * @return + */ gboolean gnt_bindable_perform_action_key(GntBindable *bindable, const char *keys); + +/** + * + * @param bindable + * @param name + * + * @return + */ gboolean gnt_bindable_perform_action_named(GntBindable *bindable, const char *name, ...); G_END_DECLS
--- a/finch/libgnt/gntbox.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntbox.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntbox.h" #include "gntutils.h"
--- a/finch/libgnt/gntbox.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntbox.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_BOX_H #define GNT_BOX_H @@ -61,35 +83,110 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_box_get_gtype(void); #define gnt_vbox_new(homo) gnt_box_new(homo, TRUE) #define gnt_hbox_new(homo) gnt_box_new(homo, FALSE) -GntWidget *gnt_box_new(gboolean homo, gboolean vert); +/** + * + * @param homo + * @param vert + * + * @return + */ +GntWidget * gnt_box_new(gboolean homo, gboolean vert); +/** + * + * @param box + * @param widget + */ void gnt_box_add_widget(GntBox *box, GntWidget *widget); +/** + * + * @param box + * @param title + */ void gnt_box_set_title(GntBox *box, const char *title); +/** + * + * @param box + * @param pad + */ void gnt_box_set_pad(GntBox *box, int pad); +/** + * + * @param box + * @param set + */ void gnt_box_set_toplevel(GntBox *box, gboolean set); +/** + * + * @param box + */ void gnt_box_sync_children(GntBox *box); +/** + * + * @param box + * @param alignment + */ void gnt_box_set_alignment(GntBox *box, GntAlignment alignment); -void gnt_box_remove(GntBox *box, GntWidget *widget); /* XXX: does NOT destroy widget */ +/** + * + * @param box + * @param widget + */ +void gnt_box_remove(GntBox *box, GntWidget *widget); + + /* XXX: does NOT destroy widget */ -void gnt_box_remove_all(GntBox *box); /* Removes AND destroys all the widgets in it */ +/** + * + * @param box + */ +void gnt_box_remove_all(GntBox *box); + /* Removes AND destroys all the widgets in it */ + +/** + * + * @param box + */ void gnt_box_readjust(GntBox *box); +/** + * + * @param box + * @param fill + */ void gnt_box_set_fill(GntBox *box, gboolean fill); -void gnt_box_move_focus(GntBox *box, int dir); /* +1 to move forward, -1 for backward */ +/** + * + * @param box + * @param dir + */ +void gnt_box_move_focus(GntBox *box, int dir); + /* +1 to move forward, -1 for backward */ + +/** + * + * @param box + * @param widget + */ void gnt_box_give_focus_to_child(GntBox *box, GntWidget *widget); G_END_DECLS
--- a/finch/libgnt/gntbutton.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntbutton.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include <string.h> #include "gntbutton.h"
--- a/finch/libgnt/gntbutton.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntbutton.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_BUTTON_H #define GNT_BUTTON_H @@ -46,9 +68,20 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_button_get_gtype(void); -GntWidget *gnt_button_new(const char *text); +/** + * + * @param text + * + * @return + */ +GntWidget * gnt_button_new(const char *text); G_END_DECLS
--- a/finch/libgnt/gntcheckbox.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntcheckbox.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntcheckbox.h" enum
--- a/finch/libgnt/gntcheckbox.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntcheckbox.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_CHECK_BOX_H #define GNT_CHECK_BOX_H @@ -41,12 +63,34 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_check_box_get_gtype(void); -GntWidget *gnt_check_box_new(const char *text); +/** + * + * @param text + * + * @return + */ +GntWidget * gnt_check_box_new(const char *text); +/** + * + * @param box + * @param set + */ void gnt_check_box_set_checked(GntCheckBox *box, gboolean set); +/** + * + * @param box + * + * @return + */ gboolean gnt_check_box_get_checked(GntCheckBox *box); G_END_DECLS
--- a/finch/libgnt/gntclipboard.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntclipboard.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,6 +1,26 @@ -#include "gntclipboard.h" +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ -gchar *string; +#include "gntclipboard.h" enum { SIG_CLIPBOARD = 0,
--- a/finch/libgnt/gntclipboard.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntclipboard.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_CLIPBOARD_H #define GNT_CLIPBOARD_H @@ -33,10 +55,26 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_clipboard_get_gtype(void); -gchar *gnt_clipboard_get_string(GntClipboard *clip); +/** + * + * @param clip + * + * @return + */ +gchar * gnt_clipboard_get_string(GntClipboard *clip); +/** + * + * @param clip + * @param string + */ void gnt_clipboard_set_string(GntClipboard *clip, gchar *string); G_END_DECLS
--- a/finch/libgnt/gntcolors.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntcolors.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "config.h" #include <ncurses.h>
--- a/finch/libgnt/gntcolors.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntcolors.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_COLORS_H #define GNT_COLORS_H @@ -33,14 +55,29 @@ }; /* populate some default colors */ +/** + * + */ void gnt_init_colors(void); +/** + * + */ void gnt_uninit_colors(void); #if GLIB_CHECK_VERSION(2,6,0) +/** + * + * @param kfile + */ void gnt_colors_parse(GKeyFile *kfile); +/** + * + * @param kfile + */ void gnt_color_pairs_parse(GKeyFile *kfile); + #endif #endif
--- a/finch/libgnt/gntcombobox.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntcombobox.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntbox.h" #include "gntcombobox.h" #include "gnttree.h"
--- a/finch/libgnt/gntcombobox.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntcombobox.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_COMBO_BOX_H #define GNT_COMBO_BOX_H @@ -42,18 +64,54 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_combo_box_get_gtype(void); -GntWidget *gnt_combo_box_new(void); +/** + * + * + * @return + */ +GntWidget * gnt_combo_box_new(void); +/** + * + * @param box + * @param key + * @param text + */ void gnt_combo_box_add_data(GntComboBox *box, gpointer key, const char *text); +/** + * + * @param box + * @param key + */ void gnt_combo_box_remove(GntComboBox *box, gpointer key); +/** + * + * @param box + */ void gnt_combo_box_remove_all(GntComboBox *box); +/** + * + * @param box + * + * @return + */ gpointer gnt_combo_box_get_selected_data(GntComboBox *box); +/** + * + * @param box + * @param key + */ void gnt_combo_box_set_selected(GntComboBox *box, gpointer key); G_END_DECLS
--- a/finch/libgnt/gntentry.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntentry.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include <ctype.h> #include <string.h>
--- a/finch/libgnt/gntentry.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntentry.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_ENTRY_H #define GNT_ENTRY_H @@ -73,32 +95,97 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_entry_get_gtype(void); -GntWidget *gnt_entry_new(const char *text); +/** + * + * @param text + * + * @return + */ +GntWidget * gnt_entry_new(const char *text); +/** + * + * @param entry + * @param max + */ void gnt_entry_set_max(GntEntry *entry, int max); +/** + * + * @param entry + * @param text + */ void gnt_entry_set_text(GntEntry *entry, const char *text); +/** + * + * @param entry + * @param flag + */ void gnt_entry_set_flag(GntEntry *entry, GntEntryFlag flag); const char *gnt_entry_get_text(GntEntry *entry); +/** + * + * @param entry + */ void gnt_entry_clear(GntEntry *entry); +/** + * + * @param entry + * @param set + */ void gnt_entry_set_masked(GntEntry *entry, gboolean set); +/** + * + * @param entry + * @param text + */ void gnt_entry_add_to_history(GntEntry *entry, const char *text); +/** + * + * @param entry + * @param num + */ void gnt_entry_set_history_length(GntEntry *entry, int num); +/** + * + * @param entry + * @param word + */ void gnt_entry_set_word_suggest(GntEntry *entry, gboolean word); +/** + * + * @param entry + * @param always + */ void gnt_entry_set_always_suggest(GntEntry *entry, gboolean always); +/** + * + * @param entry + * @param text + */ void gnt_entry_add_suggest(GntEntry *entry, const char *text); +/** + * + * @param entry + * @param text + */ void gnt_entry_remove_suggest(GntEntry *entry, const char *text); G_END_DECLS
--- a/finch/libgnt/gntfilesel.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntfilesel.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntbutton.h" #include "gntentry.h" #include "gntfilesel.h"
--- a/finch/libgnt/gntfilesel.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntfilesel.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_FILE_SEL_H #define GNT_FILE_SEL_H @@ -71,32 +93,115 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_file_sel_get_gtype(void); -GntWidget *gnt_file_sel_new(void); +/** + * + * + * @return + */ +GntWidget * gnt_file_sel_new(void); +/** + * + * @param sel + * @param path + * + * @return + */ gboolean gnt_file_sel_set_current_location(GntFileSel *sel, const char *path); +/** + * + * @param sel + * @param dirs + */ void gnt_file_sel_set_dirs_only(GntFileSel *sel, gboolean dirs); +/** + * + * @param sel + * + * @return + */ gboolean gnt_file_sel_get_dirs_only(GntFileSel *sel); +/** + * + * @param sel + * @param must + */ void gnt_file_sel_set_must_exist(GntFileSel *sel, gboolean must); +/** + * + * @param sel + * + * @return + */ gboolean gnt_file_sel_get_must_exist(GntFileSel *sel); -char *gnt_file_sel_get_selected_file(GntFileSel *sel); /* The returned value should be free'd */ +/** + * + * @param sel + * + * @return + */ +char * gnt_file_sel_get_selected_file(GntFileSel *sel); + + /* The returned value should be free'd */ -GList *gnt_file_sel_get_selected_multi_files(GntFileSel *sel); +/** + * + * @param sel + * + * @return + */ +GList * gnt_file_sel_get_selected_multi_files(GntFileSel *sel); +/** + * + * @param sel + * @param set + */ void gnt_file_sel_set_multi_select(GntFileSel *sel, gboolean set); +/** + * + * @param sel + * @param suggest + */ void gnt_file_sel_set_suggested_filename(GntFileSel *sel, const char *suggest); +/** + * + * @param sel + * @param path + * @param files + * @param error) + */ void gnt_file_sel_set_read_fn(GntFileSel *sel, gboolean (*read_fn)(const char *path, GList **files, GError **error)); +/** + * + * @param name + * @param size + * + * @return + */ GntFile* gnt_file_new(const char *name, unsigned long size); +/** + * + * @param name + * + * @return + */ GntFile* gnt_file_new_dir(const char *name); G_END_DECLS
--- a/finch/libgnt/gntkeys.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntkeys.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntkeys.h" #include <glib.h>
--- a/finch/libgnt/gntkeys.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntkeys.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_KEYS_H #define GNT_KEYS_H @@ -80,16 +102,40 @@ /** * This will do stuff with the terminal settings and stuff. */ +/** + * + */ void gnt_init_keys(void); + +/** + * + * @param text + */ void gnt_keys_refine(char *text); + const char *gnt_key_translate(const char *name); const char *gnt_key_lookup(const char *key); +/** + * + * @param path + */ void gnt_keys_add_combination(const char *path); + +/** + * + * @param path + */ void gnt_keys_del_combination(const char *path); + +/** + * + * @param path + * + * @return + */ int gnt_keys_find_combination(const char *path); - /* A lot of commonly used variable names are defined in <term.h>. * #undef them to make life easier for everyone. */
--- a/finch/libgnt/gntlabel.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntlabel.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntlabel.h" #include "gntutils.h"
--- a/finch/libgnt/gntlabel.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntlabel.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_LABEL_H #define GNT_LABEL_H @@ -40,12 +62,35 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_label_get_gtype(void); -GntWidget *gnt_label_new(const char *text); +/** + * + * @param text + * + * @return + */ +GntWidget * gnt_label_new(const char *text); -GntWidget *gnt_label_new_with_format(const char *text, GntTextFormatFlags flags); +/** + * + * @param text + * @param flags + * + * @return + */ +GntWidget * gnt_label_new_with_format(const char *text, GntTextFormatFlags flags); +/** + * + * @param label + * @param text + */ void gnt_label_set_text(GntLabel *label, const char *text); G_END_DECLS
--- a/finch/libgnt/gntline.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntline.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntline.h" enum
--- a/finch/libgnt/gntline.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntline.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_LINE_H #define GNT_LINE_H @@ -40,12 +62,23 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_line_get_gtype(void); #define gnt_hline_new() gnt_line_new(FALSE) #define gnt_vline_new() gnt_line_new(TRUE) -GntWidget *gnt_line_new(gboolean vertical); +/** + * + * @param vertical + * + * @return + */ +GntWidget * gnt_line_new(gboolean vertical); G_END_DECLS
--- a/finch/libgnt/gntmain.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntmain.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #define _GNU_SOURCE #if defined(__APPLE__) || defined(__unix__) #define _XOPEN_SOURCE_EXTENDED @@ -51,7 +73,7 @@ static gboolean refresh_screen(); -GntWM *wm; +static GntWM *wm; static GntClipboard *clipboard; #define HOLDING_ESCAPE (escape_stuff.timer != 0)
--- a/finch/libgnt/gntmenu.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntmenu.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntmenu.h" #include "gntmenuitemcheck.h"
--- a/finch/libgnt/gntmenu.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntmenu.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_MENU_H #define GNT_MENU_H @@ -59,10 +81,26 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_menu_get_gtype(void); -GntWidget *gnt_menu_new(GntMenuType type); +/** + * + * @param type + * + * @return + */ +GntWidget * gnt_menu_new(GntMenuType type); +/** + * + * @param menu + * @param item + */ void gnt_menu_add_item(GntMenu *menu, GntMenuItem *item); G_END_DECLS
--- a/finch/libgnt/gntmenuitem.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntmenuitem.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntmenu.h" #include "gntmenuitem.h"
--- a/finch/libgnt/gntmenuitem.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntmenuitem.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_MENUITEM_H #define GNT_MENUITEM_H @@ -58,12 +80,34 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_menuitem_get_gtype(void); -GntMenuItem *gnt_menuitem_new(const char *text); +/** + * + * @param text + * + * @return + */ +GntMenuItem * gnt_menuitem_new(const char *text); +/** + * + * @param item + * @param callback + * @param data + */ void gnt_menuitem_set_callback(GntMenuItem *item, GntMenuItemCallback callback, gpointer data); +/** + * + * @param item + * @param menu + */ void gnt_menuitem_set_submenu(GntMenuItem *item, GntMenu *menu); G_END_DECLS
--- a/finch/libgnt/gntmenuitemcheck.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntmenuitemcheck.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntmenuitemcheck.h" static GntMenuItemClass *parent_class = NULL;
--- a/finch/libgnt/gntmenuitemcheck.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntmenuitemcheck.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_MENU_ITEM_CHECK_H #define GNT_MENU_ITEM_CHECK_H @@ -39,12 +61,34 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_menuitem_check_get_gtype(void); -GntMenuItem *gnt_menuitem_check_new(const char *text); +/** + * + * @param text + * + * @return + */ +GntMenuItem * gnt_menuitem_check_new(const char *text); +/** + * + * @param item + * + * @return + */ gboolean gnt_menuitem_check_get_checked(GntMenuItemCheck *item); +/** + * + * @param item + * @param set + */ void gnt_menuitem_check_set_checked(GntMenuItemCheck *item, gboolean set); G_END_DECLS
--- a/finch/libgnt/gntstyle.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntstyle.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,6 +1,29 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntstyle.h" #include "gntcolors.h" +#include <glib.h> #include <ctype.h> #include <string.h> @@ -8,6 +31,7 @@ static GKeyFile *gkfile; #endif +static GHashTable *unknowns; static char * str_styles[GNT_STYLES]; static int int_styles[GNT_STYLES]; static int bool_styles[GNT_STYLES]; @@ -17,6 +41,11 @@ return str_styles[style]; } +const char *gnt_style_get_from_name(const char *name) +{ + return g_hash_table_lookup(unknowns, name); +} + gboolean gnt_style_get_bool(GntStyle style, gboolean def) { int i; @@ -221,6 +250,10 @@ str_styles[styles[i].en] = g_key_file_get_string(kfile, "general", styles[i].style, NULL); } + + for (i = 0; i < nkeys; i++) + g_hash_table_replace(unknowns, g_strdup(keys[i]), + g_strdup(g_key_file_get_string(kfile, "general", keys[i], NULL))); } g_strfreev(keys); } @@ -231,6 +264,7 @@ #if GLIB_CHECK_VERSION(2,6,0) GError *error = NULL; gkfile = g_key_file_new(); + unknowns = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); if (!g_key_file_load_from_file(gkfile, filename, G_KEY_FILE_NONE, &error)) { @@ -260,6 +294,7 @@ for (i = 0; i < GNT_STYLES; i++) g_free(str_styles[i]); + g_hash_table_destroy(unknowns); #if GLIB_CHECK_VERSION(2,6,0) g_key_file_free(gkfile); #endif
--- a/finch/libgnt/gntstyle.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntstyle.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gnt.h" typedef enum @@ -10,18 +32,47 @@ GNT_STYLES } GntStyle; +/** + * + * @param filename + */ void gnt_style_read_configure_file(const char *filename); const char *gnt_style_get(GntStyle style); +const char *gnt_style_get_from_name(const char *key); + +/** + * + * @param style + * @param def + * + * @return + */ gboolean gnt_style_get_bool(GntStyle style, gboolean def); /* This should be called only once for the each type */ +/** + * + * @param type + * @param hash + */ void gnt_styles_get_keyremaps(GType type, GHashTable *hash); +/** + * + * @param type + * @param klass + */ void gnt_style_read_actions(GType type, GntBindableClass *klass); +/** + * + */ void gnt_init_styles(void); +/** + * + */ void gnt_uninit_styles(void);
--- a/finch/libgnt/gnttextview.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gnttextview.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gnttextview.h" #include "gntutils.h"
--- a/finch/libgnt/gnttextview.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gnttextview.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_TEXT_VIEW_H #define GNT_TEXT_VIEW_H @@ -53,34 +75,102 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_text_view_get_gtype(void); /* XXX: For now, don't set a textview to have any border. * If you want borders real bad, put it in a box. */ -GntWidget *gnt_text_view_new(void); +/** + * + * + * @return + */ +GntWidget * gnt_text_view_new(void); /* scroll > 0 means scroll up, < 0 means scroll down, == 0 means scroll to the end */ +/** + * + * @param view + * @param scroll + */ void gnt_text_view_scroll(GntTextView *view, int scroll); +/** + * + * @param view + * @param text + * @param flags + */ void gnt_text_view_append_text_with_flags(GntTextView *view, const char *text, GntTextFormatFlags flags); +/** + * + * @param view + * @param text + * @param flags + * @param tag + */ void gnt_text_view_append_text_with_tag(GntTextView *view, const char *text, GntTextFormatFlags flags, const char *tag); /* Move the cursor to the beginning of the next line and resets text-attributes. * It first completes the current line with the current text-attributes. */ +/** + * + * @param view + */ void gnt_text_view_next_line(GntTextView *view); +/** + * + * @param flags + * + * @return + */ chtype gnt_text_format_flag_to_chtype(GntTextFormatFlags flags); +/** + * + * @param view + */ void gnt_text_view_clear(GntTextView *view); +/** + * + * @param view + * + * @return + */ int gnt_text_view_get_lines_below(GntTextView *view); +/** + * + * @param view + * + * @return + */ int gnt_text_view_get_lines_above(GntTextView *view); /* If text is NULL, then the tag is removed. */ +/** + * + * @param view + * @param name + * @param text + * @param all + * + * @return + */ int gnt_text_view_tag_change(GntTextView *view, const char *name, const char *text, gboolean all); +/** + * + * @param view + * @param widget + */ void gnt_text_view_attach_scroll_widget(GntTextView *view, GntWidget *widget); G_END_DECLS
--- a/finch/libgnt/gnttree.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gnttree.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntmarshal.h" #include "gntstyle.h" #include "gnttree.h"
--- a/finch/libgnt/gnttree.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gnttree.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_TREE_H #define GNT_TREE_H @@ -74,75 +96,267 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_tree_get_gtype(void); -GntWidget *gnt_tree_new(void); /* A tree with just one column */ +/** + * + * + * @return + */ +GntWidget * gnt_tree_new(void); + + /* A tree with just one column */ -GntWidget *gnt_tree_new_with_columns(int columns); +/** + * + * @param columns + * + * @return + */ +GntWidget * gnt_tree_new_with_columns(int columns); +/** + * + * @param tree + * @param rows + */ void gnt_tree_set_visible_rows(GntTree *tree, int rows); +/** + * + * @param tree + * + * @return + */ int gnt_tree_get_visible_rows(GntTree *tree); +/** + * + * @param tree + * @param count + */ void gnt_tree_scroll(GntTree *tree, int count); -GntTreeRow *gnt_tree_add_row_after(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro); +/** + * + * @param tree + * @param key + * @param row + * @param parent + * @param bigbro + * + * @return + */ +GntTreeRow * gnt_tree_add_row_after(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro); -GntTreeRow *gnt_tree_add_row_last(GntTree *tree, void *key, GntTreeRow *row, void *parent); +/** + * + * @param tree + * @param key + * @param row + * @param parent + * + * @return + */ +GntTreeRow * gnt_tree_add_row_last(GntTree *tree, void *key, GntTreeRow *row, void *parent); +/** + * + * @param tree + * + * @return + */ gpointer gnt_tree_get_selection_data(GntTree *tree); /* Returned string needs to be freed */ -char *gnt_tree_get_selection_text(GntTree *tree); +/** + * + * @param tree + * + * @return + */ +char * gnt_tree_get_selection_text(GntTree *tree); -GList *gnt_tree_get_selection_text_list(GntTree *tree); +/** + * + * @param tree + * + * @return + */ +GList * gnt_tree_get_selection_text_list(GntTree *tree); const GList *gnt_tree_get_rows(GntTree *tree); +/** + * + * @param tree + * @param key + */ void gnt_tree_remove(GntTree *tree, gpointer key); +/** + * + * @param tree + */ void gnt_tree_remove_all(GntTree *tree); /* Returns the visible line number of the selected row */ +/** + * + * @param tree + * + * @return + */ int gnt_tree_get_selection_visible_line(GntTree *tree); +/** + * + * @param tree + * @param key + * @param colno + * @param text + */ void gnt_tree_change_text(GntTree *tree, gpointer key, int colno, const char *text); -GntTreeRow *gnt_tree_add_choice(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro); +/** + * + * @param tree + * @param key + * @param row + * @param parent + * @param bigbro + * + * @return + */ +GntTreeRow * gnt_tree_add_choice(GntTree *tree, void *key, GntTreeRow *row, void *parent, void *bigbro); +/** + * + * @param tree + * @param key + * @param set + */ void gnt_tree_set_choice(GntTree *tree, void *key, gboolean set); +/** + * + * @param tree + * @param key + * + * @return + */ gboolean gnt_tree_get_choice(GntTree *tree, void *key); +/** + * + * @param tree + * @param key + * @param flags + */ void gnt_tree_set_row_flags(GntTree *tree, void *key, GntTextFormatFlags flags); +/** + * + * @param key + */ void gnt_tree_set_selected(GntTree *tree , void *key); -GntTreeRow *gnt_tree_create_row(GntTree *tree, ...); +/** + * + * @param tree + * + * @return + */ +GntTreeRow * gnt_tree_create_row(GntTree *tree, ...); -GntTreeRow *gnt_tree_create_row_from_list(GntTree *tree, GList *list); +/** + * + * @param tree + * @param list + * + * @return + */ +GntTreeRow * gnt_tree_create_row_from_list(GntTree *tree, GList *list); +/** + * + * @param tree + * @param col + * @param width + */ void gnt_tree_set_col_width(GntTree *tree, int col, int width); +/** + * + * @param tree + */ void gnt_tree_set_column_titles(GntTree *tree, ...); +/** + * + * @param tree + * @param set + */ void gnt_tree_set_show_title(GntTree *tree, gboolean set); +/** + * + * @param tree + * @param func + */ void gnt_tree_set_compare_func(GntTree *tree, GCompareFunc func); +/** + * + * @param tree + * @param key + * @param expanded + */ void gnt_tree_set_expanded(GntTree *tree, void *key, gboolean expanded); +/** + * + * @param tree + * @param set + */ void gnt_tree_set_show_separator(GntTree *tree, gboolean set); +/** + * + * @param tree + * @param row + */ void gnt_tree_sort_row(GntTree *tree, void *row); /* This will try to automatically adjust the width of the columns in the tree */ +/** + * + * @param tree + */ void gnt_tree_adjust_columns(GntTree *tree); +/** + * + * @param tree + * @param hash + * @param eq + * @param kd + */ void gnt_tree_set_hash_fns(GntTree *tree, gpointer hash, gpointer eq, gpointer kd); /* This can be useful when, for example, we want to store some data * which we don't want/need to display. */ +/** + * + * @param tree + * @param col + * @param vis + */ void gnt_tree_set_column_visible(GntTree *tree, int col, gboolean vis); G_END_DECLS @@ -150,6 +364,11 @@ /* The following functions should NOT be used by applications. */ /* This should be called by the subclasses of GntTree's in their _new function */ +/** + * + * @param tree + * @param col + */ void _gnt_tree_init_internals(GntTree *tree, int col); #endif /* GNT_TREE_H */
--- a/finch/libgnt/gntutils.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntutils.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntbutton.h" #include "gntcheckbox.h" #include "gntcombobox.h"
--- a/finch/libgnt/gntutils.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntutils.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include <glib.h> #include "gnt.h" @@ -5,9 +27,22 @@ typedef gpointer (*GDupFunc)(gconstpointer data); +/** + * + * @param text + * @param width + * @param height + */ void gnt_util_get_text_bound(const char *text, int *width, int *height); /* excluding *end */ +/** + * + * @param start + * @param end + * + * @return + */ int gnt_util_onscreen_width(const char *start, const char *end); const char *gnt_util_onscreen_width_to_pointer(const char *str, int len, int *w); @@ -18,29 +53,62 @@ * * Returns a newly allocated string. */ -char *gnt_util_onscreen_fit_string(const char *string, int maxw); +/** + * + * @param string + * @param maxw + * + * @return + */ +char * gnt_util_onscreen_fit_string(const char *string, int maxw); -GHashTable *g_hash_table_duplicate(GHashTable *src, GHashFunc hash, - GEqualFunc equal, GDestroyNotify key_d, GDestroyNotify value_d, - GDupFunc key_dup, GDupFunc value_dup); - +/** + * + * @param src + * @param hash + * @param equal + * @param key_d + * @param value_d + * @param key_dup + * @param value_dup + * + * @return + */ +GHashTable * g_hash_table_duplicate(GHashTable *src, GHashFunc hash, GEqualFunc equal, GDestroyNotify key_d, GDestroyNotify value_d, GDupFunc key_dup, GDupFunc value_dup); /** * To be used with g_signal_new. Look in the key_pressed signal-definition in * gntwidget.c for usage. */ -gboolean gnt_boolean_handled_accumulator(GSignalInvocationHint *ihint, - GValue *return_accu, - const GValue *handler_return, - gpointer dummy); +/** + * + * @param ihint + * @param return_accu + * @param handler_return + * @param dummy + * + * @return + */ +gboolean gnt_boolean_handled_accumulator(GSignalInvocationHint *ihint, GValue *return_accu, const GValue *handler_return, gpointer dummy); /** * Returns a GntTree populated with "key" -> "binding" for the widget. */ -GntWidget *gnt_widget_bindings_view(GntWidget *widget); +/** + * + * @param widget + * + * @return + */ +GntWidget * gnt_widget_bindings_view(GntWidget *widget); /** * Parse widgets from 'string'. */ +/** + * + * @param string + * @param num + */ void gnt_util_parse_widgets(const char *string, int num, ...);
--- a/finch/libgnt/gntwidget.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntwidget.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + /* Stuff brutally ripped from Gflib */ #include "gntwidget.h"
--- a/finch/libgnt/gntwidget.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntwidget.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_WIDGET_H #define GNT_WIDGET_H @@ -112,39 +134,169 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_widget_get_gtype(void); + +/** + * + * @param widget + */ void gnt_widget_destroy(GntWidget *widget); + +/** + * + * @param widget + */ void gnt_widget_show(GntWidget *widget); + +/** + * + * @param widget + */ void gnt_widget_draw(GntWidget *widget); + +/** + * + * @param widget + * @param x + * @param y + * @param width + * @param height + */ void gnt_widget_expose(GntWidget *widget, int x, int y, int width, int height); + +/** + * + * @param widget + */ void gnt_widget_hide(GntWidget *widget); +/** + * + * @param widget + * @param x + * @param y + */ void gnt_widget_get_position(GntWidget *widget, int *x, int *y); + +/** + * + * @param widget + * @param x + * @param y + */ void gnt_widget_set_position(GntWidget *widget, int x, int y); + +/** + * + * @param widget + */ void gnt_widget_size_request(GntWidget *widget); + +/** + * + * @param widget + * @param width + * @param height + */ void gnt_widget_get_size(GntWidget *widget, int *width, int *height); + +/** + * + * @param widget + * @param width + * @param height + * + * @return + */ gboolean gnt_widget_set_size(GntWidget *widget, int width, int height); + +/** + * + * @param widget + * @param width + * @param height + * + * @return + */ gboolean gnt_widget_confirm_size(GntWidget *widget, int width, int height); +/** + * + * @param widget + * @param keys + * + * @return + */ gboolean gnt_widget_key_pressed(GntWidget *widget, const char *keys); +/** + * + * @param widget + * @param event + * @param x + * @param y + * + * @return + */ gboolean gnt_widget_clicked(GntWidget *widget, GntMouseEvent event, int x, int y); +/** + * + * @param widget + * @param set + * + * @return + */ gboolean gnt_widget_set_focus(GntWidget *widget, gboolean set); + +/** + * + * @param widget + */ void gnt_widget_activate(GntWidget *widget); +/** + * + * @param widget + * @param name + */ void gnt_widget_set_name(GntWidget *widget, const char *name); const char *gnt_widget_get_name(GntWidget *widget); /* Widget-subclasses should call this from the draw-callback. * Applications should just call gnt_widget_draw instead of this. */ +/** + * + * @param widget + */ void gnt_widget_queue_update(GntWidget *widget); +/** + * + * @param widget + * @param set + */ void gnt_widget_set_take_focus(GntWidget *widget, gboolean set); +/** + * + * @param widget + * @param set + */ void gnt_widget_set_visible(GntWidget *widget, gboolean set); +/** + * + * @param widget + * + * @return + */ gboolean gnt_widget_has_shadow(GntWidget *widget); G_END_DECLS
--- a/finch/libgnt/gntwindow.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntwindow.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntstyle.h" #include "gntwindow.h"
--- a/finch/libgnt/gntwindow.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntwindow.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #ifndef GNT_WINDOW_H #define GNT_WINDOW_H @@ -40,15 +62,37 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_window_get_gtype(void); #define gnt_vwindow_new(homo) gnt_window_box_new(homo, TRUE) #define gnt_hwindow_new(homo) gnt_window_box_new(homo, FALSE) -GntWidget *gnt_window_new(void); +/** + * + * + * @return + */ +GntWidget * gnt_window_new(void); -GntWidget *gnt_window_box_new(gboolean homo, gboolean vert); +/** + * + * @param homo + * @param vert + * + * @return + */ +GntWidget * gnt_window_box_new(gboolean homo, gboolean vert); +/** + * + * @param window + * @param menu + */ void gnt_window_set_menu(GntWindow *window, GntMenu *menu); G_END_DECLS
--- a/finch/libgnt/gntwm.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntwm.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #define _GNU_SOURCE #if defined(__APPLE__) || defined(__unix__) #define _XOPEN_SOURCE_EXTENDED
--- a/finch/libgnt/gntwm.h Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/gntwm.h Wed Jun 06 16:00:27 2007 +0000 @@ -1,3 +1,25 @@ +/** + * GNT - The GLib Ncurses Toolkit + * + * GNT is the legal property of its developers, whose names are too numerous + * to list here. Please refer to the COPYRIGHT file distributed with this + * source distribution. + * + * This library 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + #include "gntwidget.h" #include "gntmenu.h" @@ -144,28 +166,99 @@ G_BEGIN_DECLS +/** + * + * + * @return + */ GType gnt_wm_get_gtype(void); +/** + * + * @param wm + * @param widget + */ void gnt_wm_new_window(GntWM *wm, GntWidget *widget); +/** + * + * @param wm + * @param widget + */ void gnt_wm_window_decorate(GntWM *wm, GntWidget *widget); +/** + * + * @param wm + * @param widget + */ void gnt_wm_window_close(GntWM *wm, GntWidget *widget); +/** + * + * @param wm + * @param string + * + * @return + */ gboolean gnt_wm_process_input(GntWM *wm, const char *string); +/** + * + * @param wm + * @param event + * @param x + * @param y + * @param widget + * + * @return + */ gboolean gnt_wm_process_click(GntWM *wm, GntMouseEvent event, int x, int y, GntWidget *widget); +/** + * + * @param wm + * @param widget + * @param width + * @param height + */ void gnt_wm_resize_window(GntWM *wm, GntWidget *widget, int width, int height); +/** + * + * @param wm + * @param widget + * @param x + * @param y + */ void gnt_wm_move_window(GntWM *wm, GntWidget *widget, int x, int y); +/** + * + * @param wm + * @param widget + */ void gnt_wm_update_window(GntWM *wm, GntWidget *widget); +/** + * + * @param wm + * @param widget + */ void gnt_wm_raise_window(GntWM *wm, GntWidget *widget); +/** + * + * @param wm + * @param set + */ void gnt_wm_set_event_stack(GntWM *wm, gboolean set); +/** + * + * + * @return + */ time_t gnt_wm_get_idle_time(void); G_END_DECLS
--- a/finch/libgnt/wms/irssi.c Wed Jun 06 12:20:11 2007 +0000 +++ b/finch/libgnt/wms/irssi.c Wed Jun 06 16:00:27 2007 +0000 @@ -1,12 +1,13 @@ /** - * 1. Buddylist and conversation windows are borderless and full height of the screen. - * 2. Conversation windows will have (full-screen-width - buddylist-width) width - * - It's possible to auto-resize the conversation windows when the buddylist - * is closed/opened/resized to keep this always true. But resizing the textview - * in conversation window is rather costly, especially when there's a lot of text - * in the scrollback. So it's not done yet. + * 1. Buddylist is aligned on the left. + * 2. The rest of the screen is split into MxN grid for conversation windows. + * - M = irssi-split-h in ~/.gntrc:[general] + * - N = irssi-split-v in ~/.gntrc:[general] + * - Press alt-shift-k/j/l/h to move the selected window to the frame + * above/below/left/right of the current frame. * 3. All the other windows are always centered. */ +#include <stdlib.h> #include <string.h> #include <sys/types.h> @@ -23,6 +24,11 @@ typedef struct _Irssi { GntWM inherit; + int vert; + int horiz; + + /* This is changed whenever the buddylist is opened/closed or resized. */ + int buddylistwidth; } Irssi; typedef struct _IrssiClass @@ -35,8 +41,63 @@ static void (*org_new_window)(GntWM *wm, GntWidget *win); -/* This is changed whenever the buddylist is opened/closed or resized. */ -static int buddylistwidth; +static void +get_xywh_for_frame(Irssi *irssi, int hor, int vert, int *x, int *y, int *w, int *h) +{ + int width, height, rx, ry; + + width = (getmaxx(stdscr) - irssi->buddylistwidth) / irssi->horiz; + height = (getmaxy(stdscr) - 1) / irssi->vert; + + rx = irssi->buddylistwidth; + if (hor) + rx += hor * width; + rx++; + + ry = 0; + if (vert) + ry += vert * height + 1; + + if (x) *x = rx; + if (y) *y = ry; + if (w) { + *w = (hor == irssi->horiz - 1) ? (getmaxx(stdscr) - rx) : (width - 1); + } + if (h) { + *h = (vert == irssi->vert - 1) ? (getmaxy(stdscr) - 1 - ry) : (height - !!vert); + } +} + +static void +draw_line_separators(Irssi *irssi) +{ + int x, y; + int width, height; + + wclear(stdscr); + /* Draw the separator for the buddylist */ + if (irssi->buddylistwidth) + mvwvline(stdscr, 0, irssi->buddylistwidth, + ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL), getmaxy(stdscr) - 1); + + /* Now the separators for the conversation windows */ + width = (getmaxx(stdscr) - irssi->buddylistwidth) / irssi->horiz; + height = (getmaxy(stdscr) - 1) / irssi->vert; + for (x = 1; x < irssi->horiz; x++) { + mvwvline(stdscr, 0, irssi->buddylistwidth + x * width, + ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL), getmaxy(stdscr) - 1); + } + + for (y = 1; y < irssi->vert; y++) { + mvwhline(stdscr, y * height, irssi->buddylistwidth + 1, ACS_HLINE | COLOR_PAIR(GNT_COLOR_NORMAL), + getmaxx(stdscr) - irssi->buddylistwidth); + for (x = 1; x < irssi->horiz; x++) { + mvwaddch(stdscr, y * height, x * width + irssi->buddylistwidth, ACS_PLUS | COLOR_PAIR(GNT_COLOR_NORMAL)); + } + if (irssi->buddylistwidth) + mvwaddch(stdscr, y * height, irssi->buddylistwidth, ACS_LTEE | COLOR_PAIR(GNT_COLOR_NORMAL)); + } +} static gboolean is_budddylist(GntWidget *win) @@ -62,12 +123,12 @@ irssi_new_window(GntWM *wm, GntWidget *win) { const char *name; + int x, y, w, h; name = gnt_widget_get_name(win); if (!name || strcmp(name, "conversation-window")) { if (!GNT_IS_MENU(win) && !GNT_WIDGET_IS_FLAG_SET(win, GNT_WIDGET_TRANSIENT)) { if ((!name || strcmp(name, "buddylist"))) { - int w, h, x, y; gnt_widget_get_size(win, &w, &h); x = (getmaxx(stdscr) - w) / 2; y = (getmaxy(stdscr) - h) / 2; @@ -75,9 +136,8 @@ mvwin(win->window, y, x); } else { remove_border_set_position_size(wm, win, 0, 0, -1, getmaxy(stdscr) - 1); - gnt_widget_get_size(win, &buddylistwidth, NULL); - mvwvline(stdscr, 0, buddylistwidth, ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL), getmaxy(stdscr) - 1); - buddylistwidth++; + gnt_widget_get_size(win, &((Irssi*)wm)->buddylistwidth, NULL); + draw_line_separators((Irssi*)wm); } } org_new_window(wm, win); @@ -85,8 +145,12 @@ } /* The window we have here is a conversation window. */ - remove_border_set_position_size(wm, win, buddylistwidth, 0, - getmaxx(stdscr) - buddylistwidth, getmaxy(stdscr) - 1); + + /* XXX: There should be some way to remember which frame a conversation window + * was in the last time. Perhaps save them in some ~/.gntpositionirssi or some + * such. */ + get_xywh_for_frame((Irssi*)wm, 0, 0, &x, &y, &w, &h); + remove_border_set_position_size(wm, win, x, y, w, h); org_new_window(wm, win); } @@ -96,23 +160,93 @@ if (!is_budddylist(node->me)) return; - if (buddylistwidth) - mvwvline(stdscr, 0, buddylistwidth - 1, - ' ' | COLOR_PAIR(GNT_COLOR_NORMAL), getmaxy(stdscr) - 1); - gnt_widget_get_size(node->me, &buddylistwidth, NULL); - mvwvline(stdscr, 0, buddylistwidth, ACS_VLINE | COLOR_PAIR(GNT_COLOR_NORMAL), getmaxy(stdscr) - 1); - buddylistwidth++; + gnt_widget_get_size(node->me, &((Irssi*)wm)->buddylistwidth, NULL); + draw_line_separators((Irssi*)wm); } static gboolean irssi_close_window(GntWM *wm, GntWidget *win) { if (is_budddylist(win)) - buddylistwidth = 0; + ((Irssi*)wm)->buddylistwidth = 0; + return FALSE; +} + +static gboolean +update_conv_window_title(GntNode *node) +{ + char title[256]; + snprintf(title, sizeof(title), "%d: %s", + (int)g_object_get_data(G_OBJECT(node->me), "irssi-index") + 1, GNT_BOX(node->me)->title); + wbkgdset(node->window, '\0' | COLOR_PAIR(gnt_widget_has_focus(node->me) ? GNT_COLOR_TITLE : GNT_COLOR_TITLE_D)); + mvwaddstr(node->window, 0, 0, title); + update_panels(); + doupdate(); return FALSE; } static void +irssi_update_window(GntWM *wm, GntNode *node) +{ + GntWidget *win = node->me; + const char *name = gnt_widget_get_name(win); + if (!name || !GNT_IS_BOX(win) || strcmp(name, "conversation-window")) + return; + g_object_set_data(G_OBJECT(win), "irssi-index", GINT_TO_POINTER(g_list_index(wm->list, win))); + g_timeout_add(0, (GSourceFunc)update_conv_window_title, node); +} + +static void +find_window_position(Irssi *irssi, GntWidget *win, int *h, int *v) +{ + int x, y; + int width, height; + + gnt_widget_get_position(win, &x, &y); + width = (getmaxx(stdscr) - irssi->buddylistwidth) / irssi->horiz; + height = (getmaxy(stdscr) - 1) / irssi->vert; + + if (h) + *h = (x - irssi->buddylistwidth) / width; + if (v) + *v = y / height; +} + +static gboolean +move_direction(GntBindable *bindable, GList *list) +{ + GntWM *wm = GNT_WM(bindable); + Irssi *irssi = (Irssi*)wm; + int vert, hor; + int x, y, w, h; + GntWidget *win; + + if (wm->ordered == NULL || is_budddylist(win = GNT_WIDGET(wm->ordered->data))) + return FALSE; + + find_window_position(irssi, win, &hor, &vert); + + switch ((int)list->data) { + case 'k': + vert = MAX(0, vert - 1); + break; + case 'j': + vert = MIN(vert + 1, irssi->vert - 1); + break; + case 'l': + hor = MIN(hor + 1, irssi->horiz - 1); + break; + case 'h': + hor = MAX(0, hor - 1); + break; + } + get_xywh_for_frame(irssi, hor, vert, &x, &y, &w, &h); + gnt_wm_move_window(wm, win, x, y); + gnt_wm_resize_window(wm, win, w, h); + return TRUE; +} + +static void irssi_class_init(IrssiClass *klass) { GntWMClass *pclass = GNT_WM_CLASS(klass); @@ -122,6 +256,16 @@ pclass->new_window = irssi_new_window; pclass->window_resized = irssi_window_resized; pclass->close_window = irssi_close_window; + pclass->window_update = irssi_update_window; + + gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "move-up", move_direction, + "\033" "K", GINT_TO_POINTER('k'), NULL); + gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "move-down", move_direction, + "\033" "J", GINT_TO_POINTER('j'), NULL); + gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "move-right", move_direction, + "\033" "L", GINT_TO_POINTER('l'), NULL); + gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "move-left", move_direction, + "\033" "H", GINT_TO_POINTER('h'), NULL); gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass)); GNTDEBUG; @@ -129,8 +273,22 @@ void gntwm_init(GntWM **wm) { - buddylistwidth = 0; - *wm = g_object_new(TYPE_IRSSI, NULL); + const char *style = NULL; + Irssi *irssi; + + irssi = g_object_new(TYPE_IRSSI, NULL); + *wm = GNT_WM(irssi); + + style = gnt_style_get_from_name("irssi-split-v"); + irssi->vert = style ? atoi(style) : 1; + + style = gnt_style_get_from_name("irssi-split-h"); + irssi->horiz = style ? atoi(style) : 1; + + irssi->vert = MAX(irssi->vert, 1); + irssi->horiz = MAX(irssi->horiz, 1); + + irssi->buddylistwidth = 0; } GType irssi_get_gtype(void)