1
0
mirror of https://github.com/moparisthebest/hexchat synced 2024-12-22 23:58:52 -05:00

Merge branch 'xtext2'

This commit is contained in:
TingPing 2013-09-27 17:42:38 -04:00
commit 5465790886
16 changed files with 53 additions and 2079 deletions

View File

@ -41,18 +41,14 @@ AH_VERBATIM([HEXCHATSHAREDIR],[#undef HEXCHATSHAREDIR])
AH_VERBATIM([SOCKS],[#undef SOCKS])
AH_VERBATIM([USE_MSPROXY],[#undef USE_MSPROXY])
AH_VERBATIM([USE_LIBPROXY],[#undef USE_LIBPROXY])
AH_VERBATIM([USE_SHM],[#undef USE_SHM])
AH_VERBATIM([USE_GTKSPELL],[#undef USE_GTKSPELL])
AH_VERBATIM([USE_LIBSEXY],[#undef USE_LIBSEXY])
AH_VERBATIM([HAVE_ISO_CODES],[#undef HAVE_ISO_CODES])
AH_VERBATIM([USE_LIBNOTIFY],[#undef USE_LIBNOTIFY])
AH_VERBATIM([USE_LIBCANBERRA],[#undef USE_LIBCANBERRA])
AH_VERBATIM([USE_IPV6],[#undef USE_IPV6])
AH_VERBATIM([USE_MMX],[#undef USE_MMX])
AH_VERBATIM([USE_OPENSSL],[#undef USE_OPENSSL])
AH_VERBATIM([USE_PLUGIN],[#undef USE_PLUGIN])
AH_VERBATIM([USE_XFT],[#undef USE_XFT])
AH_VERBATIM([USE_XLIB],[#undef USE_XLIB])
AH_VERBATIM([USE_SIGACTION],[#undef USE_SIGACTION])
AH_VERBATIM([USING_FREEBSD],[#undef USING_FREEBSD])
AH_VERBATIM([USING_LINUX],[#undef USING_LINUX])
@ -91,10 +87,6 @@ AC_ARG_ENABLE(ipv6,
[AS_HELP_STRING([--disable-ipv6],[disable IPv6])],
ipv6=$enableval, ipv6=yes)
AC_ARG_ENABLE(xft,
[AS_HELP_STRING([--enable-xft],[enable use of Xft directly (default: no)])],
xft=$enableval, xft=no)
AC_ARG_ENABLE(openssl,
[AS_HELP_STRING([--enable-openssl[=PATH]],[enable use of openSSL])],
openssl=$enableval, openssl=yes)
@ -107,10 +99,6 @@ AC_ARG_ENABLE(textfe,
[AS_HELP_STRING([--enable-textfe],[build the text frontend (default: no)])],
textfe=$enableval, textfe=no)
AC_ARG_ENABLE(xlib,
[AS_HELP_STRING([--disable-xlib],[disable use of xlib (for non X11 systems)])],
xlib=$enableval, xlib=yes)
AC_ARG_ENABLE(python,
[AS_HELP_STRING([--enable-python=pythonversion],[build the python plugin; possible values: "python2", "python3" or specific such as "python3.3" (default on, python2)])],
python=$enableval, python=python2)
@ -156,15 +144,6 @@ AC_ARG_ENABLE(libcanberra,
[AS_HELP_STRING([--disable-libcanberra],[disable libcanberra support])],
libcanberra=$enableval, libcanberra=yes)
AC_ARG_ENABLE(mmx,
[AS_HELP_STRING([--disable-mmx],[disable MMX assembly routines])],
mmx=$enableval, mmx=yes)
AC_ARG_ENABLE(shm,
[AS_HELP_STRING([--enable-shm],[enable use of XShm for fast tinting (default: no)])],
shm=$enableval, shm=no)
AC_ARG_ENABLE(spell,
[AS_HELP_STRING([--enable-spell=type],[enable spelling type: none static libsexy gtkspell])],
spell=$enableval, spell=libsexy)
@ -230,41 +209,6 @@ fi
GUI_LIBS="$GUI_LIBS $GTK_LIBS"
GUI_CFLAGS="$GUI_CFLAGS $GTK_CFLAGS -DG_DISABLE_SINGLE_INCLUDES -DGDK_PIXBUF_DISABLE_SINGLE_INCLUDES -DGTK_DISABLE_SINGLE_INCLUDES"
dnl *********************************************************************
dnl ** XFT **************************************************************
dnl *********************************************************************
if test "$xft" = yes; then
if $PKG_CONFIG xft --exists; then
GUI_CFLAGS="$GUI_CFLAGS `$PKG_CONFIG xft --cflags`"
GUI_LIBS="$GUI_LIBS `$PKG_CONFIG xft --libs`"
else
xft=no
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $GTK_CFLAGS"
AC_CHECK_HEADERS(X11/Xft/Xft.h, xft=yes)
CPPFLAGS=$oldCPPFLAGS
fi
if test "$xft" = yes; then
AC_DEFINE(USE_XFT)
fi
fi
dnl *********************************************************************
dnl ** XLIB *************************************************************
dnl *********************************************************************
if test "$xlib" = yes; then
AC_DEFINE(USE_XLIB)
if test "$system" = "SunOS"; then
LIBS="$LIBS -L/usr/openwin/lib -lX11"
else
AC_CHECK_LIB(X11, XSetWMHints)
fi
else
shm=no
fi
dnl *********************************************************************
dnl ** PERL *************************************************************
dnl *********************************************************************
@ -681,61 +625,6 @@ if test "x$ntlm" = "xyes" ; then
fi
fi
dnl *********************************************************************
dnl ** XShm *************************************************************
dnl *********************************************************************
if test "$shm" = yes; then
oldl=$LIBS
oldc=$CPPFLAGS
LIBS="$LIBS `$PKG_CONFIG --libs-only-L xft`"
CPPFLAGS="$CPPFLAGS `$PKG_CONFIG --cflags-only-I xft`"
shm=no
AC_CHECK_LIB(Xext, XShmAttach, shm=yes)
if test "$shm" = yes; then
shm=no
AC_CHECK_HEADERS(sys/ipc.h, shm=yes)
if test "$shm" = yes; then
shm=no
AC_CHECK_HEADERS(sys/shm.h, shm=yes)
fi
fi
LIBS=$oldl
if test "$shm" = yes; then
GUI_LIBS="$GUI_LIBS `$PKG_CONFIG --libs-only-L xft` -lX11 -lXext"
AC_DEFINE(USE_SHM)
else
CPPFLAGS=$oldc
fi
fi
dnl *********************************************************************
dnl ** MMX **************************************************************
dnl *********************************************************************
dnl we don't need mmx on *this* machine, just i386, because
dnl it's checked at runtime.
if test "$mmx" = "yes"; then
case $host_cpu in
i386|i486|i586|i686|i786|k6|k7)
mmx=yes
;;
*)
mmx=no
esac
if test "$system" = "OpenBSD"; then
dnl openbsd fails because mmx_cmod doesn't prefix its symbols with underscore.
dnl xtext.o: Undefined symbol `_shade_ximage_15_mmx' referenced from text segment
mmx=no
fi
if test "$mmx" = "yes"; then
AC_DEFINE(USE_MMX)
fi
fi
AM_CONDITIONAL(USE_MMX, test "$mmx" = "yes")
dnl *********************************************************************
dnl ** GCC FLAGS ********************************************************
dnl *********************************************************************
@ -956,13 +845,6 @@ echo GTK+ interface ........ : $gtkfe
echo Text interface ........ : $textfe
echo Theme manager ......... : $theme_manager
echo
echo MMX tinting ........... : $mmx
echo XShm tinting .......... : $shm
if test "$xft" = no; then
echo Text backend .......... : Pango
else
echo Text backend .......... : Xft
fi
echo OpenSSL support ....... : $openssl
echo D-Bus support ......... : $dbus
echo libnotify support ..... : $libnotify

View File

@ -457,6 +457,7 @@ const struct prefs vars[] =
{"gui_tab_utils", P_OFFINT (hex_gui_tab_utils), TYPE_BOOL},
{"gui_throttlemeter", P_OFFINT (hex_gui_throttlemeter), TYPE_INT},
{"gui_topicbar", P_OFFINT (hex_gui_topicbar), TYPE_BOOL},
{"gui_transparency", P_OFFINT (hex_gui_transparency), TYPE_INT},
{"gui_tray", P_OFFINT (hex_gui_tray), TYPE_BOOL},
{"gui_tray_away", P_OFFINT (hex_gui_tray_away), TYPE_BOOL},
{"gui_tray_blink", P_OFFINT (hex_gui_tray_blink), TYPE_BOOL},
@ -585,9 +586,6 @@ const struct prefs vars[] =
{"text_stripcolor_replay", P_OFFINT (hex_text_stripcolor_replay), TYPE_BOOL},
{"text_stripcolor_topic", P_OFFINT (hex_text_stripcolor_topic), TYPE_BOOL},
{"text_thin_sep", P_OFFINT (hex_text_thin_sep), TYPE_BOOL},
{"text_tint_blue", P_OFFINT (hex_text_tint_blue), TYPE_INT},
{"text_tint_green", P_OFFINT (hex_text_tint_green), TYPE_INT},
{"text_tint_red", P_OFFINT (hex_text_tint_red), TYPE_INT},
{"text_transparent", P_OFFINT (hex_text_transparent), TYPE_BOOL},
{"text_wordwrap", P_OFFINT (hex_text_wordwrap), TYPE_BOOL},
@ -721,6 +719,7 @@ load_default_config(void)
prefs.hex_gui_tab_server = 1;
prefs.hex_gui_tab_sort = 1;
prefs.hex_gui_topicbar = 1;
prefs.hex_gui_transparency = 255;
prefs.hex_gui_tray = 1;
prefs.hex_gui_tray_blink = 1;
prefs.hex_gui_ulist_count = 1;
@ -789,9 +788,6 @@ load_default_config(void)
prefs.hex_notify_timeout = 15;
prefs.hex_text_max_indent = 256;
prefs.hex_text_max_lines = 500;
prefs.hex_text_tint_blue = 195;
prefs.hex_text_tint_green = 195;
prefs.hex_text_tint_red = 195;
prefs.hex_url_grabber_limit = 100; /* 0 means unlimited */
/* STRINGS */

View File

@ -284,6 +284,7 @@ struct hexchatprefs
int hex_gui_tab_pos;
int hex_gui_tab_small;
int hex_gui_tab_trunc;
int hex_gui_transparency;
int hex_gui_throttlemeter;
int hex_gui_ulist_pos;
int hex_gui_ulist_sort;
@ -306,9 +307,6 @@ struct hexchatprefs
int hex_notify_timeout;
int hex_text_max_indent;
int hex_text_max_lines;
int hex_text_tint_blue;
int hex_text_tint_green;
int hex_text_tint_red;
int hex_url_grabber_limit;
/* STRINGS */

View File

@ -9,14 +9,10 @@ hexchat_LDADD = ../common/libhexchatcommon.a $(GUI_LIBS)
EXTRA_DIST = \
ascii.h banlist.h chanlist.h chanview.h chanview-tabs.c \
chanview-tree.c custom-list.h editlist.h fe-gtk.h fkeys.h gtkutil.h joind.h \
maingui.h menu.h mmx_cmod.S mmx_cmod.h notifygui.h palette.h pixmaps.h \
maingui.h menu.h notifygui.h palette.h pixmaps.h \
plugin-tray.h plugingui.c plugingui.h rawlog.h sexy-iso-codes.h \
sexy-spell-entry.h sexy-marshal.h textgui.h urlgrab.h userlistgui.h xtext.h
if USE_MMX
mmx_cmod_S = mmx_cmod.S
endif
if DO_PLUGIN
plugingui_c = plugingui.c
endif
@ -28,6 +24,6 @@ endif
hexchat_SOURCES = ascii.c banlist.c chanlist.c chanview.c custom-list.c \
dccgui.c editlist.c fe-gtk.c fkeys.c gtkutil.c ignoregui.c joind.c menu.c \
maingui.c $(mmx_cmod_S) notifygui.c palette.c pixmaps.c plugin-tray.c $(plugingui_c) \
maingui.c notifygui.c palette.c pixmaps.c plugin-tray.c $(plugingui_c) \
rawlog.c servlistgui.c setup.c $(sexy_spell) textgui.c \
urlgrab.c userlistgui.c xtext.c

View File

@ -52,10 +52,6 @@
#include "urlgrab.h"
#include "setup.h"
#ifdef USE_XLIB
#include <gdk/gdkx.h>
#endif
#ifdef USE_LIBCANBERRA
#include <canberra.h>
#endif
@ -66,49 +62,6 @@ GdkPixmap *channelwin_pix;
static ca_context *ca_con;
#endif
#ifdef USE_XLIB
static void
redraw_trans_xtexts (void)
{
GSList *list = sess_list;
session *sess;
int done_main = FALSE;
while (list)
{
sess = list->data;
if (GTK_XTEXT (sess->gui->xtext)->transparent)
{
if (!sess->gui->is_tab || !done_main)
gtk_xtext_refresh (GTK_XTEXT (sess->gui->xtext), 1);
if (sess->gui->is_tab)
done_main = TRUE;
}
list = list->next;
}
}
static GdkFilterReturn
root_event_cb (GdkXEvent *xev, GdkEventProperty *event, gpointer data)
{
static Atom at = None;
XEvent *xevent = (XEvent *)xev;
if (xevent->type == PropertyNotify)
{
if (at == None)
at = XInternAtom (xevent->xproperty.display, "_XROOTPMAP_ID", True);
if (at == xevent->xproperty.atom)
redraw_trans_xtexts ();
}
return GDK_FILTER_CONTINUE;
}
#endif
/* === command-line parameter parsing : requires glib 2.6 === */
static char *arg_cfgdir = NULL;
@ -281,11 +234,6 @@ fe_args (int argc, char *argv[])
gtk_init (&argc, &argv);
#ifdef USE_XLIB
gdk_window_set_events (gdk_get_default_root_window (), GDK_PROPERTY_CHANGE_MASK);
gdk_window_add_filter (gdk_get_default_root_window (), (GdkFilterFunc)root_event_cb, NULL);
#endif
return -1;
}

View File

@ -110,7 +110,6 @@
<ClInclude Include="joind.h" />
<ClInclude Include="maingui.h" />
<ClInclude Include="menu.h" />
<ClInclude Include="mmx_cmod.h" />
<ClInclude Include="notifygui.h" />
<ClInclude Include="palette.h" />
<ClInclude Include="pixmaps.h" />

View File

@ -51,9 +51,6 @@
<ClInclude Include="menu.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="mmx_cmod.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="notifygui.h">
<Filter>Header Files</Filter>
</ClInclude>

View File

@ -804,10 +804,6 @@ key_dialog_show ()
gtk_box_pack_end (GTK_BOX (vbox), hbox2, 0, 0, 1);
wid = gtk_xtext_new (colors, 0);
gtk_xtext_set_tint (GTK_XTEXT (wid), prefs.hex_text_tint_red, prefs.hex_text_tint_green, prefs.hex_text_tint_blue);
gtk_xtext_set_background (GTK_XTEXT (wid),
channelwin_pix,
prefs.hex_text_transparent);
gtk_widget_set_usize (wid, 0, 75);
gtk_box_pack_start (GTK_BOX (hbox2), wid, 1, 1, 1);
gtk_xtext_set_font (GTK_XTEXT (wid), prefs.hex_text_font);

View File

@ -529,9 +529,6 @@ mg_configure_cb (GtkWidget *wid, GdkEventConfigure *event, session *sess)
gtk_window_get_size (GTK_WINDOW (wid), &prefs.hex_gui_dialog_width,
&prefs.hex_gui_dialog_height);
}
if (((GtkXText *) sess->gui->xtext)->transparent)
gtk_widget_queue_draw (sess->gui->xtext);
}
return FALSE;
@ -1504,7 +1501,7 @@ mg_create_color_menu (GtkWidget *menu, session *sess)
mg_markup_item (submenu, _("<b>Bold</b>"), 100);
mg_markup_item (submenu, _("<u>Underline</u>"), 101);
/*mg_markup_item (submenu, _("<i>Italic</i>"), 102);*/
mg_markup_item (submenu, _("<i>Italic</i>"), 102);
mg_markup_item (submenu, _("Normal"), 103);
subsubmenu = mg_submenu (submenu, _("Colors 0-7"));
@ -2333,8 +2330,7 @@ mg_update_xtext (GtkWidget *wid)
gtk_xtext_set_palette (xtext, colors);
gtk_xtext_set_max_lines (xtext, prefs.hex_text_max_lines);
gtk_xtext_set_tint (xtext, prefs.hex_text_tint_red, prefs.hex_text_tint_green, prefs.hex_text_tint_blue);
gtk_xtext_set_background (xtext, channelwin_pix, prefs.hex_text_transparent);
gtk_xtext_set_background (xtext, channelwin_pix);
gtk_xtext_set_wordwrap (xtext, prefs.hex_text_wordwrap);
gtk_xtext_set_show_marker (xtext, prefs.hex_text_show_marker);
gtk_xtext_set_show_separator (xtext, prefs.hex_text_indent ? prefs.hex_text_show_sep : 0);
@ -2345,23 +2341,7 @@ mg_update_xtext (GtkWidget *wid)
exit (1);
}
gtk_xtext_refresh (xtext, FALSE);
}
/* handle errors reported by xtext */
static void
mg_xtext_error (int type)
{
switch (type)
{
case 0:
fe_message (_("Unable to set transparent background!\n\n"
"You may be using a non-compliant window\n"
"manager that is not currently supported.\n"), FE_MSG_WARN);
prefs.hex_text_transparent = 0;
/* no others exist yet */
}
gtk_xtext_refresh (xtext);
}
static void
@ -2394,7 +2374,6 @@ mg_create_textarea (session *sess, GtkWidget *box)
xtext = GTK_XTEXT (gui->xtext);
gtk_xtext_set_max_indent (xtext, prefs.hex_text_max_indent);
gtk_xtext_set_thin_separator (xtext, prefs.hex_text_thin_sep);
gtk_xtext_set_error_function (xtext, mg_xtext_error);
gtk_xtext_set_urlcheck_function (xtext, mg_word_check);
gtk_xtext_set_max_lines (xtext, prefs.hex_text_max_lines);
gtk_container_add (GTK_CONTAINER (frame), GTK_WIDGET (xtext));
@ -3207,6 +3186,7 @@ mg_create_topwindow (session *sess)
prefs.hex_gui_win_height, 0);
sess->gui->window = win;
gtk_container_set_border_width (GTK_CONTAINER (win), GUI_BORDER);
gtk_window_set_opacity (GTK_WINDOW (win), (prefs.hex_gui_transparency / 255.));
g_signal_connect (G_OBJECT (win), "focus_in_event",
G_CALLBACK (mg_topwin_focus_cb), sess);
@ -3311,6 +3291,7 @@ mg_create_tabwindow (session *sess)
gtk_window_maximize (GTK_WINDOW (win));
if (prefs.hex_gui_win_fullscreen)
gtk_window_fullscreen (GTK_WINDOW (win));
gtk_window_set_opacity (GTK_WINDOW (win), (prefs.hex_gui_transparency / 255.));
gtk_container_set_border_width (GTK_CONTAINER (win), GUI_BORDER);
g_signal_connect (G_OBJECT (win), "delete_event",

View File

@ -1,530 +0,0 @@
/*
* Copyright (C) 1997-2001, Michael Jennings
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
/* MMX routines for tinting XImages written by Willem Monsuwe <willem@stack.nl> */
/* Function calling conventions:
* shade_ximage_xx(void *data, int bpl, int w, int h, int rm, int gm, int bm);
*/
#define data 8(%ebp)
#define bpl 12(%ebp)
#define w 16(%ebp)
#define h 20(%ebp)
#define rm 24(%ebp)
#define gm 28(%ebp)
#define bm 32(%ebp)
#ifdef UNDERSCORE_SYMBOLS /* need this to link with msvc */
#define SHADE_XIMAGE_15 _shade_ximage_15_mmx
#define SHADE_XIMAGE_16 _shade_ximage_16_mmx
#define SHADE_XIMAGE_32 _shade_ximage_32_mmx
#define HAVE_MMX _have_mmx
#else
#define SHADE_XIMAGE_15 shade_ximage_15_mmx
#define SHADE_XIMAGE_16 shade_ximage_16_mmx
#define SHADE_XIMAGE_32 shade_ximage_32_mmx
#define HAVE_MMX have_mmx
#endif
.globl SHADE_XIMAGE_15
.globl SHADE_XIMAGE_16
.globl SHADE_XIMAGE_32
.globl HAVE_MMX
.bss
.text
.align 8
#define ENTER \
pushl %ebp ;\
movl %esp, %ebp ;\
pushl %ebx ;\
pushl %ecx ;\
pushl %edx ;\
pushl %edi ;\
pushl %esi ;\
movl data, %esi ;\
movl w, %ebx ;\
movl h, %edx
#define LEAVE \
4: ;\
emms ;\
popl %esi ;\
popl %edi ;\
popl %edx ;\
popl %ecx ;\
popl %ebx ;\
movl %ebp, %esp ;\
popl %ebp ;\
ret
SHADE_XIMAGE_15:
ENTER
leal -6(%esi, %ebx, 2), %esi
negl %ebx
jz 5f
/* Setup multipliers */
movd rm, %mm5
movd gm, %mm6
movd bm, %mm7
punpcklwd %mm5, %mm5 /* 00 00 00 00 rm rm rm rm */
punpcklwd %mm6, %mm6 /* 00 00 00 00 gm gm gm gm */
punpcklwd %mm7, %mm7 /* 00 00 00 00 bm bm bm bm */
punpckldq %mm5, %mm5 /* rm rm rm rm rm rm rm rm */
punpckldq %mm6, %mm6 /* gm gm gm gm gm gm gm gm */
punpckldq %mm7, %mm7 /* bm bm bm bm bm bm bm bm */
cmpl $256, rm
jg shade_ximage_15_mmx_saturate
cmpl $256, gm
jg shade_ximage_15_mmx_saturate
cmpl $256, bm
jg shade_ximage_15_mmx_saturate
1: movl %ebx, %ecx
addl $3, %ecx
jns 3f
2:
movq (%esi, %ecx, 2), %mm0
movq %mm0, %mm1 /* rg gb */
movq %mm0, %mm2 /* rg gb */
psrlw $5, %mm1 /* 0r rg */
psrlw $10, %mm0 /* 00 0r */
psllw $11, %mm2 /* b0 00 */
psllw $11, %mm1 /* g0 00 */
psllw $8, %mm0 /* 0r 00 */
psrlw $3, %mm1 /* 0g 00 */
psrlw $3, %mm2 /* 0b 00 */
pmulhw %mm5, %mm0 /* 00 0r */
pmulhw %mm6, %mm1 /* 00 0g */
pmulhw %mm7, %mm2 /* 00 0b */
psllw $10, %mm0 /* r0 00 */
psllw $5, %mm1 /* 0g g0 */
por %mm2, %mm0 /* r0 0b */
por %mm1, %mm0 /* rg gb */
movq %mm0, (%esi, %ecx, 2)
addl $4, %ecx
js 2b
jmp 4f
3:
movw (%esi, %ecx, 2), %ax
movd %eax, %mm0
movq %mm0, %mm1 /* rg gb */
movq %mm0, %mm2 /* rg gb */
psrlw $5, %mm1 /* 0r rg */
psrlw $10, %mm0 /* 00 0r */
psllw $11, %mm2 /* b0 00 */
psllw $11, %mm1 /* g0 00 */
psllw $8, %mm0 /* 0r 00 */
psrlw $3, %mm1 /* 0g 00 */
psrlw $3, %mm2 /* 0b 00 */
pmulhw %mm5, %mm0 /* 00 0r */
pmulhw %mm6, %mm1 /* 00 0g */
pmulhw %mm7, %mm2 /* 00 0b */
psllw $10, %mm0 /* r0 00 */
psllw $5, %mm1 /* 0g g0 */
por %mm2, %mm0 /* r0 0b */
por %mm1, %mm0 /* rg gb */
movd %mm0, %eax
movw %ax, (%esi, %ecx, 2)
incl %ecx
4:
cmpl $2, %ecx
jng 3b
addl bpl, %esi
decl %edx
jnz 1b
5:
LEAVE
shade_ximage_15_mmx_saturate:
pcmpeqw %mm3, %mm3
psllw $5, %mm3 /* ff e0 ff e0 ff e0 ff e0 */
1: movl %ebx, %ecx
addl $3, %ecx
jns 3f
2:
movq (%esi, %ecx, 2), %mm0
movq %mm0, %mm1 /* rg gb */
movq %mm0, %mm2 /* rg gb */
psrlw $5, %mm1 /* 0r rg */
psrlw $10, %mm0 /* 00 0r */
psllw $11, %mm2 /* b0 00 */
psllw $11, %mm1 /* g0 00 */
psllw $8, %mm0 /* 0r 00 */
psrlw $3, %mm1 /* 0g 00 */
psrlw $3, %mm2 /* 0b 00 */
pmulhw %mm5, %mm0 /* xx xr */
pmulhw %mm6, %mm1 /* xx xg */
pmulhw %mm7, %mm2 /* xx xb */
/* Saturate upper */
paddusw %mm3, %mm0 /* ff er */
paddusw %mm3, %mm1 /* ff eg */
paddusw %mm3, %mm2 /* ff eb */
psubw %mm3, %mm0 /* 00 0r */
psubw %mm3, %mm1 /* 00 0g */
psubw %mm3, %mm2 /* 00 0b */
psllw $10, %mm0 /* r0 00 */
psllw $5, %mm1 /* 0g g0 */
por %mm2, %mm0 /* r0 0b */
por %mm1, %mm0 /* rg gb */
movq %mm0, (%esi, %ecx, 2)
addl $4, %ecx
js 2b
jmp 4f
3:
movw (%esi, %ecx, 2), %ax
movd %eax, %mm0
movq %mm0, %mm1 /* rg gb */
movq %mm0, %mm2 /* rg gb */
psrlw $5, %mm1 /* 0r rg */
psrlw $10, %mm0 /* 00 0r */
psllw $11, %mm2 /* b0 00 */
psllw $11, %mm1 /* g0 00 */
psllw $8, %mm0 /* 0r 00 */
psrlw $3, %mm1 /* 0g 00 */
psrlw $3, %mm2 /* 0b 00 */
pmulhw %mm5, %mm0 /* xx xr */
pmulhw %mm6, %mm1 /* xx xg */
pmulhw %mm7, %mm2 /* xx xb */
/* Saturate upper */
paddusw %mm3, %mm0 /* ff er */
paddusw %mm3, %mm1 /* ff eg */
paddusw %mm3, %mm2 /* ff eb */
psubw %mm3, %mm0 /* 00 0r */
psubw %mm3, %mm1 /* 00 0g */
psubw %mm3, %mm2 /* 00 0b */
psllw $10, %mm0 /* r0 00 */
psllw $5, %mm1 /* 0g g0 */
por %mm2, %mm0 /* r0 0b */
por %mm1, %mm0 /* rg gb */
movd %mm0, %eax
movw %ax, (%esi, %ecx, 2)
incl %ecx
4:
cmpl $2, %ecx
jng 3b
addl bpl, %esi
decl %edx
jnz 1b
5:
LEAVE
SHADE_XIMAGE_16:
ENTER
leal -6(%esi, %ebx, 2), %esi
negl %ebx
jz 5f
/* Setup multipliers */
movd rm, %mm5
movd gm, %mm6
movd bm, %mm7
punpcklwd %mm5, %mm5 /* 00 00 00 00 rm rm rm rm */
punpcklwd %mm6, %mm6 /* 00 00 00 00 gm gm gm gm */
punpcklwd %mm7, %mm7 /* 00 00 00 00 bm bm bm bm */
punpckldq %mm5, %mm5 /* rm rm rm rm rm rm rm rm */
punpckldq %mm6, %mm6 /* gm gm gm gm gm gm gm gm */
punpckldq %mm7, %mm7 /* bm bm bm bm bm bm bm bm */
cmpl $256, rm
jg shade_ximage_16_mmx_saturate
cmpl $256, gm
jg shade_ximage_16_mmx_saturate
cmpl $256, bm
jg shade_ximage_16_mmx_saturate
1: movl %ebx, %ecx
addl $3, %ecx
jns 3f
2:
movq (%esi, %ecx, 2), %mm0
movq %mm0, %mm1 /* rg gb */
movq %mm0, %mm2 /* rg gb */
psrlw $5, %mm1 /* 0r rg */
psrlw $11, %mm0 /* 00 0r */
psllw $11, %mm2 /* b0 00 */
psllw $10, %mm1 /* g0 00 */
psllw $8, %mm0 /* 0r 00 */
psrlw $2, %mm1 /* 0g 00 */
psrlw $3, %mm2 /* 0b 00 */
pmulhw %mm5, %mm0 /* 00 0r */
pmulhw %mm6, %mm1 /* 00 0g */
pmulhw %mm7, %mm2 /* 00 0b */
psllw $11, %mm0 /* r0 00 */
psllw $5, %mm1 /* 0g g0 */
por %mm2, %mm0 /* r0 0b */
por %mm1, %mm0 /* rg gb */
movq %mm0, (%esi, %ecx, 2)
addl $4, %ecx
js 2b
jmp 4f
3:
movw (%esi, %ecx, 2), %ax
movd %eax, %mm0
movq %mm0, %mm1 /* rg gb */
movq %mm0, %mm2 /* rg gb */
psrlw $5, %mm1 /* 0r rg */
psrlw $11, %mm0 /* 00 0r */
psllw $11, %mm2 /* b0 00 */
psllw $10, %mm1 /* g0 00 */
psllw $8, %mm0 /* 0r 00 */
psrlw $2, %mm1 /* 0g 00 */
psrlw $3, %mm2 /* 0b 00 */
pmulhw %mm5, %mm0 /* 00 0r */
pmulhw %mm6, %mm1 /* 00 0g */
pmulhw %mm7, %mm2 /* 00 0b */
psllw $11, %mm0 /* r0 00 */
psllw $5, %mm1 /* 0g g0 */
por %mm2, %mm0 /* r0 0b */
por %mm1, %mm0 /* rg gb */
movd %mm0, %eax
movw %ax, (%esi, %ecx, 2)
incl %ecx
4:
cmpl $2, %ecx
jng 3b
addl bpl, %esi
decl %edx
jnz 1b
5:
LEAVE
shade_ximage_16_mmx_saturate:
pcmpeqw %mm3, %mm3
movq %mm3, %mm4
psllw $5, %mm3 /* ff e0 ff e0 ff e0 ff e0 */
psllw $6, %mm4 /* ff c0 ff c0 ff c0 ff c0 */
1: movl %ebx, %ecx
addl $3, %ecx
jns 3f
2:
movq (%esi, %ecx, 2), %mm0
movq %mm0, %mm1 /* rg gb */
movq %mm0, %mm2 /* rg gb */
psrlw $5, %mm1 /* 0r rg */
psrlw $11, %mm0 /* 00 0r */
psllw $11, %mm2 /* b0 00 */
psllw $10, %mm1 /* g0 00 */
psllw $8, %mm0 /* 0r 00 */
psrlw $2, %mm1 /* 0g 00 */
psrlw $3, %mm2 /* 0b 00 */
pmulhw %mm5, %mm0 /* xx xr */
pmulhw %mm6, %mm1 /* xx xg */
pmulhw %mm7, %mm2 /* xx xb */
/* Saturate upper */
paddusw %mm3, %mm0 /* ff er */
paddusw %mm4, %mm1 /* ff cg */
paddusw %mm3, %mm2 /* ff eb */
psubw %mm4, %mm1 /* 00 0g */
psubw %mm3, %mm2 /* 00 0b */
psllw $11, %mm0 /* r0 00 */
psllw $5, %mm1 /* 0g g0 */
por %mm2, %mm0 /* r0 0b */
por %mm1, %mm0 /* rg gb */
movq %mm0, (%esi, %ecx, 2)
addl $4, %ecx
js 2b
jmp 4f
3:
movw (%esi, %ecx, 2), %ax
movd %eax, %mm0
movq %mm0, %mm1 /* rg gb */
movq %mm0, %mm2 /* rg gb */
psrlw $5, %mm1 /* 0r rg */
psrlw $11, %mm0 /* 00 0r */
psllw $11, %mm2 /* b0 00 */
psllw $10, %mm1 /* g0 00 */
psllw $8, %mm0 /* 0r 00 */
psrlw $2, %mm1 /* 0g 00 */
psrlw $3, %mm2 /* 0b 00 */
pmulhw %mm5, %mm0 /* xx xr */
pmulhw %mm6, %mm1 /* xx xg */
pmulhw %mm7, %mm2 /* xx xb */
/* Saturate upper */
paddusw %mm3, %mm0 /* ff er */
paddusw %mm4, %mm1 /* ff cg */
paddusw %mm3, %mm2 /* ff eb */
psubw %mm4, %mm1 /* 00 0g */
psubw %mm3, %mm2 /* 00 0b */
psllw $11, %mm0 /* r0 00 */
psllw $5, %mm1 /* 0g g0 */
por %mm2, %mm0 /* r0 0b */
por %mm1, %mm0 /* rg gb */
movd %mm0, %eax
movw %ax, (%esi, %ecx, 2)
incl %ecx
4:
cmpl $2, %ecx
jng 3b
addl bpl, %esi
decl %edx
jnz 1b
5:
LEAVE
SHADE_XIMAGE_32:
ENTER
leal (%esi, %ebx, 4), %esi
negl %ebx
jz 3f
movd rm, %mm4
movd gm, %mm5
movd bm, %mm6
psllq $32, %mm4
psllq $16, %mm5
por %mm6, %mm4
por %mm5, %mm4
pcmpeqw %mm6, %mm6
psllw $15, %mm6 /* 80 00 80 00 80 00 80 00 */
movq %mm6, %mm5
pmulhw %mm4, %mm5 /* Get correction factor */
1:
movl %ebx, %ecx
2:
movd (%esi, %ecx, 4), %mm1 /* 00 rr gg bb */
pxor %mm0, %mm0
punpcklbw %mm1, %mm0 /* 00 00 rr 00 gg 00 bb 00 */
pxor %mm6, %mm0 /* Flip sign */
pmulhw %mm4, %mm0 /* 00 00 xx rr xx gg xx bb */
psubw %mm5, %mm0 /* Correct range */
packuswb %mm0, %mm0 /* 00 rr gg bb 00 rr gg bb */
movd %mm0, (%esi, %ecx, 4)
incl %ecx
jnz 2b
addl bpl, %esi
decl %edx
jnz 1b
3:
LEAVE
HAVE_MMX:
push %ebx
/* Check if bit 21 in flags word is writeable */
pushfl
popl %eax
movl %eax,%ebx
xorl $0x00200000, %eax
pushl %eax
popfl
pushfl
popl %eax
cmpl %eax, %ebx
je 8f
/* OK, we have CPUID */
movl $1, %eax
cpuid
test $0x00800000, %edx
jz 8f
movl $1, %eax /* success, have mmx */
popl %ebx
ret
8:
xorl %eax,%eax /* failed, no mmx */
popl %ebx
ret
#if defined(__GNUC__) && !defined(_WIN32)
.section .note.GNU-stack, "", @progbits
.previous
#endif

View File

@ -1,28 +0,0 @@
/* HexChat
* Copyright (C) 1998-2010 Peter Zelezny.
* Copyright (C) 2009-2013 Berke Viktor.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef HEXCHAT_MMX_CMOD_H
#define HEXCHAT_MMX_CMOD_H
void shade_ximage_15_mmx(void *data, int bpl, int w, int h, int rm, int gm, int bm);
void shade_ximage_16_mmx(void *data, int bpl, int w, int h, int rm, int gm, int bm);
void shade_ximage_32_mmx(void *data, int bpl, int w, int h, int rm, int gm, int bm);
int have_mmx (void);
#endif

View File

@ -121,9 +121,6 @@ open_rawlog (struct server *serv)
gtk_widget_show (hbox);
serv->gui->rawlog_textlist = gtk_xtext_new (colors, 0);
gtk_xtext_set_tint (GTK_XTEXT (serv->gui->rawlog_textlist), prefs.hex_text_tint_red, prefs.hex_text_tint_green, prefs.hex_text_tint_blue);
gtk_xtext_set_background (GTK_XTEXT (serv->gui->rawlog_textlist),
channelwin_pix, prefs.hex_text_transparent);
gtk_container_add (GTK_CONTAINER (hbox), serv->gui->rawlog_textlist);
gtk_xtext_set_font (GTK_XTEXT (serv->gui->rawlog_textlist), prefs.hex_text_font);

View File

@ -159,19 +159,11 @@ static const setting appearance_settings[] =
{ST_HEADER, N_("Text Box"),0,0,0},
{ST_TOGGLE, N_("Colored nick names"), P_OFFINTNL(hex_text_color_nicks), N_("Give each person on IRC a different color"),0,0},
{ST_TOGGLR, N_("Indent nick names"), P_OFFINTNL(hex_text_indent), N_("Make nick names right-justified"),0,0},
#if defined(USE_XLIB) || defined(WIN32)
{ST_TOGGLE, N_("Transparent background"), P_OFFINTNL(hex_text_transparent),0,0,0},
{ST_TOGGLR, N_("Show marker line"), P_OFFINTNL(hex_text_show_marker), N_("Insert a red line after the last read text."),0,0},
{ST_EFILE, N_("Background image:"), P_OFFSETNL(hex_text_background), 0, 0, sizeof prefs.hex_text_background},
{ST_TOGGLE, N_ ("Show marker line"), P_OFFINTNL (hex_text_show_marker), N_ ("Insert a red line after the last read text."), 0, 0},
{ST_EFILE, N_ ("Background image:"), P_OFFSETNL (hex_text_background), 0, 0, sizeof prefs.hex_text_background},
{ST_HEADER, N_("Transparency Settings"), 0,0,0},
{ST_HSCALE, N_("Red:"), P_OFFINTNL(hex_text_tint_red),0,0,0},
{ST_HSCALE, N_("Green:"), P_OFFINTNL(hex_text_tint_green),0,0,0},
{ST_HSCALE, N_("Blue:"), P_OFFINTNL(hex_text_tint_blue),0,0,0},
#else
{ST_TOGGLE, N_("Show marker line"), P_OFFINTNL(hex_text_show_marker), N_("Insert a red line after the last read text."),0,0},
{ST_EFILE, N_("Background image:"), P_OFFSETNL(hex_text_background), 0, 0, sizeof prefs.hex_text_background},
#endif
{ST_HSCALE, N_("Window Opacity:"), P_OFFINTNL(hex_gui_transparency),0,0,0},
{ST_HEADER, N_("Time Stamps"),0,0,0},
{ST_TOGGLE, N_("Enable time stamps"), P_OFFINTNL(hex_stamp_text),0,0,1},
@ -839,12 +831,13 @@ setup_create_spin (GtkWidget *table, int row, const setting *set)
}
static gint
setup_apply_tint (int *tag)
setup_apply_trans (int *tag)
{
prefs.hex_text_tint_red = setup_prefs.hex_text_tint_red;
prefs.hex_text_tint_green = setup_prefs.hex_text_tint_green;
prefs.hex_text_tint_blue = setup_prefs.hex_text_tint_blue;
mg_update_xtext (current_sess->gui->xtext);
prefs.hex_gui_transparency = setup_prefs.hex_gui_transparency;
gtk_window_set_opacity (GTK_WINDOW (current_sess->gui->window),
(prefs.hex_gui_transparency / 255.));
/* mg_update_xtext (current_sess->gui->xtext); */
*tag = 0;
return 0;
}
@ -858,7 +851,7 @@ setup_hscale_cb (GtkHScale *wid, const setting *set)
if (tag == 0)
{
tag = g_idle_add ((GSourceFunc) setup_apply_tint, &tag);
tag = g_idle_add ((GSourceFunc) setup_apply_trans, &tag);
}
}
@ -879,6 +872,12 @@ setup_create_hscale (GtkWidget *table, int row, const setting *set)
G_CALLBACK (setup_hscale_cb), (gpointer)set);
gtk_table_attach (GTK_TABLE (table), wid, 3, 6, row, row + 1,
GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
#ifndef WIN32 /* Windows always supports this */
/* Only used for transparency currently */
if (!gtk_widget_is_composited (current_sess->gui->window))
gtk_widget_set_sensitive (wid, FALSE);
#endif
}

View File

@ -383,9 +383,6 @@ pevent_dialog_show ()
G_CALLBACK (pevent_dialog_select), store);
pevent_dialog_twid = gtk_xtext_new (colors, 0);
gtk_xtext_set_tint (GTK_XTEXT (pevent_dialog_twid), prefs.hex_text_tint_red, prefs.hex_text_tint_green, prefs.hex_text_tint_blue);
gtk_xtext_set_background (GTK_XTEXT (pevent_dialog_twid),
channelwin_pix, prefs.hex_text_transparent);
pevent_dialog_entry = gtk_entry_new_with_max_length (255);
g_signal_connect (G_OBJECT (pevent_dialog_entry), "activate",

File diff suppressed because it is too large Load Diff

View File

@ -21,16 +21,6 @@
#define HEXCHAT_XTEXT_H
#include <gtk/gtk.h>
#ifdef USE_XFT
#include <X11/Xft/Xft.h>
#endif
#ifdef USE_SHM
#include <X11/Xlib.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#include <X11/extensions/XShm.h>
#endif
#define GTK_TYPE_XTEXT (gtk_xtext_get_type ())
#define GTK_XTEXT(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_XTEXT, GtkXText))
@ -132,10 +122,6 @@ struct _GtkXText
xtext_buffer *orig_buffer;
xtext_buffer *selection_buffer;
#ifdef USE_SHM
XShmSegmentInfo shminfo;
#endif
GtkAdjustment *adj;
GdkPixmap *pixmap; /* 0 = use palette[19] */
GdkDrawable *draw_buf; /* points to ->window */
@ -149,10 +135,6 @@ struct _GtkXText
int last_win_h;
int last_win_w;
int tint_red;
int tint_green;
int tint_blue;
GdkGC *bgc; /* backing pixmap */
GdkGC *fgc; /* text foreground color */
GdkGC *light_gc; /* sep bar */
@ -188,14 +170,6 @@ struct _GtkXText
guint16 fontwidth[128]; /* each char's width, only the ASCII ones */
#ifdef USE_XFT
XftColor color[XTEXT_COLS];
XftColor *xft_fg;
XftColor *xft_bg; /* both point into color[20] */
XftDraw *xftdraw;
XftFont *font;
XftFont *ifont; /* italics */
#else
struct pangofont
{
PangoFontDescription *font;
@ -204,7 +178,6 @@ struct _GtkXText
int descent;
} *font, pango_font;
PangoLayout *layout;
#endif
int fontsize;
int space_width; /* width (pixels) of the space " " character */
@ -213,7 +186,6 @@ struct _GtkXText
unsigned char scratch_buffer[4096];
void (*error_function) (int type);
int (*urlcheck_function) (GtkWidget * xtext, char *word);
int jump_out_offset; /* point at which to stop rendering */
@ -256,20 +228,15 @@ struct _GtkXText
unsigned int in_hilight:1;
unsigned int un_hilight:1;
unsigned int recycle:1;
unsigned int avoid_trans:1;
unsigned int force_render:1;
unsigned int shm:1;
unsigned int color_paste:1; /* CTRL was pressed when selection finished */
/* settings/prefs */
unsigned int auto_indent:1;
unsigned int thinline:1;
unsigned int transparent:1;
unsigned int shaded:1;
unsigned int marker:1;
unsigned int separator:1;
unsigned int wordwrap:1;
unsigned int overdraw:1;
unsigned int ignore_hidden:1; /* rawlog uses this */
};
@ -286,11 +253,11 @@ void gtk_xtext_append_indent (xtext_buffer *buf,
unsigned char *right_text, int right_len,
time_t stamp);
int gtk_xtext_set_font (GtkXText *xtext, char *name);
void gtk_xtext_set_background (GtkXText * xtext, GdkPixmap * pixmap, gboolean trans);
void gtk_xtext_set_background (GtkXText * xtext, GdkPixmap * pixmap);
void gtk_xtext_set_palette (GtkXText * xtext, GdkColor palette[]);
void gtk_xtext_clear (xtext_buffer *buf, int lines);
void gtk_xtext_save (GtkXText * xtext, int fh);
void gtk_xtext_refresh (GtkXText * xtext, int do_trans);
void gtk_xtext_refresh (GtkXText * xtext);
int gtk_xtext_lastlog (xtext_buffer *out, xtext_buffer *search_area);
textentry *gtk_xtext_search (GtkXText * xtext, const gchar *text, gtk_xtext_search_flags flags, GError **err);
void gtk_xtext_reset_marker_pos (GtkXText *xtext);
@ -308,7 +275,6 @@ void gtk_xtext_set_show_marker (GtkXText *xtext, gboolean show_marker);
void gtk_xtext_set_show_separator (GtkXText *xtext, gboolean show_separator);
void gtk_xtext_set_thin_separator (GtkXText *xtext, gboolean thin_separator);
void gtk_xtext_set_time_stamp (xtext_buffer *buf, gboolean timestamp);
void gtk_xtext_set_tint (GtkXText *xtext, int tint_red, int tint_green, int tint_blue);
void gtk_xtext_set_urlcheck_function (GtkXText *xtext, int (*urlcheck_function) (GtkWidget *, char *));
void gtk_xtext_set_wordwrap (GtkXText *xtext, gboolean word_wrap);