This repository has been archived on 2024-07-15. You can view files and clone it, but cannot push or open issues or pull requests.
hedera/gvn/gvn-param.h

85 lines
3.0 KiB
C
Raw Normal View History

2013-10-11 23:07:35 +00:00
/*
* Copyright (C) 2012 - Juan Ferrer Toribio
*
* 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 GVN_PARAM_H
#define GVN_PARAM_H
#include <glib-object.h>
#include "gvn-param-spec.h"
#define GVN_PARAM_LOG_DOMAIN (g_quark_from_string ("GvnParam"))
#define GVN_TYPE_PARAM (gvn_param_get_type ())
#define GVN_PARAM(self) (G_TYPE_CHECK_INSTANCE_CAST (self, GVN_TYPE_PARAM, GvnParam))
#define GVN_IS_PARAM(self) (G_TYPE_CHECK_INSTANCE_TYPE (self, GVN_TYPE_PARAM))
#define GVN_PARAM_GET_INTERFACE(self) (G_TYPE_INSTANCE_GET_INTERFACE (self, GVN_TYPE_PARAM, GvnParamInterface))
2013-10-11 23:07:35 +00:00
typedef struct _GvnParam GvnParam;
typedef struct _GvnParamInterface GvnParamInterface;
typedef enum _GvnParamStatus GvnParamStatus;
2013-10-11 23:07:35 +00:00
typedef const GValue * (* GvnParamGetValueFunc) (GvnParam * self);
typedef gboolean (* GvnParamRequestValueFunc) (GvnParam * self, const GValue * value, GError ** err);
typedef GvnParam * (* GvnParamGetMasterFunc) (GvnParam * self);
typedef void (* GvnParamSetMasterFunc) (GvnParam * self, GvnParam * master);
typedef const GvnParamSpec * (* GvnParamGetSpecFunc) (GvnParam * self);
typedef GvnParamStatus (* GvnParamGetStatusFunc) (GvnParam * self);
2013-10-11 23:07:35 +00:00
/**
* GvnParamStatus:
* @GVN_PARAM_STATUS_OK: The parameter is ready.
* @GVN_PARAM_STATUS_BUSY: The parameter is busy.
* @GVN_PARAM_STATUS_ERROR: The parameter value is incompatible to its spec.
*
* The status of the param.
**/
enum _GvnParamStatus
2013-10-11 23:07:35 +00:00
{
GVN_PARAM_STATUS_OK
,GVN_PARAM_STATUS_BUSY
,GVN_PARAM_STATUS_ERROR
};
2013-10-11 23:07:35 +00:00
/**
* GvnParam:
* @slaves: (element-type Gvn.Param):
**/
struct _GvnParam;
2013-10-11 23:07:35 +00:00
struct _GvnParamInterface
2013-10-11 23:07:35 +00:00
{
/* <private> */
GInitiallyUnownedClass parent;
GvnParamGetValueFunc get_value;
GvnParamRequestValueFunc request_value;
GvnParamGetMasterFunc get_master;
GvnParamSetMasterFunc set_master;
GvnParamGetSpecFunc get_spec;
GvnParamGetStatusFunc get_status;
2013-10-11 23:07:35 +00:00
};
GType gvn_param_get_type ();
const GValue * gvn_param_get_value (GvnParam * self);
gboolean gvn_param_request_value (GvnParam * self, const GValue * value, GError ** err);
void gvn_param_set_value (GvnParam * self, const GValue * value);
GvnParam * gvn_param_get_master (GvnParam * self);
void gvn_param_set_master (GvnParam * self, GvnParam * master);
const GvnParamSpec * gvn_param_get_spec (GvnParam * self);
GvnParamStatus gvn_param_get_status (GvnParam * self);
void gvn_param_value_changed (GvnParam * self);
2013-10-11 23:07:35 +00:00
#endif