From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Panicz Maciej Godek <godek.maciek@gmail.com> Newsgroups: gmane.lisp.guile.user Subject: Re: Example usages of guile-cairo Date: Sat, 16 Jul 2016 10:05:45 +0200 Message-ID: <CAMFYt2aHs0ChZzEFMucvXnWp6tNO2H_AQSrJawArdg+TZRy1xQ@mail.gmail.com> References: <CAMFYt2aWLCOJxVqUtx-dj4P8oOPzUpD0R=QMfztPgy6Cn9P48w@mail.gmail.com> <20160715201922.GB12575@localhost.localdomain> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1468656393 31708 80.91.229.3 (16 Jul 2016 08:06:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Jul 2016 08:06:33 +0000 (UTC) To: "guile-user@gnu.org" <guile-user@gnu.org> Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jul 16 10:06:14 2016 Return-path: <guile-user-bounces+guile-user=m.gmane.org@gnu.org> Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from <guile-user-bounces+guile-user=m.gmane.org@gnu.org>) id 1bOKc1-0000Va-GC for guile-user@m.gmane.org; Sat, 16 Jul 2016 10:06:13 +0200 Original-Received: from localhost ([::1]:36398 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <guile-user-bounces+guile-user=m.gmane.org@gnu.org>) id 1bOKc0-00060h-7q for guile-user@m.gmane.org; Sat, 16 Jul 2016 04:06:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56475) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <godek.maciek@gmail.com>) id 1bOKbd-00060P-LT for guile-user@gnu.org; Sat, 16 Jul 2016 04:05:50 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <godek.maciek@gmail.com>) id 1bOKbb-0005ru-6x for guile-user@gnu.org; Sat, 16 Jul 2016 04:05:48 -0400 Original-Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:37970) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <godek.maciek@gmail.com>) id 1bOKba-0005rq-Rn for guile-user@gnu.org; Sat, 16 Jul 2016 04:05:47 -0400 Original-Received: by mail-wm0-x22f.google.com with SMTP id o80so56057236wme.1 for <guile-user@gnu.org>; Sat, 16 Jul 2016 01:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=vtA4aaGt3M4cYgpg1TCur3Szke46UR6N/PNdC0AkQl4=; b=T5lJlprGPdtf9FVHpj+Q2QVlqIEXYkaAVfW0CDWGKQZykLL4oedW+yqoLEi+3zGApo QBRKrFZb0OtRSi0Zj7CyJMNJL68OdH3a7qJ1C+kDUbbT09n7/m4KAn4J8zV20v8QsPI5 60+bhnUZMVEeSYvqQOWmXOyFrmicVBLDM3FKD1zOtdxmOL8cvKdVVXWWYEv1gB55NEee PzQt07SNzS/Zk7TcfrTZ6fAdgthLo5ZdIWsoI4EyCnXdF5Kn7J3EiUIM1v5TesGHFFI3 p86WSl5CIRBb7Qd7IzSBRchu4EZUkfAxUqebYe7voaklEihjTo5eH2NcDJta6CuaZZgp 77gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=vtA4aaGt3M4cYgpg1TCur3Szke46UR6N/PNdC0AkQl4=; b=ZByUD9fkVjjy76jKC/AzE1qZzDhBDf5qVcUOhuUo1FL3G8tUsf2eJNReIwY5Ib3fwJ VlJ+Qv6R7cPF0zcdsHyK5M4UPSvXKIF4ZnVikJSmPv8ci2p0TTaCVzo0sRGIWzkb2J9C pjj/s4ozl6BeJWBBgIstRFJ7pjGNPdUcL8GiB4fjS9CidPsP5R65BC9wXBY7b9BRavAY qjhdpBJAPdCsWaHfotzsSVKJMP4jLW9X8wFsQj4I52sA+my02sQgZpd4QUL+5bWqrql/ SYHLIZO3AxZQ4LSPfoIADXJx8LuVRBn6rVeaMCpVdErARpaN0LYn0rx47AixG+1k03wo 4Zbw== X-Gm-Message-State: ALyK8tJT9ujjkTLanVTEnasothqag0jSGgrLpgcxsT5/oK4yLxQQMQobTvAWdsbqVxxf46nG0jLEKdV4jNsnoQ== X-Received: by 10.194.246.1 with SMTP id xs1mr4458989wjc.22.1468656345660; Sat, 16 Jul 2016 01:05:45 -0700 (PDT) Original-Received: by 10.194.179.98 with HTTP; Sat, 16 Jul 2016 01:05:45 -0700 (PDT) In-Reply-To: <20160715201922.GB12575@localhost.localdomain> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::22f X-Content-Filtered-By: Mailman/MimeDel 2.1.21 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions <guile-user.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guile-user>, <mailto:guile-user-request@gnu.org?subject=unsubscribe> List-Archive: <http://lists.gnu.org/archive/html/guile-user/> List-Post: <mailto:guile-user@gnu.org> List-Help: <mailto:guile-user-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guile-user>, <mailto:guile-user-request@gnu.org?subject=subscribe> Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" <guile-user-bounces+guile-user=m.gmane.org@gnu.org> Xref: news.gmane.org gmane.lisp.guile.user:12762 Archived-At: <http://permalink.gmane.org/gmane.lisp.guile.user/12762> Hi, thanks for your reply -- I think I have solved it (although I took a slightly different approach*) -- the problem was probably that the scale was too small for anything to be visible, and it was sufficient to enlarge the values of points. Of course, if you publish your examples, as it is always a pleasure to read other people's ideas :) *the approach was to write my own bindings to cairo, as I intended to integrate it with my SDL-based framework anyway, so I wrote a module inspired by cairosdl, with a slightly more scheme-style API, i.e. instead of passing the cairo context explicitly to each function, one uses the notion of current drawing context (like there is the notion of current output port for the display; the difference is that I didn't reify the drawing context yet), e.g. (let ((image (make-image 320 200))) (with-output-to-surface image (lambda () (set-source-rgb! 0 0 0) (move-to! 0 0) (line-to! 320 240) (move-to! 320 0) (line-to! 0 240) (set-line-width! 2) (stroke!) image))) The code is far from complete and far from perfect, but it is available in the SLAYER repository, in case anybody wanted to check it: https://bitbucket.org/panicz/slayer/src/ae322e1a1ad21564c4aba3b662ba3d5861eea026/src/drawing.c?at=2-vector-graphics&fileviewer=file-view-default 2016-07-15 22:19 GMT+02:00 Vladimir Zhbanov <vzhbanov@gmail.com>: > Hi Panicz, > > Have you solved your issue? > > If not, I would recommend to look at README in your guile-cairo > distribution, it contains some example code. BTW, I have also > prototyped some C code to make a grid pattern using guile-cairo > and gnome-gtk and have a little scheme example that I could > publish if you're still interested. > > -- > Vladimir > >