Commit 8f3cb718 authored by Ell's avatar Ell

app: add GimpMeter widget

GimpMeter visualizes a set of values that change over time.  It
consists of a gauge, showing the most-recent sampled values, a
history graph, showing a plot of the values over time, and an LED,
which can be used as a boolean indicator for some condition.

GimpMeter is used in the dashboard dockable, added in the next
commit.
parent 27512d80
......@@ -253,6 +253,8 @@ libappwidgets_a_sources = \
gimpmessagebox.h \
gimpmessagedialog.c \
gimpmessagedialog.h \
gimpmeter.c \
gimpmeter.h \
gimpnavigationview.c \
gimpnavigationview.h \
gimpopendialog.c \
......
This diff is collapsed.
/* GIMP - The GNU Image Manipulation Program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* gimpmeter.h
* Copyright (C) 2017 Ell
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GIMP_METER_H__
#define __GIMP_METER_H__
#define GIMP_TYPE_METER (gimp_meter_get_type ())
#define GIMP_METER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GIMP_TYPE_METER, GimpMeter))
#define GIMP_METER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GIMP_TYPE_METER, GimpMeterClass))
#define GIMP_IS_METER(obj) (G_TYPE_CHECK_INSTANCE_TYPE (obj, GIMP_TYPE_METER))
#define GIMP_IS_METER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_METER))
#define GIMP_METER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_METER, GimpMeterClass))
typedef struct _GimpMeterPrivate GimpMeterPrivate;
typedef struct _GimpMeterClass GimpMeterClass;
struct _GimpMeter
{
GtkWidget parent_instance;
GimpMeterPrivate *priv;
};
struct _GimpMeterClass
{
GtkWidgetClass parent_class;
};
GType gimp_meter_get_type (void) G_GNUC_CONST;
GtkWidget * gimp_meter_new (gint n_values);
void gimp_meter_set_size (GimpMeter *meter,
gint size);
gint gimp_meter_get_size (GimpMeter *meter);
void gimp_meter_set_refresh_rate (GimpMeter *meter,
gdouble rate);
gdouble gimp_meter_get_refresh_rate (GimpMeter *meter);
void gimp_meter_set_range (GimpMeter *meter,
gdouble min,
gdouble max);
gdouble gimp_meter_get_range_min (GimpMeter *meter);
gdouble gimp_meter_get_range_max (GimpMeter *meter);
void gimp_meter_set_n_values (GimpMeter *meter,
gint n_values);
gint gimp_meter_get_n_values (GimpMeter *meter);
void gimp_meter_set_color (GimpMeter *meter,
gint i,
const GimpRGB *color);
const GimpRGB * gimp_meter_get_color (GimpMeter *meter,
gint i);
void gimp_meter_set_history_visible (GimpMeter *meter,
gboolean visible);
gboolean gimp_meter_get_history_visible (GimpMeter *meter);
void gimp_meter_set_history_duration (GimpMeter *meter,
gdouble duration);
gdouble gimp_meter_get_history_duration (GimpMeter *meter);
void gimp_meter_set_history_resolution (GimpMeter *meter,
gdouble resolution);
gdouble gimp_meter_get_history_resolution (GimpMeter *meter);
void gimp_meter_clear_history (GimpMeter *meter);
void gimp_meter_add_sample (GimpMeter *meter,
const gdouble *sample);
void gimp_meter_set_led_visible (GimpMeter *meter,
gboolean visible);
gboolean gimp_meter_get_led_visible (GimpMeter *meter);
void gimp_meter_set_led_color (GimpMeter *meter,
const GimpRGB *color);
const GimpRGB * gimp_meter_get_led_color (GimpMeter *meter);
#endif /* __GIMP_METER_H__ */
......@@ -202,6 +202,7 @@ typedef struct _GimpLanguageStore GimpLanguageStore;
typedef struct _GimpLayerModeBox GimpLayerModeBox;
typedef struct _GimpLayerModeComboBox GimpLayerModeComboBox;
typedef struct _GimpMessageBox GimpMessageBox;
typedef struct _GimpMeter GimpMeter;
typedef struct _GimpOverlayBox GimpOverlayBox;
typedef struct _GimpPickableButton GimpPickableButton;
typedef struct _GimpPickablePopup GimpPickablePopup;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment