24 Commits

Author SHA1 Message Date
deepend-tildeclub
72427006dd Merge pull request #231 from mlt/py-eol
fix(python): concatenate bytes in compile_line of py console
2026-05-12 15:34:31 -06:00
deepend-tildeclub
0e5f702651 Merge pull request #233 from ZoiteChat/userlist-button-meter-layout-fix
Tighten userlist button/meter layout
2026-05-11 08:17:02 -06:00
4f1b0fc838 Tighten userlist button/meter layout 2026-05-11 01:35:57 -06:00
Mikhail Titov
23d0963c2d fix(python): decode the console input to str in _on_say_command 2026-05-10 23:57:43 -05:00
deepend-tildeclub
dcb35fb80f Merge pull request #230 from ZoiteChat/fix-scrollbar-consistency
UI Consistency: Use native GTK scrollbars across main panes
2026-05-10 08:31:15 -06:00
b1768854c3 Tighten userlist count/pane width behavior 2026-05-09 12:53:35 -06:00
4ed4eaf8e8 fix FSF address. 2026-05-08 20:50:51 -06:00
deepend-tildeclub
d167b53b17 Merge pull request #227 from ZoiteChat/fix-tab-scroll-skip
Consume handled tab wheel events
2026-05-08 07:52:37 -06:00
18eff80a30 UI Consistency: Use native GTK scrollbars across main panes 2026-05-07 13:29:22 -06:00
a44ec5f624 Consume handled tab wheel events 2026-05-07 12:03:41 -06:00
deepend-tildeclub
5da518f50e Merge pull request #226 from mlt/close-file-stream
fix(checksum): Make sure file stream is closed
2026-05-07 09:21:28 -06:00
Mikhail Titov
ebb11a8ac5 fix(checksum): Make sure file stream is closed 2026-05-07 09:11:10 -05:00
deepend-tildeclub
dd9c5db1aa Merge pull request #224 from ZoiteChat/channel_switcher_mouse_wheel_fix
Fix and Enable mouse wheel channel switching by default
2026-05-06 13:35:13 -06:00
984ac9763e Fix and Enable mouse wheel channel switching by default 2026-05-06 13:10:30 -06:00
deepend-tildeclub
ad67af2f8f Merge pull request #222 from ZoiteChat/fix-autocorrect-replace
Fix auto-replace to respect whole-word matches
2026-05-05 17:32:29 -06:00
cc8460d366 Fix auto-replace to respect whole-word matches 2026-05-05 17:22:56 -06:00
1dc9b9c956 Use Lua 5.4 deps in CI 2026-04-29 16:21:01 -06:00
deepend-tildeclub
20b552ad9d Merge pull request #214 from ZoiteChat/bump_perl_version_5_42_2
flatpak: bump perl to 5.42.2
2026-04-29 16:15:42 -06:00
deepend-tildeclub
12f4885ad7 Merge pull request #217 from ZoiteChat/remove-winamp-plugin
Remove Winamp Plugin.
2026-04-29 16:14:59 -06:00
9c1fdef286 Default Lua pkg-config target to lua-5.4 2026-04-29 16:10:06 -06:00
c125a154da More missed Winamp references. 2026-04-29 16:08:42 -06:00
028d768b23 Remove another Winamp reference. 2026-04-29 15:57:19 -06:00
42972e01b0 Remove Winamp Plugin. 2026-04-29 15:42:11 -06:00
5fad2d0c02 flatpak: bump perl to 5.42.2 2026-04-27 13:43:13 -06:00
27 changed files with 248 additions and 320 deletions

View File

@@ -34,7 +34,7 @@ jobs:
libwayland-client0 libwayland-cursor0 libwayland-egl1 \
libxkbcommon0 \
libgtk-3-bin libglib2.0-bin shared-mime-info gsettings-desktop-schemas \
libluajit-5.1-dev libpci-dev libperl-dev libssl-dev libayatana-appindicator3-dev \
liblua5.4-dev libpci-dev libperl-dev libssl-dev libayatana-appindicator3-dev \
perl python3 python3-minimal python3-dev python3-cffi mono-devel desktop-file-utils \
fonts-noto-color-emoji breeze-gtk-theme \
patchelf file curl

View File

@@ -34,7 +34,6 @@ jobs:
openssl \
libcanberra \
libayatana-appindicator \
luajit \
iso-codes \
lua \
perl \

View File

@@ -13,8 +13,8 @@
"sources": [
{
"type": "archive",
"url": "https://www.cpan.org/src/5.0/perl-5.40.1.tar.xz",
"sha256": "dfa20c2eef2b4af133525610bbb65dd13777ecf998c9c5b1ccf0d308e732ee3f"
"url": "https://www.cpan.org/src/5.0/perl-5.42.2.tar.xz",
"sha256": "0a585eeb9e363c0f80482ddb3571625250c2c86aeb408853e8ea50805cfb14bb"
}
]
}

View File

