/*
 * main.h
 * This file is part of galvani.
 *
 * Copyright (C) 2020-2024 Burkard Lutz <b.lutz@online.de>
 *
 * 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 2 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 MAIN_H
#define MAIN_H

#include <glibmm/i18n.h>
#include "typedef.h"
#include "ui.h"

//classes
class AppGalvani: public Gtk::Application
{
	public:
  	static Glib::RefPtr<AppGalvani> create();

	protected:
  	AppGalvani();
	virtual ~AppGalvani();

	protected:
  	//Overrides of default signal handlers:
  	void on_activate() override;

	private:
	void create_window ();


};


//Variables
Main_Window* main_win=0;
std::string version;
Project *project;
std::vector<mw_data> mw;
Multimeter dmm[2];
Multimeter idmm[10];	//array of installed dmm
int mid=0;	//max. index of installed dmm
std::vector<std::string> m_functions;
std::vector<acid_data> acid;
std::time_t datum;
bool data_saved=true;
bool project_defined=false;
bool full_screen = true;
int mainwin_width, mainwin_height;
std::string error_str;
std::string homedir, datadir, workdir, confdir, tmpdir, dmmdir;
std::fstream ini_file;
std::string ini_filename;
Glib::RefPtr<Gio::ListStore<Gtk::FileFilter>> dat_filters;
Glib::RefPtr<Gio::ListStore<Gtk::FileFilter>> img_filters;

//Funktions
void app_quit();	//quit program
void error_msg (std::string msg); //error message
std::string read_ini(std::string opt_item);
int get_intstr(std::string num_str);

#endif
