/* PIKA - Photo and Image Kooker Application
 * a rebranding of The GNU Image Manipulation Program (created with heckimp)
 * A derived work which may be trivial. However, any changes may be (C)2023 by Aldercone Studio
 *
 * Original copyright, applying to most contents (license remains unchanged): 
 * Copyright (C) 1995 Spencer Kimball and Peter Mattis
 *
 * pikameter.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 <https://www.gnu.org/licenses/>.
 */

#ifndef __PIKA_METER_H__
#define __PIKA_METER_H__


#define PIKA_TYPE_METER            (pika_meter_get_type ())
#define PIKA_METER(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), PIKA_TYPE_METER, PikaMeter))
#define PIKA_METER_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), PIKA_TYPE_METER, PikaMeterClass))
#define PIKA_IS_METER(obj)         (G_TYPE_CHECK_INSTANCE_TYPE (obj, PIKA_TYPE_METER))
#define PIKA_IS_METER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), PIKA_TYPE_METER))
#define PIKA_METER_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), PIKA_TYPE_METER, PikaMeterClass))


typedef struct _PikaMeterPrivate PikaMeterPrivate;
typedef struct _PikaMeterClass   PikaMeterClass;

struct _PikaMeter
{
  GtkWidget         parent_instance;

  PikaMeterPrivate *priv;
};

struct _PikaMeterClass
{
  GtkWidgetClass  parent_class;
};


GType                   pika_meter_get_type                  (void) G_GNUC_CONST;

GtkWidget             * pika_meter_new                       (gint                   n_values);

void                    pika_meter_set_size                  (PikaMeter             *meter,
                                                              gint                   size);
gint                    pika_meter_get_size                  (PikaMeter             *meter);

void                    pika_meter_set_refresh_rate          (PikaMeter             *meter,
                                                              gdouble                rate);
gdouble                 pika_meter_get_refresh_rate          (PikaMeter             *meter);

void                    pika_meter_set_range                 (PikaMeter             *meter,
                                                              gdouble                min,
                                                              gdouble                max);
gdouble                 pika_meter_get_range_min             (PikaMeter             *meter);
gdouble                 pika_meter_get_range_max             (PikaMeter             *meter);

void                    pika_meter_set_n_values              (PikaMeter             *meter,
                                                              gint                   n_values);
gint                    pika_meter_get_n_values              (PikaMeter             *meter);

void                    pika_meter_set_value_active          (PikaMeter             *meter,
                                                              gint                   value,
                                                              gboolean               active);
gboolean                pika_meter_get_value_active          (PikaMeter             *meter,
                                                              gint                   value);

void                    pika_meter_set_value_show_in_gauge    (PikaMeter            *meter,
                                                               gint                  value,
                                                               gboolean              show);
gboolean                pika_meter_get_value_show_in_gauge    (PikaMeter            *meter,
                                                               gint                  value);

void                    pika_meter_set_value_show_in_history (PikaMeter             *meter,
                                                              gint                   value,
                                                              gboolean               show);
gboolean                pika_meter_get_value_show_in_history (PikaMeter             *meter,
                                                              gint                   value);

void                    pika_meter_set_value_color           (PikaMeter             *meter,
                                                              gint                   value,
                                                              const PikaRGB         *color);
const PikaRGB         * pika_meter_get_value_color           (PikaMeter             *meter,
                                                              gint                   value);

void                    pika_meter_set_value_interpolation   (PikaMeter             *meter,
                                                              gint                   value,
                                                              PikaInterpolationType  interpolation);
PikaInterpolationType   pika_meter_get_value_interpolation   (PikaMeter             *meter,
                                                              gint                   value);

void                    pika_meter_set_history_visible       (PikaMeter             *meter,
                                                              gboolean               visible);
gboolean                pika_meter_get_history_visible       (PikaMeter             *meter);

void                    pika_meter_set_history_duration      (PikaMeter             *meter,
                                                              gdouble                duration);
gdouble                 pika_meter_get_history_duration      (PikaMeter             *meter);

void                    pika_meter_set_history_resolution    (PikaMeter             *meter,
                                                              gdouble                resolution);
gdouble                 pika_meter_get_history_resolution    (PikaMeter             *meter);

void                    pika_meter_clear_history             (PikaMeter             *meter);

void                    pika_meter_add_sample                (PikaMeter             *meter,
                                                              const gdouble         *sample);

void                    pika_meter_set_led_active            (PikaMeter             *meter,
                                                              gboolean               active);
gboolean                pika_meter_get_led_active            (PikaMeter             *meter);

void                    pika_meter_set_led_color             (PikaMeter             *meter,
                                                              const PikaRGB         *color);
const PikaRGB         * pika_meter_get_led_color             (PikaMeter             *meter);


#endif /* __PIKA_METER_H__ */
