"Fossies" - the Fresh Open Source Software Archive

Member "procmeter3-3.6+svn387/gtk2/widgets/PMBar.h" (24 Dec 2010, 2815 Bytes) of package /linux/misc/procmeter3-3.6+svn387.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "PMBar.h" see the Fossies "Dox" file reference documentation.

    1 /***************************************
    2   $Header: /home/amb/CVS/procmeter3/gtk2/widgets/PMBar.h,v 1.1 2007-09-19 19:04:34 amb Exp $
    3 
    4   ProcMeter Bar Widget include file (for ProcMeter3 3.3).
    5   ******************/ /******************
    6   Written by Andrew M. Bishop
    7 
    8   This file Copyright 1996,98,99,2000 Andrew M. Bishop
    9   It may be distributed under the GNU Public License, version 2, or
   10   any higher version.  See section COPYING of the GNU Public license
   11   for conditions under which this file may be redistributed.
   12   ***************************************/
   13 
   14 #ifndef PMBAR_H
   15 #define PMBAR_H    /*+ To stop multiple inclusions. +*/
   16 
   17 #include <gdk/gdk.h>
   18 #include <gtk/gtkadjustment.h>
   19 
   20 #include "PMGeneric.h"
   21 
   22 #define GTK_TYPE_PROCMETERBAR          (gtk_procmeterbar_get_type())
   23 #define GTK_PROCMETERBAR(obj)          GTK_CHECK_CAST((obj),GTK_TYPE_PROCMETERBAR,ProcMeterBar)
   24 #define GTK_PROCMETERBAR_CLASS(klass)  GTK_CHECK_CLASS_CAST((klass),GTK_TYPE_PROCMETERBAR,ProcMeterBarClass)
   25 #define GTK_IS_PROCMETERBAR(obj)       GTK_CHECK_TYPE((obj),GTK_TYPE_PROCMETERBAR)
   26 
   27 
   28 typedef struct _ProcMeterBar       ProcMeterBar;
   29 typedef struct _ProcMeterBarClass  ProcMeterBarClass;
   30 
   31 struct _ProcMeterBar
   32 {
   33  ProcMeterGeneric generic;
   34 
   35  gchar*           grid_units;       /*+ The number of things per grid line. +*/
   36  gushort          grid_units_x;     /*+ The position of the grid units. +*/
   37  GdkColor         grid_color;       /*+ The grid lines colour. +*/
   38  GdkGC*           grid_gc;          /*+ The graphics context for the grid lines. +*/
   39  gint             grid_min;         /*+ The minimum number of grid lines. +*/
   40  gint             grid_max;         /*+ The maximum number of grid lines. +*/
   41  gint             grid_maxvis;      /*+ The maximum number of grid lines before removing them. +*/
   42  gint             grid_drawn;       /*+ If 1 then draw as normal, if 0 never draw, if -1 draw only one line. +*/
   43  gint             grid_num;         /*+ The actual number of grid lines. +*/
   44 
   45  gushort          data[8];          /*+ The data for the bar. +*/
   46  gushort          data_index;       /*+ A pointer into the array +*/
   47  gulong           data_sum;         /*+ The average value of the last 10 data points. +*/
   48 };
   49 
   50 struct _ProcMeterBarClass
   51 {
   52  ProcMeterGenericClass parent_class;
   53 
   54  void (*resize)(ProcMeterBar *pmw);
   55  void (*update)(ProcMeterBar *pmw,gboolean all);
   56 };
   57 
   58 guint      gtk_procmeterbar_get_type(void);
   59 GtkWidget* gtk_procmeterbar_new(void);
   60 
   61 
   62 /* Public functions */
   63 
   64 void ProcMeterBarSetGridColour(ProcMeterBar *pmw,GdkColor grid_color);
   65 void ProcMeterBarSetGridMin(ProcMeterBar *pmw,gint grid_min);
   66 void ProcMeterBarSetGridMax(ProcMeterBar *pmw,gint grid_max);
   67 void ProcMeterBarSetGridUnits(ProcMeterBar *pmw,gchar *units);
   68 
   69 void ProcMeterBarAddDatum(ProcMeterBar *pmw,gushort datum);
   70 
   71 #endif /* PMBAR_H */