.\" Copyright (c) 2002-2007 Hypertriton, Inc. .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, .\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES .\" (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR .\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING .\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" .Dd August 20, 2002 .Dt AG_FIXED_PLOTTER 3 .Os .ds vT Agar API Reference .ds oS Agar 1.0 .Sh NAME .Nm AG_FixedPlotter .Nd agar integer plot widget .Sh SYNOPSIS .Bd -literal #include #include .Ed .Sh DESCRIPTION The .Nm widget is a scrollable plotter widget that accepts integer values. It is mainly designed for displaying performance measurements. .Pp A much more featureful, floating-point plotter is available as .Xr SC_Plotter 3 . .Sh INHERITANCE HIERARCHY .Xr AG_Object 3 -> .Xr AG_Widget 3 -> .Nm . .Sh INITIALIZATION .nr nS 1 .Ft "AG_FixedPlotter *" .Fn AG_FixedPlotterNew "AG_Widget *parent, enum ag_fixed_plotter_type type" "Uint flags" .Pp .nr nS 0 The .Fn AG_FixedPlotterNew function allocates, initializes, and attaches a new .Nm widget. The .Fa type argument is one of: .Pp .Bd -literal enum ag_fixed_plotter_type { AG_FIXED_PLOTTER_POINTS, /* Dots */ AG_FIXED_PLOTTER_LINES /* Lines */ } type; .Ed .Pp The .Fa flags may include: .Pp .Bl -tag -width "AG_FIXED_PLOTTER_SCROLL " .It AG_FIXED_PLOTTER_SCROLL Always scroll to the end of the plot if it is not visible. .It AG_FIXED_PLOTTER_XAXIS Display the X-axis line. .El .Sh PLOTTING .nr nS 1 .Ft "AG_FixedPlotterCurve *" .Fn AG_FixedPlotterCurve "AG_FixedPlotter *fpl, const char *name" "Uint8 r, Uint8 g, Uint8 b, Uint32 limit" .Pp .Ft void .Fn AG_FixedPlotterDatum "AG_FixedPlotterCurve *curve" "AG_FixedPlotterValue val" .Pp .nr nS 0 The .Fn AG_FixedPlotterCurve function creates a new curve into .Fa fpl . The .Fa r , .Fa g , .Fa b triplet composes a color to visually identify the item. .Fa limit is the maximum number of points (if 0, the maximum is implicitely .Dv INT_MAX - 1). .Pp The .Fn AG_FixedPlotterDatum function adds a value .Fa val to the specified .Fa curve . .Sh EVENTS The .Nm widget reacts to the following events: .Pp .Bl -tag -compact -width "window-mousebuttondown" .It window-mousemotion Scroll (x motion) or change the origin position (y motion). .It window-keydown Key 0 moves to offset 0, left key scrolls left, right key scrolls right, .It window-mousebuttonup Stop moving. .It window-mousebuttondown Start moving. .El .Pp The .Nm widget does not generate any event. .Sh STRUCTURE DATA For the .Ft AG_FixedPlotter object: .Pp .Bl -tag -width "enum ag_fixed_plotter_type type " .It Ft enum ag_fixed_plotter_type type Drawing method, initially set by .Fn AG_FixedPlotterNew . .El .Sh SEE ALSO .Xr AG_Intro 3 , .Xr AG_Widget 3 , .Xr AG_Window 3 .Sh HISTORY The .Nm widget first appeared in Agar 1.0.