1 Commits

Author SHA1 Message Date
9b89c7782c Fix PSL source path for Flatpak build 2026-04-14 09:29:45 -06:00
63 changed files with 1477 additions and 1627 deletions

View File

@@ -28,13 +28,13 @@ jobs:
sudo apt-get install -y --no-install-recommends \
build-essential pkg-config meson ninja-build cmake \
gettext \
libcanberra-dev libglib2.0-dev \
libcanberra-dev libdbus-glib-1-dev libglib2.0-dev \
libarchive-dev \
libgtk-3-dev \
libwayland-client0 libwayland-cursor0 libwayland-egl1 \
libxkbcommon0 \
libgtk-3-bin libglib2.0-bin shared-mime-info gsettings-desktop-schemas \
liblua5.4-dev libpci-dev libperl-dev libssl-dev libayatana-appindicator3-dev \
libluajit-5.1-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
@@ -261,8 +261,8 @@ jobs:
./linuxdeploy-x86_64.AppImage \
--appdir AppDir \
--desktop-file AppDir/usr/share/applications/org.zoitechat.ZoiteChat.desktop \
--icon-file AppDir/usr/share/icons/hicolor/48x48/apps/org.zoitechat.ZoiteChat.png \
--desktop-file AppDir/usr/share/applications/net.zoite.Zoitechat.desktop \
--icon-file AppDir/usr/share/icons/hicolor/48x48/apps/net.zoite.Zoitechat.png \
--custom-apprun ./AppRun \
--plugin gtk \
--output appimage

View File

@@ -25,15 +25,12 @@ jobs:
with:
submodules: true
- name: Generate PSL list
run: curl -fsSL https://publicsuffix.org/list/public_suffix_list.dat -o src/common/public_suffix_list.dat
- name: Build Flatpak
id: flatpak_builder
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: zoitechat.flatpak
manifest-path: flatpak/org.zoitechat.ZoiteChat.json
manifest-path: flatpak/net.zoite.Zoitechat.json
cache: false
restore-cache: false

View File

@@ -32,8 +32,10 @@ jobs:
glib2-devel \
gtk3 \
openssl \
dbus-glib \
libcanberra \
libayatana-appindicator \
luajit \
iso-codes \
lua \
perl \

View File

@@ -65,8 +65,8 @@ jobs:
Download-WithRetry -Url https://github.com/jrsoftware/issrc/releases/download/is-6_7_1/innosetup-6.7.1.exe -OutFile deps\innosetup-unicode.exe
& deps\innosetup-unicode.exe /VERYSILENT | Out-Null
Download-WithRetry -Url https://github.com/ZoiteChat/gvsbuild/releases/download/zoitechat-2.18.1/GTK3_Gvsbuild_zoitechat-2.18.1_x64.zip -OutFile deps\gtk-${{ matrix.arch }}.zip
Expand-Archive -LiteralPath deps\gtk-${{ matrix.arch }}.zip -DestinationPath C:\gtk-build\gtk\x64\release -Force
Download-WithRetry -Url https://github.com/ZoiteChat/gvsbuild/releases/download/zoitechat-2.18.0-pre1/GTK3_Gvsbuild_zoitechat-2.18.0-pre1_${{ matrix.platform }}.7z -OutFile deps\gtk-${{ matrix.arch }}.7z
& 7z.exe x deps\gtk-${{ matrix.arch }}.7z -oC:\gtk-build\gtk\x64\release
Download-WithRetry -Url https://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-hicolor-icon-theme-0.18-1-any.pkg.tar.zst -OutFile deps\hicolor-icon-theme.pkg.tar.zst
python -c "import tarfile,zstandard,pathlib;archive=pathlib.Path(r'deps\\hicolor-icon-theme.pkg.tar.zst');target=pathlib.Path(r'C:\\gtk-build\\gtk\\x64\\release');dctx=zstandard.ZstdDecompressor();f=archive.open('rb');reader=dctx.stream_reader(f);tf=tarfile.open(fileobj=reader,mode='r|');[tf.extract(m,path=target) for m in tf if m.name.startswith('mingw64/share/icons/hicolor/')];tf.close();reader.close();f.close()"

View File

@@ -1,46 +1,7 @@
ZoiteChat ChangeLog
=================
2.18.1 (2026-05-21)
-------------------
- Migrated D-Bus handling to GDBus.
- Enabled mouse wheel channel switching by default and consumed handled tab wheel events.
- Switched main panes to native GTK scrollbars.
- Tightened userlist button and meter layout.
- Made the native Windows file chooser modal.
- Set the Windows AppUserModelID before GTK startup.
- Updated Windows CI to use the new GTK3 bundle zip.
- Updated Windows installer architecture checks to use x64-compatible detection.
- Bumped the Flatpak Perl runtime to 5.42.2.
- Fixed palette color reads to preserve base GTK state.
- Fixed auto-replace whole-word matching.
- Fixed checksum file stream cleanup.
- Fixed byte handling in the Python console.
- Guarded GTK drag-and-drop handlers against null windows.
- Fixed size_t and integer handling issues.
- Removed the Winamp plugin.
2.18.0 (2026-04-20)
-------------------
- Added optional close buttons on tabs.
- Added Ctrl+W to close tabs and Ctrl+Shift+T to reopen recently closed tabs.
- Expanded theme import support with .hct support in colors.conf import.
- Added pevent import support from .hct theme files and improved import result messaging.
- Expanded palette and selection CSS styling for better theme consistency.
- Auto-sizes the topic bar to wrapped text for better multi-line topic handling.
- Refined command-character parsing when pasting path-like text.
- Tightened topic link detection and opening rules.
- Added Public Suffix List validation for host links to reduce bad link matches.
- Improved channel tree behavior by ignoring collapsed parent selections.
- Sanitized the Linux open environment for AppImage builds and added safer fallback handling.
- Labeled Windows installer runtimes with exact versions.
- Fixed the notification icon and corrected the Flatpak screenshot asset.
- Improved AppStream metainfo validation.
2.18.0~pre6 (2026-03-30)
------------------------
- Applied app theme CSS to the menubar consistently across the app.
- Restored horizontal separator lines in menus.

View File

@@ -1,11 +1,11 @@
icondir = join_paths(get_option('datadir'), 'icons/hicolor')
install_data(
'zoitechat.png',
rename: 'org.zoitechat.ZoiteChat.png',
rename: 'net.zoite.Zoitechat.png',
install_dir: join_paths(icondir, '48x48/apps')
)
install_data(
'zoitechat.svg',
rename: 'org.zoitechat.ZoiteChat.svg',
rename: 'net.zoite.Zoitechat.svg',
install_dir: join_paths(icondir, 'scalable/apps')
)

View File

