GDS-Render v1.2.1
layer-element.h
Go to the documentation of this file.
1/*
2 * GDSII-Converter
3 * Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
4 *
5 * This file is part of GDSII-Converter.
6 *
7 * GDSII-Converter is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * GDSII-Converter is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
18 */
19
32#ifndef __LAYER_ELEMENT_H__
33#define __LAYER_ELEMENT_H__
34
35#include <gtk/gtk.h>
36
37G_BEGIN_DECLS
38
39/* Creates Class structure etc */
40G_DECLARE_FINAL_TYPE(LayerElement, layer_element, LAYER, ELEMENT, GtkListBoxRow)
41
42#define TYPE_LAYER_ELEMENT (layer_element_get_type())
43
44typedef struct _LayerElementPriv {
45 GtkEntry *name;
46 GtkLabel *layer;
48 GtkEventBox *event_handle;
49 GtkColorButton *color;
50 GtkCheckButton *export;
52
54 /* Inheritance */
55 GtkListBoxRow parent;
56 /* Custom Elements */
58};
59
65 GtkTargetEntry *entries;
69 void (*drag_begin)(GtkWidget *, GdkDragContext *, gpointer);
71 void (*drag_data_get)(GtkWidget *, GdkDragContext *, GtkSelectionData *, guint, guint, gpointer);
73 void (*drag_end)(GtkWidget *, GdkDragContext *, gpointer);
74};
75
80GtkWidget *layer_element_new(void);
81
87const char *layer_element_get_name(LayerElement *elem);
88
94void layer_element_set_name(LayerElement *elem, const char* name);
95
101void layer_element_set_layer(LayerElement *elem, int layer);
102
108int layer_element_get_layer(LayerElement *elem);
109
115void layer_element_set_export(LayerElement *elem, gboolean export);
116
122gboolean layer_element_get_export(LayerElement *elem);
123
129void layer_element_get_color(LayerElement *elem, GdkRGBA *rgba);
130
136void layer_element_set_color(LayerElement *elem, GdkRGBA *rgba);
137
143void layer_element_set_dnd_callbacks(LayerElement *elem, struct layer_element_dnd_data *data);
144
145G_END_DECLS
146
147#endif /* __LAYER_ELEMENT_H__ */
148
@ LAYER
Definition: gds-parser.c:82
G_BEGIN_DECLS G_DECLARE_FINAL_TYPE(GdsRenderGui, gds_render_gui, RENDERER, GUI, GObject)
const char * layer_element_get_name(LayerElement *elem)
get name of the layer
Definition: layer-element.c:87
void layer_element_set_color(LayerElement *elem, GdkRGBA *rgba)
Set color of layer.
struct _LayerElementPriv LayerElementPriv
int layer_element_get_layer(LayerElement *elem)
Get layer number.
void layer_element_set_layer(LayerElement *elem, int layer)
Set layer number for this layer.
Definition: layer-element.c:97
void layer_element_get_color(LayerElement *elem, GdkRGBA *rgba)
Get color of layer.
void layer_element_set_name(LayerElement *elem, const char *name)
layer_element_set_name
Definition: layer-element.c:92
void layer_element_set_dnd_callbacks(LayerElement *elem, struct layer_element_dnd_data *data)
Setup drag and drop of elem for use in the LayerSelector.
void layer_element_set_export(LayerElement *elem, gboolean export)
Set export flag for this layer.
gboolean layer_element_get_export(LayerElement *elem)
Get export flag of layer.
GtkWidget * layer_element_new(void)
Create new layer element object.
Definition: layer-element.c:82
LayerElementPriv priv
Definition: layer-element.h:57
GtkListBoxRow parent
Definition: layer-element.h:55
GtkEventBox * event_handle
Definition: layer-element.h:48
GtkLabel * layer
Definition: layer-element.h:46
GtkColorButton * color
Definition: layer-element.h:49
GtkCheckButton * export
Definition: layer-element.h:50
This structure holds the necessary data to set up a LayerElement for Drag'n'Drop.
Definition: layer-element.h:63
void(* drag_data_get)(GtkWidget *, GdkDragContext *, GtkSelectionData *, guint, guint, gpointer)
Callback fucktion for data_get event.
Definition: layer-element.h:71
GtkTargetEntry * entries
Array of target entries for the DnD operation.
Definition: layer-element.h:65
void(* drag_begin)(GtkWidget *, GdkDragContext *, gpointer)
Callback function for drag_begin event.
Definition: layer-element.h:69
void(* drag_end)(GtkWidget *, GdkDragContext *, gpointer)
Callback function for drag_end event.
Definition: layer-element.h:73
int entry_count
Count of elements in layer_element_dnd_data::entries array.
Definition: layer-element.h:67