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
|
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2018-05-15 16:57:08 +02:00
|
|
|
#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 */
|
2018-05-23 01:03:16 +02:00
|
|
|
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())
|
2018-05-15 16:57:08 +02:00
|
|
|
|
2018-05-16 16:20:09 +02:00
|
|
|
typedef struct _LayerElementPriv {
|
|
|
|
GtkEntry *name;
|
|
|
|
GtkLabel *layer;
|
|
|
|
int layer_num;
|
2018-05-23 01:03:16 +02:00
|
|
|
GtkEventBox *event_handle;
|
2018-05-16 16:20:09 +02:00
|
|
|
GtkColorButton *color;
|
|
|
|
GtkCheckButton *export;
|
|
|
|
} LayerElementPriv;
|
|
|
|
|
2018-07-19 15:47:57 +02:00
|
|
|
struct _LayerElement {
|
2018-05-16 10:32:00 +02:00
|
|
|
/* Inheritance */
|
2018-05-23 01:03:16 +02:00
|
|
|
GtkListBoxRow parent;
|
2018-05-16 10:32:00 +02:00
|
|
|
/* Custom Elements */
|
2018-05-16 16:20:09 +02:00
|
|
|
LayerElementPriv priv;
|
2018-07-19 15:47:57 +02:00
|
|
|
};
|
2018-05-15 16:57:08 +02:00
|
|
|
|
2018-07-25 16:44:04 +02:00
|
|
|
/**
|
|
|
|
* @brief Create new layer element object
|
|
|
|
* @return new object
|
|
|
|
*/
|
2018-05-15 16:57:08 +02:00
|
|
|
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.
|
|
|
|
*/
|
2018-05-16 16:20:09 +02:00
|
|
|
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
|
|
|
|
*/
|
2018-05-16 16:20:09 +02:00
|
|
|
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
|
|
|
|
*/
|
2018-05-16 16:20:09 +02:00
|
|
|
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
|
|
|
|
*/
|
2018-05-16 16:20:09 +02:00
|
|
|
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
|
|
|
|
*/
|
2018-05-16 16:20:09 +02:00
|
|
|
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
|
|
|
|
*/
|
2018-05-16 16:20:09 +02:00
|
|
|
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
|
|
|
|
*/
|
2018-05-16 16:20:09 +02:00
|
|
|
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
|
|
|
|
*/
|
2018-05-16 16:20:09 +02:00
|
|
|
void layer_element_set_color(LayerElement *elem, GdkRGBA *rgba);
|
|
|
|
|
2019-03-15 23:17:03 +01:00
|
|
|
/**
|
|
|
|
* @brief layer_element_set_dnd_callbacks
|
|
|
|
* @param elem
|
|
|
|
* @param entries
|
|
|
|
* @param entry_count
|
|
|
|
*/
|
|
|
|
void layer_element_set_dnd_callbacks(LayerElement *elem, GtkTargetEntry *entries, int entry_count,
|
|
|
|
void (*drag_begin)(GtkWidget *, GdkDragContext *, gpointer),
|
|
|
|
void (*drag_data_get)(GtkWidget *, GdkDragContext *,
|
|
|
|
GtkSelectionData *, guint , guint, gpointer),
|
|
|
|
void (*drag_end)(GtkWidget *, GdkDragContext *, gpointer));
|
|
|
|
|
2018-05-22 12:59:28 +02:00
|
|
|
G_END_DECLS
|
|
|
|
|
2018-05-15 16:57:08 +02:00
|
|
|
#endif /* __LAYER_ELEMENT_H__ */
|
2018-07-25 16:44:04 +02:00
|
|
|
|
|
|
|
/** @} */
|