aboutsummaryrefslogtreecommitdiff
path: root/plugins/omemo/vapi
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2022-09-16 11:23:18 +0200
committerfiaxh <git@lightrise.org>2022-09-18 20:30:24 +0200
commit7ad52d9335579d03613036a7da9967fcf0c5d6b3 (patch)
treeda4d394e95b34be9989601d20126eb766cd250c6 /plugins/omemo/vapi
parentb8e84c83268a11ae41ad1d673999362427fd755c (diff)
downloaddino-7ad52d9335579d03613036a7da9967fcf0c5d6b3.tar.gz
dino-7ad52d9335579d03613036a7da9967fcf0c5d6b3.zip
OMEMO QR code: Switch to paintable, fix css
Diffstat (limited to 'plugins/omemo/vapi')
-rw-r--r--plugins/omemo/vapi/libqrencode.vapi9
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/omemo/vapi/libqrencode.vapi b/plugins/omemo/vapi/libqrencode.vapi
index 79f98b62..360f74a5 100644
--- a/plugins/omemo/vapi/libqrencode.vapi
+++ b/plugins/omemo/vapi/libqrencode.vapi
@@ -1,5 +1,3 @@
-using Gdk;
-
[CCode (cheader_filename = "qrencode.h")]
namespace Qrencode {
@@ -36,13 +34,14 @@ namespace Qrencode {
[CCode (cname = "QRcode_encodeString")]
public QRcode (string str, int version = 0, ECLevel level = ECLevel.L, EncodeMode hint = EncodeMode.EIGHT_BIT, bool casesensitive = true);
- public Pixbuf to_pixbuf(int module_size) {
+ public Gdk.Paintable to_paintable(int module_size) {
GLib.assert(module_size > 0);
var dst_width = width*module_size;
var dst_data = new uint8[dst_width*dst_width*3];
expand_and_upsample(data,width,width, dst_data,dst_width,dst_width);
- return new Pixbuf.from_data(dst_data,
- Colorspace.RGB, false, 8, dst_width, dst_width, dst_width*3);
+ return new Gdk.MemoryTexture(dst_width, dst_width, Gdk.MemoryFormat.R8G8B8,
+ new GLib.Bytes.take((owned) dst_data), dst_width*3);
+
}
/** Does 2D nearest-neighbor upsampling of an array of single-byte