@@ -44,7 +44,7 @@ option('with-exec', type: 'boolean',
option('with-fishlim', type: 'boolean',
description: 'Fish encryption plugin, requires openssl'
)
option('with-lua', type: 'string', value: 'luajit',
option('with-lua', type: 'string', value: 'lua-5.4',
description: 'Lua scripting plugin, value is pkg-config name to use or "false"'
)
option('with-perl', type: 'string', value: 'perl',
@@ -59,9 +59,6 @@ option('with-sysinfo', type: 'boolean',
option('with-upd', type: 'boolean',
description: 'Update plugin, Windows only'
)
option('with-winamp', type: 'boolean',
description: 'Winamp plugin, Windows only'
)
option('with-perl-legacy-api', type: 'boolean', value: false,
description: 'Enables the legacy IRC perl module for compatibility with old scripts'
)

View File

@@ -104,12 +104,14 @@ thread_sha256_file (GTask *task, GFile *file, gpointer task_data, GCancellable *
g_checksum_update (checksum, buffer, ret);
if (error) {
g_checksum_free (checksum);
g_task_return_error (task, error);
return;
goto cleanup;
}
g_task_return_pointer (task, g_strdup (g_checksum_get_string (checksum)), g_free);
cleanup:
g_input_stream_close(G_INPUT_STREAM(istream), NULL, NULL);
g_object_unref(istream);
g_checksum_free (checksum);
}

View File

@@ -1,7 +1,19 @@
if cc.get_id() == 'msvc'
lua_dep = cc.find_library('lua51')
else
lua_dep = dependency(get_option('with-lua'))
lua_opt = get_option('with-lua')
lua_dep = dependency(lua_opt, required: false)
if not lua_dep.found() and lua_opt == 'lua-5.4'
foreach lua_name : ['lua5.4', 'lua-5.3', 'lua5.3', 'lua']
lua_dep = dependency(lua_name, required: false)
if lua_dep.found()
break
endif
endforeach
endif
if not lua_dep.found()
error('Dependency "' + lua_opt + '" not found')
endif
endif
shared_module('lua', 'lua.c',

View File

@@ -9,9 +9,6 @@ if host_machine.system() == 'windows'
subdir('upd')
endif
if get_option('with-winamp')
subdir('winamp')
endif
endif
if get_option('with-checksum')

View File

@@ -320,9 +320,9 @@ def _on_say_command(word, word_eol, userdata):
return 0
try:
python = _cstr(word_eol[1])
python = __decode(_cstr(word_eol[1]))
except Exception:
python = b''
python = ''
if not python:
return 1

View File

@@ -1,7 +0,0 @@
shared_module('winamp', 'winamp.c',
dependencies: [libgio_dep, zoitechat_plugin_dep],
install: true,
install_dir: plugindir,
name_prefix: '',
vs_module_defs: 'winamp.def',
)

View File

@@ -1,153 +0,0 @@
/********************* Winamp Plugin 0.3******************************
*
* Distribution: GPL
*
* Originally written by: Leo - leo.nard@free.fr
* Modified by: SilvereX - SilvereX@karklas.mif.vu.lt
* Modified again by: Derek Buitenhuis - daemon404@gmail.com
* Modified yet again by: Berke Viktor - berkeviktor@aol.com
*********************************************************************/
#include "windows.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include "zoitechat-plugin.h"
#define PLAYING 1
#define PAUSED 3
static zoitechat_plugin *ph;
static int
winamp(char *word[], char *word_eol[], void *userdata)
{
HWND hwndWinamp = FindWindowW(L"Winamp v1.x",NULL);
if (hwndWinamp)
{
if (!stricmp("PAUSE", word[2]))
{
if (SendMessage(hwndWinamp,WM_USER, 0, 104))
{
SendMessage(hwndWinamp, WM_COMMAND, 40046, 0);
if (SendMessage(hwndWinamp, WM_USER, 0, 104) == PLAYING)
zoitechat_printf(ph, "Winamp: playing");
else
zoitechat_printf(ph, "Winamp: paused");
}
}
else if (!stricmp("STOP", word[2]))
{
SendMessage(hwndWinamp, WM_COMMAND, 40047, 0);
zoitechat_printf(ph, "Winamp: stopped");
}
else if (!stricmp("PLAY", word[2]))
{
SendMessage(hwndWinamp, WM_COMMAND, 40045, 0);
zoitechat_printf(ph, "Winamp: playing");
}
else if (!stricmp("NEXT", word[2]))
{
SendMessage(hwndWinamp, WM_COMMAND, 40048, 0);
zoitechat_printf(ph, "Winamp: next playlist entry");
}
else if (!stricmp("PREV", word[2]))
{
SendMessage(hwndWinamp, WM_COMMAND, 40044, 0);
zoitechat_printf(ph, "Winamp: previous playlist entry");
}
else if (!stricmp("START", word[2]))
{
SendMessage(hwndWinamp, WM_COMMAND, 40154, 0);
zoitechat_printf(ph, "Winamp: playlist start");
}
else if (!word_eol[2][0])
{
wchar_t wcurrent_play[2048];
char *current_play, *p;
int len = GetWindowTextW(hwndWinamp, wcurrent_play, G_N_ELEMENTS(wcurrent_play));
current_play = g_utf16_to_utf8 (wcurrent_play, len, NULL, NULL, NULL);
if (!current_play)
{
zoitechat_print (ph, "Winamp: Error getting song information.");
return ZOITECHAT_EAT_ALL;
}
if (strchr(current_play, '-'))
{
/* Remove any trailing text and whitespace */
p = current_play + strlen(current_play) - 8;
while (p >= current_play)
{
if (!strnicmp(p, "- Winamp", 8))
break;
p--;
}
if (p >= current_play)
p--;
while (p >= current_play && *p == ' ')
p--;
*++p = '\0';
/* Ignore any leading track number */
p = strstr (current_play, ". ");
if (p)
p += 2;
else
p = current_play;
if (*p != '\0')
zoitechat_commandf (ph, "me is now playing: %s", p);
else
zoitechat_print (ph, "Winamp: No song information found.");
g_free (current_play);
}
else
zoitechat_print(ph, "Winamp: Nothing being played.");
}
else
zoitechat_printf(ph, "Usage: /WINAMP [PAUSE|PLAY|STOP|NEXT|PREV|START]\n");
}
else
{
zoitechat_print(ph, "Winamp not found.\n");
}
return ZOITECHAT_EAT_ALL;
}
int
zoitechat_plugin_init(zoitechat_plugin *plugin_handle,
char **plugin_name,
char **plugin_desc,
char **plugin_version,
char *arg)
{
ph = plugin_handle;
*plugin_name = "Winamp";
*plugin_desc = "Winamp plugin for ZoiteChat";
*plugin_version = "0.6";
zoitechat_hook_command (ph, "WINAMP", ZOITECHAT_PRI_NORM, winamp, "Usage: /WINAMP [PAUSE|PLAY|STOP|NEXT|PREV|START] - control Winamp or show what's currently playing", 0);
zoitechat_command (ph, "MENU -ishare\\music.png ADD \"Window/Display Current Song (Winamp)\" \"WINAMP\"");
zoitechat_print (ph, "Winamp plugin loaded\n");
return 1;
}
int
zoitechat_plugin_deinit(void)
{
zoitechat_command (ph, "MENU DEL \"Window/Display Current Song (Winamp)\"");
zoitechat_print (ph, "Winamp plugin unloaded\n");
return 1;
}

View File

@@ -1,3 +0,0 @@
EXPORTS
zoitechat_plugin_init
zoitechat_plugin_deinit

View File

@@ -1,48 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Configuration">
<PlatformToolset>v142</PlatformToolset>
<ConfigurationType>DynamicLibrary</ConfigurationType>
</PropertyGroup>
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>winamp</RootNamespace>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\win32\zoitechat.props" />
<PropertyGroup>
<TargetName>hcwinamp</TargetName>
<OutDir>$(ZoiteChatRel)plugins\</OutDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<PreprocessorDefinitions>WIN32;_WIN64;_AMD64_;NDEBUG;_WINDOWS;_USRDLL;WINAMP_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(DepsRoot)\include;$(OpenSslInclude);$(Glib);..\..\src\common;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<ModuleDefinitionFile>winamp.def</ModuleDefinitionFile>
<AdditionalDependencies>$(DepLibs);%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(DepsRoot)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="winamp.def" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="winamp.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
</Project>

View File

@@ -1,23 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<None Include="winamp.def">
<Filter>Resource Files</Filter>
</None>
</ItemGroup>
<ItemGroup>
<ClCompile Include="winamp.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
</Project>

View File

@@ -782,6 +782,7 @@ load_default_config(void)
prefs.hex_gui_tab_middleclose = 1;
prefs.hex_gui_tab_server = 1;
prefs.hex_gui_tab_sort = 1;
prefs.hex_gui_tab_scrollchans = 1;
prefs.hex_gui_topicbar = 1;
prefs.hex_gui_transparency = 255;
prefs.hex_gui_tray = 1;

View File

@@ -4166,10 +4166,10 @@ const struct commands xc_cmds[] = {
static int
command_compare (const void *a, const void *b)
{
return g_ascii_strcasecmp (a, ((struct commands *)b)->name);
return g_ascii_strcasecmp (a, ((const struct commands *)b)->name);
}
static struct commands *
static const struct commands *
find_internal_command (char *name)
{
/* the "-1" is to skip the NULL terminator */
@@ -4205,7 +4205,7 @@ usercommand_show_help (session *sess, char *name)
static void
help (session *sess, char *tbuf, char *helpcmd, int quiet)
{
struct commands *cmd;
const struct commands *cmd;
if (plugin_show_help (sess, helpcmd))
return;
@@ -4763,7 +4763,7 @@ handle_command (session *sess, char *cmd, int check_spch)
char *word[PDIWORDS+1];
char *word_eol[PDIWORDS+1];
static int command_level = 0;
struct commands *int_cmd;
const struct commands *int_cmd;
char *pdibuf;
char *tbuf;
int len;

View File

@@ -493,7 +493,6 @@ plugin_auto_load (session *sess)
for_files (lib_dir, "hcperl.dll", plugin_auto_load_cb);
for_files (lib_dir, "hcpython3.dll", plugin_auto_load_cb);
for_files (lib_dir, "hcupd.dll", plugin_auto_load_cb);
for_files (lib_dir, "hcwinamp.dll", plugin_auto_load_cb);
for_files (lib_dir, "hcsysinfo.dll", plugin_auto_load_cb);
#else
for_files (lib_dir, "*."PLUGIN_SUFFIX, plugin_auto_load_cb);

View File

@@ -2,10 +2,10 @@
* 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 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
@@ -13,8 +13,8 @@
* 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
* along with this program; if not, see
* <https://www.gnu.org/licenses/>.
*/
/* You can distribute this header with your plugins for easy compilation */

View File

@@ -304,20 +304,28 @@ tab_scroll_right_down_clicked (GtkWidget *widget, chanview *cv)
static gboolean
tab_scroll_cb (GtkWidget *widget, GdkEventScroll *event, gpointer cv)
{
int direction = cv_scroll_direction (event);
if (prefs.hex_gui_tab_scrollchans)
{
if (event->direction == GDK_SCROLL_DOWN)
mg_switch_page (1, 1);
else if (event->direction == GDK_SCROLL_UP)
mg_switch_page (1, -1);
if (direction != 0)
{
mg_switch_page (1, direction);
return TRUE;
}
}
else
{
/* mouse wheel scrolling */
if (event->direction == GDK_SCROLL_UP)
if (direction < 0)
{
tab_scroll_left_up_clicked (widget, cv);
else if (event->direction == GDK_SCROLL_DOWN)
return TRUE;
}
else if (direction > 0)
{
tab_scroll_right_down_clicked (widget, cv);
return TRUE;
}
}
return FALSE;
@@ -345,17 +353,17 @@ cv_tabs_init (chanview *cv)
viewport = gtk_scrolled_window_new (0, 0);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (viewport), GTK_SHADOW_NONE);
gtk_scrolled_window_set_overlay_scrolling (GTK_SCROLLED_WINDOW (viewport), FALSE);
if (cv->vertical)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (viewport),
GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
else
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (viewport),
GTK_POLICY_ALWAYS, GTK_POLICY_NEVER);
GTK_POLICY_AUTOMATIC, GTK_POLICY_NEVER);
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (viewport), 1);
gtk_scrolled_window_set_min_content_height (GTK_SCROLLED_WINDOW (viewport), 1);
gtk_widget_set_hexpand (viewport, TRUE);
gtk_widget_set_vexpand (viewport, TRUE);
cv_add_scroll_events (viewport);
g_signal_connect (G_OBJECT (viewport), "scroll-event",
G_CALLBACK (tab_scroll_cb), cv);
gtk_box_pack_start (GTK_BOX (outer), viewport, 1, 1, 0);
@@ -677,9 +685,11 @@ cv_tabs_add (chanview *cv, chan *ch, char *name, GtkTreeIter *parent)
gtk_widget_set_name (but, "zoitechat-tab");
gtk_widget_set_size_request (but, -1, 14);
gtk_widget_add_events (but, GDK_POINTER_MOTION_MASK | GDK_LEAVE_NOTIFY_MASK);
cv_add_scroll_events (but);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 2);
label = gtk_label_new (name);
close_button = gtk_button_new ();
cv_add_scroll_events (close_button);
gtk_style_context_add_class (gtk_widget_get_style_context (close_button), "flat");
close_icon = gtk_image_new_from_icon_name ("window-close-symbolic", GTK_ICON_SIZE_MENU);
gtk_image_set_pixel_size (GTK_IMAGE (close_icon), 8);
@@ -695,6 +705,10 @@ cv_tabs_add (chanview *cv, chan *ch, char *name, GtkTreeIter *parent)
/* used to trap right-clicks */
g_signal_connect (G_OBJECT (but), "button-press-event",
G_CALLBACK (tab_click_cb), ch);
g_signal_connect (G_OBJECT (but), "scroll-event",
G_CALLBACK (tab_scroll_cb), cv);
g_signal_connect (G_OBJECT (close_button), "scroll-event",
G_CALLBACK (tab_scroll_cb), cv);
g_signal_connect (G_OBJECT (but), "motion-notify-event",
G_CALLBACK (tab_close_motion_cb), ch);
g_signal_connect (G_OBJECT (but), "leave-notify-event",

View File

@@ -111,12 +111,12 @@ cv_tree_scroll_event_cb (GtkWidget *widget, GdkEventScroll *event, gpointer user
{
if (prefs.hex_gui_tab_scrollchans)
{
if (event->direction == GDK_SCROLL_DOWN)
mg_switch_page (1, 1);
else if (event->direction == GDK_SCROLL_UP)
mg_switch_page (1, -1);
int direction = cv_scroll_direction (event);
return TRUE;
if (direction != 0)
mg_switch_page (1, direction);
return direction != 0;
}
return FALSE;
@@ -141,6 +141,7 @@ cv_tree_init (chanview *cv)
win = gtk_scrolled_window_new (0, 0);
gtk_widget_set_hexpand (win, TRUE);
gtk_widget_set_vexpand (win, TRUE);
cv_add_scroll_events (win);
/*gtk_container_set_border_width (GTK_CONTAINER (win), 1);*/
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (win),
@@ -154,6 +155,7 @@ cv_tree_init (chanview *cv)
view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (cv->store));
gtk_widget_set_hexpand (view, TRUE);
gtk_widget_set_vexpand (view, TRUE);
cv_add_scroll_events (view);
gtk_widget_set_name (view, "zoitechat-tree");
{
ThemeWidgetStyleValues style_values;

View File

@@ -95,6 +95,37 @@ static chan *cv_find_chan_by_number (chanview *cv, int num);
static int cv_find_number_of_chan (chanview *cv, chan *find_ch);
static void cv_find_neighbors_for_removal (chanview *cv, chan *find_ch, chan **left_ch, chan **first_ch);
static void
cv_add_scroll_events (GtkWidget *widget)
{
gtk_widget_add_events (widget, GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK);
}
static int
cv_scroll_direction (GdkEventScroll *event)
{
gdouble dx;
gdouble dy;
if (event->direction == GDK_SCROLL_SMOOTH && gdk_event_get_scroll_deltas ((GdkEvent *) event, &dx, &dy))
{
if (dy > 0)
return 1;
if (dy < 0)
return -1;
}
switch (event->direction)
{
case GDK_SCROLL_DOWN:
return 1;
case GDK_SCROLL_UP:
return -1;
default:
return 0;
}
}
/* ======= TABS ======= */

View File

@@ -1973,8 +1973,37 @@ replace_handle (GtkWidget *t)
{
ptrdiff_t found_offset = found - text;
ptrdiff_t found_end_offset = found_offset + (ptrdiff_t) pop_len;
gboolean start_ok;
gboolean end_ok;
int rank;
ptrdiff_t distance;
const char *before = found;
const char *after = found + pop_len;
if (before > text)
{
before = g_utf8_find_prev_char (text, before);
start_ok = !before || (!g_unichar_isalnum (g_utf8_get_char (before)) && g_utf8_get_char (before) != '_');
}
else
{
start_ok = TRUE;
}
if (*after != '\0')
{
end_ok = !g_unichar_isalnum (g_utf8_get_char (after)) && g_utf8_get_char (after) != '_';
}
else
{
end_ok = TRUE;
}
if (!start_ok || !end_ok)
{
found++;
continue;
}
if (cursor_byte_offset >= found_offset && cursor_byte_offset <= found_end_offset)
{

View File

@@ -2412,9 +2412,9 @@ mg_userlist_button (GtkWidget * box, char *label, char *cmd,
g_signal_connect (G_OBJECT (wid), "clicked",
G_CALLBACK (userlist_button_cb), cmd);
gtk_widget_set_hexpand (wid, TRUE);
gtk_widget_set_vexpand (wid, TRUE);
gtk_widget_set_vexpand (wid, FALSE);
gtk_widget_set_halign (wid, GTK_ALIGN_FILL);
gtk_widget_set_valign (wid, GTK_ALIGN_FILL);
gtk_widget_set_valign (wid, GTK_ALIGN_CENTER);
gtk_grid_attach (GTK_GRID (box), wid, a, c, b - a, d - c);
show_and_unfocus (wid);
}
@@ -3413,8 +3413,13 @@ mg_create_textarea (session *sess, GtkWidget *box)
inbox = mg_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 2);
gtk_box_pack_start (GTK_BOX (vbox), inbox, TRUE, TRUE, 0);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
frame = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_hexpand (frame, TRUE);
gtk_widget_set_vexpand (frame, TRUE);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (frame),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (frame),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_box_pack_start (GTK_BOX (inbox), frame, TRUE, TRUE, 0);
theme_get_xtext_colors_for_widget (frame, xtext_palette, XTEXT_COLS);
@@ -3431,9 +3436,7 @@ mg_create_textarea (session *sess, GtkWidget *box)
g_signal_connect (G_OBJECT (xtext), "word_click",
G_CALLBACK (mg_word_clicked), NULL);
gui->vscrollbar = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL,
GTK_XTEXT (xtext)->adj);
gtk_box_pack_start (GTK_BOX (inbox), gui->vscrollbar, FALSE, TRUE, 0);
gui->vscrollbar = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (frame));
gtk_drag_dest_set (gui->vscrollbar, 5, dnd_dest_targets, 2,
GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK);
@@ -3476,7 +3479,7 @@ mg_create_meters (session_gui *gui, GtkWidget *parent_box)
GtkWidget *infbox, *wid, *box;
gui->meter_box = infbox = box = mg_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 1);
gtk_box_pack_start (GTK_BOX (parent_box), box, 0, 0, 0);
gtk_box_pack_end (GTK_BOX (parent_box), box, 0, 0, 0);
if ((prefs.hex_gui_lagometer & 2) || (prefs.hex_gui_throttlemeter & 2))
{
@@ -3661,8 +3664,14 @@ mg_create_userlist (session_gui *gui, GtkWidget *box)
gtk_box_pack_start (GTK_BOX (box), vbox, TRUE, TRUE, 0);
gui->namelistinfo = gtk_label_new (NULL);
gtk_label_set_xalign (GTK_LABEL (gui->namelistinfo), 0.0f);
gtk_widget_set_halign (gui->namelistinfo, GTK_ALIGN_START);
gtk_label_set_xalign (GTK_LABEL (gui->namelistinfo), 0.5f);
gtk_label_set_justify (GTK_LABEL (gui->namelistinfo), GTK_JUSTIFY_CENTER);
gtk_label_set_ellipsize (GTK_LABEL (gui->namelistinfo), PANGO_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (gui->namelistinfo), 1);
gtk_widget_set_margin_start (gui->namelistinfo, 0);
gtk_widget_set_margin_end (gui->namelistinfo, 0);
gtk_widget_set_hexpand (gui->namelistinfo, TRUE);
gtk_widget_set_halign (gui->namelistinfo, GTK_ALIGN_FILL);
if (prefs.hex_gui_ulist_count)
gtk_box_pack_start (GTK_BOX (vbox), gui->namelistinfo, 0, 0, 0);

View File

@@ -93,23 +93,14 @@ userlist_apply_saved_column_width (GtkTreeViewColumn *column, int width)
static void
userlist_update_min_width (session *sess)
{
GtkRequisition minimum;
GtkRequisition natural;
GtkWidget *scrolled_window;
int width;
if (!sess || !sess->gui || !sess->gui->user_box || !sess->gui->namelistinfo || !sess->gui->user_tree)
if (!sess || !sess->gui || !sess->gui->user_tree)
return;
gtk_widget_get_preferred_size (sess->gui->namelistinfo, &minimum, &natural);
width = MAX (minimum.width, natural.width);
if (width < 1)
width = 1;
scrolled_window = gtk_widget_get_parent (sess->gui->user_tree);
if (GTK_IS_SCROLLED_WINDOW (scrolled_window))
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (scrolled_window), width);
gtk_widget_set_size_request (sess->gui->user_box, width, -1);
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (scrolled_window), 1);
}
GdkPixbuf *
@@ -909,17 +900,19 @@ userlist_create (GtkWidget *box)
};
sw = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_hexpand (sw, TRUE);
gtk_widget_set_vexpand (sw, TRUE);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
GTK_SHADOW_ETCHED_IN);
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
prefs.hex_gui_ulist_show_hosts ?
GTK_POLICY_AUTOMATIC :
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (sw), 1);
gtk_box_pack_start (GTK_BOX (box), sw, TRUE, TRUE, 0);
gtk_widget_show (sw);
treeview = gtk_tree_view_new ();
gtk_widget_set_hexpand (treeview, TRUE);
gtk_widget_set_vexpand (treeview, TRUE);
gtk_widget_set_name (treeview, "zoitechat-userlist");
gtk_widget_set_can_focus (treeview, TRUE);
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (treeview), FALSE);

