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 program is free software; you can redistribute it and/or modify 7 * it under the terms of the GNU General Public License as published by 8 * the Free Software Foundation; either version 2 of the License, or 9 * (at your option) any later version. 10 * 11 * This program 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 this program; if not, write to the Free Software 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 19 */ 20 /*! \file bus_object.h 21 * 22 * \brief Functions operating on bus objects 23 */ 24 25 G_BEGIN_DECLS 26 27 /* construction, destruction */ 28 29 LeptonObject* 30 lepton_bus_object_new (gint color, 31 gint x1, 32 gint y1, 33 gint x2, 34 gint y2, 35 gint bus_ripper_direction); 36 LeptonObject* 37 lepton_bus_object_copy (const LeptonObject *o_current); 38 39 /* methods */ 40 41 void 42 lepton_bus_object_calculate_bounds (const LeptonObject *object, 43 LeptonBounds *bounds); 44 gboolean 45 lepton_bus_object_get_position (const LeptonObject *object, 46 gint *x, 47 gint *y); 48 gint 49 lepton_bus_object_get_ripper_direction (const LeptonObject *object); 50 51 gint 52 lepton_bus_object_get_x0 (const LeptonObject *object); 53 54 gint 55 lepton_bus_object_get_x1 (const LeptonObject *object); 56 57 gint 58 lepton_bus_object_get_y0 (const LeptonObject *object); 59 60 gint 61 lepton_bus_object_get_y1 (const LeptonObject *object); 62 63 void 64 lepton_bus_object_mirror (gint world_centerx, 65 gint world_centery, 66 LeptonObject *object); 67 void 68 lepton_bus_object_modify (LeptonObject *object, 69 gint x, 70 gint y, 71 gint whichone); 72 gint 73 lepton_bus_object_orientation (const LeptonObject *object); 74 75 void 76 lepton_bus_object_rotate (gint world_centerx, 77 gint world_centery, 78 gint angle, 79 LeptonObject *object); 80 void 81 lepton_bus_object_set_ripper_direction (LeptonObject *object, 82 gint direction); 83 void 84 lepton_bus_object_set_x0 (LeptonObject *object, 85 gint x); 86 void 87 lepton_bus_object_set_x1 (LeptonObject *object, 88 gint x); 89 void 90 lepton_bus_object_set_y0 (LeptonObject *object, 91 gint y); 92 void 93 lepton_bus_object_set_y1 (LeptonObject *object, 94 gint y); 95 gchar* 96 lepton_bus_object_to_buffer (const LeptonObject *object); 97 98 void 99 lepton_bus_object_translate (LeptonObject *object, 100 gint dx, 101 gint dy); 102 LeptonObject* 103 o_bus_read (const char buf[], 104 unsigned int release_ver, 105 unsigned int fileformat_ver, 106 GError **err); 107 108 G_END_DECLS 109