diff --git a/src/laybasic/laybasic/layLayoutViewConfig.cc b/src/laybasic/laybasic/layLayoutViewConfig.cc new file mode 100644 index 000000000..3d9f5878b --- /dev/null +++ b/src/laybasic/laybasic/layLayoutViewConfig.cc @@ -0,0 +1,123 @@ + +/* + + KLayout Layout Viewer + Copyright (C) 2006-2022 Matthias Koefferlein + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +*/ + +#include "laybasicConfig.h" +#include "layConverters.h" +#include "layColorPalette.h" +#include "layStipplePalette.h" +#include "layLineStylePalette.h" +#include "layPlugin.h" +#include "tlColor.h" + +namespace lay +{ + +// ------------------------------------------------------------ +// The dummy plugin declaration to register the configuration options + +class LayoutViewBasicConfigDeclaration + : public lay::PluginDeclaration +{ +public: + virtual void get_options (std::vector < std::pair > &options) const + { + lay::ColorConverter cc; + options.push_back (std::pair (cfg_default_lyp_file, "")); + options.push_back (std::pair (cfg_default_add_other_layers, "false")); + options.push_back (std::pair (cfg_layers_always_show_source, "false")); + options.push_back (std::pair (cfg_layers_always_show_ld, "true")); + options.push_back (std::pair (cfg_layers_always_show_layout_index, "false")); + options.push_back (std::pair (cfg_test_shapes_in_view, "false")); + options.push_back (std::pair (cfg_flat_cell_list, "false")); + options.push_back (std::pair (cfg_split_cell_list, "false")); + options.push_back (std::pair (cfg_cell_list_sorting, "by-name")); + options.push_back (std::pair (cfg_split_lib_views, "false")); + options.push_back (std::pair (cfg_current_lib_view, "")); + options.push_back (std::pair (cfg_hide_empty_layers, "false")); + options.push_back (std::pair (cfg_min_inst_label_size, "16")); + options.push_back (std::pair (cfg_cell_box_text_font, "0")); + options.push_back (std::pair (cfg_cell_box_text_transform, "true")); + options.push_back (std::pair (cfg_cell_box_color, "auto")); + options.push_back (std::pair (cfg_cell_box_visible, "true")); + options.push_back (std::pair (cfg_text_color, "auto")); + options.push_back (std::pair (cfg_text_visible, "true")); + options.push_back (std::pair (cfg_text_lazy_rendering, "true")); + options.push_back (std::pair (cfg_bitmap_caching, "true")); + options.push_back (std::pair (cfg_show_properties, "false")); + options.push_back (std::pair (cfg_apply_text_trans, "true")); + options.push_back (std::pair (cfg_global_trans, "r0")); + options.push_back (std::pair (cfg_default_text_size, "0.1")); + options.push_back (std::pair (cfg_text_font, "0")); + options.push_back (std::pair (cfg_sel_color, cc.to_string (tl::Color ()))); + options.push_back (std::pair (cfg_sel_line_width, "1")); + options.push_back (std::pair (cfg_sel_vertex_size, "3")); + options.push_back (std::pair (cfg_sel_dither_pattern, "1")); + options.push_back (std::pair (cfg_sel_halo, "true")); + options.push_back (std::pair (cfg_sel_transient_mode, "true")); + options.push_back (std::pair (cfg_sel_inside_pcells_mode, "false")); + options.push_back (std::pair (cfg_tracking_cursor_enabled, "true")); + options.push_back (std::pair (cfg_tracking_cursor_color, cc.to_string (tl::Color ()))); + options.push_back (std::pair (cfg_background_color, cc.to_string (tl::Color ()))); + options.push_back (std::pair (cfg_ctx_color, cc.to_string (tl::Color ()))); + options.push_back (std::pair (cfg_ctx_dimming, "50")); + options.push_back (std::pair (cfg_ctx_hollow, "false")); + options.push_back (std::pair (cfg_child_ctx_color, cc.to_string (tl::Color ()))); + options.push_back (std::pair (cfg_child_ctx_dimming, "50")); + options.push_back (std::pair (cfg_child_ctx_hollow, "false")); + options.push_back (std::pair (cfg_child_ctx_enabled, "false")); + options.push_back (std::pair (cfg_search_range, "5")); + options.push_back (std::pair (cfg_search_range_box, "0")); + options.push_back (std::pair (cfg_abstract_mode_width, "10.0")); + options.push_back (std::pair (cfg_abstract_mode_enabled, "false")); + options.push_back (std::pair (cfg_fit_new_cell, "true")); + options.push_back (std::pair (cfg_full_hier_new_cell, "false")); + options.push_back (std::pair (cfg_initial_hier_depth, "1")); + options.push_back (std::pair (cfg_clear_ruler_new_cell, "false")); + options.push_back (std::pair (cfg_mouse_wheel_mode, "0")); + options.push_back (std::pair (cfg_pan_distance, "0.15")); + options.push_back (std::pair (cfg_paste_display_mode, "2")); + options.push_back (std::pair (cfg_guiding_shape_visible, "true")); + options.push_back (std::pair (cfg_guiding_shape_line_width, "1")); + options.push_back (std::pair (cfg_guiding_shape_color, cc.to_string (tl::Color ()))); + options.push_back (std::pair (cfg_guiding_shape_vertex_size, "5")); + options.push_back (std::pair (cfg_abs_units, "false")); + options.push_back (std::pair (cfg_dbu_units, "false")); + options.push_back (std::pair (cfg_drawing_workers, "1")); + options.push_back (std::pair (cfg_drop_small_cells, "false")); + options.push_back (std::pair (cfg_drop_small_cells_cond, "0")); + options.push_back (std::pair (cfg_drop_small_cells_value, "10")); + options.push_back (std::pair (cfg_array_border_instances, "false")); + options.push_back (std::pair (cfg_bitmap_oversampling, "1")); + options.push_back (std::pair (cfg_image_cache_size, "1")); + options.push_back (std::pair (cfg_default_font_size, "0")); + options.push_back (std::pair (cfg_color_palette, lay::ColorPalette ().to_string ())); + options.push_back (std::pair (cfg_stipple_palette, lay::StipplePalette ().to_string ())); + options.push_back (std::pair (cfg_stipple_offset, "true")); + options.push_back (std::pair (cfg_line_style_palette, lay::LineStylePalette ().to_string ())); + options.push_back (std::pair (cfg_no_stipple, "false")); + options.push_back (std::pair (cfg_markers_visible, "true")); + } +}; + +static tl::RegisteredClass config_decl (new LayoutViewBasicConfigDeclaration (), 1990, "LayoutViewBasicConfig"); + +} diff --git a/src/laybasic/laybasic/laybasic.pro b/src/laybasic/laybasic/laybasic.pro index 24f737974..915729a04 100644 --- a/src/laybasic/laybasic/laybasic.pro +++ b/src/laybasic/laybasic/laybasic.pro @@ -38,6 +38,7 @@ SOURCES += \ gsiDeclLayPlugin.cc \ gsiDeclLayTlAdded.cc \ gsiDeclLayRdbAdded.cc \ + layLayoutViewConfig.cc \ laybasicForceLink.cc \ layAnnotationShapes.cc \ layBitmap.cc \ diff --git a/src/layui/layui/layLayoutViewConfigPages.cc b/src/layui/layui/layLayoutViewConfigPages.cc index 314abe80f..d501ec102 100644 --- a/src/layui/layui/layLayoutViewConfigPages.cc +++ b/src/layui/layui/layLayoutViewConfigPages.cc @@ -1523,85 +1523,6 @@ class LayoutViewConfigDeclaration : public lay::PluginDeclaration { public: - virtual void get_options (std::vector < std::pair > &options) const - { - lay::ColorConverter cc; - options.push_back (std::pair (cfg_default_lyp_file, "")); - options.push_back (std::pair (cfg_default_add_other_layers, "false")); - options.push_back (std::pair (cfg_layers_always_show_source, "false")); - options.push_back (std::pair (cfg_layers_always_show_ld, "true")); - options.push_back (std::pair (cfg_layers_always_show_layout_index, "false")); - options.push_back (std::pair (cfg_test_shapes_in_view, "false")); - options.push_back (std::pair (cfg_flat_cell_list, "false")); - options.push_back (std::pair (cfg_split_cell_list, "false")); - options.push_back (std::pair (cfg_cell_list_sorting, "by-name")); - options.push_back (std::pair (cfg_split_lib_views, "false")); - options.push_back (std::pair (cfg_current_lib_view, "")); - options.push_back (std::pair (cfg_hide_empty_layers, "false")); - options.push_back (std::pair (cfg_min_inst_label_size, "16")); - options.push_back (std::pair (cfg_cell_box_text_font, "0")); - options.push_back (std::pair (cfg_cell_box_text_transform, "true")); - options.push_back (std::pair (cfg_cell_box_color, "auto")); - options.push_back (std::pair (cfg_cell_box_visible, "true")); - options.push_back (std::pair (cfg_text_color, "auto")); - options.push_back (std::pair (cfg_text_visible, "true")); - options.push_back (std::pair (cfg_text_lazy_rendering, "true")); - options.push_back (std::pair (cfg_bitmap_caching, "true")); - options.push_back (std::pair (cfg_show_properties, "false")); - options.push_back (std::pair (cfg_apply_text_trans, "true")); - options.push_back (std::pair (cfg_global_trans, "r0")); - options.push_back (std::pair (cfg_default_text_size, "0.1")); - options.push_back (std::pair (cfg_text_font, "0")); - options.push_back (std::pair (cfg_sel_color, cc.to_string (QColor ()))); - options.push_back (std::pair (cfg_sel_line_width, "1")); - options.push_back (std::pair (cfg_sel_vertex_size, "3")); - options.push_back (std::pair (cfg_sel_dither_pattern, "1")); - options.push_back (std::pair (cfg_sel_halo, "true")); - options.push_back (std::pair (cfg_sel_transient_mode, "true")); - options.push_back (std::pair (cfg_sel_inside_pcells_mode, "false")); - options.push_back (std::pair (cfg_tracking_cursor_enabled, "true")); - options.push_back (std::pair (cfg_tracking_cursor_color, cc.to_string (QColor ()))); - options.push_back (std::pair (cfg_background_color, cc.to_string (QColor ()))); - options.push_back (std::pair (cfg_ctx_color, cc.to_string (QColor ()))); - options.push_back (std::pair (cfg_ctx_dimming, "50")); - options.push_back (std::pair (cfg_ctx_hollow, "false")); - options.push_back (std::pair (cfg_child_ctx_color, cc.to_string (QColor ()))); - options.push_back (std::pair (cfg_child_ctx_dimming, "50")); - options.push_back (std::pair (cfg_child_ctx_hollow, "false")); - options.push_back (std::pair (cfg_child_ctx_enabled, "false")); - options.push_back (std::pair (cfg_search_range, "5")); - options.push_back (std::pair (cfg_search_range_box, "0")); - options.push_back (std::pair (cfg_abstract_mode_width, "10.0")); - options.push_back (std::pair (cfg_abstract_mode_enabled, "false")); - options.push_back (std::pair (cfg_fit_new_cell, "true")); - options.push_back (std::pair (cfg_full_hier_new_cell, "false")); - options.push_back (std::pair (cfg_initial_hier_depth, "1")); - options.push_back (std::pair (cfg_clear_ruler_new_cell, "false")); - options.push_back (std::pair (cfg_mouse_wheel_mode, "0")); - options.push_back (std::pair (cfg_pan_distance, "0.15")); - options.push_back (std::pair (cfg_paste_display_mode, "2")); - options.push_back (std::pair (cfg_guiding_shape_visible, "true")); - options.push_back (std::pair (cfg_guiding_shape_line_width, "1")); - options.push_back (std::pair (cfg_guiding_shape_color, cc.to_string (QColor ()))); - options.push_back (std::pair (cfg_guiding_shape_vertex_size, "5")); - options.push_back (std::pair (cfg_abs_units, "false")); - options.push_back (std::pair (cfg_dbu_units, "false")); - options.push_back (std::pair (cfg_drawing_workers, "1")); - options.push_back (std::pair (cfg_drop_small_cells, "false")); - options.push_back (std::pair (cfg_drop_small_cells_cond, "0")); - options.push_back (std::pair (cfg_drop_small_cells_value, "10")); - options.push_back (std::pair (cfg_array_border_instances, "false")); - options.push_back (std::pair (cfg_bitmap_oversampling, "1")); - options.push_back (std::pair (cfg_image_cache_size, "1")); - options.push_back (std::pair (cfg_default_font_size, "0")); - options.push_back (std::pair (cfg_color_palette, lay::ColorPalette ().to_string ())); - options.push_back (std::pair (cfg_stipple_palette, lay::StipplePalette ().to_string ())); - options.push_back (std::pair (cfg_stipple_offset, "true")); - options.push_back (std::pair (cfg_line_style_palette, lay::LineStylePalette ().to_string ())); - options.push_back (std::pair (cfg_no_stipple, "false")); - options.push_back (std::pair (cfg_markers_visible, "true")); - } - virtual std::vector > config_pages (QWidget *parent) const { std::vector > pages;