gds-render/widgets/layer-element.h

126 lines
2.9 KiB
C
Raw Normal View History

2018-05-15 22:54:10 +02:00
/*
* GDSII-Converter
* Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
*
* This file is part of GDSII-Converter.
*
* GDSII-Converter is free software: you can redistribute it and/or modify
2018-05-16 16:29:34 +02:00
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
2018-05-15 22:54:10 +02:00
*
* GDSII-Converter 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 GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
*/
2018-07-25 16:44:04 +02:00
/**
* @file layer-element.h
* @brief Omplementation of the layer element used for configuring layer colors etc.
* @author Mario Hüttel <mario.huettel@gmx.net>
*/
/**
* @addtogroup Widgets
* @{
*/
#ifndef __LAYER_ELEMENT_H__
#define __LAYER_ELEMENT_H__
#include <gtk/gtk.h>
2018-05-22 12:59:28 +02:00
G_BEGIN_DECLS
/* Creates Class structure etc */
G_DECLARE_FINAL_TYPE(LayerElement, layer_element, LAYER, ELEMENT, GtkListBoxRow)
2018-05-22 12:59:28 +02:00
#define TYPE_LAYER_ELEMENT (layer_element_get_type())
typedef struct _LayerElementPriv {
GtkEntry *name;
GtkLabel *layer;
int layer_num;
GtkEventBox *event_handle;
GtkColorButton *color;
GtkCheckButton *export;
} LayerElementPriv;
2018-07-19 15:47:57 +02:00
struct _LayerElement {
2018-05-16 10:32:00 +02:00
/* Inheritance */
GtkListBoxRow parent;
2018-05-16 10:32:00 +02:00
/* Custom Elements */
LayerElementPriv priv;
2018-07-19 15:47:57 +02:00
};
2018-07-25 16:44:04 +02:00
/**
* @brief Create new layer element object
* @return new object
*/
GtkWidget *layer_element_new(void);
2018-07-25 16:44:04 +02:00
/**
* @brief get name of the layer
* @param elem Layer element
* @return Name. Must not be changed, freed or anything else.
*/
const char *layer_element_get_name(LayerElement *elem);
2018-07-25 16:44:04 +02:00
/**
* @brief layer_element_set_name
* @param elem set the name of the layer
* @param name Name. Can be freed after call to this function
*/
void layer_element_set_name(LayerElement *elem, const char* name);
2018-07-25 16:44:04 +02:00
/**
* @brief Set layer number for this layer
* @param elem Layer element
* @param layer Layer number
*/
void layer_element_set_layer(LayerElement *elem, int layer);
2018-07-25 16:44:04 +02:00
/**
* @brief Get layer number
* @param elem Layer Element
* @return Number of this layer
*/
int layer_element_get_layer(LayerElement *elem);
2018-07-25 16:44:04 +02:00
/**
* @brief Set export flag for this layer
* @param elem Layer Element
* @param export flag
*/
void layer_element_set_export(LayerElement *elem, gboolean export);
2018-07-25 16:44:04 +02:00
/**
* @brief Get export flag of layer
* @param elem Layer Element
* @return
*/
gboolean layer_element_get_export(LayerElement *elem);
2018-07-25 16:44:04 +02:00
/**
* @brief Get color of layer
* @param elem Layer Element
* @param rgba RGBA color
*/
void layer_element_get_color(LayerElement *elem, GdkRGBA *rgba);
2018-07-25 16:44:04 +02:00
/**
* @brief Set color of layer
* @param elem Layer Element
* @param rgba RGBA color
*/
void layer_element_set_color(LayerElement *elem, GdkRGBA *rgba);
2018-05-22 12:59:28 +02:00
G_END_DECLS
#endif /* __LAYER_ELEMENT_H__ */
2018-07-25 16:44:04 +02:00
/** @} */