NEERAJ SOLANKI wrote:
> Hi,
> I want to draw poly lines using Gtk+ over DirectFB backend.
> The code i am using, is given below.
> 
> GdkGCValues values;
> 
> values.line_width = 15;
> values.line_style = GDK_LINE_ON_OFF_DASH;
> values.cap_style = GDK_CAP_ROUND;
> values.join_style = GDK_JOIN_BEVEL;
> 
> gdk_gc_set_values (GdkGraphDescPool[gdkGraphDesc].gc, &values,
> GDK_GC_LINE_WIDTH | GDK_GC_LINE_STYLE | GDK_GC_CAP_STYLE | GDK_GC_JOIN_STYLE);
> /*for (i = 0; i < nPoints-1; i++) { 
> gdk_draw_line (GdkImageDescPool[GdkGraphDescPool[gdkGraphDesc].gid].pixmap, 
> GdkGraphDescPool[gdkGraphDesc].gc, points[i].x, points[i].y, points[i+1].x, 
> points[i+1].y);
> }*/
> 
> gdk_draw_lines(GdkImageDescPool[GdkGraphDescPool[gdkGraphDesc].gid].pixmap,GdkGraphDescPool[gdkGraphDesc].gc,points,
>  (gint)nPoints);
> 
> 
> I am facing problem regarding line attributes.
> The line attributes (e.g. line width, line style, cap style, join style) that 
> i am setting has no effect on output.
> For example, line width in the output, is same irrespective of "line_width" 
> value in the code.
> 
> I think the setting the attributes of line is not supported in DirectFB. 

Sad, but true. It should be in the API at least. A software implementation could
be done later and should not be enabled by default, like the smooth scaling.

Some ideas (IDirectFBSurface):

- SetLineAttributes( width, style, cap, join )

All in one, or:

- SetLineWidth( width )
- ...


Better all in one, but with extensibility without changing the method(s):

- struct DFBLineAttributes (flags, width, ...)
- enum DFBLineAttibutesFlags (DLAF_WIDTH,...)
- SetLineAttributes( const DFBLineAttributes *attributes )
   (NULL = reset to defaults)

Should unset flags mean 'current' or 'default' value?

-- 
Best regards,
   Denis Oliver Kropp

.------------------------------------------.
| DirectFB - Hardware accelerated graphics |
| http://www.directfb.org/                 |
"------------------------------------------"

_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to