View File

@@ -110,6 +110,15 @@ enum
TARGET_COMPOUND_TEXT
};
enum
{
PROP_0,
PROP_HADJUSTMENT,
PROP_VADJUSTMENT,
PROP_HSCROLL_POLICY,
PROP_VSCROLL_POLICY
};
/* Selection targets for PRIMARY selection / copy-paste.
*
@@ -158,7 +167,8 @@ gtk_xtext_install_selection_targets (GtkWidget *widget)
static guint xtext_signals[LAST_SIGNAL];
G_DEFINE_TYPE (GtkXText, gtk_xtext, GTK_TYPE_WIDGET)
G_DEFINE_TYPE_WITH_CODE (GtkXText, gtk_xtext, GTK_TYPE_WIDGET,
G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
char *nocasestrstr (const char *text, const char *tofind); /* util.c */
int xtext_get_stamp_str (time_t, char **);
@@ -171,6 +181,10 @@ static void gtk_xtext_adjustment_changed (GtkAdjustment * adj,
GtkXText * xtext);
static void gtk_xtext_scroll_adjustments (GtkXText *xtext, GtkAdjustment *hadj,
GtkAdjustment *vadj);
static void gtk_xtext_set_property (GObject *object, guint prop_id,
const GValue *value, GParamSpec *pspec);
static void gtk_xtext_get_property (GObject *object, guint prop_id,
GValue *value, GParamSpec *pspec);
static int gtk_xtext_render_ents (GtkXText * xtext, textentry *, textentry *);
static void gtk_xtext_recalc_widths (xtext_buffer *buf, int);
static void gtk_xtext_fix_indent (xtext_buffer *buf);
@@ -794,6 +808,9 @@ gtk_xtext_init (GtkXText * xtext)
xtext->recycle = FALSE;
xtext->dont_render = FALSE;
xtext->dont_render2 = FALSE;
xtext->hadj = NULL;
xtext->hscroll_policy = GTK_SCROLL_MINIMUM;
xtext->vscroll_policy = GTK_SCROLL_MINIMUM;
gtk_xtext_scroll_adjustments (xtext, NULL, NULL);
gtk_xtext_install_selection_targets (GTK_WIDGET (xtext));
@@ -886,6 +903,66 @@ gtk_xtext_adjustment_changed (GtkAdjustment * adj, GtkXText * xtext)
xtext->buffer->old_value = xtext_adj_get_value (adj);
}
static void
gtk_xtext_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
{
GtkXText *xtext = GTK_XTEXT (object);
GtkAdjustment *adj;
switch (prop_id)
{
case PROP_HADJUSTMENT:
adj = g_value_get_object (value);
if (xtext->hadj == adj)
break;
if (xtext->hadj)
g_object_unref (xtext->hadj);
xtext->hadj = adj ? g_object_ref (adj) : NULL;
g_object_notify (object, "hadjustment");
break;
case PROP_VADJUSTMENT:
gtk_xtext_scroll_adjustments (xtext, NULL, g_value_get_object (value));
g_object_notify (object, "vadjustment");
break;
case PROP_HSCROLL_POLICY:
xtext->hscroll_policy = g_value_get_enum (value);
g_object_notify (object, "hscroll-policy");
break;
case PROP_VSCROLL_POLICY:
xtext->vscroll_policy = g_value_get_enum (value);
g_object_notify (object, "vscroll-policy");
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
static void
gtk_xtext_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
{
GtkXText *xtext = GTK_XTEXT (object);
switch (prop_id)
{
case PROP_HADJUSTMENT:
g_value_set_object (value, xtext->hadj);
break;
case PROP_VADJUSTMENT:
g_value_set_object (value, xtext->adj);
break;
case PROP_HSCROLL_POLICY:
g_value_set_enum (value, xtext->hscroll_policy);
break;
case PROP_VSCROLL_POLICY:
g_value_set_enum (value, xtext->vscroll_policy);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
}
}
GtkWidget *
gtk_xtext_new (const XTextColor *palette, int separator)
{
@@ -952,6 +1029,11 @@ gtk_xtext_cleanup (GtkXText *xtext)
xtext->adj = NULL;
}
if (xtext->hadj)
{
g_object_unref (G_OBJECT (xtext->hadj));
xtext->hadj = NULL;
}
if (xtext->hand_cursor)
{
@@ -2924,6 +3006,13 @@ gtk_xtext_class_init (GtkXTextClass * class)
widget_class = (GtkWidgetClass *) class;
xtext_class = (GtkXTextClass *) class;
object_class->set_property = gtk_xtext_set_property;
object_class->get_property = gtk_xtext_get_property;
g_object_class_override_property (object_class, PROP_HADJUSTMENT, "hadjustment");
g_object_class_override_property (object_class, PROP_VADJUSTMENT, "vadjustment");
g_object_class_override_property (object_class, PROP_HSCROLL_POLICY, "hscroll-policy");
g_object_class_override_property (object_class, PROP_VSCROLL_POLICY, "vscroll-policy");
xtext_signals[WORD_CLICK] =
g_signal_new ("word_click",
G_TYPE_FROM_CLASS (object_class),
@@ -4830,13 +4919,12 @@ gtk_xtext_check_marker_visibility (GtkXText * xtext)
static void
gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint maxo)
{
gint off1, off2, curlen;
gint off1, off2;
GSList *cursl;
offsets_t marks;
offlen_t *meta;
off1 = 0;
curlen = 0;
cursl = slp;
while (cursl)
{
@@ -4846,7 +4934,6 @@ gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint max
off1 = meta->off + start;
break;
}
curlen += meta->len;
start -= meta->len;
end -= meta->len;
cursl = g_slist_next (cursl);
@@ -4861,7 +4948,6 @@ gtk_xtext_unstrip_color (gint start, gint end, GSList *slp, GList **gl, gint max
off2 = meta->off + end;
break;
}
curlen += meta->len;
end -= meta->len;
cursl = g_slist_next (cursl);
}

View File

@@ -134,6 +134,9 @@ struct _GtkXText
xtext_buffer *selection_buffer;
GtkAdjustment *adj;
GtkAdjustment *hadj;
GtkScrollablePolicy hscroll_policy;
GtkScrollablePolicy vscroll_policy;
cairo_surface_t *background_surface; /* 0 = use palette[19] */
cairo_surface_t *background_clip_surface;
GdkWindow *draw_window; /* points to ->window */

View File

@@ -56,7 +56,6 @@ Name: "plugins\exec"; Description: "Exec"; Types: custom; Flags: disablenouninst
Name: "plugins\fishlim"; Description: "FiSHLiM"; Types: custom; Flags: disablenouninstallwarning
Name: "plugins\sysinfo"; Description: "SysInfo"; Types: custom; Flags: disablenouninstallwarning
Name: "plugins\upd"; Description: "Update Checker"; Types: normal custom; Flags: disablenouninstallwarning
Name: "plugins\winamp"; Description: "Winamp"; Types: custom; Flags: disablenouninstallwarning
Name: "langs"; Description: "Language Interfaces"; Types: custom; Flags: disablenouninstallwarning
Name: "langs\lua"; Description: "Lua (LuaJIT 2.1)"; Types: normal custom; Flags: disablenouninstallwarning
Name: "langs\perl"; Description: "Perl (Strawberry Perl 5.42.0.1)"; Types: custom; Flags: disablenouninstallwarning
@@ -173,11 +172,9 @@ Source: "plugins\hcexec.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Co
Source: "plugins\hcfishlim.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\fishlim
Source: "share\gtkpref.png"; DestDir: "{app}\share"; Flags: ignoreversion; Components: libs
Source: "share\adwaita-icons-attribution.txt"; DestDir: "{app}\share"; Flags: ignoreversion; Components: libs
Source: "share\music.png"; DestDir: "{app}\share"; Flags: ignoreversion; Components: plugins\winamp
Source: "share\download.png"; DestDir: "{app}\share"; Flags: ignoreversion; Components: plugins\upd
Source: "plugins\hcupd.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\upd
Source: "WinSparkle.dll"; DestDir: "{app}"; Flags: ignoreversion; Components: plugins\upd
Source: "plugins\hcwinamp.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\winamp
Source: "share\system.png"; DestDir: "{app}\share"; Flags: ignoreversion; Components: plugins\sysinfo
Source: "plugins\hcsysinfo.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: plugins\sysinfo
Source: "plugins\hcperl.dll"; DestDir: "{app}\plugins"; Flags: ignoreversion; Components: langs\perl

View File

@@ -40,11 +40,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "upd", "..\plugins\upd\upd.v
{87554B59-006C-4D94-9714-897B27067BA3} = {87554B59-006C-4D94-9714-897B27067BA3}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winamp", "..\plugins\winamp\winamp.vcxproj", "{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}"
ProjectSection(ProjectDependencies) = postProject
{87554B59-006C-4D94-9714-897B27067BA3} = {87554B59-006C-4D94-9714-897B27067BA3}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sysinfo", "..\plugins\sysinfo\sysinfo.vcxproj", "{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}"
ProjectSection(ProjectDependencies) = postProject
{87554B59-006C-4D94-9714-897B27067BA3} = {87554B59-006C-4D94-9714-897B27067BA3}
@@ -73,7 +68,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "installer", "installer\inst
{E93E1255-95D1-4B08-8FDF-B53CC6A21280} = {E93E1255-95D1-4B08-8FDF-B53CC6A21280}
{5EF7F47D-D09C-43C4-BF64-B28B11A0FF91} = {5EF7F47D-D09C-43C4-BF64-B28B11A0FF91}
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA} = {6C0CA980-97C5-427A-BE61-5BCECAFABBDA}
{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE} = {E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}
{E4BDB4C8-2335-415A-ACEE-BA88B19BFE82} = {E4BDB4C8-2335-415A-ACEE-BA88B19BFE82}
{C53145CC-D021-40C9-B97C-0249AB9A43C9} = {C53145CC-D021-40C9-B97C-0249AB9A43C9}
{D90BC3E3-1341-4849-9354-5F40489D39D1} = {D90BC3E3-1341-4849-9354-5F40489D39D1}
@@ -121,8 +115,6 @@ Global
{3C4F42FC-292A-420B-B63D-C03DFBDD8E4E}.Release|x64.Build.0 = Release|x64
{461DC24A-A410-4171-8C02-CCDBF3702C2A}.Release|x64.ActiveCfg = Release|x64
{461DC24A-A410-4171-8C02-CCDBF3702C2A}.Release|x64.Build.0 = Release|x64
{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}.Release|x64.ActiveCfg = Release|x64
{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE}.Release|x64.Build.0 = Release|x64
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}.Release|x64.ActiveCfg = Release|x64
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA}.Release|x64.Build.0 = Release|x64
{B10A2C41-344C-43E0-A32D-B9587C198D8B}.Release|x64.ActiveCfg = Release|x64
@@ -153,7 +145,6 @@ Global
{17E4BE39-76F7-4A06-AD21-EFD0C5091F76} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
{3C4F42FC-292A-420B-B63D-C03DFBDD8E4E} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
{461DC24A-A410-4171-8C02-CCDBF3702C2A} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
{E78C0D9A-798E-4BF6-B0CC-6FECB8CA2FCE} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
{6C0CA980-97C5-427A-BE61-5BCECAFABBDA} = {561126F4-FA18-45FC-A2BF-8F858F161D6D}
{B10A2C41-344C-43E0-A32D-B9587C198D8B} = {0FD996A7-464F-4981-8380-3DCA3A244A13}
{C9B735E4-75BC-45AC-A5E3-39A6D076F912} = {0FD996A7-464F-4981-8380-3DCA3A244A13}