diff options
author | Marinus Schraal <foser@gentoo.org> | 2002-11-08 17:09:05 +0000 |
---|---|---|
committer | Marinus Schraal <foser@gentoo.org> | 2002-11-08 17:09:05 +0000 |
commit | d09bf59cad72a3a24c99ca34291b8732c06395b1 (patch) | |
tree | 524327e4d01746facee33c9af34a8b17ffa4589d /net-irc | |
parent | trivial fix in Changelog (diff) | |
download | historical-d09bf59cad72a3a24c99ca34291b8732c06395b1.tar.gz historical-d09bf59cad72a3a24c99ca34291b8732c06395b1.tar.bz2 historical-d09bf59cad72a3a24c99ca34291b8732c06395b1.zip |
Added tabs patch
Diffstat (limited to 'net-irc')
-rw-r--r-- | net-irc/xchat/ChangeLog | 7 | ||||
-rw-r--r-- | net-irc/xchat/files/digest-xchat-1.9.4-r1 | 1 | ||||
-rw-r--r-- | net-irc/xchat/files/gentoo-xchat-1.9.4-scrolled-tabs.patch | 159 | ||||
-rw-r--r-- | net-irc/xchat/xchat-1.9.4-r1.ebuild | 110 |
4 files changed, 276 insertions, 1 deletions
diff --git a/net-irc/xchat/ChangeLog b/net-irc/xchat/ChangeLog index b4fb3c42dd02..3f3d80487406 100644 --- a/net-irc/xchat/ChangeLog +++ b/net-irc/xchat/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for net-irc/xchat # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL -# $Header: /var/cvsroot/gentoo-x86/net-irc/xchat/ChangeLog,v 1.26 2002/11/05 15:44:57 foser Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-irc/xchat/ChangeLog,v 1.27 2002/11/08 17:09:05 foser Exp $ + +*xchat-1.9.4-r1 (08 Nov 2002) + + 08 Nov 2002; foser <foser@gentoo.org> xchat-1.9.4-r1.ebuild : + Added a modified scrolling tabs patch *xchat-1.9.4 (05 Nov 2002) diff --git a/net-irc/xchat/files/digest-xchat-1.9.4-r1 b/net-irc/xchat/files/digest-xchat-1.9.4-r1 new file mode 100644 index 000000000000..7e2dffc2770d --- /dev/null +++ b/net-irc/xchat/files/digest-xchat-1.9.4-r1 @@ -0,0 +1 @@ +MD5 ed0820b35e5a9c7c5860108a1555236f xchat-1.9.4.tar.bz2 700920 diff --git a/net-irc/xchat/files/gentoo-xchat-1.9.4-scrolled-tabs.patch b/net-irc/xchat/files/gentoo-xchat-1.9.4-scrolled-tabs.patch new file mode 100644 index 000000000000..2b94794356f5 --- /dev/null +++ b/net-irc/xchat/files/gentoo-xchat-1.9.4-scrolled-tabs.patch @@ -0,0 +1,159 @@ +diff -rNu xchat-1.9.4-orig/src/fe-gtk/maingui.c xchat-1.9.4-scrolled-tabs/src/fe-gtk/maingui.c +--- xchat-1.9.4-orig/src/fe-gtk/maingui.c 2002-10-23 12:52:56.000000000 +0100 ++++ xchat-1.9.4-scrolled-tabs/src/fe-gtk/maingui.c 2002-11-06 18:26:55.000000000 +0000 +@@ -40,6 +40,7 @@ + #include <gtk/gtkimage.h> + #include <gtk/gtkmessagedialog.h> + #include <gtk/gtkradiomenuitem.h> ++#include <gtk/gtkobject.h> + + #include "../common/xchat.h" + #include "../common/fe.h" +@@ -1620,25 +1621,82 @@ + mg_show_generic_tab (active_tab); + } + ++/* ++ * GtkViewports request at least as much space as their children do. ++ * If we don't intervene here, the GtkViewport will be granted its ++ * request, even at the expense of resizing the top-level window. ++ */ ++static void ++mg_tab_viewport_size_request (GtkWidget *widget, GtkRequisition *requisition, gpointer user_data) ++{ ++ requisition->width = 10; requisition->height = 1; ++} ++ ++static void ++mg_tab_scroll_left_clicked (GtkWidget *widget, gpointer user_data) ++{ ++ session_gui *gui = user_data; ++ GtkAdjustment *adjustment; ++ gint viewport_width; ++ gfloat new_value; ++ ++ adjustment = gtk_viewport_get_hadjustment (GTK_VIEWPORT (gui->tabs_box->parent)); ++ gdk_window_get_geometry (gui->tabs_box->parent->window, 0, 0, &viewport_width, 0, 0); ++ new_value = tab_search_offset (gui->tabs_box, adjustment->value, 0); ++ ++ if (new_value + viewport_width > adjustment->upper) ++ new_value = adjustment->upper - viewport_width; ++ ++ gtk_adjustment_set_value (adjustment, new_value); ++} ++ ++static void ++mg_tab_scroll_right_clicked (GtkWidget *widget, gpointer user_data) ++{ ++ session_gui *gui = user_data; ++ GtkAdjustment *adjustment; ++ gint viewport_width; ++ gfloat new_value; ++ ++ adjustment = gtk_viewport_get_hadjustment (GTK_VIEWPORT (gui->tabs_box->parent)); ++ gdk_window_get_geometry (gui->tabs_box->parent->window, 0, 0, &viewport_width, 0, 0); ++ new_value = tab_search_offset (gui->tabs_box, adjustment->value, 1); ++ ++ if (new_value == 0 || new_value + viewport_width > adjustment->upper) ++ new_value = adjustment->upper - viewport_width; ++ ++ gtk_adjustment_set_value (adjustment, new_value); ++} ++ + static void + mg_create_tabs (session_gui *gui, GtkWidget *box) + { +-/* GtkWidget *sc; +- GtkWidget *frame; ++ GtkWidget *hbox; ++ GtkWidget *viewport; ++ GtkWidget *button; + +- frame = gtk_frame_new (NULL); +- gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN); +- gtk_box_pack_start (GTK_BOX (box), frame, 0, 0, 0);*/ ++ hbox = gtk_hbox_new (0, 0); ++ gtk_widget_show (hbox); ++ gtk_box_pack_start (GTK_BOX (box), hbox, 0, 0, 0); + +- gui->tabs_box = tab_group_new (mg_switch_tab_cb); ++ viewport = gtk_viewport_new (0, 0); ++ gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE); ++ gtk_signal_connect (GTK_OBJECT (viewport), "size_request", GTK_SIGNAL_FUNC (mg_tab_viewport_size_request), 0); ++ gtk_widget_show (viewport); ++ gtk_box_pack_start (GTK_BOX (hbox), viewport, 1, 1, 0); + +-/* sc = gtk_scrolled_window_new (0, 0); +- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sc), +- GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER); +- gtk_scrolled_window_add_with_viewport (sc, gui->tabs_box);*/ ++ gui->tabs_box = tab_group_new (mg_switch_tab_cb); ++ gtk_container_add (GTK_CONTAINER (viewport), gui->tabs_box); + +- gtk_box_pack_start (GTK_BOX (box), gui->tabs_box, 0, 0, 0); +-/* gtk_container_add (GTK_CONTAINER (frame), gui->tabs_box);*/ ++ button = gtk_button_new_with_label ("<"); ++ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (mg_tab_scroll_left_clicked), gui); ++ gtk_widget_show (button); ++ gtk_box_pack_start (GTK_BOX (hbox), button, 0, 0, 0); ++ ++ button = gtk_button_new_with_label (">"); ++ gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (mg_tab_scroll_right_clicked), gui); ++ gtk_widget_show (button); ++ gtk_box_pack_start (GTK_BOX (hbox), button, 0, 0, 0); + } + + static gboolean +diff -rNu xchat-1.9.4-orig/src/fe-gtk/tabs.c xchat-1.9.4-scrolled-tabs/src/fe-gtk/tabs.c +--- xchat-1.9.4-orig/src/fe-gtk/tabs.c 2002-10-23 12:42:45.000000000 +0100 ++++ xchat-1.9.4-scrolled-tabs/src/fe-gtk/tabs.c 2002-11-06 18:20:29.000000000 +0000 +@@ -335,3 +335,41 @@ + tab_group_switch (group, 0, FALSE); + } + } ++ ++gint ++tab_search_offset (GtkWidget *group, gint start_offset, gboolean forward) ++{ ++ GList *boxes; ++ GList *tabs; ++ GtkWidget *box; ++ GtkWidget *button; ++ ++ boxes = GTK_BOX (group)->children; ++ if (!forward && boxes) ++ boxes = g_list_last (boxes); ++ ++ while (boxes) ++ { ++ box = ((GtkBoxChild *)boxes->data)->widget; ++ boxes = (forward ? boxes->next : boxes->prev); ++ ++ tabs = GTK_BOX (box)->children; ++ if (!forward && tabs) ++ tabs = g_list_last (tabs); ++ ++ while (tabs) ++ { ++ button = ((GtkBoxChild *)tabs->data)->widget; ++ tabs = (forward ? tabs->next : tabs->prev); ++ ++ if (!GTK_IS_TOGGLE_BUTTON (button)) ++ continue; ++ ++ if ((forward && button->allocation.x > start_offset) || ++ (!forward && button->allocation.x < start_offset)) ++ return button->allocation.x; ++ } ++ } ++ ++ return 0; ++} +diff -rNu xchat-1.9.4-orig/src/fe-gtk/tabs.h xchat-1.9.4-scrolled-tabs/src/fe-gtk/tabs.h +--- xchat-1.9.4-orig/src/fe-gtk/tabs.h 2002-05-04 07:44:48.000000000 +0100 ++++ xchat-1.9.4-scrolled-tabs/src/fe-gtk/tabs.h 2002-11-06 18:27:18.000000000 +0000 +@@ -5,3 +5,4 @@ + void tab_rename (GtkWidget *tab, char *new_name); + void tab_remove (GtkWidget *tab); + void tab_style (GtkWidget *tab, GtkStyle *style); ++gint tab_search_offset (GtkWidget *group, gint start_offset, gboolean forward); diff --git a/net-irc/xchat/xchat-1.9.4-r1.ebuild b/net-irc/xchat/xchat-1.9.4-r1.ebuild new file mode 100644 index 000000000000..8727ae4d9990 --- /dev/null +++ b/net-irc/xchat/xchat-1.9.4-r1.ebuild @@ -0,0 +1,110 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License, v2 or later +# $Header: /var/cvsroot/gentoo-x86/net-irc/xchat/xchat-1.9.4-r1.ebuild,v 1.1 2002/11/08 17:09:05 foser Exp $ + +IUSE="perl gnome ssl gtk python mmx ipv6 nls kde" + +S=${WORKDIR}/${P} +DESCRIPTION="X-Chat is a graphical IRC client for UNIX operating systems." +SRC_URI="http://www.xchat.org/files/source/1.9/${P}.tar.bz2" +HOMEPAGE="http://www.xchat.org/" + +LICENSE="GPL-2" +SLOT="2" +KEYWORDS="x86 ppc sparc sparc64" + +RDEPEND=">=dev-libs/glib-2.0.4 + >=x11-libs/gtk+-2.0.5 + perl? ( >=sys-devel/perl-5.6.1 ) + gnome? ( >=x11-libs/libzvt-2.0.1 + >=gnome-base/libgnome-2.0.1 + >=gnome-base/gnome-applets-2.0.0 + >=gnome-base/gnome-panel-2.0.1 ) + ssl? ( >=dev-libs/openssl-0.9.6d )" + +DEPEND="${RDEPEND} + nls? ( >=sys-devel/gettext-0.10.38 )" + +src_unpack() { + unpack ${A} + patch -d ${S} -p1 < ${FILESDIR}/gentoo-${P}-scrolled-tabs.patch +} + +# From the xchat 1.9.3 README_FIRST file: +# (one of the) REMAINING PROBLEMS: +# * can't compile with gnome, panel and zvt support * +# stroke + +src_compile() { + + local myopts myflags + + if [ ! `use perl` ] ; then + use gnome \ + && myopts="${myopts} --enable-gnome --enable-panel" \ + || myopts="${myopts} --enable-gtkfe --disable-gnome --disable-zvt" + + use gnome \ + && CFLAGS="${CFLAGS} -I/usr/include/orbit-2.0" \ + || myopts="${myopts} --disable-gnome" + fi + + use gtk \ + || myopts="${myopts} --disable-gtkfe" + + use ssl \ + && myopts="${myopts} --enable-openssl" + + use perl \ + || myopts="${myopts} --disable-perl" + + use python \ + || myopts="${myopts} --disable-python" + + use nls \ + && myopts="${myopts} --enable-hebrew --enable-japanese-conv" \ + || myopts="${myopts} --disable-nls" + + use mmx \ + && myopts="${myopts} --enable-mmx" \ + || myopts="${myopts} --disable-mmx" + + use ipv6 \ + && myopts="${myopts} --enable-ipv6" + + + [ -n "${DISABLE_XFT}" ] && myopts="${myopts} --disable-xft" + + econf \ + --program-suffix=-2 \ + ${myopts} || die "Configure failed" + + MAKEOPTS="-j1" emake || die "Compile failed" +} + +src_install() { + # some magic to create a menu entry for xchat 2 + sed -e "s:Exec=xchat:Exec=xchat-2:" -e "s:Name=X-Chat:Name=X-Chat 2:" xchat.desktop > xchat-2.desktop + + use kde && insinto ${KDEDIR}/share/applnk/Internet \ + || insinto /usr/share/gnome/apps/Internet + doins xchat-2.desktop + + einstall install || die "Install failed" + + # we prefer our own launcher + rm ${D}/etc/X11/applnk/Internet/xchat.desktop + rmdir -p ${D}/etc/X11/applnk/Internet + + use python && + ( dosym /usr/lib/xchat/plugins/python.so-2 /usr/lib/xchat/plugins/python.so ) + use perl && + ( dosym /usr/lib/xchat/plugins/perl.so-2 /usr/lib/xchat/plugins/perl.so ) + + dodoc AUTHORS COPYING ChangeLog README +} + +pkg_postinst() { + einfo "If you want X-Chat to correctly display Hebrew (bidi) do " + einfo "'export DISABLE_XFT=1' and re-emerge xchat" +} |