/*
 * UPIWIN - Micro Pi Windowing Framework Kernel
 * Copyright (C) 2019 Amy Bowersox/Erbosoft Metaverse Design Solutions
 *    
 * 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, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *-------------------------------------------------------------------------
 */
#ifndef __CONFIG_H_INCLUDED
#define __CONFIG_H_INCLUDED

#include "wintype.h"

typedef void (*PEXITFUNC)(void);

/* global configuration data for UPIWIN */
typedef struct tagGLOBAL_CONFIG {
  PCSTR framebuffer_device;    /* name of frame buffer device */
  PCSTR touchscreen_device;    /* name of touchscreen device */
  PCSTR python_loc;            /* location of the Python3 executable */
  UINT32 button_debounce;      /* minimum time between button up and next button down (ms) */
  UINT32 sys_mq_length;        /* length of system message queue */
  UINT32 click_time;           /* time between button/touch DOWN and UP to be considered a "click" (ms) */
  UINT32 click_radius;         /* maximum number of pixels a touch can "drift" to be considered a "click" */
  PCSTR script_name;           /* script name to be run */
  INT32 script_arg_count;      /* number of arguments to pass to the script */
  PPCSTR script_args;          /* arguments to pass to the script */
} GLOBAL_CONFIG;

extern GLOBAL_CONFIG Gconfig;  /* one global configuration to rule them all */

extern HRESULT Config_setup(int argc, char *argv[]);
extern HRESULT Config_exitfunc(PEXITFUNC pfn);

#endif /* __CONFIG_H_INCLUDED */
