1 /* Lepton EDA library
2  * Copyright (C) 1998-2010 Ales Hvezda
3  * Copyright (C) 1998-2016 gEDA Contributors
4  * Copyright (C) 2017-2021 Lepton EDA Contributors
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library 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 GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef STRUCT_H
22 #define STRUCT_H
23 
24 #include <glib.h>  /* Include needed to make GList work. */
25 
26 /* Wrappers around a new list mechanism */
27 typedef struct _LeptonList LeptonSelection;
28 typedef struct _LeptonList LeptonPageList;
29 
30 /* lepton-schematic structures */
31 typedef struct st_conn LeptonConn;
32 
33 /* Managed text buffers */
34 typedef struct _TextBuffer TextBuffer;
35 
36 /* Component library objects */
37 typedef struct _CLibSource CLibSource;
38 typedef struct _CLibSymbol CLibSymbol;
39 
40 /* Component library search modes */
41 typedef enum { CLIB_EXACT=0, CLIB_GLOB } CLibSearchMode;
42 
43 /* f_open behaviour flags.  See documentation for f_open_flags() in
44    f_basic.c. */
45 typedef enum { F_OPEN_RC           = 1,
46                F_OPEN_CHECK_BACKUP = 2,
47                F_OPEN_FORCE_BACKUP = 4,
48                F_OPEN_RESTORE_CWD  = 8
49 } FOpenFlags;
50 
51 
52 /*! \brief Structure for connections between LeptonObjects
53  *
54  * The st_conn structure contains a single connection
55  * to another object.
56  * The connection system in s_conn.c uses this struct
57  */
58 struct st_conn {
59   /*! \brief The "other" object connected to this one */
60   LeptonObject *other_object;
61   /*! \brief type of connection. Always in reference to how the "other"
62     object is connected to the current one */
63   int type;
64   /*! \brief x coord of the connection position */
65   int x;
66   /*! \brief y coord of the connection position */
67   int y;
68   /*! \brief which endpoint of the current object caused this connection */
69   int whichone;
70   /*! \brief which endpoint of the "other" object caused this connection */
71   int other_whichone;
72 };
73 
74 /*! \brief Type of callback function for object damage notification */
75 typedef int(*ChangeNotifyFunc)(void *, LeptonObject *);
76 
77 /*! \brief Type of callback function for querying loading of backups */
78 typedef gboolean(*LoadBackupQueryFunc)(void *, GString *);
79 
80 /* used by the rc loading mechanisms */
81 typedef struct {
82   int   m_val;
83   const char *m_str;
84 } vstbl_entry;
85 
86 /* Used by g_rc_parse_handler() */
87 typedef void (*ConfigParseErrorFunc)(GError **, void *);
88 
89 #endif
90