Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 226611 Details for
Bug 331321
Ugly X lines
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Little Xlib test program
xlines.c (text/x-csrc), 1.32 KB, created by
Pat Kane
on 2007-10-14 12:30:50 UTC
(
hide
)
Description:
Little Xlib test program
Filename:
MIME Type:
Creator:
Pat Kane
Created:
2007-10-14 12:30:50 UTC
Size:
1.32 KB
patch
obsolete
>#include <math.h> >#include <X11/Xlib.h> >/* > * Draw 0 and 1 width lines > * > * build with: gcc xlines.c -lX11 -o xlines -lm > * > * Pat Kane 2007 > */ >#define WIDTH 512 >#define HEIGHT 256 > >#define NSTEPS 64 > >Display * dpy; >Window win; >XEvent event; >int scrn; > >DrawLines(int xo, int yo, int width) >{ > float w, fx, fy; > int x1, y1, x2, y2; > > XSetLineAttributes(dpy, DefaultGC(dpy, scrn), width, LineSolid, CapNotLast, JoinMiter); > x1 = xo; y1 = yo; > for ( w = 0; w < (M_PI * 2); w += M_PI/NSTEPS) > { > fx = sin(w); fy = cos(w); > x2 = x1 + (fx * WIDTH/4); > y2 = y1 + (fy * HEIGHT/2); > XDrawLine (dpy, win, DefaultGC(dpy, scrn), x1, y1, x2, y2); > } >} > > >main() >{ > > if ((dpy = XOpenDisplay("")) == NULL) > { > printf("Can not connect to X server.\n"); > exit(1); > } > scrn = DefaultScreen(dpy); > > win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), > 0, 0, > WIDTH, HEIGHT, > 0, > BlackPixel(dpy,scrn), WhitePixel(dpy,scrn)); > > XSelectInput(dpy, win, KeyPressMask|ExposureMask|ButtonPressMask); > > XMapRaised(dpy,win); > > /* wait for first expose event */ > XWindowEvent(dpy, win, ExposureMask, &event); > > DrawLines(1*WIDTH/4, HEIGHT/2, 0); > DrawLines(3*WIDTH/4, HEIGHT/2, 1); > > /* wait for key or button */ > XWindowEvent(dpy, win, KeyPressMask|ButtonPressMask, &event); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 331321
: 226611