Owen Taylor | 1 Dec 2002 08:00
Picon
Favicon

Small Xr example


People may find the following example:

  http://people.redhat.com/otaylor/x/xr-knockout-example.c
  http://people.redhat.com/otaylor/x/xr-knockout-example.png

useful. It contains:

 - The Xlib boilerplate needed to get a window up on the screen,
   handle exposes, etc.
 - Expose compression code. (needed pretty badly until we get
   a bit faster code for RENDER in the server)
 - A simple oval_path routine for drawing circles.
 - An example of using operators other than Over and Saturate

The knockout in the name does not indicate that it's especially 
pretty; it just means that the example has to do with effects
similar to knockout-groups in PDF-1.4.

You can compile it with a makefile like:

===
CFLAGS=-I/opt/xf/include/ -Wall -O2
LIBS=-L/opt/xf/lib/ -lXr -lXc -lXft -lXrender -lXext -lX11 -lm

xr-knockout-example: xr-knockout-example.o
        $(CC) -o $ <at>  $< $(LIBS)
===

Regards,
(Continue reading)

Keith Packard | 1 Dec 2002 08:49
Favicon
Gravatar

Re: Small Xr example


Some people might find the following patch helpful for Owen's nice example 
program.  (He's apparantly using C++ compilers these days).

I would like an idea if the Xr API was in any way a hinderence in this 
little activity.

-keith

*** xr-knockout-example.c.owen	2002-11-30 23:46:54.000000000 -0800
--- xr-knockout-example.c	2002-11-30 23:46:27.000000000 -0800
***************
*** 78,86 ****
               int x,     int y,
               int width, int height)
  {
-     XrSave (r);
      int i, j;

  #define CHECK_SIZE 32

      XrSetRGBColor (r, 0.4, 0.4, 0.4);
--- 78,86 ----
               int x,     int y,
               int width, int height)
  {
      int i, j;

+     XrSave (r);
  #define CHECK_SIZE 32
(Continue reading)

Vadim Plessky | 1 Dec 2002 15:37
Picon

Re: Small Xr example

On Sunday 01 December 2002 10:00 am, Owen Taylor wrote:
|  People may find the following example:
|
|    http://people.redhat.com/otaylor/x/xr-knockout-example.c
|    http://people.redhat.com/otaylor/x/xr-knockout-example.png
|

Speaking about Xr/Xc (and libsvg, libxrsvg):
 has someone prepared SRPM/binary RPM of those?

I have problem to  build Xr/Xc (trying from snapshots Carl did some time ago) 
*outside* of XFree86 CVS tree.
Carl gave me a few tips, but it seems none of those works.

Is it possible to prepare slef-compiling package out of those (just like 
FontConfig nowdays)?
Owen: do you plan to prepare RPM for Rawhide?

Many thanks in advance for any help,

Vadim

|  useful. It contains:
|
|   - The Xlib boilerplate needed to get a window up on the screen,
|     handle exposes, etc.
|   - Expose compression code. (needed pretty badly until we get
|     a bit faster code for RENDER in the server)
|   - A simple oval_path routine for drawing circles.
|   - An example of using operators other than Over and Saturate
(Continue reading)

Vadim Plessky | 1 Dec 2002 15:55
Picon

Re: Small Xr example

On Sunday 01 December 2002 10:49 am, Keith Packard wrote:
|  Some people might find the following patch helpful for Owen's nice example
|  program.  (He's apparantly using C++ compilers these days).
|

Is there any progress with gradients in Xr/Xc?
Support for gradients is required even for rather simple (2K-3K) SVG drawings.
See, for example, my Forward icon (attached), which is rendered quite well by 
librsvg-2.1.1 from GNOME CVS
(ftp://ftp.gnome.org/ftp/mirror/gnome.org/sources/librsvg/2.1)
As support for gradients (to some extent) is in librsvg2, can it be 
"backported" to Xr/Xc?

Attached drawing is done in Sodipodi (not in Adobe Illustrator or CorelDRAW), 
so I hardly believe this example can be treated as a complex one or difficult 
to handle :-)

|  I would like an idea if the Xr API was in any way a hinderence in this
|  little activity.
|
|  -keith
|
|  *** xr-knockout-example.c.owen	2002-11-30 23:46:54.000000000 -0800
|  --- xr-knockout-example.c	2002-11-30 23:46:27.000000000 -0800
[...]
|  _______________________________________________
|  Render mailing list
|  Render <at> XFree86.Org
|  http://XFree86.Org/mailman/listinfo/render

(Continue reading)

Owen Taylor | 1 Dec 2002 17:07
Picon
Favicon

Re: Small Xr example


Keith Packard <keithp <at> keithp.com> writes:

> Some people might find the following patch helpful for Owen's nice example 
> program.  (He's apparantly using C++ compilers these days).

Thanks; I've become a little sloppy with taking advantage of that
gcc extension recently, since it's now only practically wrong
(not many C99 compilers out there yet) rather than morally wrong.

> I would like an idea if the Xr API was in any way a hinderence in this 
> little activity.

Most of what I noticed was a subset of things in my original mail:

 - No convenience function for circular arcs.

 - No ability to use a surface for the source of fill or stroke

 - Couldn't control the format of group buffers, so I had
   to use a full RGBA buffer for the stencil buffer.

 - The sequence:

    XrPushGroup (r);
    draw_3circles (r, xc, yc, radius);
    XrSetOperator (r, XrOperatorOutReverse);
    XrPopGroup (r);

   Still doesn't seem natural to me; I think we need to find some
(Continue reading)

Owen Taylor | 1 Dec 2002 17:31
Picon
Favicon

Re: Small Xr example


Vadim Plessky <lucy-ples <at> mtu-net.ru> writes:

> On Sunday 01 December 2002 10:00 am, Owen Taylor wrote:
> |  People may find the following example:
> |
> |    http://people.redhat.com/otaylor/x/xr-knockout-example.c
> |    http://people.redhat.com/otaylor/x/xr-knockout-example.png
> |
> 
> Speaking about Xr/Xc (and libsvg, libxrsvg):
>  has someone prepared SRPM/binary RPM of those?
> 
> I have problem to  build Xr/Xc (trying from snapshots Carl did some time ago) 
> *outside* of XFree86 CVS tree.
> Carl gave me a few tips, but it seems none of those works.

I had good luck just grabbing them from CVS (http://keithp.com/cvs.html)
and doing 'xmkmf; make; sudo make install' in Xc then Xr. Total time,
maybe 2 minutes.

Caveats:

 - I only tested with my installed XFree86 being CVS, not with 4.2.0; should 
   certainly work with the Mike Harris's 4.2.99 snapshots, in any case.
 - This will install files into your installed XFree86 root; it's
   not a huge mess though, since it's only two files per library or so.

> Is it possible to prepare slef-compiling package out of those (just like 
> FontConfig nowdays)?
(Continue reading)

Vadim Plessky | 1 Dec 2002 18:28
Picon

Re: Small Xr example

On Sunday 01 December 2002 7:31 pm, Owen Taylor wrote:
|  Vadim Plessky <lucy-ples <at> mtu-net.ru> writes:
|  > On Sunday 01 December 2002 10:00 am, Owen Taylor wrote:
[...]
|  >
|  > Speaking about Xr/Xc (and libsvg, libxrsvg):
|  >  has someone prepared SRPM/binary RPM of those?
|  >
|  > I have problem to  build Xr/Xc (trying from snapshots Carl did some time
|  > ago) *outside* of XFree86 CVS tree.
|  > Carl gave me a few tips, but it seems none of those works.
|
|  I had good luck just grabbing them from CVS (http://keithp.com/cvs.html)
|  and doing 'xmkmf; make; sudo make install' in Xc then Xr. Total time,
|  maybe 2 minutes.

Yes, code base is quite small, and it should build fine and quickly ... if you 
have XFree86 CVS (that's what Carl told me)
I have 
$ rpm -qa | grep XFree86
XFree86-libs-4.2.0-6mdk
XFree86-devel-4.2.0-6mdk
XFree86-xfs-4.2.0-6mdk
XFree86-4.2.0-6mdk
XFree86-75dpi-fonts-4.2.0-6mdk
XFree86-100dpi-fonts-4.2.0-6mdk
XFree86-server-4.2.0-6mdk

And quite confused by the fact that it doesn't build for me.

(Continue reading)

Georgina O Economou | 1 Dec 2002 19:17
Picon
Favicon

Re: Small Xr example

At 08:28 PM 12/1/2002 +0300, you wrote:
>On Sunday 01 December 2002 7:31 pm, Owen Taylor wrote:
>|  Vadim Plessky <lucy-ples <at> mtu-net.ru> writes:
>|  > On Sunday 01 December 2002 10:00 am, Owen Taylor wrote:
>[...]
>|  >
>|  > Speaking about Xr/Xc (and libsvg, libxrsvg):
>|  >  has someone prepared SRPM/binary RPM of those?
>|  >
>|  > I have problem to  build Xr/Xc (trying from snapshots Carl did some time
>|  > ago) *outside* of XFree86 CVS tree.
>|  > Carl gave me a few tips, but it seems none of those works.
>|
>|  I had good luck just grabbing them from CVS (http://keithp.com/cvs.html)
>|  and doing 'xmkmf; make; sudo make install' in Xc then Xr. Total time,
>|  maybe 2 minutes.
>
>Yes, code base is quite small, and it should build fine and quickly ... if 
>you
>have XFree86 CVS (that's what Carl told me)

I don't really understand this.  Do you need the XFree86 cvs with the 
Keithp CVS
or are they separate?  I thought that the Keithp CVS was self-standing.

Georgina
Vadim Plessky | 1 Dec 2002 19:32
Picon

Building Xr/Xc [Re: Small Xr example ]

On Sunday 01 December 2002 8:28 pm, Vadim Plessky wrote:
|  On Sunday 01 December 2002 7:31 pm, Owen Taylor wrote:
|  [...]
|  |  I had good luck just grabbing them from CVS
|  | (http://keithp.com/cvs.html) and doing 'xmkmf; make; sudo make install'
|  | in Xc then Xr. Total time, maybe 2 minutes.
|
|  Yes, code base is quite small, and it should build fine and quickly ... if
| you have XFree86 CVS (that's what Carl told me)
|  I have
|  $ rpm -qa | grep XFree86
|  XFree86-libs-4.2.0-6mdk
|  XFree86-devel-4.2.0-6mdk
|  XFree86-xfs-4.2.0-6mdk
|  XFree86-4.2.0-6mdk
|  XFree86-75dpi-fonts-4.2.0-6mdk
|  XFree86-100dpi-fonts-4.2.0-6mdk
|  XFree86-server-4.2.0-6mdk
|
|  And quite confused by the fact that it doesn't build for me.
|
|  [vad <at> VPlessky Xc]$ pwd
|  /usr/local/vadim/XrXc/XrXc-20021104/Xc

ok, I updated to CVS, 
[vad <at> VPlessky Xc]$ pwd
/usr/local/vadim/XrXc/cvs/Xc

and:
[vad <at> VPlessky Xc]$ xmkmf
(Continue reading)

Owen Taylor | 1 Dec 2002 20:17
Picon
Favicon

Re: Small Xr example


Vadim Plessky <lucy-ples <at> mtu-net.ru> writes:

> [vad <at> VPlessky Xc]$ pwd
> /usr/local/vadim/XrXc/XrXc-20021104/Xc
> 
> [vad <at> VPlessky Xc]$ xmkmf
> mv -f Makefile Makefile.bak
> imake -DUseInstalled -I/usr/X11R6/lib/X11/config
> [vad <at> VPlessky Xc]$ make
> [vad <at> VPlessky Xc]$ su
> Password:
> [root <at> VPlessky Xc]# make install
> + mkdir -p /usr/X11R6/include/X11/Xc
> + install -c -m 0444 Xc.h /usr/X11R6/include/X11/Xc
> install in . done
> [root <at> VPlessky Xc]#
> 
> Only xc.h is installed (in /usr/X11R6/include/X11/Xc)

No idea about that ... I doubt there have been any imake changes
that would affect something like that. 

[...]

> |  > Is it possible to prepare slef-compiling package out of those (just like
> |  > FontConfig nowdays)?
> |  > Owen: do you plan to prepare RPM for Rawhide?
> |
> |  I don't think they are ready for Rawhide -- rawhide can be quite raw, but
(Continue reading)


Gmane