5f8dcd286e
Added the xtext_adjustment_apply helper to consolidate GTK2/GTK3 adjustment updates and direct field assignments.
...
Updated adjustment setup and GTK3 buffer refresh logic to use the new helper and keep page increment/signaling handling consistent.
2026-01-30 07:26:54 -07:00
4cfe5274b5
Updated GtkAdjustment helper guards to use explicit !HAVE_GTK3 branches for direct field access while keeping GTK3 accessors in the HAVE_GTK3 path.
2026-01-30 07:20:43 -07:00
f6613cbad1
Added GtkAdjustment helper accessors for value/upper/lower/page size/page increment to encapsulate GTK3 accessors and GTK2 struct fields.
...
Updated xtext adjustment logic to use the helpers in adjustment updates and rendering paths, eliminating direct field access in scroll/render flows.
2026-01-30 07:15:06 -07:00
3806b33aab
Split GTK3 vs GTK2 setup in gtk_xtext_realize so GTK2-only parent window/colormap access is guarded under #if !HAVE_GTK3.
2026-01-30 06:57:14 -07:00
fa3c7c9059
Consolidated GTK3 realization setup to use parent window/visual and keep GTK2-only colormap/parent window under the GTK2 branch in gtk_xtext_realize.
2026-01-30 06:20:21 -07:00
c0c0b2ec4c
Moved GTK2-only parent window and colormap handling into the GTK2 code path while keeping GTK3 setup relying on gtk_widget_get_parent_window and visual-only attributes in gtk_xtext_realize.
2026-01-29 23:06:21 -07:00
d553862e52
Guarded the GtkXText double-buffering toggle behind a GTK3 compile check and added a GTK3 render pipeline note in gtk_xtext_new
2026-01-29 23:01:02 -07:00
7cbd905fae
Guarded GTK2-only GtkObjectClass declaration/assignment with explicit #if !HAVE_GTK3 checks in gtk_xtext_class_init.
2026-01-29 22:57:13 -07:00
49e23b7df5
Added a GTK3 finalize handler for GtkXText that chains to the parent class alongside the existing dispose cleanup path.
...
Registered the GTK3 finalize handler in gtk_xtext_class_init while keeping GTK2 destroy registration intact.
2026-01-29 22:49:13 -07:00
bf529ba1ff
Guarded GTK2-only GtkObject includes in the xtext header for GTK2 builds only.
...
Added a shared cleanup helper plus GTK2 destroy/GTK3 dispose handlers with correct parent chaining for cleanup parity across GTK versions.
Updated class initialization to register GTK3 dispose or GTK2 destroy handlers with appropriate object class setup.
2026-01-29 22:44:54 -07:00
aa0b271aa9
Made GTK2 window access explicitly guarded in scroll/selection update code paths to keep GTK3 using gtk_widget_get_window.
...
Applied the same explicit GTK3/GTK2 window guards in render paths to keep direct GTK2 field access isolated.
2026-01-29 22:07:58 -07:00
1584764809
Consolidated gtk_xtext_size_allocate to use a guarded window pointer before resizing, preserving GTK3 gtk_widget_get_window and GTK2 direct access paths.
...
Aligned GTK3/GTK2 window selection blocks in scrolling/selection and render routines (including gtk_xtext_render_page) to use #else guards for GTK2 direct access.
2026-01-29 21:57:50 -07:00
31130197eb
Routed window access in scroll/selection helpers through guarded GTK3 window lookups while retaining GTK2 field access under #if !HAVE_GTK3.
...
Consolidated window handling in layout, render, visibility, and buffer display paths to avoid direct GTK2 window fields in GTK3 builds.
2026-01-29 21:45:57 -07:00
723d8759ff
Wrapped size allocation and window resize handling with explicit GTK3/GTK2 guards for allocation/window access while preserving GTK2 field usage under !HAVE_GTK3.
...
Applied explicit GTK3/GTK2 window access guards across render/scroll/buffer sizing paths, including gtk_xtext_render_page and gdk_window_get_width/height callsites.
2026-01-29 21:35:06 -07:00
667a56ca6c
Added GTK3 window guard handling for scrolling/selection height calculations while keeping GTK2 direct window access for those paths.
...
Switched sizing/visibility calculations and buffer show sizing to use GTK3 window retrieval with GTK2 fallbacks in layout/rendering paths.
2026-01-29 21:21:40 -07:00
c009c30211
Updated size allocation and draw/paint paths to use GTK3 allocation accessors while preserving GTK2 direct field access under guards.
...
Switched render-page and input/cursor handling to use gtk_widget_get_window on GTK3 with guarded window usage, keeping GTK2 behavior intact.
2026-01-29 21:14:09 -07:00
d4d2483161
Updated the GTK3 adjustment update path in gtk_xtext_buffer_show to explicitly set adjustment bounds/page sizing and emit value-changed, while keeping GTK2 behavior unchanged.
2026-01-25 15:16:37 -07:00
361308962e
Routed GTK3 render-time adjustment updates through gtk_xtext_adjustment_set to apply setter updates and emit value-changed, while keeping the GTK2 path on gtk_adjustment_changed
2026-01-25 13:58:11 -07:00
e0c8409971
Updated GTK3 adjustment updates in gtk_xtext_adjustment_set to use GtkAdjustment setters and gtk_adjustment_value_changed, preserving the GTK2 path with gtk_adjustment_changed.
...
Adjusted GTK3 buffer-show scroll value updates and change signaling to rely on adjustment accessors while keeping the GTK2 flow intact.
2026-01-25 13:07:55 -07:00
08d357dc98
Added explicit GTK3-only branches in gtk_xtext_unrealize() so gtk_widget_get_window() is used without GTK2 struct access leaking into the GTK3 path.
...
Split the GTK3 and GTK2 initialization paths in gtk_xtext_realize() so the GTK3 branch uses gtk_widget_get_allocation()/gtk_widget_get_parent_window() and the GTK2 branch keeps the direct struct access under #if !HAVE_GTK3.
2026-01-23 22:08:17 -07:00
0df299acf5
Updated gtk_xtext_unrealize() to use GTK3 accessors (gtk_widget_get_window(), gtk_widget_set_window(), and gtk_widget_set_realized()) while keeping the GTK2 struct access in the #if !HAVE_GTK3 branch.
...
Consolidated the GTK3 vs GTK2 branching in gtk_xtext_realize() so GTK3 uses gtk_widget_get_allocation(), gtk_widget_get_parent_window(), and gtk_widget_set_window(), with the existing GTK2 direct struct access preserved under #if !HAVE_GTK3.
2026-01-23 22:00:36 -07:00
00eb2de4c8
Split the GTK3 and GTK2 branches in gtk_xtext_unrealize() so GTK3 uses gtk_widget_get_window() while the GTK2 path remains under #if !HAVE_GTK3 with direct struct access.
...
Split the GTK3 and GTK2 branches in gtk_xtext_realize() so GTK3 uses gtk_widget_get_allocation(), gtk_widget_get_parent_window(), and gtk_widget_set_window(), while keeping the existing GTK2 struct access under #if !HAVE_GTK3.
2026-01-23 21:55:46 -07:00
f65f350965
Moved gtk_widget_set_realized() into the GTK3 branch and used GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED) for GTK2, keeping allocation/parent-window access split by #if HAVE_GTK3
2026-01-23 21:52:40 -07:00
1d32aed8dc
Added a GTK3-specific branch in gtk_xtext_unrealize() that clears user data via gtk_widget_get_window() while preserving the GTK2 struct access under #if !HAVE_GTK3.
...
Updated gtk_xtext_realize() to use gtk_widget_get_allocation(), gtk_widget_get_parent_window(), and gtk_widget_set_window() on GTK3, and routed all subsequent window usage through the local window variable instead of direct struct access; the GTK2 path remains intact under #if !HAVE_GTK3.
Adjusted gtk_xtext_clear_background() to use gtk_widget_get_window() on GTK3 rather than widget->window.
2026-01-23 21:40:22 -07:00
5715245080
Updated the GTK3 pointer position query to use gdk_device_get_position without a temporary screen variable while keeping GTK2/GTK3 code paths split by HAVE_GTK3.
2026-01-23 00:38:14 -07:00
796c991dd8
Guarded cursor unref with a null check while keeping GTK2/GTK3-specific cleanup behavior centralized.
...
Added a helper to clear window backgrounds using GTK2/GTK3-specific APIs and used it during widget realize.
2026-01-23 00:32:59 -07:00
7ac74220c4
Added a GTK3-safe null guard before unrefing cursors while keeping GTK2 behavior under !HAVE_GTK3.
...
Added a GTK3 pointer-device null fallback in gtk_xtext_get_pointer to safely handle missing devices before using gdk_device_get_position.
2026-01-23 00:27:02 -07:00
5596c8825b
Added a GTK2/GTK3-compatible cursor unref helper to centralize cleanup logic.
...
Switched cursor destruction to use the new helper in the widget teardown path.
2026-01-22 23:32:50 -07:00
a05c064466
Wrapped GTK2-only cursor cleanup with #if !HAVE_GTK3, keeping GTK3 paths on g_object_unref.
...
Moved GTK2 pointer/background calls into #if !HAVE_GTK3 blocks, leaving GTK3-compatible implementations in #else.
2026-01-22 23:28:24 -07:00
ae86a8db0f
Added a GTK3-aware pointer helper that uses gdk_device_get_position while retaining GTK2 behavior under #if !HAVE_GTK3.
...
Wrapped GTK2-only cursor unref and background pixmap calls with GTK3-compatible g_object_unref and gdk_window_set_background_pattern alternatives.
2026-01-22 23:24:43 -07:00
cf41615cb3
- Reworked GTK window snapshotting in the main GUI to capture into cairo surfaces and convert via gdk_pixbuf_get_from_surface.
...
- Added a Cairo surface → RGBA pixbuf conversion helper that unpremultiplies ARGB32 data for GTK2 compatibility while keeping window snapshots Cairo-based.
- Updated window snapshotting to use the new Cairo surface conversion instead of gdk_pixbuf_get_from_surface
2026-01-17 22:25:12 -07:00
c1f855c2ab
- Updated main GUI color helpers and tab palette generation to use XTextColor, and simplified drag icon snapshotting to use gdk_pixbuf_get_from_window with a null guard.
...
- Added pixbuf-based cairo surface capture for xtext window scrolling with a fallback to full redraw when capture fails.
2026-01-17 21:56:00 -07:00
4ac836fc66
- Added a shared XTextColor definition and a palette conversion helper for Cairo-ready colors, decoupling renderer palettes from GdkColor usage in the API surface.
...
- Updated xtext palette APIs to accept internal color arrays directly for rendering setup.
- Wired xtext palette creation through UI entry points to use the new palette helper when constructing or refreshing text views.
2026-01-17 21:39:45 -07:00
0601be026c
- Converted text background loading to build Cairo surfaces directly from pixbufs for renderer use.
...
- Updated the xtext renderer to accept Cairo background surfaces and dropped the GtkStyle attach during realize to keep rendering Cairo/Pango-focused.
- Switched background surface ownership and cleanup to use cairo_surface_t across the shared state and settings update path.
2026-01-17 18:19:00 -07:00
24b0a3d75f
- Introduced the XTextColor struct and stored xtext palette/foreground/background colors in internal renderer state rather than GdkColor fields.
...
- Converted palette colors and background pixmaps into cairo-ready values/surfaces for rendering (including background tiling and separator colors).
2026-01-17 17:44:49 -07:00
2ac5234803
- Added Cairo-based window snapshot conversion (with unpremultiplication) for drag icons and updated drag rendering to use the new helper instead of drawable capture.
...
- Updated GtkXText to track the draw window and use a pixmap-to-surface helper for Cairo contexts, avoiding drawable references in the struct and rendering flow.
- Added a Cairo helper for capturing window-backed surfaces and used it when blitting during scrolling, fixing the build break from the removed drawable helper.
2026-01-17 17:34:38 -07:00
30e309853c
Added the required gdk/gdk.h include before gdkcairo.h in maingui.c to satisfy GDK header include order requirements on Windows builds.
...
Added cairo surface tracking and context creation helpers for xtext rendering, including state initialization for the new draw surface field.
Replaced GdkPixmap-based offscreen text buffering with cairo surfaces and routed rendering/underline/strikethrough operations through the cairo context helper.
2026-01-17 16:56:35 -07:00
944ce69906
Added a Cairo color helper for drag highlight rendering and applied it to the drag motion drawing path.
...
Replaced GDK source helpers in the text rendering pipeline with Cairo surface/color helpers for lines, backgrounds, and blits.
Updated render sizing to use window dimensions and switched window copy paths to Cairo surfaces.
2026-01-17 16:46:21 -07:00
5ea424d0e8
start of ciaro implementation.
2026-01-17 16:08:00 -07:00
4683ef705b
new name after fork
2026-01-05 23:12:38 -07:00
Collin Funk
180ce9f4fd
Change various types to the correct signedness to avoid warnings.
...
Also cast the check of "inet_addr" to guint32. The POSIX declaration
of this function returns in_addr_t which is the same as uint32_t.
Windows does not define this type and instead uses unsigned long.
2024-01-29 09:06:29 -06:00
Sadie Powell
46c9df1863
Fix various compiler warnings.
...
fish.c: -Wincompatible-pointer-types
fkeys.c: -Wmisleading-indentation
proto-irc.c: -Wincompatible-pointer-types
util.c: -Wdeprecated-declarations
xtext.c: -Wmaybe-uninitialized
2022-08-29 13:50:03 -05:00
Sadie Powell
55e4f1c42e
Implement support for strikethrough text.
...
https://defs.ircdocs.horse/info/formatting.html
2021-06-20 10:39:39 -05:00
John Levon
163608d7fd
Use pango_font_metrics_get_height() to calculate font height ( #2500 )
2020-09-07 18:53:31 +02:00
Patrick Griffis
eb942fc274
Revert "xtext: Always use Pango to get correct glyph width on Unix"
...
This reverts commit d3f1ab7813 .
The performance even on Linux is just too poor in many cases.
2018-03-13 21:18:16 -04:00
Patrick Griffis
7510ab36b7
xtext: Fix accidental truncation
...
Fixes #2121
2018-02-11 17:24:32 -05:00
Peng Wu
d3f1ab7813
xtext: Always use Pango to get correct glyph width on Unix
...
This should be slower but pango seems to be reasonably fast
on Unix though extremely slow on Windows.
https://bugzilla.redhat.com/show_bug.cgi?id=1536298
2018-02-06 17:06:50 -05:00
Patrick Griffis
4cdf6460b6
xtext: Fix invalid utf-8 from truncation
2018-02-06 17:06:50 -05:00
Patrick Griffis
5d3bf39103
xtext: Remove unused code
2018-02-06 17:06:50 -05:00
Rodri
4a228d1efe
This patch hopefully solves a bug that causes that when a tab (channel or private) is left with the scrollbar at the bottom, and some new text arrives, and then we select again that tab, sometimes the scrollbar is not completely down and there is hidden text and we have to scroll manually to the bottom to show all text.
...
This was previously submitted as an issue in: https://github.com/hexchat/hexchat/issues/1948
Maybe it isn't the ideal way to solve it, but at least I tested it and it seems to work.
2018-01-18 15:07:14 -05:00