Horizon
dialogs.hpp
1 #pragma once
2 #include <memory>
3 #include "util/uuid.hpp"
4 #include "common/common.hpp"
5 #include "util/uuid_path.hpp"
6 #include "parameter/set.hpp"
7 #include <map>
8 #include <set>
9 
10 namespace Gtk {
11 class Window;
12 }
13 
14 namespace horizon {
15 class Dialogs {
16 public:
17  Dialogs(){};
18  void set_parent(Gtk::Window *w);
19  void set_interface(class ImpInterface *intf);
20 
21  std::pair<bool, UUID> map_pin(const std::vector<std::pair<const class Pin *, bool>> &pins);
22  std::pair<bool, UUIDPath<2>> map_symbol(const std::map<UUIDPath<2>, std::string> &gates);
23  std::pair<bool, UUID> map_package(const std::vector<std::pair<class Component *, bool>> &components);
24  std::pair<bool, UUID> select_symbol(class Pool *p, const UUID &unit_uuid);
25  std::pair<bool, UUID> select_part(class Pool *p, const UUID &entity_uuid, const UUID &part_uuid,
26  bool show_none = false);
27  std::pair<bool, UUID> select_entity(class Pool *pool);
28  std::pair<bool, UUID> select_unit(class Pool *pool);
29  std::pair<bool, UUID> select_padstack(class Pool *pool, const UUID &package_uuid);
30  std::pair<bool, UUID> select_hole_padstack(class Pool *pool);
31  std::pair<bool, UUID> select_via_padstack(class ViaPadstackProvider *vpp);
32  std::pair<bool, UUID> select_net(class Block *block, bool power_only, const UUID &net_default = UUID());
33  std::pair<bool, UUID> select_bus(class Block *block);
34  std::pair<bool, UUID> select_bus_member(class Block *block, const UUID &bus_uuid);
35  std::pair<bool, UUID> select_group_tag(const class Block *block, bool tag_mode, const UUID &current);
36  std::pair<bool, UUID> select_included_board(const class Board &brd);
37  unsigned int ask_net_merge(class Net *net, class Net *into);
38  bool manage_buses(class Block *b);
39  bool manage_net_classes(class Block *b);
40  bool manage_power_nets(class Block *b);
41  bool manage_via_templates(class Board *b, class ViaPadstackProvider *vpp);
42  bool manage_included_boards(class Board &b);
43  bool edit_pad_parameter_set(std::set<class Pad *> &pads, class Pool *pool, class Package *pkg);
44  bool edit_board_hole(std::set<class BoardHole *> &holes, class Pool *pool, class Block *block);
45  bool annotate(class Schematic *s);
46  bool edit_plane(class Plane *plane, class Board *brd, class Block *block);
47  bool edit_keepout(class Keepout *keepout, class IDocument *c, bool add_mode);
48  bool edit_stackup(class IDocumentBoard *brd);
49  bool edit_schematic_properties(class Schematic *s, class Pool *pool);
50  bool edit_frame_properties(class Frame *fr);
51  std::pair<bool, int64_t> ask_datum(const std::string &label, int64_t def = 0);
52  std::pair<bool, Coordi> ask_datum_coord(const std::string &label, Coordi def = Coordi());
53  std::tuple<bool, Coordi, std::pair<bool, bool>> ask_datum_coord2(const std::string &label, Coordi def = Coordi());
54  std::pair<bool, std::string> ask_datum_string_multiline(const std::string &label, const std::string &def);
55  std::pair<bool, std::string> ask_datum_string(const std::string &label, const std::string &def);
56  std::pair<bool, int> ask_datum_angle(const std::string &label, int def = 0);
57  bool edit_shapes(std::set<class Shape *> shapes);
58  bool edit_via(std::set<class Via *> &vias, class ViaPadstackProvider &vpp);
59  std::pair<bool, std::string> ask_dxf_filename();
60  std::pair<bool, std::string> ask_kicad_package_filename();
61 
62  class SymbolPinNamesWindow *show_symbol_pin_names_window(class SchematicSymbol *symbol);
63  class RenumberPadsWindow *show_renumber_pads_window(class Package *pkg, const std::set<UUID> &pads);
64  class GenerateSilkscreenWindow *show_generate_silkscreen_window(class ToolSettings *settings);
65  class EnterDatumWindow *show_enter_datum_window(const std::string &label, int64_t def = 0);
66 
67  void close_nonmodal();
68  class ToolWindow *get_nonmodal();
69 
70 private:
71  Gtk::Window *parent = nullptr;
72  class ImpInterface *interface = nullptr;
73  class ToolWindow *window_nonmodal = nullptr;
74 };
75 } // namespace horizon
horizon::ToolSettings
Definition: tool.hpp:99
horizon::IDocument
Definition: idocument.hpp:5
horizon::SymbolPinNamesWindow
Definition: symbol_pin_names_window.hpp:10
horizon::Dialogs
Definition: dialogs.hpp:15
horizon::ImpInterface
Definition: imp_interface.hpp:7
horizon::Board
Definition: board.hpp:43
horizon::ViaPadstackProvider
Definition: via_padstack_provider.hpp:13
horizon::GenerateSilkscreenWindow
Definition: generate_silkscreen_window.hpp:11
horizon::Net
Definition: net.hpp:16
horizon::Keepout
Definition: keepout.hpp:9
horizon::Block
A block is one level of hierarchy in the netlist.
Definition: block.hpp:26
horizon::SchematicSymbol
Definition: schematic_symbol.hpp:19
horizon::Coord< int64_t >
horizon::ToolWindow
Definition: tool_window.hpp:7
horizon::Schematic
A Schematic is the visual representation of a Block.
Definition: schematic.hpp:27
horizon::UUIDPath< 2 >
horizon::EnterDatumWindow
Definition: enter_datum_window.hpp:15
horizon::Frame
Definition: frame.hpp:21
horizon::Package
Definition: package.hpp:28
horizon::UUID
This class encapsulates a UUID and allows it to be uses as a value type.
Definition: uuid.hpp:16
libzip::int64_t
zip_int64_t int64_t
zip_int64_t typedef.
Definition: zip.hpp:103
horizon::IDocumentBoard
Definition: idocument_board.hpp:5
horizon::Pool
Stores objects (Unit, Entity, Symbol, Part, etc.) from the pool.
Definition: pool.hpp:21
horizon::RenumberPadsWindow
Definition: renumber_pads_window.hpp:10
horizon::Plane
Definition: plane.hpp:39