@@ -6,8 +6,8 @@ desktop_utils = find_program('desktop-file-validate', required: false)
if get_option('gtk-frontend')
if get_option('install-appdata')
zoitechat_appdata = i18n.merge_file(
input: 'org.zoitechat.ZoiteChat.metainfo.xml.in',
output: 'org.zoitechat.ZoiteChat.metainfo.xml',
input: 'net.zoite.Zoitechat.appdata.xml.in',
output: 'net.zoite.Zoitechat.appdata.xml',
po_dir: '../../po',
install: true,
install_dir: metainfodir
@@ -15,28 +15,28 @@ if get_option('gtk-frontend')
appstreamcli = find_program('appstreamcli', required: false)
if appstreamcli.found()
test('Validate org.zoitechat.ZoiteChat.metainfo.xml', appstreamcli,
test('Validate net.zoite.Zoitechat.appdata.xml', appstreamcli,
args: ['validate', zoitechat_appdata]
)
endif
endif
desktop_conf = configuration_data()
if dbus_dep.found()
if dbus_glib_dep.found()
desktop_conf.set('exec_command', 'zoitechat --existing %U')
else
desktop_conf.set('exec_command', 'zoitechat %U')
endif
desktop_file = configure_file(
input: 'org.zoitechat.ZoiteChat.desktop.in.in',
output: 'org.zoitechat.ZoiteChat.desktop.in',
input: 'net.zoite.Zoitechat.desktop.in.in',
output: 'net.zoite.Zoitechat.desktop.in',
configuration: desktop_conf
)
zoitechat_desktop = i18n.merge_file(
input: desktop_file,
output: 'org.zoitechat.ZoiteChat.desktop',
output: 'net.zoite.Zoitechat.desktop',
po_dir: '../../po',
type: 'desktop',
install: true,
@@ -44,7 +44,7 @@ if get_option('gtk-frontend')
)
if desktop_utils.found()
test('Validate org.zoitechat.ZoiteChat.desktop', desktop_utils,
test('Validate net.zoite.Zoitechat.desktop', desktop_utils,
args: [zoitechat_desktop]
)
endif
@@ -98,14 +98,14 @@ if get_option('plugin')
conf.set('LICENSE', metainfo[2])
plugin_appdata = configure_file(
input: 'org.zoitechat.ZoiteChat.Plugin.metainfo.xml.in',
output: 'org.zoitechat.ZoiteChat.Plugin.@0@.metainfo.xml'.format(name),
input: 'net.zoite.Zoitechat.Plugin.metainfo.xml.in',
output: 'net.zoite.Zoitechat.Plugin.@0@.metainfo.xml'.format(name),
configuration: conf,
install_dir: get_option('install-plugin-metainfo') ? metainfodir : '',
)
if appstreamcli.found()
test('Validate org.zoitechat.ZoiteChat.Plugin.@0@.metainfo.xml'.format(name), appstreamcli,
test('Validate net.zoite.Zoitechat.Plugin.@0@.metainfo.xml'.format(name), appstreamcli,
args: ['validate', plugin_appdata]
)
endif

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="addon">
<id>org.zoitechat.ZoiteChat.Plugin.@NAME@</id>
<extends>org.zoitechat.ZoiteChat</extends>
<id>net.zoite.Zoitechat.Plugin.@NAME@</id>
<extends>net.zoite.Zoitechat</extends>
<name>@NAME@ Plugin</name>
<summary>@SUMMARY@</summary>
<url type="homepage">https://zoitechat.org/</url>

View File

@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>org.zoitechat.ZoiteChat</id>
<id>net.zoite.Zoitechat</id>
<name>ZoiteChat</name>
<launchable type="desktop-id">org.zoitechat.ZoiteChat.desktop</launchable>
<launchable type="desktop-id">net.zoite.Zoitechat.desktop</launchable>
<developer id="org.zoitechat">
<developer id="net.zoite">
<name translate="no">ZoiteChat</name>
</developer>
@@ -26,61 +26,9 @@
</screenshot>
</screenshots>
<provides>
<id>org.zoitechat.ZoiteChat.desktop</id>
<id>zoitechat.desktop</id>
</provides>
<releases>
<release date="2026-05-21" version="2.18.1">
<description>
<ul>
<li>Migrated D-Bus handling to GDBus.</li>
<li>Enabled mouse wheel channel switching by default and consumed handled tab wheel events.</li>
<li>Switched main panes to native GTK scrollbars.</li>
<li>Tightened userlist button and meter layout.</li>
<li>Made the native Windows file chooser modal.</li>
<li>Set the Windows AppUserModelID before GTK startup.</li>
<li>Updated Windows CI to use the new GTK3 bundle zip.</li>
<li>Updated Windows installer architecture checks to use x64-compatible detection.</li>
<li>Bumped the Flatpak Perl runtime to 5.42.2.</li>
<li>Fixed palette color reads to preserve base GTK state.</li>
<li>Fixed auto-replace whole-word matching.</li>
<li>Fixed checksum file stream cleanup.</li>
<li>Fixed byte handling in the Python console.</li>
<li>Guarded GTK drag-and-drop handlers against null windows.</li>
<li>Fixed size_t and integer handling issues.</li>
<li>Removed the Winamp plugin.</li>
</ul>
</description>
</release>
<release date="2026-04-20" version="2.18.0">
<description>
<p>Tabs and navigation:</p>
<ul>
<li>Added optional close buttons on tabs.</li>
<li>Added Ctrl+W to close tabs and Ctrl+Shift+T to reopen recently closed tabs.</li>
<li>Improved channel tree behavior by ignoring collapsed parent selections.</li>
</ul>
<p>Themes and appearance:</p>
<ul>
<li>Expanded theme import support with .hct support in colors.conf import.</li>
<li>Added pevent import support from .hct theme files and improved import result messaging.</li>
<li>Expanded palette and selection CSS styling for better theme consistency.</li>
<li>Auto-sizes the topic bar to wrapped text for better multi-line topic handling.</li>
</ul>
<p>Links and text handling:</p>
<ul>
<li>Refined command-character parsing when pasting path-like text.</li>
<li>Tightened topic link detection and opening rules.</li>
<li>Added Public Suffix List validation for host links to reduce bad link matches.</li>
</ul>
<p>Packaging and platform integration:</p>
<ul>
<li>Sanitized the Linux open environment for AppImage builds and added safer fallback handling.</li>
<li>Labeled Windows installer runtimes with exact versions.</li>
<li>Fixed the notification icon and corrected the Flatpak screenshot asset.</li>
<li>Improved AppStream metainfo validation.</li>
</ul>
</description>
</release>
<release date="2026-03-30" version="2.18.0~pre6">
<description>
<p>GTK theme and UI:</p>
@@ -339,7 +287,7 @@
<description>
<p>This is largely a bug fix release though it has some large behind the scenes changes:</p>
<ul>
<li>Rename data files to use *org.zoitechat.ZoiteChat* name</li>
<li>Rename data files to use *net.zoite.Zoitechat* name</li>
<li>Add option (irc_reconnect_rejoin) to disable auto-rejoin on reconnect</li>
<li>Add ability to set custom tray icon separate of app icon</li>
<li>Fix Enchant 2.0+ support</li>

View File

@@ -4,12 +4,12 @@ GenericName=IRC Client
Comment=Chat with other people online
Keywords=IM;Chat;
Exec=@exec_command@
Icon=org.zoitechat.ZoiteChat
Icon=net.zoite.Zoitechat
Terminal=false
Type=Application
Categories=GTK;Network;IRCClient;
StartupNotify=true
StartupWMClass=org.zoitechat.ZoiteChat
StartupWMClass=net.zoite.Zoitechat
X-GNOME-UsesNotifications=true
MimeType=x-scheme-handler/irc;x-scheme-handler/ircs;
Actions=SafeMode;

View File

@@ -1,17 +1,25 @@
From 918503d57c6740d20be68a6717158673a2a8b25f Mon Sep 17 00:00:00 2001
From: Patrick Griffis <tingping@tingping.se>
Date: Sat, 17 Mar 2018 05:57:49 -0400
Subject: [PATCH] Support loading Flatpak extensions
---
src/common/plugin.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/common/plugin.c b/src/common/plugin.c
index 3ad3c558..6addf962 100644
--- a/src/common/plugin.c
+++ b/src/common/plugin.c
@@ -470,7 +470,14 @@
if (libdir && *libdir)
return libdir;
else
+ {
+ if (g_file_test ("/app/extensions/lib/zoitechat/plugins", G_FILE_TEST_IS_DIR))
+ {
+ return "/app/extensions/lib/zoitechat/plugins";
+ }
+
return ZOITECHATLIBDIR;
+ }
}
@@ -450,6 +450,8 @@ plugin_auto_load (session *sess)
lib_dir = plugin_get_libdir ();
sub_dir = g_build_filename (get_xdir (), "addons", NULL);
void
+ for_files ("/app/extensions/lib/zoitechat/plugins", "*.so", plugin_auto_load_cb);
+
#ifdef WIN32
/* a long list of bundled plugins that should be loaded automatically,
* user plugins should go to <config>, leave Program Files alone! */
--
2.14.3

View File

@@ -0,0 +1,84 @@
{
"app-id": "net.zoite.Zoitechat",
"branch": "master",
"runtime": "org.gnome.Platform",
"runtime-version": "49",
"sdk": "org.gnome.Sdk",
"command": "zoitechat",
"finish-args": [
"--share=ipc",
"--socket=x11",
"--share=network",
"--socket=pulseaudio",
"--filesystem=xdg-download",
"--filesystem=xdg-data/themes:ro",
"--filesystem=xdg-data/icons:ro",
"--filesystem=~/.themes:ro",
"--filesystem=~/.icons:ro",
"--filesystem=xdg-run/tray-icon:create",
"--env=GTK_CSD=1",
"--talk-name=org.freedesktop.Notifications",
"--talk-name=org.kde.StatusNotifierWatcher",
"--talk-name=com.canonical.AppMenu.Registrar",
"--talk-name=org.mpris.MediaPlayer2.*"
],
"add-extensions": {
"net.zoite.Zoitechat.Plugin": {
"version": "49",
"directory": "extensions",
"add-ld-path": "lib",
"merge-dirs": "lib/zoitechat/plugins",
"subdirectories": true,
"no-autodownload": true,
"autodelete": true
}
},
"modules": [
"shared-modules/dbus-glib/dbus-glib.json",
"shared-modules/lua5.4/lua-5.4.json",
"shared-modules/libcanberra/libcanberra.json",
"shared-modules/libayatana-appindicator/libayatana-appindicator-gtk3.json",
"python3-cffi.json",
"perl.json",
{
"name": "lgi",
"buildsystem": "meson",
"sources": [
{
"type": "git",
"url": "https://github.com/pavouk/lgi.git",
"commit": "c9b8e4473c6421f2a215d8c06c0d94b86eb0b26a"
}
]
},
{
"name": "zoitechat",
"buildsystem": "meson",
"config-opts": [
"-Ddbus-service-use-appid=true",
"-Dwith-perl=perl",
"-Dwith-python=python3",
"-Dwith-lua=lua"
],
"build-options": {
"cflags": "-Wno-error=missing-include-dirs"
},
"cleanup": [
"/share/man"
],
"post-install": [
"install -d /app/extensions"
],
"sources": [
{
"type": "dir",
"path": ".."
},
{
"type": "patch",
"path": "Load-plugins-from-Flatpak-extensions.patch"
}
]
}
]
}

View File

@@ -1,127 +0,0 @@
{
"app-id": "org.zoitechat.ZoiteChat",
"runtime": "org.gnome.Platform",
"runtime-version": "50",
"sdk": "org.gnome.Sdk",
"command": "zoitechat",
"finish-args": [
"--share=ipc",
"--socket=wayland",
"--socket=fallback-x11",
"--share=network",
"--socket=pulseaudio",
"--filesystem=xdg-download",
"--filesystem=xdg-run/tray-icon:create",
"--env=GTK_CSD=1",
"--talk-name=org.freedesktop.Notifications",
"--talk-name=org.kde.StatusNotifierWatcher",
"--talk-name=com.canonical.AppMenu.Registrar"
],
"add-extensions": {
"org.zoitechat.ZoiteChat.Plugin": {
"version": "50",
"directory": "extensions",
"add-ld-path": "lib",
"merge-dirs": "lib/zoitechat/plugins",
"subdirectories": true,
"no-autodownload": true,
"autodelete": true
}
},
"modules": [
"shared-modules/lua5.4/lua-5.4.json",
"shared-modules/libcanberra/libcanberra.json",
"shared-modules/libayatana-appindicator/libayatana-appindicator-gtk3.json",
{
"name": "python3-cffi",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"cffi\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/1d/b2/31537cf4b1ca988837256c910a668b553fceb8f069bedc4b1c826024b52c/pycparser-2.22.tar.gz",
"sha256": "491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz",
"sha256": "1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"
}
]
},
{
"name": "perl",
"buildsystem": "simple",
"build-options": {
"no-debuginfo": true
},
"build-commands": [
"./Configure -des -Dprefix=/app -Dvendorprefix=/app -Duseshrplib -Dman1dir=none -Dman3dir=none",
"make -j${FLATPAK_BUILDER_N_JOBS}",
"make install"
],
"cleanup": [
"/share/man",
"/lib/perl5/*/*/CORE/*.a"
],
"sources": [
{
"type": "archive",
"url": "https://www.cpan.org/src/5.0/perl-5.42.2.tar.xz",
"sha256": "0a585eeb9e363c0f80482ddb3571625250c2c86aeb408853e8ea50805cfb14bb"
}
]
},
{
"name": "lgi",
"buildsystem": "meson",
"sources": [
{
"type": "archive",
"url": "https://github.com/pavouk/lgi/archive/c9b8e4473c6421f2a215d8c06c0d94b86eb0b26a.tar.gz",
"sha256": "db67b2b7ee89fa566f783486d56be7203552a997bc55f35020b57dd2776b9943"
}
]
},
{
"name": "zoitechat",
"buildsystem": "meson",
"config-opts": [
"-Ddbus-service-use-appid=true",
"-Dwith-perl=perl",
"-Dwith-python=python3",
"-Dwith-lua=lua"
],
"build-options": {
"cflags": "-Wno-error=missing-include-dirs"
},
"cleanup": [
"/share/man"
],
"post-install": [
"install -d /app/extensions"
],
"sources": [
{
"type": "git",
"url": "https://github.com/ZoiteChat/zoitechat.git",
"tag": "zoitechat-2.18.1",
"commit": "479f1649efa0e5b166a7c7c9d86214b42ec9f794"
},
{
"type": "file",
"url": "https://publicsuffix.org/list/public_suffix_list.dat",
"sha256": "6f7f7d9e8c68447f1c74095a12574b7fee46b0cd759c518a659aee0615d8e118",
"dest": "src/common",
"dest-filename": "public_suffix_list.dat"
},
{
"type": "patch",
"path": "Load-plugins-from-Flatpak-extensions.patch"
}
]
}
]
}

20
flatpak/perl.json Normal file
View File

@@ -0,0 +1,20 @@
{
"name": "perl",
"buildsystem": "simple",
"build-commands": [
"./Configure -des -Dprefix=/app -Dvendorprefix=/app -Duseshrplib -Dman1dir=none -Dman3dir=none",
"make -j${FLATPAK_BUILDER_N_JOBS}",
"make install"
],
"cleanup": [
"/share/man",
"/lib/perl5/*/*/CORE/*.a"
],
"sources": [
{
"type": "archive",
"url": "https://www.cpan.org/src/5.0/perl-5.40.1.tar.xz",
"sha256": "dfa20c2eef2b4af133525610bbb65dd13777ecf998c9c5b1ccf0d308e732ee3f"
}
]
}

19
flatpak/python3-cffi.json Normal file
View File

@@ -0,0 +1,19 @@
{
"name": "python3-cffi",
"buildsystem": "simple",
"build-commands": [
"pip3 install --verbose --exists-action=i --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} \"cffi\" --no-build-isolation"
],
"sources": [
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/1d/b2/31537cf4b1ca988837256c910a668b553fceb8f069bedc4b1c826024b52c/pycparser-2.22.tar.gz",
"sha256": "491c8be9c040f5390f5bf44a5b07752bd07f56edf992381b05c701439eec10f6"
},
{
"type": "file",
"url": "https://files.pythonhosted.org/packages/fc/97/c783634659c2920c3fc70419e3af40972dbaf758daa229a7d6ea6135c90d/cffi-1.17.1.tar.gz",
"sha256": "1c39c6016c32bc48dd54561950ebd6836e1670f2ae46128f67cf49e789c52824"
}
]
}

View File

@@ -1,5 +1,5 @@
project('zoitechat', 'c',
version: '2.18.1',
version: '2.18.0~pre6',
meson_version: '>= 0.55.0',
default_options: [
'c_std=c17',
@@ -18,7 +18,7 @@ libgmodule_dep = dependency('gmodule-2.0')
libcanberra_dep = dependency('libcanberra', version: '>= 0.22',
required: get_option('libcanberra'))
dbus_dep = dependency('gio-2.0', required: get_option('dbus'))
dbus_glib_dep = dependency('dbus-glib-1', required: get_option('dbus'))
global_deps = []
if cc.get_id() == 'msvc'
@@ -39,7 +39,7 @@ config_h.set10('ENABLE_NLS', true)
# Optional features
config_h.set('USE_OPENSSL', libssl_dep.found())
config_h.set('USE_LIBCANBERRA', libcanberra_dep.found())
config_h.set('USE_DBUS', dbus_dep.found())
config_h.set('USE_DBUS', dbus_glib_dep.found())
config_h.set('USE_PLUGIN', get_option('plugin'))
config_h.set('USE_GTK_FRONTEND', get_option('gtk-frontend'))
@@ -181,7 +181,7 @@ if meson.version().version_compare('>= 0.55.0')
'GTK Frontend': get_option('gtk-frontend') ? 'enabled (GTK+ 3.22+)' : 'disabled',
'TLS (openssl)': libssl_dep.found(),
'Plugin Support': get_option('plugin'),
'DBus Support': dbus_dep.found(),
'DBus Support': dbus_glib_dep.found(),
'libcanberra': libcanberra_dep.found(),
}, section: 'Features')

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: 'lua-5.4',
option('with-lua', type: 'string', value: 'luajit',
description: 'Lua scripting plugin, value is pkg-config name to use or "false"'
)
option('with-perl', type: 'string', value: 'perl',
@@ -59,6 +59,9 @@ 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

@@ -8,6 +8,7 @@ arch=('x86_64')
url='https://github.com/zoitechat/zoitechat'
license=('GPL-2.0-or-later')
depends=(
'dbus-glib'
'glib2'
'gtk3'
'iso-codes'

View File

@@ -104,14 +104,12 @@ 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);
goto cleanup;
return;
}
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,19 +1,7 @@
if cc.get_id() == 'msvc'
lua_dep = cc.find_library('lua51')
else
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
lua_dep = dependency(get_option('with-lua'))
endif
shared_module('lua', 'lua.c',

View File

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

View File

@@ -19,7 +19,7 @@ else:
if not hasattr(sys, 'argv'):
sys.argv = ['<zoitechat>']
VERSION = b'2.18.1'
VERSION = b'2.18.0~pre6'
PLUGIN_NAME = ffi.new('char[]', b'Python')
PLUGIN_DESC = ffi.new('char[]', b'Python %d.%d scripting interface' % (sys.version_info[0], sys.version_info[1]))
PLUGIN_VERSION = ffi.new('char[]', VERSION)
@@ -320,9 +320,9 @@ def _on_say_command(word, word_eol, userdata):
return 0
try:
python = __decode(_cstr(word_eol[1]))
python = _cstr(word_eol[1])
except Exception:
python = ''
python = b''
if not python:
return 1

View File

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

153
plugins/winamp/winamp.c Normal file
View File

@@ -0,0 +1,153 @@
/********************* 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

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

View File

@@ -0,0 +1,48 @@
<?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

@@ -0,0 +1,23 @@
<?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,7 +782,6 @@ 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;
@@ -1168,11 +1167,8 @@ set_showval (session *sess, const struct prefs *var, char *tbuf)
switch (var->type)
{
case TYPE_STR:
{
const char *value = (char *) &prefs + var->offset;
sprintf (tbuf + len, "\0033:\017 %s\n", value ? value : "");
}
break;
sprintf (tbuf + len, "\0033:\017 %s\n", (char *) &prefs + var->offset);
break;
case TYPE_INT:
sprintf (tbuf + len, "\0033:\017 %d\n", *((int *) &prefs + var->offset));
break;

View File

@@ -82,6 +82,10 @@ has_theme_argument (void)
void
zoitechat_remote (void)
/* TODO: dbus_g_connection_unref (connection) are commented because it makes
* dbus to crash. Fixed in dbus >=0.70 ?!?
* https://launchpad.net/distros/ubuntu/+source/dbus/+bug/54375
*/
{
GDBusConnection *connection;
GDBusProxy *dbus = NULL;

File diff suppressed because it is too large Load Diff

View File

@@ -1,122 +1,203 @@
#include <gio/gio.h>
#include <glib.h>
/* example.c - program to demonstrate some D-BUS stuffs.
* Copyright (C) 2006 Claessens Xavier
*
* 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
*
* Claessens Xavier
* xclaesse@gmail.com
*/
#include <config.h>
#include <dbus/dbus-glib.h>
#include <stdlib.h>
#include "../marshal.c"
#define DBUS_SERVICE "org.zoitechat.service"
#define DBUS_CONNECTION_PATH "/org/zoitechat"
#define DBUS_CONNECTION_INTERFACE "org.zoitechat.connection"
#define DBUS_PLUGIN_INTERFACE "org.zoitechat.plugin"
#define DBUS_REMOTE "/org/zoitechat/Remote"
#define DBUS_REMOTE_CONNECTION_INTERFACE "org.zoitechat.connection"
#define DBUS_REMOTE_PLUGIN_INTERFACE "org.zoitechat.plugin"
static gboolean
call_sync (GDBusProxy *proxy, const char *method, GVariant *params, GVariant **out)
guint command_id;
guint server_id;
static void
write_error (const char *message,
GError **error)
{
if (error == NULL || *error == NULL) {
return;
}
g_printerr ("%s: %s\n", message, (*error)->message);
g_clear_error (error);
}
static void
test_server_cb (DBusGProxy *proxy,
char *word[],
char *word_eol[],
guint hook_id,
guint context_id,
gpointer user_data)
{
if (hook_id == server_id) {
g_print ("message: %s\n", word_eol[0]);
}
}
static void
test_command_cb (DBusGProxy *proxy,
char *word[],
char *word_eol[],
guint hook_id,
guint context_id,
gpointer user_data)
{
GError *error = NULL;
GVariant *result;
result = g_dbus_proxy_call_sync (proxy,
method,
params,
G_DBUS_CALL_FLAGS_NONE,
-1,
NULL,
&error);
if (!result)
{
g_printerr ("%s failed: %s\n", method, error->message);
g_clear_error (&error);
return FALSE;
if (hook_id == command_id) {
if (!dbus_g_proxy_call (proxy, "Unhook",
&error,
G_TYPE_UINT, hook_id,
G_TYPE_INVALID, G_TYPE_INVALID)) {
write_error ("Failed to complete unhook", &error);
}
/* Now if you write "/test blah" again in the ZoiteChat window
* you'll get a "Unknown command" error message */
g_print ("test command received: %s\n", word_eol[1]);
if (!dbus_g_proxy_call (proxy, "Print",
&error,
G_TYPE_STRING, "test command succeed",
G_TYPE_INVALID,
G_TYPE_INVALID)) {
write_error ("Failed to complete Print", &error);
}
}
}
if (out)
*out = result;
else
g_variant_unref (result);
return TRUE;
static void
unload_cb (void)
{
g_print ("Good bye !\n");
exit (EXIT_SUCCESS);
}
int
main (int argc, char **argv)
{
GDBusConnection *connection;
GDBusProxy *connection_proxy;
GDBusProxy *plugin_proxy;
GVariant *connect_result = NULL;
gchar *remote_path = NULL;
gchar *command = NULL;
const char *path_tmp;
int status = EXIT_FAILURE;
DBusGConnection *connection;
DBusGProxy *remote_object;
GMainLoop *mainloop;
gchar *path;
GError *error = NULL;
connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
if (!connection)
{
g_printerr ("Bus connection failed: %s\n", error->message);
g_clear_error (&error);
#if ! GLIB_CHECK_VERSION (2, 36, 0)
g_type_init ();
#endif
connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
if (connection == NULL) {
write_error ("Couldn't connect to session bus", &error);
return EXIT_FAILURE;
}
connection_proxy = g_dbus_proxy_new_sync (connection,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
DBUS_SERVICE,
DBUS_CONNECTION_PATH,
DBUS_CONNECTION_INTERFACE,
NULL,
&error);
if (!connection_proxy)
{
g_printerr ("Connection proxy failed: %s\n", error->message);
g_clear_error (&error);
g_object_unref (connection);
remote_object = dbus_g_proxy_new_for_name (connection,
DBUS_SERVICE,
DBUS_REMOTE,
DBUS_REMOTE_CONNECTION_INTERFACE);
if (!dbus_g_proxy_call (remote_object, "Connect",
&error,
G_TYPE_STRING, argv[0],
G_TYPE_STRING, "example",
G_TYPE_STRING, "Example of a D-Bus client",
G_TYPE_STRING, "1.0",
G_TYPE_INVALID,
G_TYPE_STRING, &path, G_TYPE_INVALID)) {
write_error ("Failed to complete Connect", &error);
return EXIT_FAILURE;
}
g_object_unref (remote_object);
if (!call_sync (connection_proxy,
"Connect",
g_variant_new ("(ssss)", "example", "example", "GDBus example", "1.0"),
&connect_result))
goto cleanup;
remote_object = dbus_g_proxy_new_for_name (connection,
DBUS_SERVICE,
path,
DBUS_REMOTE_PLUGIN_INTERFACE);
g_free (path);
g_variant_get (connect_result, "(&s)", &path_tmp);
remote_path = g_strdup (path_tmp);
g_variant_unref (connect_result);
connect_result = NULL;
plugin_proxy = g_dbus_proxy_new_sync (connection,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
DBUS_SERVICE,
remote_path,
DBUS_PLUGIN_INTERFACE,
NULL,
&error);
if (!plugin_proxy)
{
g_printerr ("Plugin proxy failed: %s\n", error->message);
g_clear_error (&error);
goto cleanup;
if (!dbus_g_proxy_call (remote_object, "HookCommand",
&error,
G_TYPE_STRING, "test",
G_TYPE_INT, 0,
G_TYPE_STRING, "Simple D-BUS example",
G_TYPE_INT, 1, G_TYPE_INVALID,
G_TYPE_UINT, &command_id, G_TYPE_INVALID)) {
write_error ("Failed to complete HookCommand", &error);
return EXIT_FAILURE;
}
g_print ("Command hook id=%d\n", command_id);
if (argc > 1)
command = g_strjoinv (" ", &argv[1]);
else
command = g_strdup ("gui focus");
if (!call_sync (plugin_proxy, "Command", g_variant_new ("(s)", command), NULL))
{
g_object_unref (plugin_proxy);
goto cleanup;
if (!dbus_g_proxy_call (remote_object, "HookServer",
&error,
G_TYPE_STRING, "RAW LINE",
G_TYPE_INT, 0,
G_TYPE_INT, 0, G_TYPE_INVALID,
G_TYPE_UINT, &server_id, G_TYPE_INVALID)) {
write_error ("Failed to complete HookServer", &error);
return EXIT_FAILURE;
}
g_print ("Server hook id=%d\n", server_id);
call_sync (connection_proxy, "Disconnect", g_variant_new ("()"), NULL);
status = EXIT_SUCCESS;
g_object_unref (plugin_proxy);
dbus_g_object_register_marshaller (
_zoitechat_marshal_VOID__POINTER_POINTER_UINT_UINT,
G_TYPE_NONE,
G_TYPE_STRV, G_TYPE_STRV, G_TYPE_UINT, G_TYPE_UINT,
G_TYPE_INVALID);
cleanup:
g_free (command);
g_free (remote_path);
g_object_unref (connection_proxy);
g_object_unref (connection);
return status;
dbus_g_object_register_marshaller (
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE,
G_TYPE_INVALID);
dbus_g_proxy_add_signal (remote_object, "CommandSignal",
G_TYPE_STRV,
G_TYPE_STRV,
G_TYPE_UINT,
G_TYPE_UINT,
G_TYPE_INVALID);
dbus_g_proxy_connect_signal (remote_object, "CommandSignal",
G_CALLBACK (test_command_cb),
NULL, NULL);
dbus_g_proxy_add_signal (remote_object, "ServerSignal",
G_TYPE_STRV,
G_TYPE_STRV,
G_TYPE_UINT,
G_TYPE_UINT,
G_TYPE_INVALID);
dbus_g_proxy_connect_signal (remote_object, "ServerSignal",
G_CALLBACK (test_server_cb),
NULL, NULL);
dbus_g_proxy_add_signal (remote_object, "UnloadSignal",
G_TYPE_INVALID);
dbus_g_proxy_connect_signal (remote_object, "UnloadSignal",
G_CALLBACK (unload_cb),
NULL, NULL);
/* Now you can write on the ZoiteChat windows: "/test arg1 arg2 ..." */
mainloop = g_main_loop_new (NULL, FALSE);
g_main_loop_run (mainloop);
return EXIT_SUCCESS;
}

View File

@@ -1,4 +1,6 @@
dbus_deps = []
dbus_deps = [
dbus_glib_dep
]
dbus_sources = [
'dbus-plugin.c',
@@ -33,8 +35,16 @@ configure_file(
install_dir: dbus_service_dir
)
dbus_binding_tool = find_program('dbus-binding-tool')
dbus_remote_object = custom_target('remote-object-glue',
input: 'remote-object.xml',
output: 'remote-object-glue.h',
command: [dbus_binding_tool, '--prefix=remote_object', '--mode=glib-server',
'--output=@OUTPUT@', '@INPUT@']
)
zoitechat_dbus = static_library('zoitechatdbus',
sources: marshal + dbus_sources,
sources: [dbus_remote_object, marshal] + dbus_sources,
c_args: dbus_cargs,
dependencies: common_deps + dbus_deps,
include_directories: dbus_includes,

View File

@@ -100,8 +100,9 @@ make_te = find_program('make-te.py')
python3 = find_program('python3', required: true)
public_suffix_data = custom_target('public_suffix_data_h',
input: 'public_suffix_list.dat',
output: 'public_suffix_data.h',
command: [python3, files('gen-public-suffix.py'), '@OUTPUT@']
command: [python3, files('gen-public-suffix.py'), '@OUTPUT@', '@INPUT@']
)
textevents = custom_target('textevents',
@@ -115,7 +116,7 @@ if libssl_dep.found()
common_deps += libssl_dep
endif
if dbus_dep.found()
if dbus_glib_dep.found()
subdir('dbus')
common_deps += zoitechat_dbus_dep
common_includes += include_directories('dbus')

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, ((const struct commands *)b)->name);
return g_ascii_strcasecmp (a, ((struct commands *)b)->name);
}
static const struct commands *
static 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)
{
const struct commands *cmd;
struct commands *cmd;
if (plugin_show_help (sess, helpcmd))
return;
@@ -4397,7 +4397,7 @@ void
check_special_chars (char *cmd, int do_ascii) /* check for %X */
{
int occur = 0;
size_t len = strlen (cmd);
int len = strlen (cmd);
char *buf, *utf;
char tbuf[4];
int i = 0, j = 0;
@@ -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;
const struct commands *int_cmd;
struct commands *int_cmd;
char *pdibuf;
char *tbuf;
int len;

View File

@@ -493,6 +493,7 @@ 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

@@ -1017,7 +1017,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
char *account;
char ip[128], nick[NICKLEN];
char *text, *ex;
size_t len = strlen (type);
int len = strlen (type);
/* fill in the "ip" and "nick" buffers */
ex = strchr (word[1], '!');

View File

@@ -22,7 +22,6 @@
#include <ctype.h>
#include <inttypes.h>
#include <limits.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
@@ -75,18 +74,6 @@ typedef struct
static bool string_builder_init (StringBuilder *builder);
static void string_builder_free (StringBuilder *builder);
static bool string_builder_append (StringBuilder *builder, const char *text);
static int size_to_int (size_t value);
static int
size_to_int (size_t value)
{
if (value > (size_t) INT_MAX)
{
return INT_MAX;
}
return (int) value;
}
char *
sysinfo_get_cpu (void)
@@ -524,7 +511,6 @@ static char *read_hdd_info (IWbemClassObject *object)
static char *bstr_to_utf8 (BSTR bstr)
{
int utf8_len;
int wide_len;
char *utf8;
if (bstr == NULL)
@@ -532,8 +518,7 @@ static char *bstr_to_utf8 (BSTR bstr)
return NULL;
}
wide_len = size_to_int ((size_t) SysStringLen (bstr));
utf8_len = WideCharToMultiByte (CP_UTF8, 0, bstr, wide_len, NULL, 0, NULL, NULL);
utf8_len = WideCharToMultiByte (CP_UTF8, 0, bstr, SysStringLen (bstr), NULL, 0, NULL, NULL);
if (utf8_len <= 0)
{
return NULL;
@@ -545,7 +530,7 @@ static char *bstr_to_utf8 (BSTR bstr)
return NULL;
}
if (WideCharToMultiByte (CP_UTF8, 0, bstr, wide_len, utf8, utf8_len, NULL, NULL) <= 0)
if (WideCharToMultiByte (CP_UTF8, 0, bstr, SysStringLen (bstr), utf8, utf8_len, NULL, NULL) <= 0)
{
free (utf8);
return NULL;

View File

@@ -321,7 +321,7 @@ url_check_line (char *buf)
for (i = 0; i < ARRAY_SIZE (commands); i++)
{
char *cmd = commands[i];
size_t len = strlen (cmd);
int len = strlen (cmd);
if (strncmp (cmd, po, len) == 0)
{

View File

@@ -98,7 +98,7 @@ path_part (char *file, char *path, int pathlen)
char * /* like strstr(), but nocase */
nocasestrstr (const char *s, const char *wanted)
{
register const size_t len = strlen (wanted);
register const int len = strlen (wanted);
if (len == 0)
return (char *)s;

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, see
* <https://www.gnu.org/licenses/>.
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/* You can distribute this header with your plugins for easy compilation */

View File

@@ -452,7 +452,7 @@ void
fe_add_chan_list (server *serv, char *chan, char *users, char *topic)
{
chanlistrow *next_row;
size_t len = strlen (chan) + 1;
int len = strlen (chan) + 1;
/* we allocate the struct and channel string in one go */
next_row = g_malloc (sizeof (chanlistrow) + len);

View File

@@ -61,19 +61,28 @@ static tab_scroll_animation *tab_right_animation;
*/
static inline gint
cv_tabs_get_viewport_size (GtkAdjustment *adj)
cv_tabs_get_viewport_size (GdkWindow *parent_win, gboolean vertical)
{
return (gint) gtk_adjustment_get_page_size (adj);
gint viewport_size = 0;
if (vertical)
viewport_size = gdk_window_get_height (parent_win);
else
viewport_size = gdk_window_get_width (parent_win);
return viewport_size;
}
static void
cv_tabs_sizealloc (GtkWidget *widget, GtkAllocation *allocation, chanview *cv)
{
GdkWindow *parent_win;
GtkAdjustment *adj;
GtkWidget *inner;
gint viewport_size;
inner = ((tabview *)cv)->inner;
parent_win = gtk_widget_get_window (gtk_widget_get_parent (inner));
if (cv->vertical)
{
@@ -83,20 +92,16 @@ cv_tabs_sizealloc (GtkWidget *widget, GtkAllocation *allocation, chanview *cv)
adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (gtk_widget_get_parent (inner)));
}
viewport_size = cv_tabs_get_viewport_size (adj);
viewport_size = cv_tabs_get_viewport_size (parent_win, cv->vertical);
if (gtk_adjustment_get_upper (adj) <= viewport_size)
{
if (((tabview *)cv)->b1)
gtk_widget_hide (((tabview *)cv)->b1);
if (((tabview *)cv)->b2)
gtk_widget_hide (((tabview *)cv)->b2);
gtk_widget_hide (((tabview *)cv)->b1);
gtk_widget_hide (((tabview *)cv)->b2);
} else
{
if (((tabview *)cv)->b1)
gtk_widget_show (((tabview *)cv)->b1);
if (((tabview *)cv)->b2)
gtk_widget_show (((tabview *)cv)->b2);
gtk_widget_show (((tabview *)cv)->b1);
gtk_widget_show (((tabview *)cv)->b2);
}
}
@@ -236,8 +241,10 @@ tab_scroll_left_up_clicked (GtkWidget *widget, chanview *cv)
gint viewport_size;
gfloat new_value;
GtkWidget *inner;
GdkWindow *parent_win;
inner = ((tabview *)cv)->inner;
parent_win = gtk_widget_get_window (gtk_widget_get_parent (inner));
if (cv->vertical)
{
@@ -247,7 +254,7 @@ tab_scroll_left_up_clicked (GtkWidget *widget, chanview *cv)
adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (gtk_widget_get_parent(inner)));
}
viewport_size = cv_tabs_get_viewport_size (adj);
viewport_size = cv_tabs_get_viewport_size (parent_win, cv->vertical);
new_value = tab_search_offset (inner, gtk_adjustment_get_value (adj), 0, cv->vertical);
@@ -272,8 +279,10 @@ tab_scroll_right_down_clicked (GtkWidget *widget, chanview *cv)
gint viewport_size;
gfloat new_value;
GtkWidget *inner;
GdkWindow *parent_win;
inner = ((tabview *)cv)->inner;
parent_win = gtk_widget_get_window (gtk_widget_get_parent (inner));
if (cv->vertical)
{
@@ -283,7 +292,7 @@ tab_scroll_right_down_clicked (GtkWidget *widget, chanview *cv)
adj = gtk_scrollable_get_hadjustment (GTK_SCROLLABLE (gtk_widget_get_parent(inner)));
}
viewport_size = cv_tabs_get_viewport_size (adj);
viewport_size = cv_tabs_get_viewport_size (parent_win, cv->vertical);
new_value = tab_search_offset (inner, gtk_adjustment_get_value (adj), 1, cv->vertical);
@@ -304,37 +313,67 @@ 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 (direction != 0)
{
mg_switch_page (1, direction);
return TRUE;
}
if (event->direction == GDK_SCROLL_DOWN)
mg_switch_page (1, 1);
else if (event->direction == GDK_SCROLL_UP)
mg_switch_page (1, -1);
}
else
{
if (direction < 0)
{
/* mouse wheel scrolling */
if (event->direction == GDK_SCROLL_UP)
tab_scroll_left_up_clicked (widget, cv);
return TRUE;
}
else if (direction > 0)
{
else if (event->direction == GDK_SCROLL_DOWN)
tab_scroll_right_down_clicked (widget, cv);
return TRUE;
}
}
return FALSE;
}
/* make a Scroll (arrow) button */
static GtkWidget *
make_sbutton (GtkArrowType type, void *click_cb, void *userdata)
{
GtkWidget *button, *arrow;
const char *icon_name = "pan-end-symbolic";
button = gtk_button_new ();
switch (type)
{
case GTK_ARROW_UP:
icon_name = "pan-up-symbolic";
break;
case GTK_ARROW_DOWN:
icon_name = "pan-down-symbolic";
break;
case GTK_ARROW_LEFT:
icon_name = "pan-start-symbolic";
break;
case GTK_ARROW_RIGHT:
default:
icon_name = "pan-end-symbolic";
break;
}
arrow = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
gtk_container_add (GTK_CONTAINER (button), arrow);
gtk_button_set_relief (GTK_BUTTON (button), GTK_RELIEF_NONE);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (click_cb), userdata);
g_signal_connect (G_OBJECT (button), "scroll-event",
G_CALLBACK (tab_scroll_cb), userdata);
gtk_widget_show (arrow);
return button;
}
static void
cv_tabs_init (chanview *cv)
{
GtkWidget *box;
GtkWidget *box, *hbox = NULL;
GtkWidget *viewport;
GtkWidget *outer;
@@ -351,19 +390,12 @@ cv_tabs_init (chanview *cv)
G_CALLBACK (cv_tabs_sizealloc), cv);
gtk_widget_show (outer);
viewport = gtk_scrolled_window_new (0, 0);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (viewport), GTK_SHADOW_NONE);
viewport = gtk_viewport_new (0, 0);
gtk_viewport_set_shadow_type (GTK_VIEWPORT (viewport), GTK_SHADOW_NONE);
if (cv->vertical)
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (viewport),
GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
gtk_widget_set_size_request (viewport, -1, 1);
else
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (viewport),
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);
gtk_widget_set_size_request (viewport, 1, -1);
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);
@@ -381,6 +413,35 @@ cv_tabs_init (chanview *cv)
gtk_container_add (GTK_CONTAINER (viewport), box);
gtk_widget_show (box);
/* if vertical, the buttons can be side by side */
if (cv->vertical)
{
hbox = gtkutil_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
gtk_box_pack_start (GTK_BOX (outer), hbox, 0, 0, 0);
gtk_widget_show (hbox);
}
/* make the Scroll buttons */
((tabview *)cv)->b2 = make_sbutton (cv->vertical ?
GTK_ARROW_UP : GTK_ARROW_LEFT,
tab_scroll_left_up_clicked,
cv);
((tabview *)cv)->b1 = make_sbutton (cv->vertical ?
GTK_ARROW_DOWN : GTK_ARROW_RIGHT,
tab_scroll_right_down_clicked,
cv);
if (hbox)
{
gtk_container_add (GTK_CONTAINER (hbox), ((tabview *)cv)->b2);
gtk_container_add (GTK_CONTAINER (hbox), ((tabview *)cv)->b1);
} else
{
gtk_box_pack_start (GTK_BOX (outer), ((tabview *)cv)->b2, 0, 0, 0);
gtk_box_pack_start (GTK_BOX (outer), ((tabview *)cv)->b1, 0, 0, 0);
}
gtk_container_add (GTK_CONTAINER (cv->box), outer);
}
@@ -685,11 +746,9 @@ 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);
@@ -705,10 +764,6 @@ 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)
{
int direction = cv_scroll_direction (event);
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 direction != 0;
return TRUE;
}
return FALSE;
@@ -141,7 +141,6 @@ 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),
@@ -155,7 +154,6 @@ 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,37 +95,6 @@ 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

@@ -124,25 +124,6 @@ create_msg_dialog (gchar *title, gchar *message)
static char *win32_argv0_dir;
static void
win32_set_appusermodelid (void)
{
HMODULE shell32;
HRESULT (WINAPI *set_appid) (PCWSTR);
shell32 = GetModuleHandleW (L"shell32.dll");
if (!shell32)
shell32 = LoadLibraryW (L"shell32.dll");
if (!shell32)
return;
set_appid = (HRESULT (WINAPI *) (PCWSTR)) GetProcAddress (shell32, "SetCurrentProcessExplicitAppUserModelID");
if (!set_appid)
return;
set_appid (L"ZoiteChat.Desktop.Notify");
}
static void
win32_set_gsettings_schema_dir (void)
{
@@ -320,7 +301,7 @@ fe_args (int argc, char *argv[])
GError *error = NULL;
GOptionContext *context;
char *buffer;
const char *desktop_id = "org.zoitechat.ZoiteChat";
const char *desktop_id = "net.zoite.Zoitechat";
#ifdef WIN32
char *base_path = NULL;
char *locale_path = NULL;
@@ -441,7 +422,6 @@ fe_args (int argc, char *argv[])
#ifdef WIN32
win32_set_gsettings_schema_dir ();
win32_set_appusermodelid ();
win32_configure_pixbuf_loaders ();
/* this is mainly for irc:// URL handling. When windows calls us from */

View File

@@ -1973,37 +1973,8 @@ 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

@@ -522,10 +522,6 @@ gtkutil_file_req (GtkWindow *parent, const char *title, void *callback, void *us
g_signal_connect (native, "response",
G_CALLBACK (gtkutil_native_file_req_response), freq);
if (flags & FRF_MODAL)
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (native), TRUE);
gtk_native_dialog_show (GTK_NATIVE_DIALOG (native));
return;
}
@@ -976,7 +972,7 @@ gtkutil_copy_to_clipboard (GtkWidget *widget, GdkAtom selection,
win = gtk_widget_get_toplevel (GTK_WIDGET (widget));
if (gtk_widget_is_toplevel (win))
{
gint len = (gint) strlen (str);
int len = strlen (str);
if (selection)
{

View File

@@ -902,12 +902,7 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata
if ((event->changed_mask & GDK_WINDOW_STATE_ICONIFIED) &&
(event->new_window_state & GDK_WINDOW_STATE_ICONIFIED) &&
prefs.hex_gui_tray_minimize && prefs.hex_gui_tray &&
gtkutil_tray_icon_supported (wid)
#ifndef WIN32
)
#else
&& !gtk_window_is_active (wid))
#endif
gtkutil_tray_icon_supported (wid))
{
tray_toggle_visibility (TRUE);
}
@@ -952,8 +947,7 @@ mg_windowstate_cb (GtkWindow *wid, GdkEventWindowState *event, gpointer userdata
if (sess && sess->gui && GTK_IS_WIDGET (sess->gui->window))
gtk_widget_queue_draw (sess->gui->window);
if (current_sess && current_sess->gui)
menu_set_fullscreen (current_sess->gui, prefs.hex_gui_win_fullscreen);
menu_set_fullscreen (current_sess->gui, prefs.hex_gui_win_fullscreen);
#ifdef G_OS_WIN32
mg_win32_allow_autohide_taskbar (wid, event);
@@ -2418,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, FALSE);
gtk_widget_set_vexpand (wid, TRUE);
gtk_widget_set_halign (wid, GTK_ALIGN_FILL);
gtk_widget_set_valign (wid, GTK_ALIGN_CENTER);
gtk_widget_set_valign (wid, GTK_ALIGN_FILL);
gtk_grid_attach (GTK_GRID (box), wid, a, c, b - a, d - c);
show_and_unfocus (wid);
}
@@ -3419,13 +3413,8 @@ 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_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);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
gtk_box_pack_start (GTK_BOX (inbox), frame, TRUE, TRUE, 0);
theme_get_xtext_colors_for_widget (frame, xtext_palette, XTEXT_COLS);
@@ -3442,7 +3431,9 @@ mg_create_textarea (session *sess, GtkWidget *box)
g_signal_connect (G_OBJECT (xtext), "word_click",
G_CALLBACK (mg_word_clicked), NULL);
gui->vscrollbar = gtk_scrolled_window_get_vscrollbar (GTK_SCROLLED_WINDOW (frame));
gui->vscrollbar = gtk_scrollbar_new (GTK_ORIENTATION_VERTICAL,
GTK_XTEXT (xtext)->adj);
gtk_box_pack_start (GTK_BOX (inbox), gui->vscrollbar, FALSE, TRUE, 0);
gtk_drag_dest_set (gui->vscrollbar, 5, dnd_dest_targets, 2,
GDK_ACTION_MOVE | GDK_ACTION_COPY | GDK_ACTION_LINK);
@@ -3485,7 +3476,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_end (GTK_BOX (parent_box), box, 0, 0, 0);
gtk_box_pack_start (GTK_BOX (parent_box), box, 0, 0, 0);
if ((prefs.hex_gui_lagometer & 2) || (prefs.hex_gui_throttlemeter & 2))
{
@@ -3575,44 +3566,6 @@ mg_theme_userlist_changed (const ThemeChangedEvent *event, gpointer userdata)
mg_theme_apply_userlist_style (gui);
}
static void
mg_theme_refresh_menu_widget (GtkWidget *widget)
{
GtkRequisition minimum;
GtkRequisition natural;
if (!widget)
return;
gtk_widget_queue_resize (widget);
gtk_widget_get_preferred_size (widget, &minimum, &natural);
}
static void
mg_theme_refresh_menu_tree (GtkWidget *menu)
{
GList *children;
GList *node;
if (!menu || !GTK_IS_MENU_SHELL (menu))
return;
children = gtk_container_get_children (GTK_CONTAINER (menu));
for (node = children; node; node = node->next)
{
GtkWidget *item = GTK_WIDGET (node->data);
GtkWidget *submenu = NULL;
if (GTK_IS_MENU_ITEM (item))
submenu = gtk_menu_item_get_submenu (GTK_MENU_ITEM (item));
if (submenu)
mg_theme_refresh_menu_tree (submenu);
mg_theme_refresh_menu_widget (item);
}
g_list_free (children);
mg_theme_refresh_menu_widget (menu);
}
static void
mg_theme_window_changed (const ThemeChangedEvent *event, gpointer userdata)
{
@@ -3623,11 +3576,8 @@ mg_theme_window_changed (const ThemeChangedEvent *event, gpointer userdata)
!theme_changed_event_has_reason (event, THEME_CHANGED_REASON_WIDGET_STYLE))
return;
if (!gui)
return;
theme_manager_apply_to_window (gui->window);
mg_theme_refresh_menu_tree (gui->menu);
if (gui)
theme_manager_apply_to_window (gui->window);
}
static void
@@ -3670,14 +3620,8 @@ 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.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);
gtk_label_set_xalign (GTK_LABEL (gui->namelistinfo), 0.0f);
gtk_widget_set_halign (gui->namelistinfo, GTK_ALIGN_START);
if (prefs.hex_gui_ulist_count)
gtk_box_pack_start (GTK_BOX (vbox), gui->namelistinfo, 0, 0, 0);
@@ -4733,14 +4677,7 @@ mg_win32_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data)
{
if (strcmp (command, "__WIN32_TASKBAR_TOGGLE__") == 0)
{
GdkWindowState state = 0;
GdkWindow *gdk_window = gtk_widget_get_window (current_sess->gui->window);
if (gdk_window)
state = gdk_window_get_state (gdk_window);
if (gtk_widget_get_visible (current_sess->gui->window)
&& (state & GDK_WINDOW_STATE_ICONIFIED) == 0)
if (gtk_widget_get_visible (current_sess->gui->window))
fe_ctrl_gui (current_sess, FE_GUI_ICONIFY, 0);
else
fe_ctrl_gui (current_sess, FE_GUI_SHOW, 0);
@@ -5254,14 +5191,9 @@ static void
mg_handle_drop (GtkWidget *widget, int y, int *pos, int *other_pos)
{
int height;
GdkWindow *window;
session_gui *gui = current_sess->gui;
window = gtk_widget_get_window (widget);
if (!window)
return;
height = gdk_window_get_height (window);
height = gdk_window_get_height (gtk_widget_get_window (widget));
if (y < height / 2)
{
@@ -5339,9 +5271,6 @@ mg_drag_begin_cb (GtkWidget *widget, GdkDragContext *context, gpointer userdata)
return FALSE;
window = gtk_widget_get_window (widget);
if (!window)
return FALSE;
width = gdk_window_get_width (window);
height = gdk_window_get_height (window);
@@ -5419,16 +5348,11 @@ mg_drag_motion_cb (GtkWidget *widget, GdkDragContext *context, int x, int y, gui
width = allocation.width;
height = allocation.height;
window = gtk_widget_get_window (widget);
if (!window)
return FALSE;
}
else
{
ox = oy = 0;
window = gtk_widget_get_window (widget);
if (!window)
return FALSE;
width = gdk_window_get_width (window);
height = gdk_window_get_height (window);
}

View File

@@ -2309,7 +2309,7 @@ menu_reorder (GtkMenu *menu, GtkWidget *item, int pos)
if (pos < 0) /* position offset from end/bottom */
{
GList *children = gtk_container_get_children (GTK_CONTAINER (menu));
gint length = (gint) g_list_length (children);
int length = g_list_length (children);
g_list_free (children);
gtk_menu_reorder_child (menu, item, (length + pos) - 1);
@@ -2381,7 +2381,7 @@ menu_add_sub (GtkWidget *menu, menu_entry *me)
if (pos < 0) /* position offset from end/bottom */
{
GList *children = gtk_container_get_children (GTK_CONTAINER (menu));
gint length = (gint) g_list_length (children);
int length = g_list_length (children);
g_list_free (children);
pos = length + pos;

View File

@@ -56,7 +56,7 @@ notification_backend_show (const char *title, const char *text)
g_variant_builder_init (&params, G_VARIANT_TYPE ("(susssasa{sv}i)"));
g_variant_builder_add (&params, "s", "zoitechat"); /* App name */
g_variant_builder_add (&params, "u", 0); /* ID, 0 means don't replace */
g_variant_builder_add (&params, "s", "org.zoitechat.ZoiteChat"); /* App icon */
g_variant_builder_add (&params, "s", "net.zoite.Zoitechat"); /* App icon */
g_variant_builder_add (&params, "s", title);
g_variant_builder_add (&params, "s", text);
g_variant_builder_add (&params, "as", NULL); /* Actions */
@@ -65,7 +65,7 @@ notification_backend_show (const char *title, const char *text)
g_variant_builder_open (&params, G_VARIANT_TYPE ("a{sv}"));
g_variant_builder_open (&params, G_VARIANT_TYPE ("{sv}"));
g_variant_builder_add (&params, "s", "desktop-entry");
g_variant_builder_add (&params, "v", g_variant_new_string ("org.zoitechat.ZoiteChat"));
g_variant_builder_add (&params, "v", g_variant_new_string ("net.zoite.Zoitechat"));
g_variant_builder_close (&params);
g_variant_builder_close (&params);

View File

@@ -80,7 +80,7 @@ typedef GIcon *TrayIcon;
typedef GIcon *TrayCustomIcon;
#define tray_icon_free(i) g_object_unref(i)
#define ICON_NORMAL_NAME "org.zoitechat.ZoiteChat"
#define ICON_NORMAL_NAME "net.zoite.Zoitechat"
#define ICON_MSG_NAME "mail-unread"
#define ICON_HILIGHT_NAME "dialog-warning"
#define ICON_FILE_NAME "folder-download"
@@ -920,10 +920,7 @@ tray_menu_notify_cb (GObject *tray, GParamSpec *pspec, gpointer user_data)
{
if (!tray_backend_is_embedded ())
{
if (!tray_restore_timer)
{
tray_restore_timer = g_timeout_add (500, (GSourceFunc) tray_menu_try_restore, NULL);
}
tray_restore_timer = g_timeout_add(500, (GSourceFunc)tray_menu_try_restore, NULL);
}
else
{
@@ -939,10 +936,9 @@ tray_menu_notify_cb (GObject *tray, GParamSpec *pspec, gpointer user_data)
static gboolean
tray_menu_try_restore (void)
{
tray_restore_timer = 0;
tray_cleanup ();
tray_init ();
return G_SOURCE_REMOVE;
tray_cleanup();
tray_init();
return TRUE;
}
static void

View File

@@ -367,7 +367,7 @@ static const setting filexfer_settings[] =
{ST_TOGGLE, N_("Receive window"), P_OFFINTNL(hex_gui_autoopen_recv), 0, 0, 0},
{ST_TOGGLE, N_("Chat window"), P_OFFINTNL(hex_gui_autoopen_chat), 0, 0, 0},
{ST_HEADER, N_("Maximum File Transfer Speeds (KiB/s or MiB/s)"), 0, 0, 0},
{ST_HEADER, N_("Maximum File Transfer Speeds (Byte per Second)"), 0, 0, 0},
{ST_NUMBER, N_("One upload:"), P_OFFINTNL(hex_dcc_max_send_cps),
N_("Maximum speed for one transfer"), 0, 10000000},
{ST_NUMBER, N_("One download:"), P_OFFINTNL(hex_dcc_max_get_cps),
@@ -873,67 +873,6 @@ setup_create_italic_label (char *text)
return label;
}
typedef struct
{
const setting *set;
GtkSpinButton *spin;
GtkComboBox *unit;
} setup_dcc_speed_data;
static gboolean
setup_is_dcc_speed_setting (const setting *set)
{
return set->offset == P_OFFINTNL (hex_dcc_max_send_cps)
|| set->offset == P_OFFINTNL (hex_dcc_max_get_cps)
|| set->offset == P_OFFINTNL (hex_dcc_global_max_send_cps)
|| set->offset == P_OFFINTNL (hex_dcc_global_max_get_cps);
}
static int
setup_dcc_speed_multiplier (GtkComboBox *combo)
{
return gtk_combo_box_get_active (combo) == 1 ? 1024 * 1024 : 1024;
}
static void
setup_dcc_speed_spin_range (setup_dcc_speed_data *data)
{
int max = data->set->extra / setup_dcc_speed_multiplier (data->unit);
gtk_spin_button_set_range (data->spin, 0, max > 0 ? max : 0);
}
static void
setup_dcc_speed_store (setup_dcc_speed_data *data)
{
int value = gtk_spin_button_get_value_as_int (data->spin);
int speed = value * setup_dcc_speed_multiplier (data->unit);
if (speed > data->set->extra)
speed = data->set->extra;
setup_set_int (&setup_prefs, data->set, speed);
}
static void
setup_dcc_speed_spin_cb (GtkSpinButton *spin, setup_dcc_speed_data *data)
{
(void)spin;
setup_dcc_speed_store (data);
}
static void
setup_dcc_speed_unit_cb (GtkComboBox *combo, setup_dcc_speed_data *data)
{
int speed = setup_get_int (&setup_prefs, data->set);
int multiplier;
int value;
(void)combo;
setup_dcc_speed_spin_range (data);
multiplier = setup_dcc_speed_multiplier (data->unit);
value = (speed + (multiplier / 2)) / multiplier;
gtk_spin_button_set_value (data->spin, value);
setup_dcc_speed_store (data);
}
static void
setup_spin_cb (GtkSpinButton *spin, const setting *set)
{
@@ -963,43 +902,11 @@ setup_create_spin (GtkWidget *table, int row, const setting *set)
g_object_set_data (G_OBJECT (wid), "lbl", label);
if (set->tooltip)
gtk_widget_set_tooltip_text (wid, _(set->tooltip));
if (setup_is_dcc_speed_setting (set))
{
GtkWidget *unit;
setup_dcc_speed_data *data = g_new0 (setup_dcc_speed_data, 1);
int speed = setup_get_int (&setup_prefs, set);
int use_mib = speed >= (1024 * 1024) && speed % (1024 * 1024) == 0;
int multiplier;
data->set = set;
data->spin = GTK_SPIN_BUTTON (wid);
unit = gtk_combo_box_text_new ();
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (unit), _("KiB/s"));
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (unit), _("MiB/s"));
gtk_combo_box_set_wrap_width (GTK_COMBO_BOX (unit), 1);
gtk_combo_box_set_active (GTK_COMBO_BOX (unit), use_mib ? 1 : 0);
data->unit = GTK_COMBO_BOX (unit);
setup_dcc_speed_spin_range (data);
multiplier = setup_dcc_speed_multiplier (data->unit);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (wid), (speed + (multiplier / 2)) / multiplier);
g_signal_connect (G_OBJECT (wid), "value-changed",
G_CALLBACK (setup_dcc_speed_spin_cb), data);
g_signal_connect (G_OBJECT (unit), "changed",
G_CALLBACK (setup_dcc_speed_unit_cb), data);
gtk_box_pack_start (GTK_BOX (rbox), wid, 0, 0, 0);
gtk_box_pack_start (GTK_BOX (rbox), unit, 0, 0, 6);
} else
{
gtk_spin_button_set_value (GTK_SPIN_BUTTON (wid),
gtk_spin_button_set_value (GTK_SPIN_BUTTON (wid),
setup_get_int (&setup_prefs, set));
g_signal_connect (G_OBJECT (wid), "value-changed",
g_signal_connect (G_OBJECT (wid), "value-changed",
G_CALLBACK (setup_spin_cb), (gpointer)set);
gtk_box_pack_start (GTK_BOX (rbox), wid, 0, 0, 0);
}
gtk_box_pack_start (GTK_BOX (rbox), wid, 0, 0, 0);
if (set->list)
{
@@ -1364,7 +1271,7 @@ setup_entry_cb (GtkEntry *entry, setting *set)
int size;
int pos;
unsigned char *p = (unsigned char*)gtk_entry_get_text (entry);
size_t len = strlen ((const char *) p);
int len = strlen (p);
/* need to truncate? */
if (len >= set->extra)
@@ -2180,7 +2087,7 @@ unslash (char *dir)
{
if (dir[0])
{
size_t len = strlen (dir) - 1;
int len = strlen (dir) - 1;
#ifdef WIN32
if (dir[len] == '/' || dir[len] == '\\')
#else

View File

@@ -82,36 +82,6 @@ theme_token_to_rgb16 (ThemeSemanticToken token, guint16 *red, guint16 *green, gu
return TRUE;
}
static GtkStateFlags
theme_access_state_with_base (GtkStyleContext *context, GtkStateFlags state)
{
GtkStateFlags base_state;
base_state = gtk_style_context_get_state (context);
base_state &= (GTK_STATE_FLAG_DIR_LTR | GTK_STATE_FLAG_DIR_RTL | GTK_STATE_FLAG_BACKDROP | GTK_STATE_FLAG_FOCUSED);
return base_state | state;
}
static void
theme_access_context_get_color (GtkStyleContext *context, GtkStateFlags state, GdkRGBA *out_color)
{
gtk_style_context_save (context);
gtk_style_context_set_state (context, theme_access_state_with_base (context, state));
gtk_style_context_get_color (context, gtk_style_context_get_state (context), out_color);
gtk_style_context_restore (context);
}
static void
theme_access_context_get_background_color (GtkStyleContext *context, GtkStateFlags state, GdkRGBA *out_color)
{
gtk_style_context_save (context);
gtk_style_context_set_state (context, theme_access_state_with_base (context, state));
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_style_context_get_background_color (context, gtk_style_context_get_state (context), out_color);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_style_context_restore (context);
}
static gboolean
theme_access_get_gtk_palette_map (GtkWidget *widget, ThemeGtkPaletteMap *out_map)
{
@@ -126,11 +96,13 @@ theme_access_get_gtk_palette_map (GtkWidget *widget, ThemeGtkPaletteMap *out_map
if (context == NULL)
return FALSE;
theme_access_context_get_color (context, GTK_STATE_FLAG_NORMAL, &out_map->text_foreground);
theme_access_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &out_map->text_background);
theme_access_context_get_color (context, GTK_STATE_FLAG_SELECTED, &out_map->selection_foreground);
theme_access_context_get_background_color (context, GTK_STATE_FLAG_SELECTED, &out_map->selection_background);
theme_access_context_get_color (context, GTK_STATE_FLAG_LINK, &accent);
gtk_style_context_get_color (context, GTK_STATE_FLAG_NORMAL, &out_map->text_foreground);
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
gtk_style_context_get_background_color (context, GTK_STATE_FLAG_NORMAL, &out_map->text_background);
gtk_style_context_get_color (context, GTK_STATE_FLAG_SELECTED, &out_map->selection_foreground);
gtk_style_context_get_background_color (context, GTK_STATE_FLAG_SELECTED, &out_map->selection_background);
G_GNUC_END_IGNORE_DEPRECATIONS
gtk_style_context_get_color (context, GTK_STATE_FLAG_LINK, &accent);
if (accent.alpha <= 0.0)
accent = out_map->selection_background;
out_map->accent = accent;

View File

@@ -34,9 +34,9 @@ static const char *theme_css_selector_light_class = "zoitechat-light";
static const char *theme_css_palette_provider_key = "zoitechat-palette-provider";
static const guint theme_css_provider_priority = GTK_STYLE_PROVIDER_PRIORITY_USER;
static const char *theme_css_palette_scope_selectors =
".zoitechat-palette, .zoitechat-palette *, .zoitechat-palette box, .zoitechat-palette grid, .zoitechat-palette stack, .zoitechat-palette frame, .zoitechat-palette paned, .zoitechat-palette paned > separator, .zoitechat-palette separator, .zoitechat-palette viewport, .zoitechat-palette overlay, .zoitechat-palette revealer, .zoitechat-palette notebook, .zoitechat-palette notebook > header, .zoitechat-palette notebook > header > tabs, .zoitechat-palette notebook > header > tabs > tab, .zoitechat-palette scrolledwindow, .zoitechat-palette scrollbar, .zoitechat-palette scrollbar slider, .zoitechat-palette scrollbar trough, .zoitechat-palette treeview, .zoitechat-palette treeview.view, .zoitechat-palette treeview.view text, .zoitechat-palette treeview.view cell, .zoitechat-palette treeview.view row, .zoitechat-palette treeview header, .zoitechat-palette treeview header button, .zoitechat-palette list, .zoitechat-palette list row, .zoitechat-palette row, .zoitechat-palette textview, .zoitechat-palette textview text, .zoitechat-palette text, .zoitechat-palette entry, .zoitechat-palette entry text, .zoitechat-palette button, .zoitechat-palette button label, .zoitechat-palette check, .zoitechat-palette switch, .zoitechat-palette slider, .zoitechat-palette scale, .zoitechat-palette scale trough, .zoitechat-palette scale highlight, .zoitechat-palette spinbutton, .zoitechat-palette combobox, .zoitechat-palette combobox box, .zoitechat-palette progressbar, .zoitechat-palette progressbar trough, .zoitechat-palette levelbar, .zoitechat-palette levelbar trough, .zoitechat-palette menubar, .zoitechat-palette menu, .zoitechat-palette menuitem, .zoitechat-palette menuitem label, .zoitechat-palette toolbar, .zoitechat-palette headerbar, .zoitechat-palette label, .zoitechat-palette link, .zoitechat-palette infobar, .zoitechat-palette statusbar, .zoitechat-palette statusbar frame, .zoitechat-palette tooltip, .zoitechat-palette tooltip label";
".zoitechat-palette, .zoitechat-palette *, .zoitechat-palette box, .zoitechat-palette grid, .zoitechat-palette stack, .zoitechat-palette frame, .zoitechat-palette paned, .zoitechat-palette paned > separator, .zoitechat-palette separator, .zoitechat-palette viewport, .zoitechat-palette overlay, .zoitechat-palette revealer, .zoitechat-palette notebook, .zoitechat-palette notebook > header, .zoitechat-palette notebook > header > tabs, .zoitechat-palette notebook > header > tabs > tab, .zoitechat-palette scrolledwindow, .zoitechat-palette scrollbar, .zoitechat-palette scrollbar slider, .zoitechat-palette scrollbar trough, .zoitechat-palette treeview, .zoitechat-palette treeview.view, .zoitechat-palette treeview.view text, .zoitechat-palette treeview.view cell, .zoitechat-palette treeview.view row, .zoitechat-palette treeview header, .zoitechat-palette treeview header button, .zoitechat-palette list, .zoitechat-palette list row, .zoitechat-palette row, .zoitechat-palette textview, .zoitechat-palette textview text, .zoitechat-palette text, .zoitechat-palette entry, .zoitechat-palette entry text, .zoitechat-palette button, .zoitechat-palette button label, .zoitechat-palette check, .zoitechat-palette radio, .zoitechat-palette switch, .zoitechat-palette slider, .zoitechat-palette scale, .zoitechat-palette scale trough, .zoitechat-palette scale highlight, .zoitechat-palette spinbutton, .zoitechat-palette combobox, .zoitechat-palette combobox box, .zoitechat-palette progressbar, .zoitechat-palette progressbar trough, .zoitechat-palette levelbar, .zoitechat-palette levelbar trough, .zoitechat-palette menubar, .zoitechat-palette menu, .zoitechat-palette menuitem, .zoitechat-palette menuitem label, .zoitechat-palette toolbar, .zoitechat-palette headerbar, .zoitechat-palette label, .zoitechat-palette link, .zoitechat-palette infobar, .zoitechat-palette statusbar, .zoitechat-palette statusbar frame, .zoitechat-palette tooltip, .zoitechat-palette tooltip label";
static const char *theme_css_palette_selection_selectors =
".zoitechat-palette *:selected, .zoitechat-palette *:selected:focus, .zoitechat-palette *:selected:hover, .zoitechat-palette treeview.view:selected, .zoitechat-palette treeview.view:selected:focus, .zoitechat-palette treeview.view:selected:hover, .zoitechat-palette row:selected, .zoitechat-palette row:selected:focus, .zoitechat-palette row:selected:hover, .zoitechat-palette selection, .zoitechat-palette text selection, .zoitechat-palette entry selection, .zoitechat-palette entry text selection, .zoitechat-palette button:selected, .zoitechat-palette button:checked, .zoitechat-palette check:checked, .zoitechat-palette switch:checked, .zoitechat-palette slider:active, .zoitechat-palette menuitem:selected, .zoitechat-palette menuitem:hover, .zoitechat-palette notebook > header > tabs > tab:checked, .zoitechat-palette notebook > header > tabs > tab:hover, .zoitechat-palette treeview header button:hover, .zoitechat-palette treeview header button:active, .zoitechat-palette progressbar progress, .zoitechat-palette levelbar block.filled, .zoitechat-palette:focus selection, .zoitechat-palette:focus text selection";
".zoitechat-palette *:selected, .zoitechat-palette *:selected:focus, .zoitechat-palette *:selected:hover, .zoitechat-palette treeview.view:selected, .zoitechat-palette treeview.view:selected:focus, .zoitechat-palette treeview.view:selected:hover, .zoitechat-palette row:selected, .zoitechat-palette row:selected:focus, .zoitechat-palette row:selected:hover, .zoitechat-palette selection, .zoitechat-palette text selection, .zoitechat-palette entry selection, .zoitechat-palette entry text selection, .zoitechat-palette button:selected, .zoitechat-palette button:checked, .zoitechat-palette check:checked, .zoitechat-palette radio:checked, .zoitechat-palette switch:checked, .zoitechat-palette slider:active, .zoitechat-palette menuitem:selected, .zoitechat-palette menuitem:hover, .zoitechat-palette notebook > header > tabs > tab:checked, .zoitechat-palette notebook > header > tabs > tab:hover, .zoitechat-palette treeview header button:hover, .zoitechat-palette treeview header button:active, .zoitechat-palette progressbar progress, .zoitechat-palette levelbar block.filled, .zoitechat-palette:focus selection, .zoitechat-palette:focus text selection";
typedef struct
{

View File

@@ -93,14 +93,23 @@ 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_tree)
if (!sess || !sess->gui || !sess->gui->user_box || !sess->gui->namelistinfo || !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), 1);
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (scrolled_window), width);
gtk_widget_set_size_request (sess->gui->user_box, width, -1);
}
GdkPixbuf *
@@ -900,19 +909,17 @@ 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_IN);
GTK_SHADOW_ETCHED_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_scrolled_window_set_min_content_width (GTK_SCROLLED_WINDOW (sw), 1);
prefs.hex_gui_ulist_show_hosts ?
GTK_POLICY_AUTOMATIC :
GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC);
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,15 +110,6 @@ enum
TARGET_COMPOUND_TEXT
};
enum
{
PROP_0,
PROP_HADJUSTMENT,
PROP_VADJUSTMENT,
PROP_HSCROLL_POLICY,
PROP_VSCROLL_POLICY
};
/* Selection targets for PRIMARY selection / copy-paste.
*
@@ -167,8 +158,7 @@ gtk_xtext_install_selection_targets (GtkWidget *widget)
static guint xtext_signals[LAST_SIGNAL];
G_DEFINE_TYPE_WITH_CODE (GtkXText, gtk_xtext, GTK_TYPE_WIDGET,
G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
G_DEFINE_TYPE (GtkXText, gtk_xtext, GTK_TYPE_WIDGET)
char *nocasestrstr (const char *text, const char *tofind); /* util.c */
int xtext_get_stamp_str (time_t, char **);
@@ -178,13 +168,9 @@ static gboolean gtk_xtext_is_selecting (GtkXText *xtext);
static char *gtk_xtext_selection_get_text (GtkXText *xtext, int *len_ret);
static textentry *gtk_xtext_nth (GtkXText *xtext, int line, int *subline);
static void gtk_xtext_adjustment_changed (GtkAdjustment * adj,
GtkXText * xtext);
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);
@@ -808,9 +794,6 @@ 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));
@@ -903,66 +886,6 @@ 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)
{
@@ -1029,11 +952,6 @@ 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)
{
@@ -3006,13 +2924,6 @@ 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),
@@ -4919,12 +4830,13 @@ 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;
gint off1, off2, curlen;
GSList *cursl;
offsets_t marks;
offlen_t *meta;
off1 = 0;
curlen = 0;
cursl = slp;
while (cursl)
{
@@ -4934,6 +4846,7 @@ 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);
@@ -4948,6 +4861,7 @@ 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,9 +134,6 @@ 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

@@ -313,8 +313,7 @@ fe_print_text (struct session *sess, char *text, time_t stamp,
gboolean no_activity)
{
int dotime = FALSE;
int comma, k, i = 0, j = 0;
size_t len = strlen (text);
int comma, k, i = 0, j = 0, len = strlen (text);
unsigned char *newtext = g_malloc (len + 1024);

View File

@@ -26,19 +26,12 @@
#include <windows.h>
#include <cstdlib>
#include <climits>
#include "typedef.h" // for ssize_t
#include <enchant-provider.h>
ENCHANT_PLUGIN_DECLARE ("win8")
static int
size_to_int (size_t value)
{
return value > static_cast<size_t>(INT_MAX) ? INT_MAX : static_cast<int>(value);
}
static char *
utf16_to_utf8 (const wchar_t * const str, bool from_bcp47)
{
@@ -143,7 +136,7 @@ static void
win8_dict_add_to_personal (EnchantDict *dict, const char *const word, size_t len)
{
auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false);
checker->Add (wword);
std::free (wword);
@@ -153,7 +146,7 @@ static void
win8_dict_add_to_session (EnchantDict *dict, const char *const word, size_t len)
{
auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false);
checker->Ignore (wword);
std::free (wword);
@@ -163,7 +156,7 @@ static int
win8_dict_check (EnchantDict *dict, const char *const word, size_t len)
{
auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false);
IEnumSpellingError *errors;
ISpellingError *error = nullptr;
HRESULT hr;
@@ -191,7 +184,7 @@ static char **
win8_dict_suggest (EnchantDict *dict, const char *const word, size_t len, size_t *out_n_suggs)
{
auto checker = static_cast<ISpellChecker*>(dict->user_data);
wchar_t *wword = utf8_to_utf16 (word, size_to_int (len), false);
wchar_t *wword = utf8_to_utf16 (word, static_cast<int>(len), false);
IEnumString *suggestions;
HRESULT hr;

View File

@@ -30,8 +30,8 @@ PrivilegesRequired=none
ShowComponentSizes=no
CreateUninstallRegKey=not IsTaskSelected('portable')
Uninstallable=not IsTaskSelected('portable')
ArchitecturesAllowed=x64compatible
ArchitecturesInstallIn64BitMode=x64compatible
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
MinVersion=6.1
WizardImageFile={#PROJECTDIR}wizardimage.bmp
WizardSmallImageFile={#PROJECTDIR}wizardsmallimage.bmp
@@ -56,6 +56,7 @@ 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
@@ -172,9 +173,11 @@ 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

@@ -1 +1 @@
2.18.1
2.18.0~pre6

View File

@@ -40,6 +40,11 @@ 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}
@@ -68,6 +73,7 @@ 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}
@@ -115,6 +121,8 @@ 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
@@ -145,6 +153,7 @@ 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}